Skip to content
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

Fix LSP not showing type signature in untyped code #1889

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

yannham
Copy link
Member

@yannham yannham commented Apr 12, 2024

Most of the time, hovering over a symbol in untyped code would show Dyn even though the symbol has a type annotation - typically for records accessed via a non-trivial path, e.g. foo.bar.baz. This is an issue especially because we don't get to see the right types for stdlib symbols when hovering over them.

Capture d’écran du 2024-04-12 15-58-40

This PR fixes the issue by taking the type annotation (technically one of the aggregated type annotations) instead of the type provided by the typechecker when the latter is Dyn.

@yannham yannham requested a review from jneem April 12, 2024 16:03
@github-actions github-actions bot temporarily deployed to pull request April 12, 2024 16:06 Inactive
Most of the time, hovering over a symbol in untyped code would show
`Dyn` even though the symbol has a type annotation - in particular for
records accessed via a non-trivial path, e.g. `foo.bar.baz`. This is an
issue because in particular, we don't get to see the right types for
stdlib symbols when hovering over them.

This commit fixes the issue by taking the type annotation instead of the
type provided by the typechecker when the latter is `Dyn`.
@yannham yannham enabled auto-merge April 12, 2024 16:27
@github-actions github-actions bot temporarily deployed to pull request April 12, 2024 16:30 Inactive
@yannham yannham added this pull request to the merge queue Apr 12, 2024
Merged via the queue into master with commit b731a43 Apr 12, 2024
5 checks passed
@yannham yannham deleted the fix/lsp-show-type-annot branch April 12, 2024 17:07
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