diff --git a/crates/ark/src/lsp/snapshots/ark__lsp__symbols__tests__symbol_rhs_braced_list.snap b/crates/ark/src/lsp/snapshots/ark__lsp__symbols__tests__symbol_rhs_braced_list.snap index 95c351682..f10536e30 100644 --- a/crates/ark/src/lsp/snapshots/ark__lsp__symbols__tests__symbol_rhs_braced_list.snap +++ b/crates/ark/src/lsp/snapshots/ark__lsp__symbols__tests__symbol_rhs_braced_list.snap @@ -15,8 +15,8 @@ expression: "test_symbol(\"\nfoo <- {\n bar <- function() {}\n}\n\")" character: 0, }, end: Position { - line: 1, - character: 3, + line: 3, + character: 1, }, }, selection_range: Range { @@ -25,8 +25,8 @@ expression: "test_symbol(\"\nfoo <- {\n bar <- function() {}\n}\n\")" character: 0, }, end: Position { - line: 1, - character: 3, + line: 3, + character: 1, }, }, children: Some( diff --git a/crates/ark/src/lsp/snapshots/ark__lsp__symbols__tests__symbol_rhs_methods.snap b/crates/ark/src/lsp/snapshots/ark__lsp__symbols__tests__symbol_rhs_methods.snap index b5e6f1922..108646642 100644 --- a/crates/ark/src/lsp/snapshots/ark__lsp__symbols__tests__symbol_rhs_methods.snap +++ b/crates/ark/src/lsp/snapshots/ark__lsp__symbols__tests__symbol_rhs_methods.snap @@ -43,8 +43,8 @@ expression: "test_symbol(\"\n# section ----\nclass <- r6::r6class(\n 'class',\n character: 0, }, end: Position { - line: 2, - character: 5, + line: 11, + character: 1, }, }, selection_range: Range { @@ -53,8 +53,8 @@ expression: "test_symbol(\"\n# section ----\nclass <- r6::r6class(\n 'class',\n character: 0, }, end: Position { - line: 2, - character: 5, + line: 11, + character: 1, }, }, children: Some( diff --git a/crates/ark/src/lsp/symbols.rs b/crates/ark/src/lsp/symbols.rs index 5557f457a..e17d060e0 100644 --- a/crates/ark/src/lsp/symbols.rs +++ b/crates/ark/src/lsp/symbols.rs @@ -424,8 +424,8 @@ fn collect_assignment( // Otherwise, collect as generic object let name = contents.node_slice(&lhs)?.to_string(); - let start = convert_point_to_position(contents, lhs.start_position()); - let end = convert_point_to_position(contents, lhs.end_position()); + let start = convert_point_to_position(contents, node.start_position()); + let end = convert_point_to_position(contents, node.end_position()); // Now recurse into RHS let mut children = Vec::new(); @@ -583,7 +583,7 @@ mod tests { }, end: Position { line: 0, - character: 3, + character: 8, }, }; assert_eq!(test_symbol("foo <- 1"), vec![new_symbol( @@ -621,7 +621,7 @@ mod tests { }, end: Position { line: 0, - character: 23, + character: 28, }, }; let bar = new_symbol(String::from("bar"), SymbolKind::VARIABLE, range); @@ -667,7 +667,7 @@ foo <- function() { }, end: Position { line: 0, - character: 5, + character: 10, }, }; let foo = new_symbol(String::from("foo"), SymbolKind::VARIABLE, range);