Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Local binding hints (WIP) #4610

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

Draft
cassandracomar wants to merge 35 commits into haskell:master
base: master
Choose a base branch
Loading
from cassandracomar:local-binding-hints

Conversation

Copy link

@cassandracomar cassandracomar commented Jun 2, 2025
edited
Loading

continuation of #4368.

so far, I've merged in changes in master and updated things so they compile with ghc-9.12.

TODO:

  1. get tests passing (the 9.12 flakes seem flaky)
  2. allow both code lenses and inlay hints for rendering local sig hints, via a configurable toggle.

update: this now allows either code lenses or inlay hints for local bindings. as we discussed, I've defaulted this to code lenses, with an optional toggle to flip on inlay hints instead. but the code lenses don't have their tests restored as yet. will reintroduce those tomorrow.

July541 and others added 30 commits June 17, 2022 18:38
Co-authored-by: fendor <fendor@users.noreply.github.com>
Now let and where clause will show binding type in inlay hints
properties = emptyProperties
& defineEnumProperty #mode "Control how type lenses are shown"
[ (Always, "Always displays type lenses of global bindings")
, (Exported, "Only display type lenses of exported global bindings")
, (Diagnostics, "Follows error messages produced by GHC about missing signatures")
] Always
& defineBooleanProperty #localBindingInlayHintOn
"Display inlay hints of local bindings"
Copy link
Author

@cassandracomar cassandracomar Jun 3, 2025

Choose a reason for hiding this comment

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

this needs a better explanation for documentation

Copy link
Author

@cassandracomar cassandracomar Jun 3, 2025

Choose a reason for hiding this comment

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

this may also be clearer as a three-way enum called localBindingHintsMode with the options NoLocalHints, UseInlayHints, UseCodeLenses.

happy to let others bikeshed this, though.

Copy link
Collaborator

@michaelpj michaelpj Jun 9, 2025

Choose a reason for hiding this comment

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

Yeah, sounds good, although I'm somewhat tempted towards a global option for the user preference here.

"mode": "always"
},
"globalOn": true
"inlayHintsOn": true
Copy link
Author

@cassandracomar cassandracomar Jun 3, 2025

Choose a reason for hiding this comment

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

regenerate these

fendor reacted with thumbs up emoji
Copy link
Collaborator

I wonder what to do about inlay hints vs code lenses. As I commented in the other issue, I do think we should prefer them if we can. But maybe we need a consistent approach. e.g. something like:

  • a global "preferred in-buffer display mode: inlay hints/code lenses", default inlay-hints
  • if it's set to inlay hints then use inlay hints if the client supports it otherwise fall back to code lenses

Out of scope for this PR though.

Copy link
Collaborator

Give a shout if you need help/want attention on any bit of it in particular!

Copy link
Author

Give a shout if you need help/want attention on any bit of it in particular!

will do! haven't had a chance to go through the test failures.

fendor reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@michaelpj michaelpj michaelpj left review comments

@fendor fendor Awaiting requested review from fendor fendor is a code owner

@wz1000 wz1000 Awaiting requested review from wz1000 wz1000 is a code owner

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /