Skip to content

Fix completion for record dot syntax when record isn't known #4619

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

Merged

Conversation

samuel-williams-da
Copy link
Contributor

@samuel-williams-da samuel-williams-da commented Jun 7, 2025

The issue was that the prefix info extractor didn't check that the "modName" it pulls out is a valid module name, so would include cases when using record dot syntax.
This is only an issue when the record type beforehand's type isn't known , i.e. undefined.myField, as otherwise the incorrect completions were replaced with the field names directly.

Fixes #4405

Copy link
Collaborator

@michaelpj michaelpj left a comment

Choose a reason for hiding this comment

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

nice!

@samuel-williams-da samuel-williams-da marked this pull request as ready for review June 8, 2025 09:44
@fendor fendor added merge me Label to trigger pull request merge and removed merge me Label to trigger pull request merge labels Jun 8, 2025
@fendor fendor added the merge me Label to trigger pull request merge label Jun 8, 2025
@mergify mergify bot merged commit 0a26bd5 into haskell:master Jun 8, 2025
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Completing record selectors with RecordDotSyntax inserts invalid imports instead
3 participants