microsoft / vscode

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

php debugging #148593

Closed page3131 closed 2 years ago

page3131 commented 2 years ago

Issue Type: Bug

I have several projects and several copies of several projects for different servers. I right click on the directory and it opens the folder as a project. At some point along the way the php debugger will not load the configuration. I have deleted the settings directory and saved the settings sometimes the dugger menu item comes back. I usually have 2 or more visual studio code projects loaded and navigating between them. As needed I turn off the debugger on one and turn it on with the another project. For some reason now I am unable to get the "run" in the menu and the left side debug icon doesn't show a start option or set up the settings option. It does seem to work in other projects. It seems to get locked on some projects. I think I saw a message about it already connected.

Step 1 load a project Step 2 Activate php debugger Step 3 open another project Step 4 Deactivate debugger from step 1 Step 5 Attempt to use the debugger from step 3 Step 6 Repeat until the second project fails to show the debugging controls Step 7 If the above fails load a bunch of projects and enable, use and disable the php debugger through out the list of open projects

Other than that I am not sure why it fails to load the debugger controls. For now in the worst case scenarios I have to switch over to Sublime.

VS Code version: Code 1.66.2 (dfd34e8260c270da74b5c2d86d61aee4b6d56977, 2022-04-11T07:46:01.075Z) OS version: Windows_NT x64 10.0.17763 Restricted Mode: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Xeon(R) Gold 6246R CPU @ 3.40GHz (4 x 3400)| |GPU Status|2d_canvas: unavailable_software
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software| |Load (avg)|undefined| |Memory (System)|20.00GB (4.04GB free)| |Process Argv|--crash-reporter-id c307ed96-e0fb-4d71-9ff2-7b4bdb7c0355| |Screen Reader|no| |VM|100%|
Extensions (16) Extension|Author (truncated)|Version ---|---|--- SecurityIntelliSense|azs|0.8.0 vscode-eslint|dba|2.2.2 Ionide-fsharp|Ion|6.0.2 csharp|ms-|1.24.4 dotnet-interactive-vscode|ms-|1.0.3175020 vscode-dotnet-pack|ms-|1.0.8 vscode-edge-devtools|ms-|1.4.8 python|ms-|2022.4.1 vscode-pylance|ms-|2022.4.3 jupyter|ms-|2022.3.1000901801 jupyter-keymap|ms-|1.0.0 jupyter-renderers|ms-|1.0.6 vscode-typescript-next|ms-|4.7.20220501 debugger-for-chrome|msj|4.13.0 debugger-for-edge|msj|1.0.15 php-debug|xde|1.26.1
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492cf:30256860 pythonvspyl392:30443607 pythontb:30283811 pythonptprofiler:30281270 vshan820:30294714 vstes263:30335439 pythondataviewer:30285071 vscod805:30301674 pythonvspyt200:30340761 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593:30376534 vsc1dst:30438360 pythonvs932:30410667 wslgetstarted:30449410 pythonvsnew555:30457759 vscscmwlcmt:30465135 cppdebug:30475216 vscaat:30438848 ```
page3131 commented 2 years ago

Otherwise an amazing product.

page3131 commented 2 years ago

I found that I can copy and paste the launch and settings json from another project and this will now show the debug control items.

roblourens commented 2 years ago

Sorry, I don't follow. Can you show screenshots of what working and not working looks like? And what settings do you use to fix it?

page3131 commented 2 years ago

image

Not sure how I didn't notice that there was a comment on here. Can this case be opened again? In the screen shot you can see that the "run" is not in the menu. It is in the modules. Much of my previous copy and pasting files hasn't worked to get it back. I am now not able to debug this project. I am thinking I need to use sublime.

page3131 commented 2 years ago
image
page3131 commented 2 years ago
image
page3131 commented 2 years ago

Please bring back the debug run button.

roblourens commented 2 years ago

image

There is something weird going on here. You've selected the Edge devtools sidebar viewlet, but the "Run and debug" title is showing (and obviously has not loaded)

Any errors in the devtools (Help > Toggle developer tools)?

Can you click the debug icon in the activity bar (Play button with bug)?

page3131 commented 2 years ago

That is because my mouse is over the edge debug tool. This view is the run and debug tool bar.

Yes

image
page3131 commented 2 years ago
image
page3131 commented 2 years ago

This time I highlighted the debug button.

page3131 commented 2 years ago

So it is thinking it is already connected but it is not.

page3131 commented 2 years ago

Today I ended up taking the global settings.json and copying the content to the .vscode/settings.json. That brought the "run" button back when reloading vscode.

page3131 commented 2 years ago

Thanks for reopening the case.

roblourens commented 2 years ago

Today I ended up taking the global settings.json and copying the content to the .vscode/settings.json. That brought the "run" button back when reloading vscode.

Good - Can you share your settings.json and explain exactly what you did?

@sbatten that stack above kind of makes it look like a DebugService was created twice in the course of creating the debug view - because the only path to register that extension handler twice is from the DebugService constructor. Any idea?

sbatten commented 2 years ago

I can't explain it, but it looks like their are 2 copies of the run and debug view container, is that what you are suggesting as well?

page3131 commented 2 years ago

image I noticed that the "run" menu was not in the top menu bar. I went to settings -> Extensions -> PHP Debug. I then hit the save button. I close out and reopen and now it shows. It usually is resolved by saving the settings. It seems to be inconsistent with exactly how it is saved. I have had this method not work. I then make a change an save. When that doesn't work I then copy new files. When that doesn't work I suppose I repeat the above and so far it has come back without much repetition.

roblourens commented 2 years ago

I can't explain it, but it looks like their are 2 copies of the run and debug view container, is that what you are suggesting as well?

I guess so, but it seems like even if the view container is created twice, the DebugService shouldn't be created a second time too

Thanks @page3131, I don't totally follow but I don't really think that saving the settings.json is going to fix this issue, so it's probably a random occurrence

page3131 commented 2 years ago

What ever is going on is a work around to get the debugger started. Today I reloaded visual studio code 10 times. It would not load the debugger run button. I saved the settings. After reloading it was available. I don't know if it helps but I open the projects by directory.

roblourens commented 2 years ago

I will merge this issue into https://github.com/microsoft/vscode/issues/150169 because that seems to be the same issue and has some more details. As a workaround, does it help if you run the command "Reset View Locations"?

page3131 commented 2 years ago

Reset View Locations doesn't help.

roblourens commented 2 years ago

Ok, sorry - we will keep investigating in the other issue since the stack is the same