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

feat: hovering over binders shows their types #3797

Merged
merged 2 commits into from
Mar 29, 2024

Conversation

kmill
Copy link
Collaborator

@kmill kmill commented Mar 28, 2024

Modifies withBindingBodyUnusedName to annotate the syntax for the variable with its corresponding fvar. Now, for example, you can hover over the variables in fun x y => ... in the infoview to see their types. This change affects notations such as ∃ n, n = 1, where hovering over n shows that n : Nat.

Also adds such annotations for the variables in let and let_fun.

Implementation note: the variables are annotated with fresh positions using nextExtraPos.

Removes the unused and unnecessary Lean.PrettyPrinter.Delaborator.liftMetaM.

Closes #1618, closes #2737

Modifies `withBindingBodyUnusedName` to annotate the syntax for the variable with its corresponding fvar. Now, for example, you can hover over the variables in `fun x y => ...` in the infoview to see their types.

Also adds such annotations for the variables in `let` and `let_fun`.

Implementation note: since the fvar is local to `withBindingBody'`, this uses a fresh position for the fvar using `nextExtraPos`. This makes it safe to use `withBindingBody'` for the same expression repeatedly, since each generated fvar gets its own position.
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Mar 28, 2024
@kmill kmill added this pull request to the merge queue Mar 29, 2024
Merged via the queue into leanprover:master with commit 44ad3e2 Mar 29, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect hover in infoview for lambda binders Bug in widgets: type of i in ∃ i, ... is wrong
1 participant