-
Notifications
You must be signed in to change notification settings - Fork 124
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
Implement signature help request #324
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I'll merge both this and the merlin PR they are both ready.
Worth adding a CHANGES entry as well. |
Awesome work. Merged manually. |
Thanks, I was having trouble figuring out why Github was detecting conflicts... |
Thanks for the great work on this @mnxn, the feature is amazing 🎉 I noticed two things when testing:
|
The highlighted argument won't always be the first, but it won't detect that you've moved onto the next parameter until you start a new expression. I'm not sure it's possible to detect you've moved on to the next function argument with the expression tree that Merlin provides. It's harder to do in a function-application-by-juxtaposition language like OCaml since it lacks the comma argument delimiters that C-like languages have.
The language server actually isn't providing an |
CHANGES: ## Features - Support cancellation notifications when possible. (ocaml/ocaml-lsp#323) - Implement signature help request for functions (ocaml/ocaml-lsp#324) - Server LSP requests & notifications concurrently. Requests that require merlin are still serialized. (ocaml/ocaml-lsp#330)
Partially completes #312
Depends on rgrinberg/merlin#8
Currently supports showing signature help when an expression is detected as having a function type or is being applied. So it will show signature help for these two scenarios:
The second one will underline the specific parameter that is currently being applied. Operators also show signature help.
Notes:
I haven't figured what the best way to provide function/parameter documentation is. The function could just return positions for function documentation, but I feel like there should be a better way to do it.
Showing signature help for operators or after entering a space after a function-type value might be annoying to users. Perhaps the functionality should be configurable? I couldn't find a built-in VSCode setting to disable signature help.
The current implementation seems to depend on having correctly typed arguments. This doesn't show any signature help:
Images:
Space after function-typed value:
Providing a function argument:
Anonymous function:
Operator: