Skip to content

Only show linear arrows on data constructors with LinearTypes#4862

Merged
fendor merged 4 commits intohaskell:masterfrom
crtschin:crtschin/datacon-linear-hover
Apr 1, 2026
Merged

Only show linear arrows on data constructors with LinearTypes#4862
fendor merged 4 commits intohaskell:masterfrom
crtschin:crtschin/datacon-linear-hover

Conversation

@crtschin
Copy link
Copy Markdown
Collaborator

@crtschin crtschin commented Mar 4, 2026

Closes #2904.

Does what it says on the tin. Mostly follows the investigation @July541 already did here. Some notes:

  • I added a usage of parsed module as I couldn't get the extensions active in the current module from the HscEnv, and I didn't know how to do so otherwise.
  • Turning the DataCon into a Type used to occur through dataConWrapId, which I changed to dataConDisplayType, which also displays wrapper types from what I can tell.
  • I also touched ghcide/src/Development/IDE/Plugin/Completions.hs, because I changed the signature of safeTyThingType. I didn't understand what was being completed so I stuck to always emitting linear annotations there.

@crtschin crtschin requested a review from wz1000 as a code owner March 4, 2026 09:46
@fendor fendor requested a review from July541 March 4, 2026 11:50
@July541
Copy link
Copy Markdown
Collaborator

July541 commented Mar 4, 2026

Thanks for this fantastic work! ❤️❤️❤️

Unfortunately I can't make the review because I have totally lost the details after 4 years. I didn't get in touch with Haskell for a long time and not familiar with recent ghc versions.

@fendor fendor added the status: needs review This PR is ready for review label Mar 5, 2026
@crtschin crtschin force-pushed the crtschin/datacon-linear-hover branch from 850ff2a to e64e4b1 Compare March 24, 2026 23:52
Comment thread ghcide/src/Development/IDE/Spans/AtPoint.hs Outdated
@fendor fendor requested a review from vidit-od March 28, 2026 16:36
Copy link
Copy Markdown
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 for your contribution! I have a couple of comments, but otherwise we can merge this!

Comment thread ghcide/src/Development/IDE/Spans/Common.hs Outdated
Comment thread ghcide/src/Development/IDE/Spans/AtPoint.hs Outdated
Comment thread ghcide/src/Development/IDE/Core/Actions.hs Outdated
@fendor fendor enabled auto-merge (squash) March 30, 2026 07:35
@fendor fendor merged commit 177ca8e into haskell:master Apr 1, 2026
69 of 76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: needs review This PR is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type-on-hover for type constructors shows linear arrows even if -XLinearTypes is not enabled

3 participants