helix
helix copied to clipboard
LSP signature helper should not appear when inside a lambda
The new LSP signature helper pops up when you're inside the body of a lambda that's being passed to a function, which is a little annoying.
We could probably fix it by only making the pop-up visible when the node under the cursor is a direct descendent of the function arguments.
I was thinking the same about it being noisy when writing funs in Erlang https://github.com/erlang-ls/erlang_ls/issues/1344. It might be good to propose this upstream in rust-analyzer as well.
The direct descendant idea I think is interesting though. I would definitely be interested in trying that out if it existed. I suspect it may have some bugs though:
- it could be too selective
- for example, typing tuples of variables in a function call in rust I would like to continue seeing the signature help
- in these cases it might be better to have a manual keybind to summon signature-help like auto-complete's
C-x
- I'm not sure how well it would work for temporarily errored syntax trees
- if you're typing a comma to separate params and the grammar is very unforgiving, would it complicate the direct descendant check?
Hmm, yeah, you're right. It seems like where it is desirable and where it is not is very language specific, so a solution might not be simple. A manual trigger would be helpful, because right now it's either all or nothing.