Skip to content
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

Fix completion snippets on DuplicateRecordFields #1360

Merged
merged 3 commits into from
Feb 13, 2021

Conversation

berberman
Copy link
Collaborator

@berberman berberman commented Feb 12, 2021

Closes #682

According to GHC Wiki:

`data T = MkT { x :: Int }`

When DuplicateRecordFields is enabled, field accessors become "selectors". For example, the corresponding GlobalRdrElt of above x is x |-> GRE $sel:x:MkT (FldParent T (Just x)) LocalDef. So we can't use gre_name($sel:x:MkT) for completion, but par_lbl(x) of its parent.

In this PR, item names are converted into OccNames before passed to mkNameCompItem, resulting in no renamed filed selector occuring in the result.

  • regression test

@berberman berberman marked this pull request as ready for review February 13, 2021 10:29
Copy link
Collaborator

@pepeiborra pepeiborra left a comment

Choose a reason for hiding this comment

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

@pepeiborra pepeiborra merged commit e2bf01b into haskell:master Feb 13, 2021
@berberman berberman deleted the fix-completion branch February 14, 2021 03:55
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.

Incorrect completion text when using DuplicateRecordFields
2 participants