V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
kouhe3
V2EX  ›  程序员

VS Code 中 IntelliCode quicksuggestions, Tabnine, GitHub Copilot 共存

  •  
  •   kouhe3 · Jun 16, 2022 · 2739 views
    This topic created in 1415 days ago, the information mentioned may be changed or developed.

    tabnine 更新了,启用 Advanced Completions 需要开启 inline 补全。 同时我还安装了 Copilot. 我还不想丢掉 IntelliCode 下拉框那样的提示。

    为了让 GitHub Copilot, IntelliCode quicksuggestions, Tabnine Advanced Completions 可以同时使用,我做了如下配置:

    {
    "github.copilot.inlineSuggest.enable": false,
    "editor.suggest.preview": true,
    "editor.inlineSuggest.enabled": true
    }
    

    也就是

    1. 关掉 Copilot 的 inline, 如果要用 copilot 就按 ctrl + enter 打开侧栏
    2. 允许 vscode 自动显示 inline 建议
    3. 用 inline 预览 intellicode 建议

    最后的效果就是这样的:

    同时显示内联建议和下拉栏,quicksuggestions 的建议在 inline 中是斜体,tabnine 的建议在 inline 中是正文

    4 replies    2022-06-17 21:52:22 +08:00
    kouhe3
        1
    kouhe3  
    OP
       Jun 16, 2022
    实际用起来的时候就是
    如 [VSCode 1.60 更新]( https://code.visualstudio.com/updates/v1_60#_inline-suggestions-in-autocomplete)
    所说的那样,
    按一下 Tab 是补 IntelliCode 的建议,
    再按一次 Tab 是补 Tabnine 的建议。
    yazoox
        2
    yazoox  
       Jun 17, 2022
    不是很好理解,要是能有个 video 展示一下,就更好了。thx
    kouhe3
        4
    kouhe3  
    OP
       Jun 17, 2022
    其实.. IntelliCode 的这张图,

    https://github.com/MicrosoftDocs/intellicode/raw/HEAD/images/intellisenseSelection.gif

    就是内联与弹窗建议完美合作的案例。
    弹窗给出函数名,然后内联建议扩展完成函数名后面的那部分参数。

    但是这种方法有一个问题,那就是弹窗建议一直在牵制内联建议。

    https://github.com/microsoft/vscode/issues/131940#issuecomment-930064671

    所以.社区里有人提出了新的解决冲突的方案,但是新方案能用上,就不知道要到猴年马月了。XD
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2517 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 05:47 · PVG 13:47 · LAX 22:47 · JFK 01:47
    ♥ Do have faith in what you're doing.