Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"justMyCode": false is not respected at debug-test configurations #24726

Closed
Akay7 opened this issue Dec 16, 2024 · 9 comments
Closed

"justMyCode": false is not respected at debug-test configurations #24726

Akay7 opened this issue Dec 16, 2024 · 9 comments
Assignees
Labels
area-testing bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team

Comments

@Akay7
Copy link

Akay7 commented Dec 16, 2024

Type: Bug

I pretty sure that I was able to step out of my code, but recently I found that I unable to debug code that is not in my project.

Seems that "justMyCode": false is not respected at debug-test configurations

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Python: Debug Tests",
      "type": "debugpy",
      "request": "launch",
      "program": "${file}",
      "purpose": ["debug-test"],
      "console": "integratedTerminal",
      "presentation": {
          "hidden": true, // keep original launch order in 'run and debug' tab
      },
      "env": {
        "DJANGO_DB_HOST": "127.0.0.1",
        "DJANGO_REDIS_DSN": "redis://127.0.0.1:6379/3",
        "DJANGO_MAILGUN_ENABLED": "False",
      },
      "justMyCode": false
    }
  ]
}
  

VS Code version: Code 1.96.0 (138f619c86f1199955d53b4166bef66ef252935c, 2024-12-11T02:29:09.626Z)
OS version: Linux x64 6.11.8-1-default
Modes:

System Info
Item Value
CPUs AMD Ryzen 7 4800H with Radeon Graphics (16 x 4280)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
webnn: disabled_off
Load (avg) 2, 1, 1
Memory (System) 30.77GB (13.35GB free)
Process Argv --crash-reporter-id 984dcac8-a1bd-4a4c-8189-1e3fa31e8ad4
Screen Reader no
VM 33%
DESKTOP_SESSION default
XDG_CURRENT_DESKTOP KDE
XDG_SESSION_DESKTOP KDE
XDG_SESSION_TYPE x11
Extensions (61)
Extension Author (truncated) Version
swagger-viewer Arj 3.1.2
vscode-django bat 1.15.0
kivy-vscode Bat 0.5.5
doxdocgen csc 1.4.0
dbclient-jdbc cwe 1.3.9
vscode-redis-client cwe 7.7.6
githistory don 0.6.20
gitlens eam 16.0.5
copilot Git 1.252.0
copilot-chat Git 0.23.1
vscode-github-actions git 0.27.0
go gol 0.42.1
headwind hey 1.7.0
rest-client hum 0.25.1
better-cpp-syntax jef 1.27.1
vscode-circuitpython joe 0.2.0
solidity Jua 0.0.179
auto-build mar 2.1.62
marp-vscode mar 2.8.0
rainbow-csv mec 3.13.0
vscode-docker ms- 1.29.3
vscode-language-pack-ru MS- 1.96.2024121109
vscode-kubernetes-tools ms- 1.3.18
debugpy ms- 2024.14.0
isort ms- 2023.10.1
python ms- 2024.22.0
vscode-pylance ms- 2024.12.1
jupyter ms- 2025.1.2024121301
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.0.21
tensorboard ms- 2023.10.1002992421
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
remote-containers ms- 0.394.0
remote-ssh ms- 0.116.0
remote-ssh-edit ms- 0.87.0
remote-wsl ms- 0.88.5
cmake-tools ms- 1.19.52
cpptools ms- 1.22.11
cpptools-extension-pack ms- 1.3.0
live-server ms- 0.4.15
makefile-tools ms- 0.11.13
remote-explorer ms- 0.4.3
sqltools mtx 0.28.3
sqltools-driver-mysql mtx 0.6.3
sqltools-driver-sqlite mtx 0.5.1
platformio-ide pla 3.3.3
vscode-yaml red 1.15.0
git-blame sol 0.2.58
code-spell-checker str 4.0.21
code-spell-checker-russian str 2.2.2
helm-intellisense Tim 0.14.3
es6-string-html Tob 2.17.0
pdf tom 1.2.2
simple-rst tro 1.5.4
cmake twx 0.0.17
vscode-counter uct 3.6.1
intellicode-api-usage-examples Vis 0.2.9
vscodeintellicode Vis 1.3.2
volar Vue 2.1.10
gitblame wad 11.1.1

(1 theme extensions excluded)

A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythonnoceb:30805159
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupyter:31046869
2f103344:31071589
nativerepl1:31139838
pythonrstrctxt:31112756
nativeloc1:31192215
cf971741:31144450
iacca1:31171482
notype1:31157159
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530

@rebornix rebornix assigned karthiknadig and unassigned roblourens Dec 16, 2024
@rzhao271 rzhao271 added bug Issue identified by VS Code Team member as probable bug python Pull requests that update Python code labels Dec 17, 2024
@jonyscathe
Copy link

