Skip to content

Expand type aliases one level when hovering #557

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

Closed
zth opened this issue Aug 30, 2022 · 2 comments · Fixed by #584
Closed

Expand type aliases one level when hovering #557

zth opened this issue Aug 30, 2022 · 2 comments · Fixed by #584
Milestone

Comments

@zth
Copy link
Collaborator

zth commented Aug 30, 2022

Currently, when hovering something where the type is a reference to some other type, that other type is not expanded. Example:

SomeModule.Types.searchInput
type searchInput = AnotherModule.searchInput

We should expand that type reference one level (?), so that the resulting hover instead would be something along the lines of:

AnotherModule.searchInput
type searchInput = {
  someField: int
}

type searchInput = AnotherModule.searchInput

Not 100% of how the representation should be, but we should include the full aliased type at least.

@cristianoc
Copy link
Collaborator

Can we have a complete example (there are some details I have doubts about)? Also, is this only about references across different files?

@cristianoc
Copy link
Collaborator

cristianoc commented Sep 11, 2022

  type peps  = {x:int, y:string}

  let foo = () => {x:3, y:""}
// Hover: unit => peps

When hovering on foo instead of showing just unit => peps it could additionally print the type definition of peps as in the module hover:

  type peps = {x: int, y: string}

In general, when showing a type t, it could collect all the type names mentioned in t, and for each, if it is a type definition, expand it below.

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