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

chore: move MessageData.ofConstName earlier #5877

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

kmill
Copy link
Collaborator

@kmill kmill commented Oct 29, 2024

Makes MessageData.ofConstName available without needing to import the pretty printer. Any code making use of MessageData can write m!" ... {.ofConstName n} ... " to have the name print with hover information. More error messages now have hover information.

  • Now .ofConstName also has a boolean flag to make names print fully qualified. Default: false.
  • Now .ofConstName will sanitize names that aren't constants. It is OK to use it in "unknown constant '{.ofConstName constName}'" errors.

Usability note: it is more user-friendly to have "has already been declared" errors report the fully qualified name. For this, write m!"{.ofConstName n true} has already been declared".

Makes `MessageData.ofConstName` available without needing to import the pretty printer. Any code making use of `MessageData` can write `m!" ... {.ofConstName n} ... "` to have the name print with hover information. More error messages now have hover information.

* Now `.ofConstName` also has a boolean flag to make names print fully qualified. Default: false.
* Now `.ofConstName` will sanitize names that aren't constants. It is OK to use it in `"unknown constant '{.ofConstName constName}'"` errors.

Usability note: it is more user-friendly to have "has already been declared" errors report the fully qualified name. For this, write `m!"{.ofConstName n true} has already been declared"`.
@kmill
Copy link
Collaborator Author

kmill commented Oct 29, 2024

This salvages part of #5779

@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 Oct 29, 2024
@leanprover-community-bot
Copy link
Collaborator

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase cdbe29b46d35ca1d16affa329813e8d7d41dfe7e --onto 9847923f9be5de968f10ed7c7493e3ca0072abce. (2024-10-29 19:44:13)

@kmill kmill added this pull request to the merge queue Oct 29, 2024
Merged via the queue into leanprover:master with commit 95d3b4b Oct 29, 2024
13 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.

2 participants