From 8c4aab0c803e3962ffc2c42538df1d29dd3a8ef0 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Thu, 19 Mar 2020 01:39:12 +0200 Subject: Client side draft --- crates/rust-analyzer/src/main_loop.rs | 8 +++++++- crates/rust-analyzer/src/req.rs | 2 +- editors/code/src/main.ts | 6 ++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index c899ff677..f81f43930 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs @@ -641,9 +641,15 @@ fn on_notification( }; let not = match notification_cast::(not) { Ok(_params) => { + dbg!(_params); + // let request = request_new::( + // loop_state.next_request_id(), + // ConfigurationParams::default(), + // ); + // let zz = connection.sender.send(request.into()).unwrap(); return Ok(()); } - Err(not) => not, + Err(not) => dbg!(not), }; let not = match notification_cast::(not) { Ok(params) => { diff --git a/crates/rust-analyzer/src/req.rs b/crates/rust-analyzer/src/req.rs index 8557294f6..994f0ed61 100644 --- a/crates/rust-analyzer/src/req.rs +++ b/crates/rust-analyzer/src/req.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; pub use lsp_types::{ notification::*, request::*, ApplyWorkspaceEditParams, CodeActionParams, CodeLens, - CodeLensParams, CompletionParams, CompletionResponse, DiagnosticTag, + CodeLensParams, CompletionParams, CompletionResponse, ConfigurationParams, DiagnosticTag, DidChangeConfigurationParams, DidChangeWatchedFilesParams, DidChangeWatchedFilesRegistrationOptions, DocumentOnTypeFormattingParams, DocumentSymbolParams, DocumentSymbolResponse, FileSystemWatcher, Hover, InitializeResult, MessageType, diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 980ed925b..63d145db0 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -91,6 +91,12 @@ export async function activate(context: vscode.ExtensionContext) { activateHighlighting(ctx); } activateInlayHints(ctx); + + vscode.workspace.onDidChangeConfiguration( + _ => ctx?.client?.sendNotification('workspace/didChangeConfiguration', { settings: "" }), + null, + ctx?.subscriptions, + ); } export async function deactivate() { -- cgit v1.2.3