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

Pretty-print signatures in hover and #check <ident> #1943

Merged
merged 6 commits into from
Dec 21, 2022

Conversation

Kha
Copy link
Member

@Kha Kha commented Dec 12, 2022

Resolves #375

I changed #check to use the signature pretty printer as well mostly for testing, though I don't think there's any real downside. In fact I would probably go further and just make #check $n:ident a semantically separate command that shows the signature of n without elaboration - I can't be the only one that usually starts with #check toString and then only remembers to add the @ on the second try.

@Kha Kha added the changelog Automatically adds PR title linking to PR to changelog on merge label Dec 12, 2022
@Kha
Copy link
Member Author

Kha commented Dec 14, 2022

In fact I would probably go further and just make #check $n:ident a semantically separate command that shows the signature of n without elaboration - I can't be the only one that usually starts with #check toString and then only remembers to add the @ on the second try.

Done, https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/.60.23check.20.3Cident.3E.60 was generally in support

@Kha Kha changed the title Add signature pretty printer Pretty-print signatures in hover and #check <ident> Dec 14, 2022
@gebner
Copy link
Member

gebner commented Dec 21, 2022

The only thing I'm concerned about in this PR is the abuse of the delaborator to produce something which is not a term.

@gebner gebner merged commit de9a637 into leanprover:master Dec 21, 2022
@Kha
Copy link
Member Author

Kha commented Dec 21, 2022

The only thing I'm concerned about in this PR is the abuse of the delaborator to produce something which is not a term.

In contrast to other proposals like a special pp option we're not really going through the term elaborator but mostly using it from the outside, with the exception of using delabCore once for convenience. Looking at it again though, it might have been nicer to reuse only the part around creating the Delaborator.State as most of the other parts are not applicable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog Automatically adds PR title linking to PR to changelog on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Signature pretty printer
2 participants