question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support to detect file links in output

See original GitHub issue

Does 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:

  1. Open a workspace folder, say /home/juxeii/projects/myproject
  2. Create an empyt file, say gtestLog_testfoo and save this under /home/juxeii/projects/myproject and under /home/juxeii
  3. 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: grafik 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:open
  • Created a year ago
  • Reactions:1
  • Comments:22 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
bpaserocommented, May 31, 2022

👍

2reactions
bpaserocommented, May 31, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Detect file links in console output : RIDER-44884 - YouTrack
It would be nice if file URIs were detected in debug/console output, the same way http and https links are detected and made...
Read more >
Open file links from console or compile output #98593 - GitHub
When I either do a compilation in the integrated terminal or with a build task and I click on a file "link" for...
Read more >
Find links (external references) in a workbook
Find links used in formulas​​ Click Options. In the Find what box, enter . xl. In the Within box, click Workbook.
Read more >
How to figure out if a file is a link? - Stack Overflow
I tested my program with a regular file type and a symbolic link. In both cases the output was "regular file" i.e the...
Read more >
Fail to Output a URL in the Media Field - Crocoblock
In case you want to output a link to a certain media file, it can be done with no sweat using the Attachment...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found