I also have found this recently.
Used to work just fine with a test debug configuration of:

        {
            "name": "Python: Debug Unit Tests",
            "type": "python",
            "request": "launch",
            "purpose": ["debug-test"],
            "console": "integratedTerminal",
            "justMyCode": false,
        }

But now, no matter what combination I do of launch.json and the justMyCode setting in the Python Debugger extension GUI settings I am not able to debug code within imported modules.

@karthiknadig karthiknadig removed bug Issue identified by VS Code Team member as probable bug python Pull requests that update Python code labels Jan 16, 2025
@karthiknadig karthiknadig removed their assignment Jan 16, 2025
@karthiknadig karthiknadig transferred this issue from microsoft/vscode Jan 16, 2025
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jan 16, 2025
@karthiknadig karthiknadig added bug Issue identified by VS Code Team member as probable bug area-testing labels Jan 16, 2025
@eleanorjboyd
Copy link
Member

What version of python are you using?

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jan 17, 2025
@Akay7
Copy link
Author

Akay7 commented Jan 17, 2025

I'm using
Python 3.12.8 (main, Dec 04 2024, 21:53:56) [GCC] on linux

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Jan 17, 2025
@dalemyers
Copy link

I'm also seeing this. It used to work fine.

launch.json:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "bashdb",
            "request": "launch",
            "name": "Bash-Debug Current File",
            "cwd": "${workspaceFolder}",
            "program": "${file}",
            "pathBash": "/opt/homebrew/bin/bash",
            "args": []
        },
        {
            "name": "Python: Current File",
            "type": "debugpy",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": false
        },
        {
            "name": "Python: Debug Tests",
            "type": "debugpy",
            "request": "launch",
            "program": "${file}",
            "purpose": [
                "debug-test"
            ],
            "console": "integratedTerminal",
            "justMyCode": false
        }
    ]
}

settings.json (just Python settings):

{
    "python.defaultInterpreterPath": "${workspaceFolder}/../../.venv/bin/python3",
    "python.testing.pytestArgs": [
        "--rootdir=${workspaceFolder}",
        "tests"
    ],
    "python.testing.pytestPath": "${workspaceFolder}/../../.venv/bin/pytest",
    "python.testing.pytestEnabled": true,
    "python.testing.unittestEnabled": false,
}

I have no Python settings in my user settings.

Python version: 3.13.1
Pytest version: 7.4.4
VSCode version: 1.96.4
Python extension version: 2024.22.2
Python debugger extension version: 2024.14.0

All I'm doing is selecting the testing pane on the left, finding a test, then clicking the "debug" test button. Breakpoints are hit, but I just can't step in to code that is not mine.

@eleanorjboyd I'm internal to MS, so feel free to reach out for debugging steps. My alias is dalemyers.

@eleanorjboyd
Copy link
Member

I also have found this recently. Used to work just fine with a test debug configuration of:

        {
            "name": "Python: Debug Unit Tests",
            "type": "python",
            "request": "launch",
            "purpose": ["debug-test"],
            "console": "integratedTerminal",
            "justMyCode": false,
        }

But now, no matter what combination I do of launch.json and the justMyCode setting in the Python Debugger extension GUI settings I am not able to debug code within imported modules.

does it make a difference setting "type" to "debugpy"? I tried this myself and it worked

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Feb 6, 2025
@eleanorjboyd
Copy link
Member

@dalemyers, thanks for the detailed description. For you config with the debug test, what is the purpose of setting this: "program": "${file}",?

I gave your config a try on my machine and it worked. What OS are you using and are you connected to a remote? Also if you set your logs to info, do you see this in your python logs Using configuration in launch.json. To do so first set your log level to trace via the Developer: set log level command in the command palette then check the output panel and select "python" from the dropdown.

@dalemyers
Copy link

or you config with the debug test, what is the purpose of setting this: "program": "${file}",?

I have no idea... It's copied from somewhere. Removing it didn't change anything.

What OS are you using

macOS 15.2

are you connected to a remote

No. Entirely local.

do you see this in your python logs Using configuration in launch.json

Yes.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Feb 6, 2025
@bzczb
Copy link

bzczb commented Feb 7, 2025

justMyCode=false in launch.json and debugpy.debugJustMyCode=false in settings.json are working again for me in unit tests, after the latest update!

Dupe of #24439 ?

@Akay7
Copy link
Author

Akay7 commented Feb 7, 2025

Now it started working again, without any changes on my side. So if anyone has the same problem, try updating.

@Akay7 Akay7 closed this as completed Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-testing bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

8 participants