Skip to content

Link from error codes to the error message index #3246

Open
@david-christiansen

Description

@david-christiansen

Is your enhancement request related to a problem? Please describe.

Some GHC error messages and warnings can be confusing.

Describe the solution you'd like

The Haskell Foundation has started a project to assign unique numbers to each error or warning emitted by GHC, and a community-driven web site that associates documentation with each code. The codes will be part of GHC 9.6. I'd like to see HLS include links to this documentation from messages in some convenient way.

Describe alternatives you've considered

None.

Additional context

All codes emitted by GHC match GHC-(0-9){5}. The message index will have addresses of the form https://errors.haskell.org/messages/GHC-NNNNN. The index is maintained at https://github.com/haskellfoundation/error-message-index/.

Activity

added
GHCissues with particular GHC versions
status: blockedNot actionable, because blocked by upstream/GHC etc.
and removed on Oct 5, 2022
michaelpj

michaelpj commented on Oct 5, 2022

@michaelpj
Collaborator

Need to come back to this when we've got basic 9.6 support.

michaelpj

michaelpj commented on Oct 5, 2022

@michaelpj
Collaborator

We can actually put this in the Diagnostic: it has a code field and a codeDescription field that's a URI, so perfect.

added
level: easyThe issue is suited for beginners
and removed
status: blockedNot actionable, because blocked by upstream/GHC etc.
on Jan 16, 2024
added
HackathonThis issue is suitable for hackathon sessions
on May 1, 2024
michaelpj

michaelpj commented on May 1, 2024

@michaelpj
Collaborator

I think we can do this already without structured diagnostics: we can just regex it out of the diagnostic message easily enough.

michaelpj

michaelpj commented on Jun 6, 2024

@michaelpj
Collaborator

I have some code for this, but annoyingly we don't actually render the error codes already! So it's confusing what to do - do we render them (thus making users see them in the messages), or not (and not be able to pull them out)... 🤔

michaelpj

michaelpj commented on Jun 6, 2024

@michaelpj
Collaborator
michaelpj

michaelpj commented on Jun 6, 2024

@michaelpj
Collaborator

Hmmm. I feel like I am going in the wrong direction here by smuggling additional information into messages only to parse it out later. Perhaps the right thing to do is just to implement the structured diagnostics stuff 🤔

moved this from Todo to In Progress in HLS & Friends Zurihacon Jun 9, 2024
dylan-thinnes

dylan-thinnes commented on Jun 9, 2024

@dylan-thinnes
Contributor

Working on this for ZuriHac

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    GHCissues with particular GHC versionsHackathonThis issue is suitable for hackathon sessionslevel: easyThe issue is suited for beginnerstype: enhancementNew feature or request

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @david-christiansen@michaelpj@dylan-thinnes

        Issue actions

          Link from error codes to the error message index · Issue #3246 · haskell/haskell-language-server