using VSCode's native parameterHints.enabled setting

This commit is contained in:
Nagy Botond 2023-04-20 22:13:33 +03:00
parent 770734fdbb
commit 36281e0745
2 changed files with 4 additions and 9 deletions

View File

@ -1455,11 +1455,6 @@
"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": {}
}
},

View File

@ -89,11 +89,11 @@ export function shuffleCrateGraph(ctx: CtxInit): Cmd {
export function triggerParameterHints(_: CtxInit): Cmd {
return async () => {
const autoTriggerParameterHints = vscode.workspace
.getConfiguration("rust-analyzer")
.get<boolean>("autoTriggerParameterHints");
const parameterHintsEnabled = vscode.workspace
.getConfiguration("editor")
.get<boolean>("parameterHints.enabled");
if (autoTriggerParameterHints) {
if (parameterHintsEnabled) {
await vscode.commands.executeCommand("editor.action.triggerParameterHints");
}
};