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

Improve hover output for let patterns #1696

Merged
merged 3 commits into from
Oct 24, 2023
Merged

Improve hover output for let patterns #1696

merged 3 commits into from
Oct 24, 2023

Conversation

jneem
Copy link
Member

@jneem jneem commented Oct 23, 2023

This makes the LSP aware of the types of let pattern bindings (when the typechecker knows them, at least).

I'll say that this fixes #1536 even though there's a bigger question about more aggressive type inference, because (1) the original confusion about whether the bound variable refers to the pattern or the thing inside it is fixed (not by this PR), and (2) we're now getting the right type in the fully-typechecked case.

@jneem jneem requested review from vkleen and yannham October 23, 2023 22:53
@github-actions github-actions bot temporarily deployed to pull request October 23, 2023 22:58 Inactive
Copy link
Member

@yannham yannham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT. I think we can close the original issue, whose example was really about statically typed pattern matching, and leave any potential extension to another issue/feature request.

lsp/nls/src/requests/hover.rs Outdated Show resolved Hide resolved
@jneem jneem enabled auto-merge October 24, 2023 23:15
@github-actions github-actions bot temporarily deployed to pull request October 24, 2023 23:20 Inactive
@jneem jneem added this pull request to the merge queue Oct 24, 2023
Merged via the queue into master with commit f0de135 Oct 24, 2023
5 checks passed
@jneem jneem deleted the hover-pattern branch October 24, 2023 23:45
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.

LSP hover help is wrong when pattern bindings are involved.
2 participants