From bbe8b795698ab0838a7c2733a5554f5e836dc73b Mon Sep 17 00:00:00 2001 From: ifengqi <362254883@qq.com> Date: Fri, 11 Oct 2024 21:39:35 +0800 Subject: [PATCH] Support LSP commands to display CodeLens in the latest Rust Analyzer. (#3565) --- lapce-proxy/src/plugin/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lapce-proxy/src/plugin/mod.rs b/lapce-proxy/src/plugin/mod.rs index 590f9de6..bc15f2bf 100644 --- a/lapce-proxy/src/plugin/mod.rs +++ b/lapce-proxy/src/plugin/mod.rs @@ -1667,6 +1667,14 @@ fn client_capabilities() -> ClientCapabilities { // https://github.com/rust-lang/rust-analyzer/blob/master/docs/dev/lsp-extensions.md#server-status let mut experimental = Map::new(); experimental.insert("serverStatusNotification".into(), true.into()); + let command_vec = ["rust-analyzer.runSingle", "rust-analyzer.debugSingle"] + .map(Value::from) + .to_vec(); + + let mut commands = Map::new(); + experimental.insert("serverStatusNotification".into(), true.into()); + commands.insert("commands".into(), command_vec.into()); + experimental.insert("commands".into(), commands.into()); ClientCapabilities { text_document: Some(TextDocumentClientCapabilities { synchronization: Some(TextDocumentSyncClientCapabilities {