summaryrefslogtreecommitdiff
path: root/support/texlab/src/protocol/mod.rs
blob: c08a7d82f541f6d47a6742498de2493fef977cb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
cfg_if::cfg_if! {
    if #[cfg(feature = "server")] {
        mod client;
        mod codec;

        pub use self::{
            client::{LatexLspClient, LspClient},
            codec::LspCodec,
        };
    }
}

mod capabilities;
mod edit;
mod options;
mod range;
mod uri;

pub use self::{
    capabilities::ClientCapabilitiesExt,
    edit::*,
    options::*,
    range::RangeExt,
    uri::{AsUri, Uri},
};
pub use lsp_types::*;

use serde::{Deserialize, Serialize};
use serde_repr::*;

#[serde(untagged)]
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
pub enum DefinitionResponse {
    Locations(Vec<Location>),
    LocationLinks(Vec<LocationLink>),
}

#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize_repr, Deserialize_repr)]
#[repr(i32)]
pub enum ForwardSearchStatus {
    Success = 0,
    Error = 1,
    Failure = 2,
    Unconfigured = 3,
}

#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
pub struct ForwardSearchResult {
    pub status: ForwardSearchStatus,
}

#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BuildParams {
    pub text_document: TextDocumentIdentifier,
}

#[derive(Debug, PartialEq, Eq, Clone, Copy, Serialize_repr, Deserialize_repr)]
#[repr(i32)]
pub enum BuildStatus {
    Success = 0,
    Error = 1,
    Failure = 2,
    Cancelled = 3,
}

#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BuildResult {
    pub status: BuildStatus,
}