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 hyperlinks to specific file line numbers in the terminal #66957

Closed
joshunger opened this issue Jan 22, 2019 · 6 comments
Closed

Support hyperlinks to specific file line numbers in the terminal #66957

joshunger opened this issue Jan 22, 2019 · 6 comments
Assignees
Labels
*as-designed Described behavior is as designed terminal General terminal issues that don't fall under another label

Comments

@joshunger
Copy link
Contributor

Would it be possible to support hyperlinks that open to a specific file and line number in the terminal?

For example, if the output below displayed in the terminal -

/Users/.../Foo.js
  9:35  error  'children' is missing in props validation  react/prop-types

I could click on 9:35 and it would open the Foo.js file and move focus to line 9.

@vscodebot vscodebot bot added the terminal General terminal issues that don't fall under another label label Jan 22, 2019
@IllusionMH
Copy link
Contributor

VSCode already supports links to pisition in file, however filename should be immediately followed by line (and column). Since output is plain text it is impossible to tell that it is line:number in file, and not time stamp on general case.

You can try unix formatter that will output compatible path:line:column, and you'll be able to Ctrl+click on them to navigate to the exact position

@Tyriar
Copy link
Member

Tyriar commented Jan 23, 2019

Yeah since the text is separated it's very difficult to associate it with the link, there are several formats supported for line/col but they're all on the same line something like this file:line:col, file (line:col), etc.

@Tyriar Tyriar closed this as completed Jan 23, 2019
@Tyriar Tyriar added the *as-designed Described behavior is as designed label Jan 23, 2019
@joshunger
Copy link
Contributor Author

Thanks @Tyriar @IllusionMH

@keyvan-m-sadeghi
Copy link

Hi @Tyriar
AVA produces text in the file:line:col format that you mentioned. Though they are not rendered as links. Am I missing something?
screenshot

@IllusionMH
Copy link
Contributor

IllusionMH commented Feb 8, 2019

@keyvan-m-sadeghi if you are about file names in stack trace - that's not enough info to make it a link.
It should be either absolute path (as in ESLint unix formatter mentioned above) or at least path relative to workspace folder.

For example we have about 200 index.js files in our project and having just file name as string won't be enough info to open correct file.

@Tyriar
Copy link
Member

Tyriar commented Feb 11, 2019

@keyvan-m-sadeghi see #22772, if ava changed to it to print ./index.js:line:col instead then it would work. #22772 may not be able to get resolved, at least with the current design of validating the paths, as doing so would require pinging the disk basically for every single word in the terminal.

@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed terminal General terminal issues that don't fall under another label
Projects
None yet
Development

No branches or pull requests

4 participants