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::Python),\n language: TestLanguage::Python.get_language(),\n text: r#\"\n @decor1\n @decor2\n class A:\n ...\n \n class C:\n \"\"\"class docstring\"\"\"\n \n def __init__(self):\n pass\n \n #Vsrc\n @staticmethod()\n def foo():\n \"\"\"method docstring\"\"\"\n \n #Vdst\n def bar():\n ...\n \n def func():\n ...\n \"#.to_string(),\n })"
---
Ok(
[
BlockLocationTree {
block: BlockLocation {
start_byte: 9,
end_byte: 65,
start_row: 1,
start_col: 8,
end_row: 4,
end_col: 15,
},
children: [
BlockLocationTree {
block: BlockLocation {
start_byte: 41,
end_byte: 65,
start_row: 3,
start_col: 8,
end_row: 4,
end_col: 15,
},
children: [],
},
],
},
BlockLocationTree {
block: BlockLocation {
start_byte: 86,
end_byte: 385,
start_row: 6,
start_col: 8,
end_row: 19,
end_col: 19,
},
children: [
BlockLocationTree {
block: BlockLocation {
start_byte: 150,
end_byte: 190,
start_row: 9,
start_col: 12,
end_row: 10,
end_col: 20,
},
children: [],
},
BlockLocationTree {
block: BlockLocation {
start_byte: 230,
end_byte: 307,
start_row: 13,
start_col: 12,
end_row: 15,
end_col: 38,
},
children: [
BlockLocationTree {
block: BlockLocation {
start_byte: 258,
end_byte: 307,
start_row: 14,
start_col: 12,
end_row: 15,
end_col: 38,
},
children: [],
},
],
},
BlockLocationTree {
block: BlockLocation {
start_byte: 355,
end_byte: 385,
start_row: 18,
start_col: 12,
end_row: 19,
end_col: 19,
},
children: [],
},
],
},
BlockLocationTree {
block: BlockLocation {
start_byte: 411,
end_byte: 438,
start_row: 21,
start_col: 8,
end_row: 22,
end_col: 15,
},
children: [],
},
],
)