You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In emacs / vim modes for Merlin the ability to grow / shrink enclosing has an interresting side effect: often the first two enclosing are identical but the second one shows the most general type while the second one show the specialized type.
For example, given the following code:
letf : 'a -> 'a =funx -> x
let _ = f 4
Querying Merlin on the usage of f line 2 first result in 'a -> 'a, and querying the next enclosing shows the specialized type int -> int. However, in ocaml-lsp, there is no way to get that second answer since the on_hover query always consider the first enclosing.
I feel like I am more often interested in the specialized type because it also gives me information on the type of the actual parameters. I guess this is a matter of context and preference, but I generally find the current behavior not satisfying.
We might soon be able to use a custom query that would allow editors to reproduce the classic merlin enclosing behavior, but I am wondering whether we should change the default behavior for the on_hover query...
We could also show both types at the same time ?
The text was updated successfully, but these errors were encountered:
In emacs / vim modes for Merlin the ability to grow / shrink enclosing has an interresting side effect: often the first two enclosing are identical but the second one shows the most general type while the second one show the specialized type.
For example, given the following code:
Querying Merlin on the usage of
f
line 2 first result in'a -> 'a
, and querying the next enclosing shows the specialized typeint -> int
. However, in ocaml-lsp, there is no way to get that second answer since the on_hover query always consider the first enclosing.I feel like I am more often interested in the specialized type because it also gives me information on the type of the actual parameters. I guess this is a matter of context and preference, but I generally find the current behavior not satisfying.
We might soon be able to use a custom query that would allow editors to reproduce the classic merlin enclosing behavior, but I am wondering whether we should change the default behavior for the on_hover query...
We could also show both types at the same time ?
The text was updated successfully, but these errors were encountered: