跳转到内容

GitHub Copilot 设置参考

本文列出 Visual Studio Code 中 GitHub Copilot 的配置设置。有关在 VS Code 中使用设置的一般信息,请参阅用户和工作区设置

设置描述默认值
chat.commandCenter.enabled控制是否在 VS Code 标题栏中显示聊天菜单true
workbench.settings.showAISearchToggle在设置编辑器中启用使用 AI 搜索设置true
search.searchView.semanticSearchBehavior配置何时在搜索视图中运行语义搜索:手动(默认)、无文本搜索结果时、或始终"manual"
search.searchView.keywordSuggestions控制是否在搜索视图中显示关键词建议false
chat.disableAIFeatures禁用并隐藏 VS Code 中的内置 AI 功能,如聊天和内联建议(Inline Suggestion),并禁用 Copilot 扩展false
设置描述默认值
github.copilot.editor.enableCodeActions控制 Copilot 命令是否在可用时显示为代码操作true
github.copilot.renameSuggestions.triggerAutomatically生成符号重命名建议true
github.copilot.enable为指定语言启用或禁用内联建议(Inline Suggestion){ "*": true, "plaintext": false, "markdown": false, "scminput": false }
github.copilot.nextEditSuggestions.enabled启用下一个编辑建议(NES)true
editor.inlineSuggest.edits.allowCodeShifting配置 NES 是否能移动代码以显示建议"always"
editor.inlineSuggest.edits.renderSideBySide配置 NES 是否可以并排显示较大建议"auto"
github.copilot.nextEditSuggestions.fixes启用基于诊断(波浪线)的下一个编辑建议,如缺少导入true
editor.inlineSuggest.edits.showCollapsed仅在按 Tab 导航到建议或悬停时显示 NES 代码变更false
editor.inlineSuggest.fontFamily配置内联补全的字体系列"default"
editor.inlineSuggest.showToolbar启用或禁用内联补全显示的工具栏"onHover"
editor.inlineSuggest.minShowDelay显示内联建议(Inline Suggestion)前等待的时间(毫秒)0
设置描述默认值
github.copilot.chat.localeOverride指定聊天响应的语言区域,如 enfr"auto"
chat.checkpoints.enabled启用或禁用聊天中的检查点true
chat.checkpoints.showFileChanges在每次聊天请求结束时显示文件变更摘要false
chat.editor.fontFamily聊天代码块中的字体系列"default"
chat.editor.fontSize聊天代码块中的字体大小(像素)14
chat.editing.autoAcceptDelay配置自动接受建议编辑的延迟,0 表示禁用自动接受0
chat.notifyWindowOnConfirmation配置何时在需要用户输入时显示操作系统通知"windowNotFocused"
chat.notifyWindowOnResponseReceived配置何时在收到聊天响应时显示操作系统通知"windowNotFocused"
chat.hookFilesLocations配置额外的 Hook 文件位置{}
chat.useCustomAgentHooks启用在自定义智能体(Custom Agent) frontmatter 中定义的智能体(Agent)作用域 Hooksfalse
chat.useAgentsMdFile启用或禁用使用 AGENTS.md 文件作为聊天请求的上下文true
chat.useClaudeMdFile启用或禁用使用 CLAUDE.md 文件作为始终启用的自定义说明(Custom Instructions)true
设置描述默认值
chat.agent.enabled启用或禁用使用智能体(需要 VS Code 1.99 或更高版本)true
chat.agent.maxRequestsCopilot 使用智能体(Agent)可以发出的最大请求数25
github.copilot.chat.agent.autoFix自动诊断和修复生成的代码变更中的问题true
chat.mcp.access管理哪些 MCP 服务器可以在 VS Code 中使用true
chat.mcp.discovery.enabled配置从其他应用程序自动发现 MCP 服务器配置false
chat.tools.terminal.autoApprove控制使用智能体(Agent)时哪些终端命令被自动批准危险命令默认为 false
chat.permissions.default配置新聊天会话的默认权限级别"default"