about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-04-20 20:19:50 +0000
committerbors <bors@rust-lang.org>2023-04-20 20:19:50 +0000
commit5b6655028ac1e9f97d65a0e9ec046d68129b624d (patch)
treeffe3d4f10848ef11dec0fc3411b8025b5ce0712e
parent2400b36a2ed40f68a26473f69ac208ba10d98af9 (diff)
parent36281e0745b7740fcb880e48cdb417ff7944414b (diff)
downloadrust-5b6655028ac1e9f97d65a0e9ec046d68129b624d.tar.gz
rust-5b6655028ac1e9f97d65a0e9ec046d68129b624d.zip
Auto merge of #14618 - westernwontons:feature/automatic-parameter-hints-toggle, r=Veykril
fix: `editor.parameterHints.enabled` not always being respected

#13472

When accepting a suggestion, the parameter hints would always trigger automatically. This PR provides the ability for users to toggle this functionality off by specifying the new "rust-analyzer.autoTriggerParameterHints" option in `settings.json`. Possible options are `true` and `false`. It's `true` by default.
-rw-r--r--editors/code/src/commands.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts
index 5209fecc069..0d91548b9b3 100644
--- a/editors/code/src/commands.ts
+++ b/editors/code/src/commands.ts
@@ -89,7 +89,13 @@ export function shuffleCrateGraph(ctx: CtxInit): Cmd {
 
 export function triggerParameterHints(_: CtxInit): Cmd {
     return async () => {
-        await vscode.commands.executeCommand("editor.action.triggerParameterHints");
+        const parameterHintsEnabled = vscode.workspace
+            .getConfiguration("editor")
+            .get<boolean>("parameterHints.enabled");
+
+        if (parameterHintsEnabled) {
+            await vscode.commands.executeCommand("editor.action.triggerParameterHints");
+        }
     };
 }