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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
---
source: code-blocks-server/tests/test_api.rs
expression: "code_blocks_server::get_subtrees(GetSubtreesArgs {\n queries: get_query_strings(&TestLanguage::TypeScript),\n language: TestLanguage::TypeScript.get_language(),\n text: r#\"\nclass TsClass {\n constructor() {}\n\n foo() {}\n\n /**\n * bar docs\n */\n bar() {}\n}\n\nexport function baz() {}\n\nexport default function baz2() {}\n \"#.to_string(),\n })"
---
Ok(
[
BlockLocationTree {
block: BlockLocation {
start_byte: 1,
end_byte: 97,
start_row: 1,
start_col: 0,
end_row: 10,
end_col: 1,
},
children: [
BlockLocationTree {
block: BlockLocation {
start_byte: 21,
end_byte: 37,
start_row: 2,
start_col: 4,
end_row: 2,
end_col: 20,
},
children: [],
},
BlockLocationTree {
block: BlockLocation {
start_byte: 43,
end_byte: 51,
start_row: 4,
start_col: 4,
end_row: 4,
end_col: 12,
},
children: [],
},
BlockLocationTree {
block: BlockLocation {
start_byte: 57,
end_byte: 95,
start_row: 6,
start_col: 4,
end_row: 9,
end_col: 12,
},
children: [],
},
],
},
BlockLocationTree {
block: BlockLocation {
start_byte: 99,
end_byte: 123,
start_row: 12,
start_col: 0,
end_row: 12,
end_col: 24,
},
children: [
BlockLocationTree {
block: BlockLocation {
start_byte: 106,
end_byte: 123,
start_row: 12,
start_col: 7,
end_row: 12,
end_col: 24,
},
children: [],
},
],
},
BlockLocationTree {
block: BlockLocation {
start_byte: 125,
end_byte: 158,
start_row: 14,
start_col: 0,
end_row: 14,
end_col: 33,
},
children: [
BlockLocationTree {
block: BlockLocation {
start_byte: 140,
end_byte: 158,
start_row: 14,
start_col: 15,
end_row: 14,
end_col: 33,
},
children: [],
},
],
},
],
)