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

ellipsis for inlay-hint #12872

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ofzo
Copy link
Contributor

@ofzo ofzo commented Feb 14, 2025

Auto inferred types can be long in some cases, especially type parameters with paradigms, which will make the inlay hint very distracting to code readers, this PR will collapse the display for inlay hints longer than 20 characters

before:
41C2B188-3E71-4B5D-A7A1-772D6966090E-8615-000002743F44169B

after:
IMG_3224

@poliorcetics
Copy link
Contributor

  1. Using <...> as the wrapper for generics may be good for most languages, but it won't work for Go for example, so this has to be configurable by language
  2. This should be an option, I have never wanted shorter inlay hints in my usage of helix
  3. This is reconstructing the regex for each hint, on each LSP call. It should instead put the regex in a static OnceCell (mapping per language, see 1.) and reused

ellipsis for inlay-hint
@ofzo ofzo force-pushed the ellipsis-inlay-hint branch from 8c9cd15 to 4493ac2 Compare February 19, 2025 12:35
@ofzo
Copy link
Contributor Author

ofzo commented Feb 19, 2025

  1. Using <...> as the wrapper for generics may be good for most languages, but it won't work for Go for example, so this has to be configurable by language
  2. This should be an option, I have never wanted shorter inlay hints in my usage of helix
  3. This is reconstructing the regex for each hint, on each LSP call. It should instead put the regex in a static OnceCell (mapping per language, see 1.) and reused

You're right, I've taken a page from vscode and simplified this capability by removing the language differences and just intercepting to the maximum extent possible, and supporting configuration.
image

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.

2 participants