mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
dedupe
This commit is contained in:
parent
bf42a75f1e
commit
52de08330f
3 changed files with 29 additions and 27 deletions
|
@ -1,10 +1,29 @@
|
|||
use serde::{ser::Serialize, de::DeserializeOwned};
|
||||
use languageserver_types::{TextDocumentIdentifier, Range};
|
||||
|
||||
pub use languageserver_types::{
|
||||
request::*, notification::*,
|
||||
InitializeResult, PublishDiagnosticsParams
|
||||
InitializeResult, PublishDiagnosticsParams,
|
||||
};
|
||||
|
||||
|
||||
pub trait ClientRequest: Send + 'static {
|
||||
type Params: DeserializeOwned + Send + 'static;
|
||||
type Result: Serialize + Send + 'static;
|
||||
const METHOD: &'static str;
|
||||
}
|
||||
|
||||
impl<T> ClientRequest for T
|
||||
where T: Request + Send + 'static,
|
||||
T::Params: DeserializeOwned + Send + 'static,
|
||||
T::Result: Serialize + Send + 'static,
|
||||
{
|
||||
type Params = <T as Request>::Params;
|
||||
type Result = <T as Request>::Result;
|
||||
const METHOD: &'static str = <T as Request>::METHOD;
|
||||
}
|
||||
|
||||
|
||||
pub enum SyntaxTree {}
|
||||
|
||||
impl Request for SyntaxTree {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue