Skip to content

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

Merged
mergify[bot] merged 4 commits into
haskell:masterfrom
samuel-williams-da:record-dot-completion-fix
Jun 8, 2025
Merged

Fix completion for record dot syntax when record isn't known#4619
mergify[bot] merged 4 commits into
haskell:masterfrom
samuel-williams-da:record-dot-completion-fix

Conversation

@samuel-williams-da

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

Copy link
Copy Markdown
Contributor

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

@michaelpj michaelpj left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice!

Comment thread ghcide/src/Development/IDE/Plugin/Completions/Logic.hs
@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