1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
source: code-blocks-server/tests/test_api.rs
expression: "get_subtrees(GetSubtreesArgs {\n queries: get_query_strings(&TestLanguage::Rust),\n language: TestLanguage::Rust.get_language(),\n text: r#\"\nmod m {\n fn foo() {}\n fn baz() {}\n}\n\n#[cfg(test)]\nmod m {\n /// comment 1\n #[test]\n fn foo() {}\n\n #[test]\n #[ignore]\n /// comment 2\n fn baz() {}\n}\n \"#.to_string(),\n })"
---
Ok(
[
BlockLocationTree {
block: BlockLocation {
start_byte: 1,
end_byte: 42,
start_row: 1,
start_col: 0,
end_row: 4,
end_col: 1,
},
children: [
BlockLocationTree {
block: BlockLocation {
start_byte: 13,
end_byte: 24,
start_row: 2,
start_col: 4,
end_row: 2,
end_col: 15,
},
children: [],
},
BlockLocationTree {
block: BlockLocation {
start_byte: 29,
end_byte: 40,
start_row: 3,
start_col: 4,
end_row: 3,
end_col: 15,
},
children: [],
},
],
},
BlockLocationTree {
block: BlockLocation {
start_byte: 44,
end_byte: 173,
start_row: 6,
start_col: 0,
end_row: 16,
end_col: 1,
},
children: [
BlockLocationTree {
block: BlockLocation {
start_byte: 69,
end_byte: 110,
start_row: 8,
start_col: 4,
end_row: 10,
end_col: 15,
},
children: [],
},
BlockLocationTree {
block: BlockLocation {
start_byte: 116,
end_byte: 171,
start_row: 12,
start_col: 4,
end_row: 15,
end_col: 15,
},
children: [],
},
],
},
],
)