“VS Code IntelliSense(建议面板)和Tabnine内联建议冲突”

huangapple go评论91阅读模式
英文:

VS Code IntelliSense (suggestion panel) and Tabnine inline suggestion conflict

问题

自从我开始使用VS Code的Tabnine插件以来,我一直遇到这个问题。
我在VS Code中添加了内联建议模式,但它与建议面板发生冲突。

我希望我的VS Code可以按照以下方式工作:
在输入内容时,按下tab键自动完成Tabnine,并按下enter键插入IntelliSense(建议面板)中的第一个预选项。

我的当前情况是:
因为建议面板中的第一个项未被预选,所以按下enter键会进入下一行,而按下tab键会自动完成Tabnine的内联建议。以下是我的编辑器在第一个项未被预选时的截图。

“VS Code IntelliSense(建议面板)和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.

“VS Code IntelliSense(建议面板)和Tabnine内联建议冲突”

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".

huangapple
  • 本文由 发表于 2023年6月13日 15:22:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/76462551.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定