Skip to content

Conversation

liam923
Copy link
Contributor

@liam923 liam923 commented Jun 12, 2025

This PR adds a new command, locate-type-multi, that enables new VSCode functionality.

A useful current command in VSCode is "Go to Type Definition", which uses the locate-type query to go to the definition of the type of the identifier under the cursor. However, this command is rather limited - it only works on Tconstrs, and when the Tconstr carries arguments, it just ignores the args. In other words, the command doesn't provide the ability to go to a's defintion if the type is any of the following: a t, (a * _), a -> _, _ -> a.

locate-type-multi, instead of always just returning the location of a single identifier, returns a tree structure that represents all the identifiers within a type. So for example, if the type is a -> (b * c), it returns the locations of all of a, b, and c, and this is in a tree-like data structure that makes it easy for VSCode to present this to the user.

@liam923 liam923 requested a review from goldfirere June 12, 2025 06:26
@liam923 liam923 force-pushed the locate-type-multi branch from 0375df3 to e46b24b Compare June 12, 2025 06:34
@liam923 liam923 force-pushed the locate-type-multi branch from e46b24b to 17cd8de Compare July 22, 2025 20:08
@liam923
Copy link
Contributor Author

liam923 commented Jul 22, 2025

I've made a corresponding PR upstream: ocaml/merlin#1951

@goldfirere
Copy link
Contributor

Is it reasonable to wait on this until the upstream conversation settles down?

@liam923
Copy link
Contributor Author

liam923 commented Aug 26, 2025

Is it reasonable to wait on this until the upstream conversation settles down?

Yes. I've talked to them offline and expect review to be finished soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants