Unnamed repository; edit this file 'description' to name the repository.
Don't assume VSCode internal commands in the server
Lukas Wirth 2023-02-14
parent 4456800 · commit 95fa278
-rw-r--r--crates/rust-analyzer/src/to_proto.rs2
-rw-r--r--editors/code/src/commands.ts6
-rw-r--r--editors/code/src/main.ts1
3 files changed, 8 insertions, 1 deletions
diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs
index 78cd4b8e2b..7f4b7e2a32 100644
--- a/crates/rust-analyzer/src/to_proto.rs
+++ b/crates/rust-analyzer/src/to_proto.rs
@@ -1360,7 +1360,7 @@ pub(crate) mod command {
pub(crate) fn trigger_parameter_hints() -> lsp_types::Command {
lsp_types::Command {
title: "triggerParameterHints".into(),
- command: "editor.action.triggerParameterHints".into(),
+ command: "rust-analyzer.triggerParameterHints".into(),
arguments: None,
}
}
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts
index b5b64e33e0..49a8ca4edb 100644
--- a/editors/code/src/commands.ts
+++ b/editors/code/src/commands.ts
@@ -87,6 +87,12 @@ export function shuffleCrateGraph(ctx: CtxInit): Cmd {
};
}
+export function triggerParameterHints(_: CtxInit): Cmd {
+ return async () => {
+ await vscode.commands.executeCommand("editor.action.triggerParameterHints");
+ };
+}
+
export function matchingBrace(ctx: CtxInit): Cmd {
return async () => {
const editor = ctx.activeRustEditor;
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index dd439317c7..5987368e6e 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -186,5 +186,6 @@ function createCommands(): Record<string, CommandFactory> {
resolveCodeAction: { enabled: commands.resolveCodeAction },
runSingle: { enabled: commands.runSingle },
showReferences: { enabled: commands.showReferences },
+ triggerParameterHints: { enabled: commands.triggerParameterHints },
};
}