-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support to detect file links in output #149153
Comments
I actually have the Same problem but this is also Happening when the Problems try to Redirect to the Editor. So I do have a Workspace with only 1 Folder and the Extension I use are for Saleforce Extension Pack. |
Does this reproduce when not using remote? I wonder if we need to properly convert file paths for opening when clicking on the output because they originate from the remote and cannot be opened locally. I.e. a |
@bpasero Yes, it is not dependent on any remote setting. Just create an simple extension with an output channel and write two uri's to it. One within project root and one outside. |
I wonder if something with the paths is messed up, when you click "Create File" where does it store the file to? |
I recall, it created it locally(in the remote setting) and what was also weird, it also changed from "/" to "" as path delimiter. |
I cannot reproduce, even from an empty window, I can open both paths. My extension code: const outputChannel = vscode.window.createOutputChannel('MyExt');
const testfileuriBad = vscode.Uri.file(path.join('/Users/bpasero/', 'gtestLog_testfoo')).toString();
outputChannel.appendLine(testfileuriBad);
const testfileuriGood = vscode.Uri.file(path.join('/Users/bpasero/Desktop', 'gtestLog_testfoo')).toString();
outputChannel.appendLine(testfileuriGood); I have a file |
I don't know how to help. I have created an empty extension.
The extension project lives in I created dummy files Do you have some Windows machine with WSL2 to test? |
Thanks for the steps, so it is happening in a remote WSL environment. I suspect that maybe we do some special mapping of the paths for the workspace folder so that files outside of the workspace cannot be opened, but I let Martin chime in as well. |
Just for the records: it is not only happening in a WSL environment, but it is the same issue in a remote SSH setting. |
I wonder if it is output channel related issue because the files in workspace are being opened. I suspect some where inside while opening the file there could be a validation to not to allow file outside workspace? |
I am able to reproduce and believe this is a bug in how we transform URLs. In my testing, only a link that points into a file inside the workspace is being converted to |
@bpasero The URI converter converts all URIs unrelated if they belong in a workspace or not. I think the difference is explained by this special casing of workspace folders in the output link computer. |
@alexdima 🤔 but the link is there even for the non-workspace case, so link detection seems to work, but maybe we do the rewriting conditionally. |
Oh I see, the links are indeed different:
As such it makes sense that for the second link we just try to open it. |
Turning into a feature as this works as intended currently. We need to expand the output link detection to handle |
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation. Happy Coding! |
Is there any reason why it should not be supported? At least a little documentation about this behaviour would be needed. |
Nope, no reason I can think of. |
Just asking, since it is declared as feature now, which means it is dependant on upvotes. |
👍 |
1 similar comment
👍 |
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
/home/juxeii/projects/myproject
gtestLog_testfoo
and save this under/home/juxeii/projects/myproject
and under/home/juxeii
On my extension it looks like this
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)
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.The text was updated successfully, but these errors were encountered: