Skip to content

Add an assist for importing record fields when using OverloadedRecordDot #3642

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
Jun 13, 2023

Conversation

simmsb
Copy link
Contributor

@simmsb simmsb commented Jun 10, 2023

When using OverloadedRecordDot to access fields of a record, if the field being accessed is not imported then a constraint error will be emitted.

In ghc 9.6 the error message carries a suggestion to import the field (and so the assist will be generated), however in ghc 9.2 this suggestion is not present and so we don't get any assist.

image

@simmsb simmsb requested a review from santiweight as a code owner June 10, 2023 18:08
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, could we have a test for GHC 9.6 and above?

@simmsb
Copy link
Contributor Author

simmsb commented Jun 10, 2023

LGTM, could we have a test for GHC 9.6 and above?

Yup, I'll give it a check tomorrow

@simmsb simmsb force-pushed the master branch 2 times, most recently from 2867a34 to 457e2ac Compare June 11, 2023 16:39
@michaelpj
Copy link
Collaborator

stylish-haskell failed in pre-commit, weirdly?

@joyfulmantis
Copy link
Collaborator

stylish-haskell failed in pre-commit, weirdly?

Probably due to cpp stuff. Some of the cpp tags especially for ghc >=9.5 poison stylish-haskell. I think it's usually possible to format cpp that stylish-haskell can accept usually at the cost of brevity, but once there is a poisonous cpp in a file you edit you can either change it yourself and add a bunch of lines to your diff, or commit with --no-verify

@simmsb simmsb force-pushed the master branch 2 times, most recently from a45a73d to a1cc6a2 Compare June 12, 2023 11:29
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.

thank you! LGTM

@fendor fendor added the merge me Label to trigger pull request merge label Jun 12, 2023
@mergify mergify bot merged commit 139dcf5 into haskell:master Jun 13, 2023
@fendor fendor mentioned this pull request Aug 8, 2023
19 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants