diff options
author | Aleksey Kladov <[email protected]> | 2018-08-10 20:33:29 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-10 20:33:29 +0100 |
commit | 7c67612b8a894187fa3b64725531a5459f9211bf (patch) | |
tree | 9e2a536efa0c880d921fd8d4d74423afc9451fd4 /crates/server/src/req.rs | |
parent | 26262aaf05983c5b7f41cc438e287523268fe1eb (diff) |
organizize
Diffstat (limited to 'crates/server/src/req.rs')
-rw-r--r-- | crates/server/src/req.rs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/crates/server/src/req.rs b/crates/server/src/req.rs new file mode 100644 index 000000000..4e588159b --- /dev/null +++ b/crates/server/src/req.rs | |||
@@ -0,0 +1,41 @@ | |||
1 | use languageserver_types::{TextDocumentIdentifier, Range}; | ||
2 | |||
3 | pub use languageserver_types::{ | ||
4 | request::*, notification::*, | ||
5 | InitializeResult, | ||
6 | }; | ||
7 | |||
8 | pub enum SyntaxTree {} | ||
9 | |||
10 | impl Request for SyntaxTree { | ||
11 | type Params = SyntaxTreeParams; | ||
12 | type Result = String; | ||
13 | const METHOD: &'static str = "m/syntaxTree"; | ||
14 | } | ||
15 | |||
16 | #[derive(Deserialize, Debug)] | ||
17 | #[serde(rename_all = "camelCase")] | ||
18 | pub struct SyntaxTreeParams { | ||
19 | pub text_document: TextDocumentIdentifier | ||
20 | } | ||
21 | |||
22 | pub enum ExtendSelection {} | ||
23 | |||
24 | impl Request for ExtendSelection { | ||
25 | type Params = ExtendSelectionParams; | ||
26 | type Result = ExtendSelectionResult; | ||
27 | const METHOD: &'static str = "m/extendSelection"; | ||
28 | } | ||
29 | |||
30 | #[derive(Deserialize, Debug)] | ||
31 | #[serde(rename_all = "camelCase")] | ||
32 | pub struct ExtendSelectionParams { | ||
33 | pub text_document: TextDocumentIdentifier, | ||
34 | pub selections: Vec<Range>, | ||
35 | } | ||
36 | |||
37 | #[derive(Serialize, Debug)] | ||
38 | #[serde(rename_all = "camelCase")] | ||
39 | pub struct ExtendSelectionResult { | ||
40 | pub selections: Vec<Range>, | ||
41 | } | ||