gpt4 book ai didi

visual-studio-code - VSCode 如何自动插入 Intellisense 建议而无需按 Enter?

转载 作者:行者123 更新时间:2023-12-04 17:29:27 24 4
gpt4 key购买 nike

默认 VS Code 智能感知行为

  • 用户会看到一个建议菜单
  • 然后用户必须按向上或向下箭头键来浏览菜单
  • 最后用户必须按 Enter 确认以插入建议并关闭对话框

  • 我想要的是什么
  • 不需要回车
  • 通过按向上/向下
  • 自动插入(并循环)建议
  • 按任何其他键将关闭对话框并继续输入


  • 明确地说,我想复制 default behaviour of YouCompleteMe :

    When you type, a completion menu pops up. If you like the completions, you use the <Tab> key (by default, can be changed to <Enter> or <Down> arrow or whatever) to select a completion string you want. The very act of "tabbing through" the list to select the item you want inserts the candidate string. When you tab to a different candidate, the editor code is replaced with the new candidate. There is no accept key because by the point where you have the candidate you want selected in the menu the candidate has already been inserted in the editor. There is nothing to "accept". You just keep typing, the candidate has already been inserted.



    默认情况下或通过插件,Visual Studio Code 是否可以实现这种行为?

    最佳答案

    editor.tabCompletion option是目前可用的最接近的东西:

    By default, tab completion is disabled. Use the editor.tabCompletion setting to enable it. These values exist:

    • off - (default) Tab completion is disabled.
    • on - Tab completion is enabled for all suggestions and repeated invocations insert the next best suggestion.
    • onlySnippets - Tab completion only inserts static snippets which prefix match the current line prefix.

    (强调我的)

    ... 除了第一个 Tab按隐藏建议窗口。
    我做了一些关于 editor.tabCompletion 的挖掘,我发现 closing the suggestion window is part of the tab completion's option original design ,而其他用户已经询问了 an option not to close the suggestion window或特别 YouCompleteMe-style behaviour ,目前不支持此功能。

    关于visual-studio-code - VSCode 如何自动插入 Intellisense 建议而无需按 Enter?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61078606/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com