Skip to content

Only show linear arrows on data constructors with LinearTypes#4862

Open
crtschin wants to merge 2 commits intohaskell:masterfrom
crtschin:crtschin/datacon-linear-hover
Open

Only show linear arrows on data constructors with LinearTypes#4862
crtschin wants to merge 2 commits intohaskell:masterfrom
crtschin:crtschin/datacon-linear-hover

Conversation

@crtschin
Copy link
Contributor

@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
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
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