【问题标题】:Is there a way to prevent Copilot to make suggestions about paths有没有办法阻止 Copilot 对路径提出建议
【发布时间】:2023-02-17 06:12:40
【问题描述】:

Copilot 建议的相对路径不正确,每次我在路径字符串中写“/”时都会提出建议

这使我无法从我的 IDE 中看到这些路径建议

有没有办法只为导入路径禁用 Copilot?

【问题讨论】:

  • 你能找到解决方案吗?
  • 不幸的是没有
  • 谢谢可能会破坏交易!我发现它覆盖了一直有效的工具,有点麻烦哈哈
  • 是的是哈哈哈。我通常让 Copilot 处于禁用状态。我只在遇到困难或需要创建通用代码时才使用它。
  • 仍在等待解决方案

标签: github github-copilot


【解决方案1】:
  1. 单击左下角的设置图标。
  2. 转到设置。在搜索栏中输入副驾驶。您应该会在中心看到 GitHub > copilot enable。在其下方是“在 settings.json 中编辑”链接。点击那个。
  3. 查找此部分:
    "github.copilot.enable": {
       "*": true, ...
    
    1. 添加到它:
      "javascript": {
        "importSuggestions": false,
        "autoImportSuggestions": false,
        "typeOnlyImportSuggestions": false
      },
      "javascriptreact": {
        "importSuggestions": false,
        "autoImportSuggestions": false,
        "typeOnlyImportSuggestions": false
      },
      "typescript": {
        "importSuggestions": false,
        "autoImportSuggestions": false,
        "typeOnlyImportSuggestions": false
      },
      "typescriptreact": {
        "importSuggestions": false,
        "autoImportSuggestions": false,
        "typeOnlyImportSuggestions": false
      }
    
    • 这将在所有文件上启用 copilot,但 JS、JSX、TS 和 TSX 文件的导入建议除外。我假设代码对于其他非基于 js 的文件是相似的。

    1. 重新启动代码编辑器,应该会应用更改。当您输入导入时,下拉菜单应该在那里 9 考虑到您使用的是自动导入扩展而不是副驾驶的建议。

【讨论】:

    猜你喜欢
    • 2015-02-03
    • 2012-05-08
    • 1970-01-01
    • 1970-01-01
    • 2021-02-24
    • 2019-10-20
    • 1970-01-01
    • 2011-01-18
    • 2021-04-02
    相关资源
    最近更新 更多