英文:
Difference between "acceptSelectedSuggestion" and "acceptAlternativeSelectedSuggestion" in VSCode keybinding config
问题
我正在配置Visual Studio Code的键绑定。对于接受建议,有两个默认的键绑定,但我不知道为什么有acceptAlternativeSelectedSuggestion和acceptSelectedSuggestion,因为它们似乎导致相同的效果。它们有什么区别?
{
"key": "shift+tab",
"command": "acceptAlternativeSelectedSuggestion",
"when": "suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && textInputFocus"
},
{
"key": "tab",
"command": "acceptSelectedSuggestion",
"when": "suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && textInputFocus"
},
英文:
I'm configuring keybindings of Visual Studio Code. For accepting suggestions, two keybindings are set by default, but I have no idea why there are acceptAlternativeSelectedSuggestion and acceptSelectedSuggestion as they seem to cause the same effect. What is the difference?
{
"key": "shift+tab",
"command": "acceptAlternativeSelectedSuggestion",
"when": "suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && textInputFocus"
},
{
"key": "tab",
"command": "acceptSelectedSuggestion",
"when": "suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && textInputFocus"
},
答案1
得分: 4
-
acceptSelectedSuggestion在接受建议后会保留光标右侧的文本。 -
acceptAlternativeSelectedSuggestion在接受建议后会移除光标右侧的文本。
如果需要进一步查看源代码,可以在以下文件中找到:
英文:
Experimentally, it affects what happens to the text to the right of the caret if the caret is in the middle of a word during completion.
-
acceptSelectedSuggestioncauses the text to the right of the caret to be kept after the suggestion is accepted. -
acceptAlternativeSelectedSuggestioncauses the text to the right of the caret to be removed after the suggestion is accepted.
If you feel like further digging, the source code can be found in the following files:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论