microsoft / vscode

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

Hitting a breakpoint in symlinked file opens a new instance of the file #202165

Closed dasz-odoo closed 10 months ago

dasz-odoo commented 10 months ago

Type: Bug

Behaviour

Expected vs. Actual

I develop addons for an open source project, in order to have all standard files + my customised addons files I open the project repository and have a symlink to my custom addons directory. Using breakpoints in those files always open a new tab. When I open the file for working, the path is /dev/my_custom_addon/.../file.py which is a symlink to my_home/work/dev/... which is also the path that my debugger opens when hitting the breakpoint i.e. not the short symlink path but the absolute path

Steps to reproduce:

  1. put a breakpoint in a symlinked file
  2. run your program and hit that breakpoint
  3. vscode will open the same file but from the absolute path, not the symlinked path

Expected Behavior:

Do not open the same file from the symlinked path. Stop the debugger in the same file where I put my breakpoint.

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

``` XXX ```

User Settings

``` languageServer: "Pylance" ```

VS Code version: Code 1.85.1 (0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2, 2023-12-13T09:47:11.635Z) OS version: Linux x64 5.15.0-91-generic snap Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-8365U CPU @ 1.60GHz (8 x 2390)| |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
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|2, 2, 2| |Memory (System)|15.43GB (6.64GB free)| |Process Argv|--no-sandbox --force-user-env --unity-launch --crash-reporter-id 7eaf83cf-f98c-4cc8-8689-c053473e589c| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|cinnamon| |XDG_CURRENT_DESKTOP|X-Cinnamon| |XDG_SESSION_DESKTOP|cinnamon| |XDG_SESSION_TYPE|x11|
Extensions (32) Extension|Author (truncated)|Version ---|---|--- comment-tagged-templates|bie|0.3.2 es7-react-js-snippets|dsz|4.4.3 gitlens|eam|14.6.1 restore-terminals|Eth|1.1.8 auto-rename-tag|for|0.1.10 copilot|Git|1.147.0 copilot-chat|Git|0.11.1 better-cpp-syntax|jef|1.17.2 OdooSnippets|jig|1.5.0 vscode-redux-devtools|jin|1.0.2 cmake-language-support-vscode|jos|0.0.9 rainbow-csv|mec|3.11.0 vscode-scss|mrm|0.10.0 language-gettext|mro|0.2.2 vscode-docker|ms-|1.28.0 csharp|ms-|2.14.8 vscode-dotnet-runtime|ms-|2.0.0 flake8|ms-|2023.10.0 isort|ms-|2023.10.1 python|ms-|2023.22.1 vscode-pylance|ms-|2023.12.1 cmake-tools|ms-|1.16.32 cpptools|ms-|1.18.5 cpptools-extension-pack|ms-|1.3.0 hexeditor|ms-|1.9.12 jinja-snippets|nox|1.0.0 vscode-xml|red|0.26.1 LiveServer|rit|5.7.9 jinjahtml|sam|0.20.0 cmake|twx|0.0.17 gitblame|wad|10.6.0 jinja|who|0.0.8 (1 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 vshan820:30294714 vscod805:30301674 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 py29gd2263:30899288 vsclangdc:30486549 c4g48928:30535728 azure-dev_surveyone:30548225 a9j8j154:30646983 0bi6i642:30933247 pythongtdpath:30769146 i26e3531:30792625 welcomedialogc:30910334 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30928863 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 pythontbext0:30879054 accentitlementsc:30887149 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 aa_t_chat:30882232 cp7184t3:30927821 ```
dasz-odoo commented 10 months ago

this is the same as https://github.com/microsoft/ptvsd/issues/2094 which also links 3 other issues of the same nature

roblourens commented 10 months ago

Please file on the vscode-python or debugpy repos