microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.31k stars 29.31k forks source link

Node.js breakpoints require blur and refocus to show triggered #137450

Closed thesoftwarephilosopher closed 2 years ago

thesoftwarephilosopher commented 2 years ago

Issue Type: Bug

For some reason, in the past month, when my code hits a Node.js breakpoint in the debugger, very often (maybe always?) VS Code does nothing---even though the code is clearly paused---until I switch windows away from VS Code and then back to it, at which point the debugger kicks in, highlights the right line, shows everything in the debugger tab, etc.

VS Code version: Code 1.62.2 (3a6960b964327f0e3882ce18fcebd07ed191b316, 2021-11-11T20:56:38.428Z) OS version: Windows_NT x64 10.0.22000 Restricted Mode: No

System Info |Item|Value| |---|---| |CPUs|11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz (8 x 1382)| |GPU Status|2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled| |Load (avg)|undefined| |Memory (System)|7.74GB (0.71GB free)| |Process Argv|--crash-reporter-id 398eb7b3-3072-4301-bc53-fa9ac7b77f26| |Screen Reader|no| |VM|0%|
Extensions (13) Extension|Author (truncated)|Version ---|---|--- vscode-sqlite|ale|0.14.0 vscode-nunjucks|exe|0.1.0 eml|lei|0.4.0 rainbow-csv|mec|1.10.1 dotenv|mik|1.0.1 remote-wsl|ms-|0.58.5 test-adapter-converter|ms-|0.1.4 pixelbyte-love2d|pix|0.1.22 material-icon-theme|PKi|4.10.0 prisma|Pri|3.5.0 lua|sum|2.4.9 local-lua-debugger-vscode|tom|0.3.1 markdown-all-in-one|yzh|3.4.0
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes516:30244333 pythontb:30283811 pythonptprofiler:30281270 vsdfh931:30280409 vshan820:30294714 vstes263:30335439 vscorecescf:30384386 pythondataviewer:30285071 vscod805cf:30301675 pythonvspyt200:30340761 binariesv615:30325510 bridge0708:30335490 dockerwalkthru:30377721 bridge0723:30353136 pythonrunftest32:30373476 pythonf5test824:30373475 javagetstartedt:30391933 pythonvspyt187:30373474 vsqsis200cf:30402084 vsaa593cf:30376535 vssld246:30401890 ```
weinand commented 2 years ago

@sdegutis please file a separate issue for the Markdown feature request directly against github: https://support.github.com/contact/feedback

Since it is unrelated to debugging I'm hiding it here...

roblourens commented 2 years ago

That's a strange issue. If you hit a breakpoint when the window is not focused, does it get focused correctly?

Wondering whether this is from https://github.com/microsoft/vscode/commit/fb78bbdabb550f136728b5edf93d58c53b44c060 where seems that we wait for the window to be focused before continuing to process the pause event.

thesoftwarephilosopher commented 2 years ago

I just reproduced it again (ugh), and what happens is more correctly this:

  1. I set a breakpoint in VSCode
  2. I go to the website and do the thing that crashes
  3. I go back to VS code and it's not breakpointy
  4. I switch back to the website
  5. I switch back to vs_code and finally it does its thing

Sounds like it could be related to that commit? Dunno.

roblourens commented 2 years ago

And you're sure your website code definitely hit the code that should hit the breakpoint? It's not related to focus in the website?

thesoftwarephilosopher commented 2 years ago

Yep, 99% sure. I've been using the debugger successfully for months, and then it started to do this within the last few weeks or so. Each time, I did nothing on the website to "trigger" the breakpoint on the second visit to the website and away from Vs-code. It's very possible that I can retrigger this by switching apps to another window besides the website, and then back to vsCode, during step 4. I'll try that next time it happens again.

thesoftwarephilosopher commented 2 years ago

Yep just switched to Mail and back to vs:code, and it "kicked in." It's definitely a bug.

weinand commented 2 years ago

/duplicate #123257