pub trait LspClient: Send + Sync {
// Required methods
fn initialize<'life0, 'async_trait>(
&'life0 self,
root_uri: String,
) -> Pin<Box<dyn Future<Output = Layer3Result<LspCapabilities>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn open_document<'life0, 'async_trait>(
&'life0 self,
uri: String,
language_id: String,
content: String,
) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn close_document<'life0, 'async_trait>(
&'life0 self,
uri: String,
) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn change_document<'life0, 'async_trait>(
&'life0 self,
uri: String,
changes: Vec<TextChange>,
) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn save_document<'life0, 'async_trait>(
&'life0 self,
uri: String,
) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn is_ready(&self) -> bool;
fn supported_languages(&self) -> Vec<String>;
}Expand description
LSP 客户端 trait
与 Language Server 通信的接口。
Required Methods§
Sourcefn initialize<'life0, 'async_trait>(
&'life0 self,
root_uri: String,
) -> Pin<Box<dyn Future<Output = Layer3Result<LspCapabilities>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn initialize<'life0, 'async_trait>(
&'life0 self,
root_uri: String,
) -> Pin<Box<dyn Future<Output = Layer3Result<LspCapabilities>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
初始化连接
Sourcefn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
关闭连接
Sourcefn open_document<'life0, 'async_trait>(
&'life0 self,
uri: String,
language_id: String,
content: String,
) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn open_document<'life0, 'async_trait>(
&'life0 self,
uri: String,
language_id: String,
content: String,
) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
打开文档
Sourcefn close_document<'life0, 'async_trait>(
&'life0 self,
uri: String,
) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn close_document<'life0, 'async_trait>(
&'life0 self,
uri: String,
) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
关闭文档
Sourcefn change_document<'life0, 'async_trait>(
&'life0 self,
uri: String,
changes: Vec<TextChange>,
) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn change_document<'life0, 'async_trait>(
&'life0 self,
uri: String,
changes: Vec<TextChange>,
) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
更新文档内容
Sourcefn save_document<'life0, 'async_trait>(
&'life0 self,
uri: String,
) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn save_document<'life0, 'async_trait>(
&'life0 self,
uri: String,
) -> Pin<Box<dyn Future<Output = Layer3Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
保存文档
Sourcefn supported_languages(&self) -> Vec<String>
fn supported_languages(&self) -> Vec<String>
获取支持的语言
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".