vscode
vscode copied to clipboard
"Open link" command fails to follow file url with line number if given file is outside of directory opened by vscode
Does this issue occur when all extensions are disabled?: Yes
VS Code version: Code - Insiders 1.95.0-insider (c85acdad6b679973c79b01a38afa91448c705c1c, 2024-10-18T07:31:27.077Z) OS version: Darwin arm64 23.6.0 Modes:
System Info
| Item | Value |
|---|---|
| CPUs | Apple M2 Pro (10 x 2400) |
| GPU Status | 2d_canvas: enabled canvas_oop_rasterization: enabled_on 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_graphite: disabled_off video_decode: enabled video_encode: enabled webgl: enabled webgl2: enabled webgpu: enabled webnn: disabled_off |
| Load (avg) | 2, 3, 3 |
| Memory (System) | 16.00GB (0.31GB free) |
| Process Argv | |
| Screen Reader | no |
| VM | 0% |
Steps to Reproduce:
Use minimal attached files structure: example.zip
- You will need to the following directories structure
├── index_outside_of_working_dir.js
└── vscode-working-directory
├── error.log
└── index.js
- The content of both
.jsfiles is the same and actually, doesn't matter for demonstration:
function greet(){
return "Hello, World!";
}
- The content of
error.logshould be:
Error: Some error outsie of project's working directory
at greet (file:///Users/User/Documents/sandboxes/vscode-problem/index_outside_of_working_dir.js:2:10) <--- attempts to create new file with numbers in it's name ❌
at greet (file:///Users/User/Documents/sandboxes/vscode-problem/index_outside_of_working_dir.js:2) <--- attempts to create new file with numbers in it's name ❌
at greet (file:///Users/User/Documents/sandboxes/vscode-problem/index_outside_of_working_dir.js) <---- no problems ✅
Error: Some error within working directory
at greet (file:///Users/User/Documents/sandboxes/vscode-problem/vscode-working-directory/index.js:2:10) <---- no problems ✅
at greet (file:///Users/User/Documents/sandboxes/vscode-problem/vscode-working-directory/index.js:2) <---- no problems ✅
at greet (file:///Users/User/Documents/sandboxes/vscode-problem/vscode-working-directory/index.js) <---- no problems ✅
Replace /Users/User/Documents/sandboxes/vscode-problem/ with your own absolute path
- Open
vscode-working-directoryin vscode and then openerror.log. "Open link" action will fail to navigate to.jsfile outside of currently opened directory if there are also line numbers following the absolute path of the file ❌ Instead, vscode will offer to create not existing.jsfile with line numbers in its name. - Now open an upper directory (
/vscode-problem) in vscode and the problem is gone, because nowindex_outside_of_working_dir.jsbelongs to currently opened directory ✅