Pylance errors from chat virtual documents

Open
#317,735 2 comments 0 reactions 2 assignees View on GitHub

@amunger is already working on this.

Since Jul 6, 2026.

Assessment

This issue has not been assessed yet.

Description

bug notebook virtual-documents

Type: Bug

  1. Do anything that makes Copilot register a virtual document for a Jupyter notebook with VS Code for the current session, for instance by attaching a Python Jupyter notebook to a Copilot chat by using # followed by the filename, or by having Copilot create it.

At this point, in our project, we get dozens of errors reported by Pylance/Pyright (mostly due to it not being able to find imports) whenever that Copilot session is open, and not when it isn't (even if we open the notebook itself), because when the session is open there's a virtual document for the Jupyter notebook registered with VS Code, which Pylance picks up, but then I guess because of the path of the virtual document, it can't find things at the root of our project it normally finds.

This is really problematic for our workflow, constantly warning us of errors that don't really exist.

Extension version: 0.48.1
VS Code version: Code 1.120.0 (0958016b2af9f09bb4257e0df4a95e2f90590f9f, 2026-05-12T20:17:22Z)
OS version: Windows_NT x64 10.0.26100
Modes:

Dominant language
TypeScript
Stars
193k
Forks
42.9k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/vscode

All issues in microsoft/vscode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.