microsoft / vscode

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

Support file paths as links even when outside the workspace #163778

Open SmartManoj opened 1 year ago

SmartManoj commented 1 year ago

Type: Bug

Run a python file with error

VS Code version: Code 1.72.1 (129500ee4c8ab7263461ffe327268ba56b9f210d, 2022-10-10T17:22:48.346Z) OS version: Windows_NT x64 10.0.22621 Modes: Sandboxed: No

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 5 5500U with Radeon Graphics (12 x 2096)| |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)|5.86GB (0.48GB free)| |Process Argv|--crash-reporter-id 31502f3f-fe80-4181-8fd4-0902bc420d82| |Screen Reader|no| |VM|0%|
Extensions (53) Extension|Author (truncated)|Version ---|---|--- terraform|4op|0.2.5 vscode-intelephense-client|bme|1.8.2 path-intellisense|chr|2.8.1 open-html-in-browser|cod|0.1.21 parameter-hints|Dom|0.2.7 EditorConfig|Edi|0.16.4 vscode-great-icons|emm|2.1.86 code-runner|for|0.11.8 copilot|Git|1.53.7011 gc-excelviewer|Gra|4.2.56 todo-tree|Gru|0.0.219 terraform|has|2.24.3 vscode-gist|ken|3.0.3 node-module-intellisense|lei|1.5.0 vscode-JS-CSS-HTML-formatter|lon|0.2.3 aws-cli-configure|mar|0.3.0 vscode-autohotkey-plus-plus|mar|3.0.0 pretty-formatter|mbl|0.2.2 theme-monokai-pro-vscode|mon|1.1.21 phpstorm-parameter-hints-in-vscode|MrC|1.0.0 vscode-docker|ms-|1.22.1 black-formatter|ms-|2022.4.0 isort|ms-|2022.3.12861052 python|ms-|2022.17.12871028 vscode-pylance|ms-|2022.10.20 jupyter|ms-|2022.9.1202862440 jupyter-keymap|ms-|1.0.0 jupyter-renderers|ms-|1.0.10 vscode-jupyter-cell-tags|ms-|0.1.6 vscode-jupyter-slideshow|ms-|0.1.5 remote-containers|ms-|0.255.3 remote-ssh|ms-|0.90.1 remote-ssh-edit|ms-|0.84.0 azure-account|ms-|0.11.2 cmake-tools|ms-|1.12.27 cpptools|ms-|1.12.4 cpptools-extension-pack|ms-|1.3.0 js-debug-nightly|ms-|2022.10.1317 sublime-keybindings|ms-|4.0.10 sqltools|mtx|0.25.1 nodejs-snippets|piy|0.0.2 material-icon-theme|PKi|4.21.0 vue-vscode-snippets|sdr|3.1.1 vscode-fileutils|sle|3.5.0 guides|spy|0.9.3 select-quotes|StA|0.0.2 rewrap|stk|1.16.3 temp-terraform-markdown|stu|0.0.1 open-in-browser|tec|2.0.0 pdf|tom|1.2.0 vscode-switch-wordwrap|Tsu|0.0.3 cmake|twx|0.0.17 vscode-todo-highlight|way|1.0.5 (4 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes627:30244334 vslsvsres303:30308271 pythonvspyl392:30443607 vserr242cf:30382550 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vshan820:30294714 vstes263cf:30335440 pythondataviewer:30285071 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 cmake_vspar411:30581797 vsaa593cf:30376535 pythonvs932:30410667 cppdebug:30492333 vsclangdc:30486549 c4g48928:30535728 dsvsc012cf:30540253 azure-dev_surveyone:30548225 i497e931:30553904 pyindex848cf:30577861 nodejswelcome1cf:30587006 40g7c324:30573242 ```

image

vscodenpa commented 1 year ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.72.2. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

SmartManoj commented 1 year ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.72.2. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

Still the same.

sandy081 commented 1 year ago

@joaomoreno Assigning this to you as I do not know who owns output link computer.

bpasero commented 1 year ago

Turning into a feature request as this is simply not how output link detection works: it will only detect links for paths that are inside the workspace but not for any pattern. I think we did that for performance reasons, though the code is also very old:

https://github.com/microsoft/vscode/blob/9d5741f01a67beea273121615b2d015fc298d9ea/src/vs/workbench/contrib/output/common/outputLinkComputer.ts#L40-L43

huangqinjin commented 10 months ago

Could we at least have a switch to enable file links? Current logic is too strict. /path/to/workspace/file supports links but /path/to/others/../workspace/file does not support, though they point to the same file.