-
-
Notifications
You must be signed in to change notification settings - Fork 369
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
Draft: Migrate hls-class-plugin
to use structured diagnostics
#4472
base: master
Are you sure you want to change the base?
Draft: Migrate hls-class-plugin
to use structured diagnostics
#4472
Conversation
We're leaving the TODOs for either later in this PR or in another PR
This reverts commit 4fed987.
Had to move `attachReason` between modules to achieve this, which is fine because it was never exported from its own module.
This reverts commit 0776c65.
Implement 'rangesOverlap' function which checks whether two 'Range's overlap in any way. Implement two new plugin utility functions which allow to conveniently get all currently displayed diagnostics for a given 'Range'.
Add compatibility module for GHC's structured error messages. Introduce 'Prism's and 'Lens's to easily access nested structures. Expand documentation for 'StructuredMessage'
Fixes haskell#4440 Fixes test for disabling deferred-type-errors.
Co-authored-by: Mergify <37929162+mergify[bot]@users.noreply.github.com>
* new tests * change codeAction title * more tests and docs --------- Co-authored-by: fendor <[email protected]>
Allows HLS to 'Goto Definition' for Note references.
hls-class-plugin
to use structured diagnosticshls-class-plugin
to use structured diagnostics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice! It's a shame about not everything being structured. I wonder if we should just do an inventory of the places where we use GHC's diagnostics and check manually that they've been made structured? Maybe that's cheaper than doing all the PRs and either letting them get stale or adding a bunch of CPP?
Split off from #4433, this PR moves the
hls-class-plugin
to use the structured diagnostics.It worked well in my tests, but unfortunately it is incompatible with GHC 9.4, because the error message the plugin cares about is not structured in 9.4.
We can either wait until we drop support for 9.4 or maintain both paths until we drop support for 9.4.
Unfortunately, the only way to push GHC into the direction we want, is to do the latter and report any lacking error messages to GHC ASAP.
FYI, only the last commit matters.