-
-
Notifications
You must be signed in to change notification settings - Fork 387
Inlay hints usage #2938
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
Comments
+1 for let bindings. I'd have to see what the fixity one actually looks like, but in my head it seems like overload. |
+1 for let bindings too Can we use this to show the implicit imports list, instead of a code lens? |
Not sure, I haven't seen any inlay hint in a new line. But is there any shortcoming for code lens? |
The idea is to show the implicit imports list inline, not in a new line. We have wanted this for a while: |
Note that inlay hints aren't supported by the More ideas Type signaturesLambda arguments? i.e.
Function arguments? i.e.
(probably not, a bit redundant with the main type signature?) Bindings in do blocks? i.e.
These are all really special cases of "put an inlay hint every time a variable is bound without a type signature", but I think that would probably be too much in many cases. But might be worth trying to see if it's unbearable! Maybe the general case is what we want. Implicit namesRecord wildcards?
An explicit imports inlay hint is arguably an example of this! MiscRecord names in positional record construction?
|
I can see someone wanting to keep some of the inlay hints but not all (myself included). Is this something we want to allow to be configurable? Or should we aim for a minimum case first (i.e. just let bindings and lambdas for example) and go from there? |
Ideally we don't configure things too much, but we might want a "noisy" version and a "quiet" version, perhaps. I think the observation about the general case is more for design thinking: I'm not sure I have a good rationale for why some places that introduce a name without a type signature should get inlay hints and some shouldn't. So what's our heuristic? |
Agree @michaelpj 's ideas, just one thought, I prefer to show function parameters' name instead of their type. (Although not beautiful to look at) |
Also maybe holes: #3228 |
I think all our code lenses that display signatures should be inlay hints also: #3254 |
Out of curiosity, what is the current status of the inlay hints support of |
It'll be there once I finish haskell/lsp#458 😅 |
@michaelpj I noticed the linked issue was closed in favor of another one that is now merged. Do you know how long until that will land in a release? |
Support in the library has been there for a while now, now someone just actually needs to implement using them in HLS. |
Another idea: show inferred deriving strategies and allow clicking on them to make them explicit. |
HI, guys. I think I've made some progress #4131. I successfully display fixity info via inlay hints, there's still a lot of work to do :) |
If you're looking for ideas: |
A kind of obvious one that I've mentioned to some people before but not written down: our import lenses. At the moment they are code lenses and they take up a whole extra line per-import. But since they are precisely suggesting extra changes to the import line, we could instead have them be inlay hints, which would mean they only take up one line. i.e.
rather than
(#4208) |
(We're going to try and split out individual issues for the individual ideas) |
Hello @michaelpj! Just found this on GSoC and would be willing to contribute. I have an intermediate experience with Haskell, as an independent learner. I use HLS on Emacs, so I'd like to give back in whatever way possible. I'm not a traditional university student though, hopefully that is not an issue. As the project mentions you as the mentor, would you be willing to guide me in how to get started with this? Regards, Divya. |
@jetjinser is the GSoC student for this, so I think the plan is for them to focus on it for now. |
Oh, didn't know this was already being worked upon. Apologies. |
In order to prevent spam, I open a thread to discuss about the inlay hint usage in Haskell.
Previous info is here: #2019 (comment)
lsp-3.17 had supported inlay hint, in which can embed some useful info, it wildly used by displaying function parameter names in other languages. But it is not suitable in Haskell since Haskell have a lot of currying, which looks not valid to display parameter name in Haskell.
Sample of inlay hint:

I don't want Haskell missing this straightforward function, so I wrote these to discuss what we can do to use inlay hint best, here are some I'd like:
All these are initial ideas for discussion, feel free to put forward any suggestions:)
The text was updated successfully, but these errors were encountered: