Skip to content

Improving Handling of Structured Diagnostics #4735

@sgillespie

Description

@sgillespie

Most of HLS is now using GHC structured diagnostics instead of regexes (#4605). However, there are still some messages we still rely on regex matching for, because they aren't available in structured format. I've created a GHC issue, but I'm not sure if this is a complete list.

Known Instances

Here are the ones I know about:

Suggest Type Signature Change: We have to extract the declName from a type mismatch from the ErrInfo (an SDoc).

Fill typed holes: The hole fit and refinement suggestions are stored in ErrInfo supplementary.

Fill type wildcard: We need to determine whether the user wrote a top-level hole, for example whether the user wrote foo :: _ or foo :: Maybe _. We do this again, by looking at ErrInfo context.

Discussion

To move forward, we'll still need to

  • Make sure the list above is complete
  • Figure out specifically which fields we need to add

Related Links

#4605
https://gitlab.haskell.org/ghc/ghc/-/issues/26353

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions