-
Notifications
You must be signed in to change notification settings - Fork 448
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: do not report metaprogramming declarations via exact?
and rw?
#6672
base: master
Are you sure you want to change the base?
Conversation
Mathlib CI status (docs):
|
exact?
and rw?
exact?
and rw?
This conflicts a bit of using As a pragmatic compromise, could Or I change my naming convention in #6355 to something else. |
Another way to shave the cat: We introduce an way to mark namespaces (not names) as “hidden”. This annotation should convey that contents of the namespace should not show up in search results, autocompletion etc., unless that namespaces is explicitly opened. This would also work well for |
I suspect for If it's possible to just use the |
Is this filtering just for presentation or also for the search? I.e. could you filter the successful results and maybe even include a hint (“some results from hidden namespaces were omitted“). That may be both good (users find a proof, and can copy some theorem or ask for a public one) and bad (users enable
Ok. If we are doing ad-hoc things I can ex-exclude |
@@ -184,6 +184,11 @@ def anyS (n : Name) (f : String → Bool) : Bool := | |||
| .num p _ => p.anyS f | |||
| _ => false | |||
|
|||
/-- Return true if the name is in a namespace associated to metaprogramming.-/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/-- Return true if the name is in a namespace associated to metaprogramming.-/ | |
/-- Return true if the name is in a namespace associated to metaprogramming. -/ |
/-- Return true if the name is in a namespace associated to metaprogramming.-/ | ||
def isMetaprogramming (n : Name) : Bool := | ||
let components := n.components | ||
components.head? == `Lean || (components.any fun n => n == `Tactic || n == `Linter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The environment linters in Batteries use Batteries.Tactic.Lint
as part of their namespace: they get excluded by Tactic
, but maybe you could
- also filter
Lint
here, or - change their namespace to
Linter
instead ofLint
.
@@ -275,3 +275,9 @@ error: apply? didn't find any relevant lemmas | |||
-/ | |||
#guard_msgs in | |||
example {α : Sort u} (x y : α) : Eq x y := by apply? | |||
|
|||
-- If this lemmas is added later to the library, please update this `#guard_msgs`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- If this lemmas is added later to the library, please update this `#guard_msgs`. | |
-- If this lemma is added later to the library, please update this `#guard_msgs`. |
This PR filters out all declarations from
Lean.*
,*.Tactic.*
, and*.Linter.*
from the results ofexact?
andrw?
.