Skip to content

Migrate change-type-signature-plugin to use structured diagnostics #4632

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

sgillespie
Copy link
Contributor

@sgillespie sgillespie commented Jun 11, 2025

This addresses using structured diagnostics from GHC (rather than regular expressions) for hls-change-type-signature-plugin.

A couple of notes:

  • I reworked the regexp tests a little bit. Since I don't know how the original were created, I found it easier to generate them from the diagnostics of the existing golden test inputs. Happy to restore the old ones if that's better.
  • I added some Traversals/Lenses in the plugin. Would it be more useful to put thim in Development.IDE.GHC.Compat.Error?

@sgillespie sgillespie force-pushed the master branch 2 times, most recently from ce74f12 to 120d8ac Compare June 18, 2025 13:23
@sgillespie sgillespie force-pushed the master branch 2 times, most recently from 5556c3e to be06dc8 Compare June 18, 2025 13:41
@sgillespie sgillespie changed the title WIP: Migrate change-type-signature-plugin to use structured diagnostics Migrate change-type-signature-plugin to use structured diagnostics Jun 19, 2025
@sgillespie sgillespie marked this pull request as ready for review June 19, 2025 13:22
@sgillespie sgillespie requested a review from fendor as a code owner June 19, 2025 13:22
Copy link
Collaborator

@fendor fendor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for taking the time and modernising the whole plugin!

Small comments, otherwise good to go, imo

Comment on lines +211 to +212
matchingDiagnostic :: ErrInfo -> Maybe DeclName
matchingDiagnostic ErrInfo{errInfoContext} =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need that? Should we open a GHC issue for adding the DeclName context to the error message?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need that?

Sadly, I think we do

Should we open a GHC issue for adding the DeclName context to the error message?

That would be awesome

@sgillespie sgillespie requested a review from wz1000 as a code owner June 21, 2025 02:42
Copy link
Collaborator

@fendor fendor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@fendor
Copy link
Collaborator

fendor commented Jun 21, 2025

Stack CI test failure is genuine, otherwise, let's merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants