🚀 在 VS Code 中

GitHub Copilot 常見問題

本文回答關於在 Visual Studio Code 中使用 GitHub Copilot 的常見問題。

GitHub Copilot 訂閱

如何取得 Copilot 訂閱?

有多種方式可以取得 GitHub Copilot 的存取權

使用者類型 描述
個人
組織/企業成員

我已達到完成或聊天互動的限制

您的程式碼完成和聊天互動限制每月重設,從您首次註冊 Copilot Free 方案的當天開始計算。如果您達到限制,您可以選擇註冊付費訂閱,並取得無限數量的完成和聊天訊息。或者,您可以等到下個月再繼續免費使用 Copilot。

Visual indicators in Chat view, Status Bar, and title bar that you reached a limit for Copilot chat messages.

如果只有聊天互動達到限制,您仍然可以使用 Copilot 進行程式碼完成。

如果只有程式碼完成達到限制,您仍然可以使用 Copilot 進行聊天互動和 Copilot 編輯。

我的 Copilot 訂閱在 VS Code 中未偵測到

  • 若要在 Visual Studio Code 中使用 Copilot Chat,您必須使用有權存取 GitHub Copilot 的 GitHub ID 登入 Visual Studio Code。如果您的 Copilot 訂閱與另一個 GitHub 帳戶相關聯,您可能必須登出您的 GitHub 帳戶,並使用另一個帳戶登入。使用活動列中的 帳戶 選單登出您目前的 GitHub 帳戶。

  • GitHub Copilot 設定中驗證您的 Copilot 訂閱是否仍然有效。

如何切換 Copilot 的帳戶

若要切換至另一個 GitHub 帳戶以使用 Copilot

  1. 從活動列開啟擴充功能檢視(或使用 ⇧⌘X (Windows、Linux Ctrl+Shift+X)),並在搜尋方塊中輸入GitHub Copilot

    Extensions view in VS Code, showing the GitHub Copilot extension.

    注意

    有兩個 Copilot 擴充功能:GitHub Copilot 和 GitHub Copilot Chat。

  2. 對於 GitHub Copilot 擴充功能,選取齒輪圖示,然後選取 帳戶偏好設定

    Accounts menu in VS Code, showing the option to sign out of the current GitHub account.

  3. 從「帳戶偏好設定快速選取」中,選擇現有的帳戶,或選取 使用新帳戶... 以使用不同的 GitHub 帳戶登入。

    Accounts menu in VS Code, showing the option to sign in with GitHub to use GitHub Copilot.

  4. 針對 GitHub Copilot Chat 擴充功能重複這些步驟。

一般

Copilot 的網路和防火牆設定

  • 如果您或您的組織採用防火牆或 Proxy 伺服器等安全性措施,則將某些網域 URL 加入「允許清單」並開啟特定連接埠和通訊協定可能會有幫助。深入瞭解疑難排解 GitHub Copilot 的防火牆設定

  • 如果您在公司設備上工作並連線到公司網路,您可能會透過 VPN 或 HTTP Proxy 伺服器連線到網際網路。在某些情況下,這些類型的網路設定可能會阻止 GitHub Copilot 連線到 GitHub 的伺服器。深入瞭解 GitHub Copilot 的網路錯誤疑難排解

如何提供關於 Copilot 的意見反應?

如果您想提供關於 Copilot 功能(包括內嵌建議和聊天)的意見反應,您可以在 vscode-copilot-release 儲存機制中建立問題。

如果您要回報問題,包含來自 GitHub Copilot 記錄 的資訊可能會有所幫助。

在 VS Code 中檢視 GitHub Copilot 的記錄

GitHub Copilot 擴充功能的記錄檔儲存在 Visual Studio Code 擴充功能的標準記錄位置中。記錄檔對於診斷連線問題很有用。

使用 切換輸出 命令 (⇧⌘U (Windows Ctrl+Shift+U, Linux Ctrl+K Ctrl+H)) 並在下拉式選單中選取 GitHub CopilotGitHub Copilot Chat

是否有 Copilot 擴充功能的預先發行組建?

是,您可以切換到 Copilot 擴充功能的預先發行(每晚)版本,以試用最新的功能和修正。從擴充功能檢視中,按一下滑鼠右鍵或選取齒輪圖示以開啟內容選單,然後選取 切換至預先發行版本

Extensions view context menu with Switch to Pre-Release Version option

您可以透過擴充功能詳細資訊中的「預先發行」徽章來判斷您是否正在執行預先發行版本

Pre-release version of the GitHub Copilot extension

Copilot 程式碼完成

如何啟用/停用 Copilot?

您可以從狀態列暫時停用 Copilot 完成項目。系統會提示您是否要針對所有程式碼(全域)或僅針對在作用中編輯器中偵測到的程式語言(例如,Python)停用 Copilot。

Screenshot showing the VS Code status bar, highlighting the Copilot icon that indicates Copilot is active.

內嵌完成項目在編輯器中無法運作

Copilot 聊天

Copilot Chat 功能對我不起作用?

如果 Copilot Chat 無法運作,請檢查每個需求

  • 確定您使用的是最新版本的 Visual Studio Code(執行 程式碼:檢查更新)。
  • 確定您已安裝最新版本的 GitHub CopilotGitHub Copilot Chat 擴充功能。
  • 您登入 VS Code 的 GitHub 帳戶必須具有有效的 Copilot 訂閱。檢查您的 Copilot 訂閱
  • 驗證您是否尚未達到 Copilot Free 方案 的每月聊天互動限制。

為什麼我的 Copilot Chat 擴充功能被封鎖?

如果您收到訊息指出擴充功能被封鎖而無法使用 Copilot Chat,則可能是因為從該特定擴充功能偵測到濫用模式,導致該擴充功能被停用。當您遇到此問題時,請聯絡擴充功能的發行者。您可以在 Visual Studio Marketplace 中的擴充功能詳細資訊頁面上找到發行者資訊。

其他資源