🚀 取得 (在 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 帳戶。

  • 確認您的 Copilot 訂閱在 GitHub 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 的意見反應?

您可以在 GitHub Copilot 討論區中提供關於 Copilot 行內建議和回應的意見反應。

如果您想要提供關於 Copilot Chat 功能的意見反應,您可以在 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 Copilot」或「GitHub 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 Chat

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 的擴充功能詳細資料頁面上找到發行者資訊。

其他資源