Skip to content

Commit 3eba779

Browse files
committed
Adding a (currently failing) test for scenario identified by @DavisVaughan
1 parent 597c9a5 commit 3eba779

File tree

1 file changed

+21
-0
lines changed
  • crates/ark/src/lsp/completions/sources

1 file changed

+21
-0
lines changed

crates/ark/src/lsp/completions/sources/utils.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,27 @@ mod tests {
428428
call_node_position_type(&context.node, context.point),
429429
CallNodePositionType::Ambiguous
430430
);
431+
432+
// After `(`, and on own line
433+
let (text, point) = point_from_cursor("fn(\n @\n)");
434+
let document = Document::new(&text, None);
435+
let context = DocumentContext::new(&document, point, None);
436+
437+
// On `main`, this passes
438+
// assert_eq!(
439+
// context.node.node_type(),
440+
// NodeType::Anonymous(String::from("("))
441+
// );
442+
443+
// On this pr, `(`, doesn't contain the user's cursor, so instead it selects
444+
// the surrounding `Arguments` node
445+
assert_eq!(context.node.node_type(), NodeType::Arguments);
446+
447+
// On `main`, this passes, and this should also still pass on this PR, but currently does not
448+
assert_eq!(
449+
call_node_position_type(&context.node, context.point),
450+
CallNodePositionType::Name
451+
);
431452
}
432453

433454
#[test]

0 commit comments

Comments
 (0)