0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

VSCode で WSL2 プロジェクトを開くと Copilot 拡張機能が応答しない

Posted at

症状

  • VSCode で WSL2 内のプロジェクトを開いている時に Copilot Chat を使うと、応答が返ってこない
    • "Getting Copilot ready." → しばらく待つと "Copilot took too long to get ready. Please try again." エラーが出る

原因

  • WSL2 内から Copilot への認証でエラーが発生するせい1
    • Windows 上の VScode は、WSL2 上の VSCode に対してリモート同期をして動いている2

対策

  • VSCode の setting.json に以下の行を追加して、VSCode を再起動する
    • この設定により Copilot 拡張機能は WSL 内ではなく Windows 側で呼ばれるようになる3
      • ちなみにリモート環境 (WSL2) で動作させる時は ui ではなく workspace4
setting.json
    "remote.extensionKind": {
        "GitHub.copilot": ["ui"],
        "GitHub.copilot-chat": ["ui"]
    }

参考

  1. github - Copilot is not working is WSL remote connection? - Stack Overflow

  2. Supporting Remote Development and GitHub Codespaces | Visual Studio Code Extension API

  3. https://code.visualstudio.com/api/advanced-topics/remote-extensions#incorrect-execution-location

  4. https://code.visualstudio.com/api/advanced-topics/extension-host#preferred-extension-location

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?