about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNagy Botond <75550932+westernwontons@users.noreply.github.com>2023-04-20 19:41:15 +0300
committerNagy Botond <75550932+westernwontons@users.noreply.github.com>2023-04-20 19:41:15 +0300
commit770734fdbb066f89fa951273a4ac03003ce0ff59 (patch)
tree6c47437eeaa231fcf9156bcc8e84ef9a5d854dc8
parent2400b36a2ed40f68a26473f69ac208ba10d98af9 (diff)
downloadrust-770734fdbb066f89fa951273a4ac03003ce0ff59.tar.gz
rust-770734fdbb066f89fa951273a4ac03003ce0ff59.zip
Automatic parameter hints trigger can be toggled on/off
-rw-r--r--editors/code/package.json5
-rw-r--r--editors/code/src/commands.ts8
2 files changed, 12 insertions, 1 deletions
diff --git a/editors/code/package.json b/editors/code/package.json
index f6ad2f7908f..4b6406ee7dd 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -1455,6 +1455,11 @@
                         "Search in current workspace and dependencies."
                     ]
                 },
+                "rust-analyzer.autoTriggerParameterHints": {
+                    "type": "boolean",
+                    "default": true,
+                    "markdownDescription": "Enable or disable automatic triggering of parameter hints when accepting suggestions."
+                },
                 "$generated-end": {}
             }
         },
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts
index 5209fecc069..c1da65d8915 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 autoTriggerParameterHints = vscode.workspace
+            .getConfiguration("rust-analyzer")
+            .get<boolean>("autoTriggerParameterHints");
+
+        if (autoTriggerParameterHints) {
+            await vscode.commands.executeCommand("editor.action.triggerParameterHints");
+        }
     };
 }