xdebug / vscode-php-debug

PHP Debug Adapter for Visual Studio Code 🐞⛔
MIT License
771 stars 176 forks source link

[Possible improvement] Persist host paths for reverse mapping #855

Open AnrDaemon opened 1 year ago

AnrDaemon commented 1 year ago

Type: Bug?

I've stumbled upon a problem that, while understandable after investigation, could use an improvement.

My setup had included the following path mappings:

"pathMappings": {
    "/home/user/project": "${workspaceFolder}",
    "/home/user/project/app/admin/func/": "${workspaceFolder}/app/func/"
}

The project had a symlink from ~/app/admin/func to app/func at one point, thus ~/app/func/func.php and ~/app/admin/func/func.php were the same file. The symlink was made obsolete months ago and when I were doing cleanup of my dev. VM last week, I've removed it for good. After that, I've found that I'm unable to install breakpoints inside the ~/app/func/ directory. Even when I have a debug session in progress, and all paths are known to extension, setting breakpoint in the current file marks it as unresolved. Meditating over xdebug communication log immediately led me to the launch.json pathMappings setting, indeed, but I think this area could be improved from extension's side.

Extension version: 1.29.0 VS Code version: Code 1.73.0 (8fa188b2b301d36553cbc9ce1b0a146ccb93351f, 2022-11-01T15:34:06.111Z) OS version: Windows_NT x64 10.0.19045 Modes: Sandboxed: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz (8 x 3408)| |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_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|undefined| |Memory (System)|15.92GB (8.94GB free)| |Process Argv|--folder-uri file:///c%3A/Users/Admin/Documents/hk/invapi-php| |Screen Reader|no| |VM|0%|