Skip to content

Feature: Add line/links to error messages #7045

Open

Description

@orta

Is this a bug report?

No

How it is now

I have an error message like this:

Compiled with warnings.

./src/components/installation/Websocket.tsx
  Line 77:  Expected to return a value at the end of arrow function  array-callback-return

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

I can cmd+click on ./src/components/installation/Websocket.tsx and it'll take me to the right file ⭐️

What would be nice is that in the case where there is one error per file, it could instead be ./src/components/installation/Websocket.tsx:77 and clicking on that in the terminal would take directly there. The :77 could be colored using ANSI to be the background color, so it's not visible.

Alternatively, and perhaps a nicer UI, is to use hyperlinks one the Line 77 using something like hyperlinker which would have the href as ./src/components/installation/Websocket.tsx:77. This works in quite a lot of terminals now.

Screen Shot 2019-05-13 at 1 06 22 PM

Activity

  1. heyimalex commented on May 13, 2019

    @heyimalex
    Contributor

    Related to #6980 I think, though the hyperlinker suggestion is new.

  2. justingrant commented on May 21, 2019

    @justingrant
    Contributor

    If we do this, please make sure to include the column number too, not just the line number, so that editors can navigate to the exact row/col position. I believe the usual format is something like
    /foo/bar.js:287:13 which will navigate to line 287, column 13 of bar.js.

    See https://www.gnu.org/prep/standards/html_node/Errors.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions