diff options
Diffstat (limited to 'crates/server/src/req.rs')
-rw-r--r-- | crates/server/src/req.rs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/crates/server/src/req.rs b/crates/server/src/req.rs index 64e7ef4ae..10f0b2919 100644 --- a/crates/server/src/req.rs +++ b/crates/server/src/req.rs | |||
@@ -1,10 +1,29 @@ | |||
1 | use serde::{ser::Serialize, de::DeserializeOwned}; | ||
1 | use languageserver_types::{TextDocumentIdentifier, Range}; | 2 | use languageserver_types::{TextDocumentIdentifier, Range}; |
2 | 3 | ||
3 | pub use languageserver_types::{ | 4 | pub use languageserver_types::{ |
4 | request::*, notification::*, | 5 | request::*, notification::*, |
5 | InitializeResult, PublishDiagnosticsParams | 6 | InitializeResult, PublishDiagnosticsParams, |
6 | }; | 7 | }; |
7 | 8 | ||
9 | |||
10 | pub trait ClientRequest: Send + 'static { | ||
11 | type Params: DeserializeOwned + Send + 'static; | ||
12 | type Result: Serialize + Send + 'static; | ||
13 | const METHOD: &'static str; | ||
14 | } | ||
15 | |||
16 | impl<T> ClientRequest for T | ||
17 | where T: Request + Send + 'static, | ||
18 | T::Params: DeserializeOwned + Send + 'static, | ||
19 | T::Result: Serialize + Send + 'static, | ||
20 | { | ||
21 | type Params = <T as Request>::Params; | ||
22 | type Result = <T as Request>::Result; | ||
23 | const METHOD: &'static str = <T as Request>::METHOD; | ||
24 | } | ||
25 | |||
26 | |||
8 | pub enum SyntaxTree {} | 27 | pub enum SyntaxTree {} |
9 | 28 | ||
10 | impl Request for SyntaxTree { | 29 | impl Request for SyntaxTree { |