Skip to content

Commit

Permalink
Auto merge of rust-lang#14147 - Veykril:completion, r=Veykril
Browse files Browse the repository at this point in the history
Don't assume VSCode internal commands in the server
  • Loading branch information
bors committed Feb 14, 2023
2 parents 4456800 + 95fa278 commit 2e86029
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/rust-analyzer/src/to_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
Expand Down
6 changes: 6 additions & 0 deletions editors/code/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions editors/code/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
};
}

0 comments on commit 2e86029

Please sign in to comment.