fix: improve Name.isMetaprogramming (#12767)
This PR makes sure that identifiers with `Meta` or `Simproc` in their name do not show up in library search results. For example, `Nat.Simproc.eq_add_gt` can currently be suggested by library search, even though it is an implementation detail. Additionally, there are various declarations in mathlib in the `Mathlib.Meta` namespace that we do not want to suggest.
This commit is contained in:
parent
2ea4d016c4
commit
bb047b8725
1 changed files with 1 additions and 1 deletions
|
|
@ -205,7 +205,7 @@ def anyS (n : Name) (f : String → Bool) : Bool :=
|
|||
/-- Return true if the name is in a namespace associated to metaprogramming. -/
|
||||
def isMetaprogramming (n : Name) : Bool :=
|
||||
let components := n.components
|
||||
components.head? == some `Lean || (components.any fun n => n == `Tactic || n == `Linter)
|
||||
components.head?.any (· == `Lean) || (components.any (· matches `Tactic | `Linter | `Simproc | `Meta))
|
||||
|
||||
end Name
|
||||
end Lean
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue