英文:
VS Code IntelliSense (suggestion panel) and Tabnine inline suggestion conflict
问题
自从我开始使用VS Code的Tabnine插件以来,我一直遇到这个问题。
我在VS Code中添加了内联建议模式,但它与建议面板发生冲突。
我希望我的VS Code可以按照以下方式工作:
在输入内容时,按下tab
键自动完成Tabnine,并按下enter
键插入IntelliSense(建议面板)中的第一个预选项。
我的当前情况是:
因为建议面板中的第一个项未被预选,所以按下enter
键会进入下一行,而按下tab
键会自动完成Tabnine的内联建议。以下是我的编辑器在第一个项未被预选时的截图。
当按下向下箭头
键时,它将选择第一个项,然后按下enter
键将插入第一个项。
我的一些编辑器设置:
"editor.inlineSuggest.enabled": true,
"editor.suggestSelection": "first",
"editor.suggest.selectionMode": "never",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.suggestSelection": "recentlyUsed"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.suggestSelection": "recentlyUsed"
},
英文:
I have had this issue since I started using Tabnine for VS Code.
I added inline suggestion mode in VS Code and it conflicts with the suggestion panel.
I want my VS Code to work as follows:
When typing stuff, hitting tab
autocomplete Tabnine and hitting enter
insert first pre-selected item in IntelliSense (suggestion panel).
My current situation:
Because the first item in the suggestion panel is not pre-selected, hitting enter
will go to the next line, and hitting tab
will auto-complete Tabnine inline suggestions.
Here is a screenshot of my editor when the first item is not pre-selected.
When hitting arrow down
key, it will select the first item, and then hitting enter
will insert the first item.
Some of my editor settings:
"editor.inlineSuggest.enabled": true,
"editor.suggestSelection": "first",
"editor.suggest.selectionMode": "never"
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.suggestSelection": "recentlyUsed"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.suggestSelection": "recentlyUsed"
},
答案1
得分: 1
我猜你设置了"editor.suggest.selectionMode": "never"
来"启用 tabnine 的制表建议"?但这样做会使你必须手动使用箭头键来聚焦建议。
我建议只是解除将 Tab 键绑定到接受选定建议的操作。
{
"key": "tab",
"command": "-acceptSelectedSuggestion",
"when": "suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && textInputFocus"
},
然后,你可以移除"editor.suggest.selectionMode": "never"
以让它恢复到默认值"always"
。
英文:
I'm guessing you set "editor.suggest.selectionMode": "never"
to "enable tab for tabnine"? But in doing so you made it so you have to manually use arrow keys to focus a suggestion.
I'd instead suggest just unbinding tab from accepting a selected suggestion.
{
"key": "tab",
"command": "-acceptSelectedSuggestion",
"when": "suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && textInputFocus"
},
And then you can remove your "editor.suggest.selectionMode": "never"
to let it go back to the default value of "always"
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论