merlin icon indicating copy to clipboard operation
merlin copied to clipboard

Signature help

Open rgrinberg opened this issue 4 years ago • 4 comments

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

rgrinberg avatar Mar 17 '21 22:03 rgrinberg

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.

mlantas avatar Apr 13 '21 17:04 mlantas

@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 !

voodoos avatar Feb 23 '22 12:02 voodoos

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?

mlantas avatar Feb 23 '22 19:02 mlantas

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.

voodoos avatar Feb 24 '22 09:02 voodoos

Closing for now since this has been re-implemented downstream using Merlin as a library.

voodoos avatar Nov 07 '22 15:11 voodoos