mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
simplify
This commit is contained in:
parent
8f1ce82753
commit
4268fbeaa1
4 changed files with 38 additions and 54 deletions
|
@ -1,6 +1,4 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use serde::{ser::Serialize, de::DeserializeOwned};
|
||||
use languageserver_types::{TextDocumentIdentifier, Range, Url, Position, Location};
|
||||
use url_serde;
|
||||
|
||||
|
@ -18,24 +16,6 @@ pub use languageserver_types::{
|
|||
TextDocumentEdit,
|
||||
};
|
||||
|
||||
|
||||
pub trait ClientRequest: 'static {
|
||||
type Params: DeserializeOwned + Send + 'static;
|
||||
type Result: Serialize + Send + 'static;
|
||||
const METHOD: &'static str;
|
||||
}
|
||||
|
||||
impl<T> ClientRequest for T
|
||||
where T: Request + '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