fix: complete field access even if its parent is a closure (#1019)

* dev: complete field access even if it's parent is a closure

* test: update snapshot
This commit is contained in:
Myriad-Dreamin 2024-12-18 15:06:57 +08:00 committed by GitHub
parent e116b0b645
commit 142138297e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 4 deletions

View file

@ -98,7 +98,12 @@ impl StatefulRequest for CompletionRequest {
let parent_init = parent.find(parent_init.span())?;
parent_init.find(node.span())?;
}
Some(SyntaxKind::Closure) => return None,
Some(SyntaxKind::Closure) => {
let parent = node.parent()?;
let parent_body = parent.cast::<ast::Closure>()?.body();
let parent_body = parent.find(parent_body.span())?;
parent_body.find(node.span())?;
}
_ => {}
}
}