Skip to content

Commit 64d8ca9

Browse files
committed
Extend range of assignment symbols to end of node
1 parent bdd1af1 commit 64d8ca9

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

crates/ark/src/lsp/snapshots/ark__lsp__symbols__tests__symbol_nested_assignments_enabled.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ expression: symbols
1616
},
1717
end: Position {
1818
line: 2,
19-
character: 8,
19+
character: 13,
2020
},
2121
},
2222
selection_range: Range {
@@ -26,7 +26,7 @@ expression: symbols
2626
},
2727
end: Position {
2828
line: 2,
29-
character: 8,
29+
character: 13,
3030
},
3131
},
3232
children: Some(
@@ -76,7 +76,7 @@ expression: symbols
7676
},
7777
end: Position {
7878
line: 5,
79-
character: 8,
79+
character: 13,
8080
},
8181
},
8282
selection_range: Range {
@@ -86,7 +86,7 @@ expression: symbols
8686
},
8787
end: Position {
8888
line: 5,
89-
character: 8,
89+
character: 13,
9090
},
9191
},
9292
children: Some(

crates/ark/src/lsp/snapshots/ark__lsp__symbols__tests__symbol_rhs_braced_list.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ expression: "test_symbol(\"\nfoo <- {\n bar <- function() {}\n}\n\")"
1515
character: 0,
1616
},
1717
end: Position {
18-
line: 1,
19-
character: 3,
18+
line: 3,
19+
character: 1,
2020
},
2121
},
2222
selection_range: Range {
@@ -25,8 +25,8 @@ expression: "test_symbol(\"\nfoo <- {\n bar <- function() {}\n}\n\")"
2525
character: 0,
2626
},
2727
end: Position {
28-
line: 1,
29-
character: 3,
28+
line: 3,
29+
character: 1,
3030
},
3131
},
3232
children: Some(

crates/ark/src/lsp/snapshots/ark__lsp__symbols__tests__symbol_rhs_methods.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ expression: "test_symbol(\"\n# section ----\nclass <- r6::r6class(\n 'class',\n
4343
character: 0,
4444
},
4545
end: Position {
46-
line: 2,
47-
character: 5,
46+
line: 11,
47+
character: 1,
4848
},
4949
},
5050
selection_range: Range {
@@ -53,8 +53,8 @@ expression: "test_symbol(\"\n# section ----\nclass <- r6::r6class(\n 'class',\n
5353
character: 0,
5454
},
5555
end: Position {
56-
line: 2,
57-
character: 5,
56+
line: 11,
57+
character: 1,
5858
},
5959
},
6060
children: Some(

crates/ark/src/lsp/symbols.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,8 @@ fn collect_assignment(
453453
// too busy.
454454
let name = contents.node_slice(&lhs)?.to_string();
455455

456-
let start = convert_point_to_position(contents, lhs.start_position());
457-
let end = convert_point_to_position(contents, lhs.end_position());
456+
let start = convert_point_to_position(contents, node.start_position());
457+
let end = convert_point_to_position(contents, node.end_position());
458458

459459
// Now recurse into RHS
460460
let mut children = Vec::new();
@@ -624,7 +624,7 @@ mod tests {
624624
},
625625
end: Position {
626626
line: 0,
627-
character: 3,
627+
character: 8,
628628
},
629629
};
630630
assert_eq!(test_symbol("foo <- 1"), vec![new_symbol(

0 commit comments

Comments
 (0)