Skip to content

Commit 1dd4dd0

Browse files
committed
Anticipate being in an "arguments" node when completing inside a call
1 parent 3eba779 commit 1dd4dd0

File tree

1 file changed

+1
-11
lines changed
  • crates/ark/src/lsp/completions/sources

1 file changed

+1
-11
lines changed

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

+1-11
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ pub(super) enum CallNodePositionType {
101101

102102
pub(super) fn call_node_position_type(node: &Node, point: Point) -> CallNodePositionType {
103103
match node.node_type() {
104+
NodeType::Arguments => return CallNodePositionType::Name,
104105
NodeType::Anonymous(kind) if kind == "(" => {
105106
if point.is_before_or_equal(node.start_position()) {
106107
// Before the `(`
@@ -434,17 +435,6 @@ mod tests {
434435
let document = Document::new(&text, None);
435436
let context = DocumentContext::new(&document, point, None);
436437

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
448438
assert_eq!(
449439
call_node_position_type(&context.node, context.point),
450440
CallNodePositionType::Name

0 commit comments

Comments
 (0)