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

Local file links as hyperlinks #6257

Open
valkum opened this issue Oct 9, 2024 · 0 comments
Open

Local file links as hyperlinks #6257

valkum opened this issue Oct 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@valkum
Copy link

valkum commented Oct 9, 2024

Is your feature request related to a problem? Please describe.
Some tools (such as linters) emit the position of the failed check as a file path with line and col number.

E.g.

warning: using `map_err` over `inspect_err`
   --> toast/src/graphql/mod.rs:506:44

VSCode creates links in the local terminal which will open the file at the appropriate position. They use the following parsing: https://github.com/microsoft/vscode/blob/bb09960d30806b18e432a835b430c21e107f6aad/src/vs/workbench/contrib/terminalContrib/links/browser/terminalLinkParsing.ts

Describe the solution you'd like
Ideally, wezterm would implement something similar. A simple regex solution is not completely suitable because often these links are relative and don't start with a scheme.

Also, it would be nice if this could be context aware, only enabling this when the output is from a certain command (but I am not sure if this is even possible).

Describe alternatives you've considered
Simple regex hyperlink_rules. These lack support for the relative nature and are not suitable for all kinds of scenarios, because we don't have a start token (but you could use --> in the case of clippy).

Additional context
https://github.com/microsoft/vscode/blob/bb09960d30806b18e432a835b430c21e107f6aad/src/vs/workbench/contrib/terminalContrib/links/browser/terminalLinkParsing.ts
https://github.com/microsoft/vscode/blob/bb09960d30806b18e432a835b430c21e107f6aad/src/vs/workbench/contrib/terminalContrib/links/browser/terminalLocalLinkDetector.ts

@valkum valkum added the enhancement New feature or request label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant