补全开关与编辑器设置
配置各编辑器的行内建议、next edit suggestions、快捷键和账号授权。
This page has not been translated into English yet. The original Chinese version is shown below.
补全开关、Chat 模式、账号授权分别控制不同事情。关闭输入时的建议后,需要调整 Chat 工作方式时仍应到聊天模式中选择。
VS Code
点击标题栏聊天图标旁的箭头,选择 Configure Inline Suggestions,然后选择 Enable Completions 或 Disable Completions。也可以在 Settings 的 Extensions → Copilot 下调整行内建议。
以下配置示例开启行内建议,按语言启用或关闭 Copilot;这是示例配置,不是所有字段的默认值清单:
{
"editor.inlineSuggest.enabled": true,
"github.copilot.enable": {
"*": true,
"yaml": false,
"plaintext": false,
"markdown": true,
"javascript": true,
"python": true
}
}Next edit suggestions 由 github.copilot.nextEditSuggestions.enabled 控制。Business / Enterprise 用户还需要提供套餐的组织或企业开启 Editor preview features。
在 Keyboard Shortcuts 编辑器中按命令名称搜索,可以重新绑定 Copilot 快捷键。
JetBrains
点击窗口底部 Copilot 状态图标,可关闭全部补全或仅关闭当前文件语言的补全。Settings → Tools → GitHub Copilot 的 General 和 Completions 页提供建议显示、更新检查和语言配置。
启用自动检查更新后,可选 Stable 或 Nightly 渠道;后者更新更频繁,也可能更不稳定。按语言配置和 github-copilot.xml 的完整例子见 JetBrains 语言开关。快捷键按 IDE 的 Keymap 设置调整。
Visual Studio
底部 Copilot 图标的菜单可切换全局或当前语言建议;Enable Globally、Enable for LANGUAGE 是切换项,判断当前状态后再操作。图标有斜线表示禁用。
在 Tools → Options → GitHub → Copilot → Copilot Completions 中启用 Enable next edit suggestions。快捷键在 Tools → Options → Environment → Keyboard 搜索命令后重新分配。
使用 ReSharper 时,官方建议在 Extensions → ReSharper → Options → Environment → IntelliSense → General 选择 Visual Studio,让 Copilot 使用编辑器的原生 IntelliSense。
Xcode
在 GitHub Copilot for Xcode 应用的 Advanced → Suggestion Settings 中,用 Request suggestions while typing 控制输入时请求建议。应用的 Automatically check for updates 控制更新检查;升级后重启 Xcode。
官方配置页说明 Xcode 的 next edit suggestions 默认开启,可在 Advanced 中关闭;Business / Enterprise 同样受 Editor preview features 策略限制。
在 Xcode → Settings → Key Bindings 搜索 Copilot 修改快捷键。若不用 Tab 接受建议首行,先关闭 Copilot 应用高级设置的 Accept suggestions with Tab。官方当前只支持用 Option 执行 View full suggestion。
Eclipse
Copilot 设置可调整自动补全、代理和企业认证地址。Next edit suggestions 在扩展设置的 Completions 中启用,Business / Enterprise 需要对应的 Editor preview features 策略。通过 Copilot → Edit Keyboard Shortcuts... 调整快捷键。
撤销 VS Code 的 GitHub 授权
设备不再可访问时,可在 GitHub Settings → Applications 中撤销 Authorized OAuth Apps → GitHub for VS Code;若 Authorized GitHub Apps 中还列有 GitHub Copilot,也撤销该项。
官方说明撤销后,当前 VS Code 会话最多仍可继续使用 30 分钟。要在保留的设备重新授权,先从 Accounts 菜单退出,再选择 Sign in with GitHub to use GitHub Copilot,完成浏览器授权并返回 VS Code。