防止 VS Code 智能感知建议框消耗向上/向下箭头 [英] Prevent VS Code intellisense suggestion boxes from consuming up/down arrows
问题描述
当我在 VS Code 中键入std::"并启用 Intellisense 时,会出现一个下拉列表,其中包含建议的补全.然后,按下向下键将在下拉列表中循环.但我不想用箭头键浏览下拉菜单;我想移到下一行代码.有没有办法让箭头键忽略下拉菜单而不完全禁用下拉菜单?
When I type "std::" in VS Code with Intellisense active, a dropdown appears with suggested completions. Then, pressing the down key will cycle through the dropdown. But I don't want to browse through the dropdown with my arrow keys; I want to move to the next line of code. Is there a way to make arrow keys ignore the dropdown without disabling dropdowns entirely?
推荐答案
将这些添加到您的 keybindings.json
:
{
"key": "down",
"command": "-selectNextSuggestion",
"when": "textInputFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
},
// {
// "key": "down",
// "command": "Your Other Command Here",
// "when": "textInputFocus && suggestWidgetMultipleSuggestions && suggestWidgetVisible"
// }
第一个在建议面板打开时禁用默认的 DownArrow 操作,第二个使 DownArrow 在这种情况下执行其他操作.您不需要第二个键绑定,因为一旦特殊的 selectNextSuggestion 被禁用,您只需要默认操作.
The first disables the default DownArrow action when a suggest panel is open and the second makes the DownArrow do something else in that situation. You don't need the second keybinding since you only want the default action once the special selectNextSuggestion is disabled.
这篇关于防止 VS Code 智能感知建议框消耗向上/向下箭头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!