Signature help
This series of patches were applied in LSP to provide signature hinting when a user types a function application. It would be much more convenient for us if they were upstreamed.
cc @mnxn
The function needs to build the string in order to get the parameter offsets.
There's some complexity in the printing (like unwrapping option types), that I wasn't sure was appropriate to do from the editor side.
@mnxn before thinking about how we could improve and merge that PR I would like it would be good to have it's expected behaviour to be illustrated in a series of tests. Could you add some to the merlin test-suite ?
(you can take example from type-enclosing/type-alias.t for example)
The first cases that I can think about are:
- a simple function with test for the first arg, second and last
- a function with labelled argument that is then called with varying arguments order
- a function with an optional argument
- function calls before or after an error in the buffer
I noticed some weird behaviour while using vscode, I while try to take notes next time it happens to write more specific tests.
Thank you !
My understanding is that to write a test like that example I would first need to expose the signature help functionality to the command line interface through the all_commands list.
Is that correct?
Yes it is correct, and that's also required for a new Merlin feature: we eventually want it to be available for every Merlin's client and that means adding it to the protocol.
Closing for now since this has been re-implemented downstream using Merlin as a library.