fix: unknown identifier code actions with nested open (#10619)
This PR fixes a bug in the unknown identifier code actions where it would yield non-sensical suggestions for nested `open` declarations like `open Foo.Bar`.
This commit is contained in:
parent
76403367ba
commit
9f2ce635ae
1 changed files with 2 additions and 2 deletions
|
|
@ -41,7 +41,7 @@ structure ContextualizedCompletionInfo where
|
|||
ctx : ContextInfo
|
||||
info : CompletionInfo
|
||||
|
||||
partial def minimizeGlobalIdentifierInContext (currNamespace : Name) (openDecls : List OpenDecl) (id : Name)
|
||||
def minimizeGlobalIdentifierInContext (currNamespace : Name) (openDecls : List OpenDecl) (id : Name)
|
||||
: Name := Id.run do
|
||||
let mut minimized := shortenIn id currNamespace
|
||||
for openDecl in openDecls do
|
||||
|
|
@ -68,7 +68,7 @@ where
|
|||
else if contextNamespace.isPrefixOf id then
|
||||
id.replacePrefix contextNamespace .anonymous
|
||||
else
|
||||
shortenIn id contextNamespace.getPrefix
|
||||
id
|
||||
|
||||
def unfoldDefinitionGuarded? (e : Expr) : MetaM (Option Expr) :=
|
||||
try Lean.Meta.unfoldDefinition? e catch _ => pure none
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue