microsoft / microsoft/vscode-python-debugger

Pylance features are not working when debugger is attached to file outside workspace

Open
#688 3 comments 0 reactions 1 assignee View on GitHub

@eleanorjboyd is already working on this.

Since May 27, 2025.

Dominant language
TypeScript
Stars
181
Forks
126
Avg merge
2d 3h
Merged PRs (30d)
3

Description

  1. Save the snippet below, set breakpoint at bar() and then run it (not in debug mode).
  2. Attach debugger.
  3. Try to go to definition for bar or foo. ctrl-click is not working and go to definition is not present in context menu.
  4. If you hover over variable it says use 'Alt' to show editor language tooltip but it's not working.
    Image
  5. Syntax highlight itself looks weirdly - apparently the problem is that symbols are not recognizes as such and modules / methods / functions appear just as white, making it harder to read.

Snippet:

import debugpy


def foo():
    print("hello")


def bar():
    foo()


debugpy.listen(5678)
debugpy.wait_for_client()
bar()

Issue demo:

https://github.com/user-attachments/assets/ffe6b4fc-24e4-484f-be84-727ea163774e

Expected result (for it to work in similar way to starting debug mode from editor):

https://github.com/user-attachments/assets/a494d7b0-7d8d-4e44-be7b-a378edbfbdb6

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.