Support to detect file links in output
See original GitHub issueDoes this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.67.0 (system setup)
- OS Version: Windows_NT x64 10.0.19044
Steps to Reproduce:
- Open a workspace folder, say
/home/juxeii/projects/myproject
- Create an empyt file, say
gtestLog_testfoo
and save this under/home/juxeii/projects/myproject
and under/home/juxeii
- Create a simple vsc extension and write both file paths to an output channel like so:
const outputChannel = vscode.window.createOutputChannel('MyExt');
const testfileuriBad = vscode.Uri.file(path.join('/home/juxeii', 'gtestLog_testfoo'));
outputChannel.appendLine(testfileuriBad);
const testfileuriGood = vscode.Uri.file(path.join('/home/juxeii/projects/myproject, 'gtestLog_testfoo'));
outputChannel.appendLine(testfileuriGood);
On my extension it looks like this
[5/10/2022, 12:57:31] INFO: Log file: file:///home/juxeii/projects/myproject/gtestLog_testfoo
[5/10/2022, 12:57:31] INFO: Test file file:///home/juxeii/gtestLog_testfoo
The output channel provides two file link, both of which I can click.
But only the first link file:///home/juxeii/projects/myproject/gtestLog_testfoo
opens the file, while the second fails:
This occurs both when working with remote ssh on wsl2 on windows, and with a remote linux machine.
Is this intended behavior not letting open files outside the workspace?
The error log in the output window gives Log (Window)
[2022-05-10 13:21:40.864] [renderer3] [error] Error: File not found
at g.handleSetInputError (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2701:95592)
at async g.setInput (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2701:94832)
at async doSetInput (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2699:6429)
at async doOpenEditor (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2699:4791)
at async d.openEditor (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2699:3783)
at async vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:2906:16950
at async C.doOpenCodeEditor (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:1360:31342)
at async m.open (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:594:51701)
at async open (vscode-file://vscode-app/c:/Program%20Files/Microsoft%20VS%20Code/resources/app/out/vs/workbench/workbench.desktop.main.js:594:53162)
EDIT: open the folder /home/juxeii
as workspace root, and I can open the file again. This confirmes that somehow the workspace root is in play here, which has a problem with links in the output window to files outside the workspace.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:22 (13 by maintainers)
Top GitHub Comments
👍
Turning into a feature as this works as intended currently. We need to expand the output link detection to handle
file
links if we want to support this scenario.