Skip to main content

Troubleshooting GitHub Copilot in Visual Studio Code

This article provides troubleshooting advice for errors related to GitHub Copilot in Visual Studio Code.

GitHub Copilot 适用于在 GitHub.com 上使用个人帐户的 GitHub 客户,以及企业帐户拥有的 GitHub Enterprise Cloud 组织。

GitHub Copilot 供经过验证的学生、教师和热门开源项目的维护人员免费使用。 如果你不是学生、教师或热门开源项目的维护人员,可以在一次性 60 天试用版中免费试用 GitHub Copilot。 免费试用后,需要付费订阅才能继续使用。 有关详细信息,请参阅“关于 GitHub Copilot 的计费”。

Viewing and collecting log files

The log files for the GitHub Copilot extension are stored in the standard log location for Visual Studio Code extensions. The log files are useful for diagnosing connection issues.

  1. Open the View menu in Visual Studio Code.
  2. Click Output.
  3. On the right of the Output view pane, select GitHub Copilot from the dropdown menu.

Screenshot of GitHub Copilot Output pane

Alternatively, you can open the log folder for Visual Studio Code extensions in your system's file explorer. This is useful if you need to forward the log files to the support team.

  1. Open the VS Code Command Palette
    • For Mac:
      • Use: Shift+Command+P
    • For Windows or Linux:
      • Use: Ctrl+Shift+P
  2. Type "Logs", and then select Developer: Open Extension Logs Folder from the list.

Viewing network connectivity diagnostics logs

If you encounter problems connecting to GitHub Copilot due to network restrictions, firewalls, or your proxy setup, use the following troubleshooting steps.

  1. Open the VS Code Command Palette
    • For Mac:
      • Use: Shift+Command+P
    • For Windows or Linux:
      • Use: Ctrl+Shift+P
  2. Type "Diagnostics", and then select GitHub Copilot: Collect Diagnostics from the list. This opens a new editor with the relevant information that you can inspect yourself or share with the support team.
  3. Check the section on Reachability to determine if GitHub Copilot can actually access the necessary services.

Viewing Electron logs

In rare cases, errors might not be propagated to the corresponding error handlers and are not logged in the regular locations. If you encounter errors and there is nothing in the logs, you may try to see the logs from the process running VS Code and the extension.

  1. Open the VS Code Command Palette
    • For Mac:
      • Use: Shift+Command+P
    • For Windows or Linux:
      • Use Ctrl+Shift+P
  2. Type "Toggle", and then select Developer: Toggle Developer Tools from the list.
  3. In the Developer Tools window, select the Console tab to see any errors or warnings.

Screenshot of Visual Studio Code Developer Console

Further reading