diff --git a/crates/tinymist-query/src/completion.rs b/crates/tinymist-query/src/completion.rs index 649d3e87..0330e37b 100644 --- a/crates/tinymist-query/src/completion.rs +++ b/crates/tinymist-query/src/completion.rs @@ -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::()?.body(); + let parent_body = parent.find(parent_body.span())?; + parent_body.find(node.span())?; + } _ => {} } } diff --git a/crates/tinymist-query/src/fixtures/completion/snaps/test@field_simple.typ.snap b/crates/tinymist-query/src/fixtures/completion/snaps/test@field_simple.typ.snap index 529ac28b..6a75573e 100644 --- a/crates/tinymist-query/src/fixtures/completion/snaps/test@field_simple.typ.snap +++ b/crates/tinymist-query/src/fixtures/completion/snaps/test@field_simple.typ.snap @@ -1,10 +1,13 @@ --- source: crates/tinymist-query/src/completion.rs -description: Completion on / (55..56) +description: Completion on / (51..52) expression: "JsonRepr::new_pure(results)" input_file: crates/tinymist-query/src/fixtures/completion/field_simple.typ snapshot_kind: text --- [ - null + { + "isIncomplete": false, + "items": [] + } ] diff --git a/tests/e2e/main.rs b/tests/e2e/main.rs index ece589f7..95a29d8d 100644 --- a/tests/e2e/main.rs +++ b/tests/e2e/main.rs @@ -374,7 +374,7 @@ fn e2e() { }); let hash = replay_log(&tinymist_binary, &root.join("neovim")); - insta::assert_snapshot!(hash, @"siphash128_13:1b57e3cb3fd4ba2a088a4eaf7aa6d4bb"); + insta::assert_snapshot!(hash, @"siphash128_13:a46fdba2828c3e0b2fa431509c12d45e"); } {