Skip to content

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

Merged
gebner merged 6 commits into
leanprover:masterfrom
Kha:pp-sig
Dec 21, 2022
Merged

gebner merged 6 commits into
leanprover:masterfrom
Kha:pp-sig

Conversation

@Kha

@Kha Kha commented Dec 12, 2022

Copy link
Copy Markdown
Member

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 label Dec 12, 2022
@Kha

Kha commented Dec 14, 2022

Copy link
Copy Markdown
Member Author

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

gebner commented Dec 21, 2022

Copy link
Copy Markdown
Member

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

Kha commented Dec 21, 2022

Copy link
Copy Markdown
Member Author

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Signature pretty printer

2 participants