File tree 1 file changed +21
-0
lines changed
crates/ark/src/lsp/completions/sources
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -428,6 +428,27 @@ mod tests {
428
428
call_node_position_type( & context. node, context. point) ,
429
429
CallNodePositionType :: Ambiguous
430
430
) ;
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
+ ) ;
431
452
}
432
453
433
454
#[ test]
You can’t perform that action at this time.
0 commit comments