Auto merge of #14147 - Veykril:completion, r=Veykril

Don't assume VSCode internal commands in the server
This commit is contained in:
bors 2023-02-14 14:19:20 +00:00
commit 2e86029662
3 changed files with 8 additions and 1 deletions

View File

@ -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,
}
}

View File

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

View File

@ -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 },
};
}