Support LSP commands to display CodeLens in the latest Rust Analyzer. (#3565)

This commit is contained in:
ifengqi 2024-10-11 21:39:35 +08:00 committed by GitHub
parent c826f94ec1
commit bbe8b79569
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -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 {