Skip to content

Conversation

@vidit-od
Copy link
Contributor

Another PR to fix issue #4782. Previously PR #4807 was raised but later discarded due to the following main reason.

  • Getting Multiple suggestions increases cognitive load to identify what actually to click
  • The name at the beginning do not help in improving user experience.

explicitRecord

This is a Small PR aiming to introduce Cursor aware record expansion.

  • users just need to trigger code action
  • gets just one suggestion closest to cursor position.
  • does not require to expand any other records to expand current record as experienced in original issue.

@vidit-od vidit-od requested a review from ozkutuk as a code owner January 26, 2026 17:41
Copy link
Collaborator

@ozkutuk ozkutuk left a comment

Choose a reason for hiding this comment

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

In theory, I like the idea, but unless I am missing something...this doesn't seem to be fixing the original issue at all? I have tried on this example file:

module RecTest where

data RecOuter = RecOuter
  { inner :: RecInner
  }

data RecInner
    = RecInner
    { foo :: Char
    , bar :: Int
    }

ex :: RecOuter
ex = RecOuter (RecInner 'c' 42)

I have invoked the code action while the cursor was over RecInner, and the result was:

ex :: RecOuter
ex = RecOuter { inner = (RecInner 'c' 42) }

...which is already the current behavior and from what I understand exactly what the original issue complains about. I might as well be missing the point of the change though, so please let me know if that is the case. Either way, I think it also makes sense to add a test for the case we are trying to address, both to ensure that the problem is indeed fixed, and also to prevent regressions in the future.

@fendor fendor requested review from fendor and ozkutuk January 30, 2026 08: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.

Looks pretty good to me, one more test please and a couple of nitpicks!

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!

Copy link
Collaborator

@ozkutuk ozkutuk left a comment

Choose a reason for hiding this comment

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

LGTM, just one minor suggestion on code style. Feel free to take it or leave it as you see fit.

@vidit-od
Copy link
Contributor Author

vidit-od commented Feb 1, 2026

Done, Hopefully everything is covered now.

Thanks a lot for reviewing and helping me on this PR @ozkutuk @fendor .

Also a thing to consider for PR #4819 . This PR introduces a few extra testcases that still follows "Record wildcard expansion" format. They will require change.

@ozkutuk
Copy link
Collaborator

ozkutuk commented Feb 1, 2026

@vidit-od Looking good! I'll leave it to @fendor to push the merge button.

Also a thing to consider for PR #4819 . This PR introduces a few extra testcases that still follows "Record wildcard expansion" format. They will require change.

Yes, I will rebase that PR on top of your work once it gets merged, but thanks for the heads-up.

@fendor fendor merged commit 43b7b3b into haskell:master Feb 1, 2026
54 of 57 checks passed
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.

4 participants