vscode
vscode copied to clipboard
Auto-quoting of context keys prevents removal of keybindings via UI
Does this issue occur when all extensions are disabled?: Probably, but hard to reproduce
- VS Code Version: 1.70.0 and insiders
- OS Version: Linux x64 5.18.16-1-MANJARO
Steps to Reproduce:
- Install an extension that contributes a keybinding with a
whenclause containing anfoo in extension.barcheck (e.g. the Julia extension). - Go to the Keyboard Shortcuts UI via
workbench.action.openGlobalKeybindings - Right click -> remove the keybinding.
- VS Code tries to remove the keybinding by inserting a new one into the
User/keybindings.json, where the command is prefixed with a minus and, crucially, all complex context keys are quoted:
[
{
"key": "ctrl+enter",
"command": "-extension.my-command",
"when": "foo in 'extension.bar'"
}
]
- This doesn't actually remove the keybinding from the UI or prevent VS Code from resolving it.
- Remove the single quotes around
'extension.bar' - The keybinding is properly removed from the UI and cannot be used anymore, as expected.
As far as I can tell, this behaviour is specific to in clauses; it's also hard to repro this without an extension because user-supplied keybindings are just removed outright from keybindings.json instead of adding an additional negated entry.
