Skip to content
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 relative paths as links in output #167211

Closed
damms005 opened this issue Nov 25, 2022 · 16 comments
Closed

Support relative paths as links in output #167211

damms005 opened this issue Nov 25, 2022 · 16 comments
Labels
feature-request Request for new features or functionality output Output channel system issues
Milestone

Comments

@damms005
Copy link

Does this issue occur when all extensions are disabled?: Yes/No (Not applicable. An extension that logs paths/url to the Output window is required to reproduce the issue)

  • VS Code Version: 1.73.1
  • OS Version: Linux (Zorin OS Pro 16).

Steps to Reproduce:

  1. Install an extension that logs clickable links/file paths to the Output Window (for example, Wallaby)
  2. Trigger an action that makes the extension above log an entry that includes a clickable link/file path to the Output Window
  3. Observe that no links/file paths in the Output window is clickable; neither via Ctrl + Click nor Alt + Click

Expected outcome:

Notice that the text Launch Coverage & Test Explorer is a clickable link

image

Actual outcome (bug)

Notice that the text Launch Coverage & Test Explorer** is not clickable

image

@weinand weinand assigned aeschli and unassigned weinand Nov 28, 2022
@aeschli aeschli assigned sandy081 and bpasero and unassigned aeschli and sandy081 Nov 28, 2022
@bpasero bpasero added output Output channel system issues feature-request Request for new features or functionality labels Nov 29, 2022
@bpasero bpasero removed their assignment Nov 29, 2022
@bpasero bpasero changed the title File paths and links in the Output window are not clickable Support relative paths as links in output Nov 29, 2022
@bpasero
Copy link
Member

bpasero commented Nov 29, 2022

We only support absolute paths that are inside the workspace as links for performance reasons. See also #163778 and #149153

@bpasero bpasero added this to the Backlog milestone Nov 29, 2022
@damms005
Copy link
Author

@bpasero is the support for absolute paths only restricted to Linux? As you can see from my screenshots above, same VS Code versions and same Wallaby extension version; but the first screenshot shows that the links are clickable (one of the Wallaby extension maintainer sent that to me) while the screenshot below it have unclickable links.

The maintainer took the screenshot from his Mac, while I took mine from my Linux.

@bpasero
Copy link
Member

bpasero commented Nov 30, 2022

Any platform. Here is the code that creates the patterns for link detection and the workspace roots are taken as input:

private computePatterns(createData: ICreateData): void {
// Produce patterns for each workspace root we are configured with
// This means that we will be able to detect links for paths that
// contain any of the workspace roots as segments.
const workspaceFolders = createData.workspaceFolders
.sort((resourceStrA, resourceStrB) => resourceStrB.length - resourceStrA.length) // longest paths first (for https://github.com/microsoft/vscode/issues/88121)
.map(resourceStr => URI.parse(resourceStr));
for (const workspaceFolder of workspaceFolders) {
const patterns = OutputLinkComputer.createPatterns(workspaceFolder);
this.patterns.set(workspaceFolder, patterns);
}
}

@damms005
Copy link
Author

Any clue as to why the same extension, same version, will behave differently? His output window is clickable (as evident in the screenshot above); while I have a different experience. Will tagging him here help?

@bpasero
Copy link
Member

bpasero commented Nov 30, 2022

Sorry I am not sure, @sandy081 @mjbvz or @jrieken do you know if extensions can provide links to output viewer?

@jrieken
Copy link
Member

jrieken commented Nov 30, 2022

Yes - via the DocumentLinkProvider API they can

@bpasero
Copy link
Member

bpasero commented Nov 30, 2022

Ah yeah thanks, I had forgotten about that API. So it is possible that there is a bug in the extension that only surfaces on some operating systems.

@smcenlly
Copy link
Contributor

smcenlly commented Dec 1, 2022

I'm from the Wallaby team. We had helped @damms005 triage his issue, and yes, we use the the DocumentLinkProvider API.

@damms005 told us the issue affected all extensions with links, not just ours.

@bpasero
Copy link
Member

bpasero commented Dec 2, 2022

Can you produce a minimal sample in a hello world extension for us to reproduce?

@damms005
Copy link
Author

damms005 commented Dec 2, 2022

@bpasero I am unsure if that request is directed at @smcenlly or myself. However, a hello world extension is not required to reproduce this, IMO. Only two conditions need to be met to reproduce this issue:

  1. Anything that writes file paths or URLs to the output window. See the below screenshot of the built-in Git extension. None of those file paths is clickable
  2. VS Code running on Linux OS (in my case, specifically Zorin OS Pro. It is based on Ubuntu)

image

@bpasero
Copy link
Member

bpasero commented Dec 3, 2022

From core (without extensions) we only detect and show a link if the path is:

  • absolute
  • a child of a workspace folder that is opened

@damms005
Copy link
Author

damms005 commented Dec 3, 2022

From core (without extensions) we only detect and show a link if the path is:

  • absolute
  • a child of a workspace folder that is opened

Only on Linux or across platforms? If across all platforms, what explains the different behaviour on Linux systems?

@bpasero
Copy link
Member

bpasero commented Dec 5, 2022

This is platform independent. I cannot explain platform inconsistencies, but if there is a small sample to play with, I am happy to try.

@damms005
Copy link
Author

damms005 commented Dec 5, 2022

Perhaps I'm unable to communicate this very well, or you choose to not understand the problem. Either ways, I do not see the current direction this is headed as yielding any result.

Thanks for your efforts anyways.

@damms005 damms005 closed this as completed Dec 5, 2022
@damms005
Copy link
Author

For anyone that stumbled on this, the issue was having "editor.links": false in my settings.json

@damms005
Copy link
Author

@bpasero The description for the link says 'Controls whether the editor should detect links and make them clickable'

Since this only affects the Output Window, perhaps the description should be updated to reflect same. It will be helpful in debugging like in my case

@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality output Output channel system issues
Projects
None yet
Development

No branches or pull requests

8 participants