fix: when pretty printing constant names, do not use aliases from "non-API exports"#5689
Merged
kmill merged 3 commits intoleanprover:masterfrom Dec 10, 2024
Merged
fix: when pretty printing constant names, do not use aliases from "non-API exports"#5689kmill merged 3 commits intoleanprover:masterfrom
exports"#5689kmill merged 3 commits intoleanprover:masterfrom
Conversation
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Oct 13, 2024
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Oct 13, 2024
|
Mathlib CI status (docs):
|
Collaborator
Author
41ab574 to
f8e7820
Compare
…n-API" `export`s Heuristic: an "API" `export` is one that exports a declaration to a parent namespace. This PR makes it so that aliases created by `export` from exporting a name into some parallel namespace are not considered. This is motivated by Lake's use of `export` to make some declarations like `Lean.Name` permanently available in the `Lake` namespace. A consequence to this is that in docgen, we see `Lean.Name` pretty printed as `Lake.Name`. Another solution would be to create a `scoped open` command that auto-opens some names whenever a namespace is activated. If that is ever implemented, it would be easy to revert the changes in this PR. Closes leanprover#2524
3bddf21 to
a7b0da3
Compare
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Dec 10, 2024
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Dec 10, 2024
luisacicolini
pushed a commit
to opencompl/lean4
that referenced
this pull request
Jan 21, 2025
…n-API `export`s" (leanprover#5689) This PR adjusts the way the pretty printer unresolves names. It used to make use of all `export`s when pretty printing, but now it only uses `export`s that put names into parent namespaces (heuristic: these are "API exports" that are intended by the library author), rather than "horizontal exports" that put the names into an unrelated namespace, which the dot notation feature in leanprover#6189 now incentivizes. Closes the already closed leanprover#2524
JovanGerb
pushed a commit
to JovanGerb/lean4
that referenced
this pull request
Jan 21, 2025
…n-API `export`s" (leanprover#5689) This PR adjusts the way the pretty printer unresolves names. It used to make use of all `export`s when pretty printing, but now it only uses `export`s that put names into parent namespaces (heuristic: these are "API exports" that are intended by the library author), rather than "horizontal exports" that put the names into an unrelated namespace, which the dot notation feature in leanprover#6189 now incentivizes. Closes the already closed leanprover#2524
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adjusts the way the pretty printer unresolves names. It used to make use of all
exports when pretty printing, but now it only usesexports that put names into parent namespaces (heuristic: these are "API exports" that are intended by the library author), rather than "horizontal exports" that put the names into an unrelated namespace, which the dot notation feature in #6189 now incentivizes.Closes the already closed #2524