|
|
@ -113,6 +113,10 @@ impl Client {
|
|
|
|
self.offset_encoding
|
|
|
|
self.offset_encoding
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn config(&self) -> Option<&Value> {
|
|
|
|
|
|
|
|
self.config.as_ref()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Execute a RPC request on the language server.
|
|
|
|
/// Execute a RPC request on the language server.
|
|
|
|
async fn request<R: lsp::request::Request>(&self, params: R::Params) -> Result<R::Result>
|
|
|
|
async fn request<R: lsp::request::Request>(&self, params: R::Params) -> Result<R::Result>
|
|
|
|
where
|
|
|
|
where
|
|
|
@ -246,6 +250,13 @@ impl Client {
|
|
|
|
root_uri: root,
|
|
|
|
root_uri: root,
|
|
|
|
initialization_options: self.config.clone(),
|
|
|
|
initialization_options: self.config.clone(),
|
|
|
|
capabilities: lsp::ClientCapabilities {
|
|
|
|
capabilities: lsp::ClientCapabilities {
|
|
|
|
|
|
|
|
workspace: Some(lsp::WorkspaceClientCapabilities {
|
|
|
|
|
|
|
|
configuration: Some(true),
|
|
|
|
|
|
|
|
did_change_configuration: Some(lsp::DynamicRegistrationClientCapabilities {
|
|
|
|
|
|
|
|
dynamic_registration: Some(false),
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
..Default::default()
|
|
|
|
|
|
|
|
}),
|
|
|
|
text_document: Some(lsp::TextDocumentClientCapabilities {
|
|
|
|
text_document: Some(lsp::TextDocumentClientCapabilities {
|
|
|
|
completion: Some(lsp::CompletionClientCapabilities {
|
|
|
|
completion: Some(lsp::CompletionClientCapabilities {
|
|
|
|
completion_item: Some(lsp::CompletionItemCapability {
|
|
|
|
completion_item: Some(lsp::CompletionItemCapability {
|
|
|
@ -330,6 +341,16 @@ impl Client {
|
|
|
|
self.exit().await
|
|
|
|
self.exit().await
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// Workspace
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub fn did_change_configuration(&self, settings: Value) -> impl Future<Output = Result<()>> {
|
|
|
|
|
|
|
|
self.notify::<lsp::notification::DidChangeConfiguration>(
|
|
|
|
|
|
|
|
lsp::DidChangeConfigurationParams { settings },
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------------------
|
|
|
|
// -------------------------------------------------------------------------------------------
|
|
|
|
// Text document
|
|
|
|
// Text document
|
|
|
|
// -------------------------------------------------------------------------------------------
|
|
|
|
// -------------------------------------------------------------------------------------------
|
|
|
|