VS 代码建议小部件和内联建议冲突

问题描述 投票:0回答:1

自从我开始使用 Tabnine for VS Code 以来,我就遇到了这个问题。 我在 VS Code 中添加了内联建议模式,它与建议面板冲突。

我希望我的 VS Code 按如下方式工作: 输入内容时,点击

tab
自动完成 Tabnine 并点击
enter
在 IntelliSense(建议面板)中插入第一个预选项目。

我现在的情况: 由于建议面板中的第一项没有预先选择,因此点击

enter
将转到下一行,点击
tab
将自动完成 Tabnine 内联建议。 这是我的编辑器在未预先选择第一项时的屏幕截图。

当按

arrow down
键时,将选择第一项,然后按
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"
  },
visual-studio-code autocomplete intellisense tabnine
1个回答
1
投票

我猜你设置

"editor.suggest.selectionMode": "never"
是为了“启用 tabnine 选项卡”?但这样做时,您必须手动使用箭头键来集中建议。

我建议只是取消绑定选项卡以接受选定的建议。前任。像这样在 keybindings.json 中:

{
    "key": "tab",
    "command": "-acceptSelectedSuggestion",
    "when": "suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && textInputFocus"
},

然后您可以删除

"editor.suggest.selectionMode": "never"
以使其恢复到默认值
"always"


实际上,您可以尝试的另一件事是将

"editor.inlineSuggest.suppressSuggestions": true
放入 settings.json 文件中。设置的描述:

控制内联建议如何与建议小部件交互。如果启用,当内联建议可用时,建议小部件不会自动显示。

© www.soinside.com 2019 - 2024. All rights reserved.