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
Hovering over an identifier (key) shows the type, just like in OCaml. Additionally it also has a Go to <type> link that the user can click on and go to the type. It would be great to have something similar in OCaml.
We already have a go to type function, which should work for simple types like int.
Type applications like int list we could do something more fancy and display both int and list. This would require us to know the types present in a complicated type like this. Not sure if merlin can supply us with this information cc @voodoos. It is currently a shortfall of the already existing "go to type" functionality.
It seems that the hover text request is markdown so we can supply as many links as we would like. I'm thinking something like:
\```ocaml
(int, intlist) result
\```
Goto:
- [result](loc of result)
- [int](loc of int)
- [list](loc of list)
- [int](loc of int)
Obviously this introduces some degree of redundancy, but the structure of the links might help users dissect the type more easily. Especially in complicated cases like format.
rust-analyzer also has a similar feature though it doesn't look like its as extensive as proposed above:
The text was updated successfully, but these errors were encountered:
Alizter
changed the title
feature request: "have a goto type link on hover"
feature request: have a "goto type" link on hover
Oct 16, 2023
In rust-analyzer, you get the following UX:
Hovering over an identifier (
key
) shows the type, just like in OCaml. Additionally it also has aGo to <type>
link that the user can click on and go to the type. It would be great to have something similar in OCaml.int
.int list
we could do something more fancy and display bothint
andlist
. This would require us to know the types present in a complicated type like this. Not sure if merlin can supply us with this information cc @voodoos. It is currently a shortfall of the already existing "go to type" functionality.It seems that the hover text request is markdown so we can supply as many links as we would like. I'm thinking something like:
Obviously this introduces some degree of redundancy, but the structure of the links might help users dissect the type more easily. Especially in complicated cases like
format
.rust-analyzer also has a similar feature though it doesn't look like its as extensive as proposed above:
The text was updated successfully, but these errors were encountered: