Skip to content

How does the VS Code Python “justMyCode” debugger feature determine which code belongs to the user?

Visual Studio Code offers a debugger launch option called justMyCode which allows – if set to false – to step-into non-user written code when debugging. The documentation says:

When omitted or set to true (the default), restricts debugging to user-written code only. Set to false to also enable debugging of standard library functions.

But this doesn’t seem to include only Python standard libraries. For example, if we install and use the popular PIL image library…

from PIL import Image
img ="./image.jpg")

…and set a breakpoint at line 2, we are able to step-into the non-user-code method.

Based on which criteria does VS Code know that PIL is non-user code? The path the package resides in?



This is related to the code you wrote and the path where the import package is located.

Vscode can distinguish the code by identifying the path

User contributions licensed under: CC BY-SA
9 People found this is helpful