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

[debug] DebugConfigurationProvider not invoked on debug session restart #212005

Open
connectdotz opened this issue May 4, 2024 · 3 comments
Open
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@connectdotz
Copy link

connectdotz commented May 4, 2024

Type: Bug

  1. Setup: Clone the vscode-mock-debug from GitHub. Although this bug also affects the vscode-jest extension, the vscode-mock-debug is used here for demonstration because it is easier to set up and reproduce.
  2. Breakpoint in Extension: Open the cloned repository in VS Code, navigate to src/activateMockDebug.ts, and place a breakpoint at MockConfigurationProvider.resolveDebugConfiguration.
  3. Start Debugging: Press F5 to start the extensionHost, which initiates the debugging session for the extension itself. This should open the "sampleWorkspace" with a readme.md file.
  4. Debug Session: Open the readme.md file and place a breakpoint in any line. Start a debug session that triggers this breakpoint. (use the inline menu on the top of the editor, choose "Debug File".)
  5. Verify Extension Invocation: Upon debug session creation, the MockConfigurationProvider.resolveDebugConfiguration will be invoked and breakpoint will be hit. Let it continue.
  6. Session Restart: Next it should hit the readme.md breakpoint. Use the restart button in the debug toolbar to restart the session.
  7. Observation of Bug: Observe that upon restarting, MockConfigurationProvider.resolveDebugConfiguration is not invoked, which deviates from the expected behavior where configuration methods should be invoked for every session initiation, including restarts.

This has caused an issue jest-community/vscode-jest#1148, where the "unresolved" debug config was used upon debug session restart.

VS Code version: Code 1.89.0 (b58957e, 2024-05-01T02:10:10.196Z)
OS version: Darwin x64 23.4.0
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz (12 x 3200)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 5, 5, 5
Memory (System) 32.00GB (4.01GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (47)
Extension Author (truncated) Version
better-comments aar 3.0.2
vscode-color-pick ada 0.6.2
vscode-markdownlint Dav 0.55.0
vscode-eslint dba 2.4.4
xml Dot 2.5.1
gitlens eam 14.9.1
prettier-vscode esb 10.4.0
vscode-commands fab 2.0.2
flow-for-vscode flo 2.2.1
shell-format fox 7.2.5
html-preview-vscode geo 0.2.5
copilot Git 1.186.856
copilot-chat Git 0.15.0
vscode-pull-request-github Git 0.88.0
go gol 0.41.4
svg joc 1.5.3
vscode-insertdatestring jsy 2.3.1
vscode-colorize kam 0.11.1
json-lines-viewer leh 0.0.4
git-graph mhu 1.30.0
vscode-docker ms- 1.29.1
debugpy ms- 2024.6.0
isort ms- 2023.10.1
python ms- 2024.6.0
vscode-pylance ms- 2024.4.1
jupyter ms- 2024.4.0
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.0.17
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
remote-containers ms- 0.362.0
wordcount ms- 0.1.0
vscode-jest Ort 6.2.5
material-icon-theme PKi 5.1.0
java red 1.30.0
markdown-preview-enhanced shd 0.8.13
code-spell-checker str 3.0.1
pdf tom 1.2.2
intellicode-api-usage-examples Vis 0.2.8
vscodeintellicode Vis 1.3.1
vscode-java-debug vsc 0.57.0
vscode-java-dependency vsc 0.23.6
vscode-java-pack vsc 0.26.0
vscode-java-test vsc 0.41.1
vscode-maven vsc 0.44.0
vim vsc 1.27.2
markdown-all-in-one yzh 3.6.2

(1 theme extensions excluded)

@roblourens
Copy link
Member

It looks like maybe you register your own debug adapter type, and resolve to the 'node' type, is that what's happening in this scenario?

@roblourens
Copy link
Member

What should happen in mock-debug is that the config provider isn't called for each restart, but it restarts reusing the original resolved config.

But also, restarting actually works differently in the node debug adapter.

Possible that this is related to #212823 too but that might be a different scenario

@roblourens roblourens added the info-needed Issue requires more information from poster label May 17, 2024
@roblourens
Copy link
Member

roblourens commented May 17, 2024

I pushed a fix for a related bug here #212991 and I think it might fix your issue, but I'm not sure.

Our Insiders releases are paused for the Build conference, so this won't be in an Insiders until around next Thursday. You can try then, or build the vscode repo if you want to try it earlier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants