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

Toggling inlay hints #134

Closed
alecmev opened this issue Feb 22, 2022 · 3 comments
Closed

Toggling inlay hints #134

alecmev opened this issue Feb 22, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@alecmev
Copy link
Contributor

alecmev commented Feb 22, 2022

They're super useful on functions with lots of arguments, but get in the way in simple calls like this:

const y = data.filter(x => x > 0);

The predicate: in front of x makes it less readable, not more. Another reason is that sometimes I use a pretty narrow window, just wide enough to fit in 80 characters, and with hints enabled I need to scroll horizontally now.

So it would be nice to just have this "X-ray" that I can turn on only when I encounter a big function call, and can't quickly decipher what means what, and keep it off by default.

Is it possible? Something that doesn't require a server restart?

P.S. Thank you for implementing this!

@rchl
Copy link
Member

rchl commented Aug 10, 2022

I would imagine this to be controlled by the LSP package itself.

But first both the https://github.com/typescript-language-server/typescript-language-server and https://github.com/sublimelsp/LSP would have to implement the official Inline Hints spec.

Then the server would always have inline hints enabled and LSP would control whether those should be shown or not.

@predragnikolic
Copy link
Member

predragnikolic commented Mar 22, 2023

Done with sublimelsp/LSP#2023

@alecmev
Copy link
Contributor Author

alecmev commented Mar 29, 2023

Thank you! 🎉 Works like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants