mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
4681 lines
261 KiB
JSON
4681 lines
261 KiB
JSON
[{
|
|
"testCaseDescription": "javascript-class-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
22
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
24
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
35,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
28,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
39
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
41,
|
|
44
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
45,
|
|
46
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
57,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
41,
|
|
61
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
62,
|
|
67
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
68,
|
|
69
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
80,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
73,
|
|
82
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
62,
|
|
84
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
86
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
87
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
0,
|
|
87
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
87
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"patch": "insert",
|
|
"range": [
|
|
87,
|
|
87
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
87,
|
|
87
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"class.js",
|
|
"class.js"
|
|
],
|
|
"oids": [
|
|
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391",
|
|
"8f6ae64dbe49f3d6f2043226aea0eb8148d2751f"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"class.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/class.js b/class.js",
|
|
"index e69de29..8f6ae64 100644",
|
|
"--- a/class.js",
|
|
"+++ b/class.js",
|
|
"@@ -0,0 +1 @@",
|
|
"+class Foo { static one(a) { return a; }; two(b) { return b; } three(c) { return c; } }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "025ac2dcb7ae8e622fb5a7f0508e2ec9e15604f8..b8c0b35327672fc19a3bbbb950aa826d0b501b1d"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-class-replacement-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
22
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
24
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
35,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
28,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
39
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
41,
|
|
44
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
45,
|
|
46
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
57,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
41,
|
|
61
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
62,
|
|
65
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
66,
|
|
67
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
78,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
71,
|
|
80
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
62,
|
|
82
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
84
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
0,
|
|
85
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
85
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
85
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
91,
|
|
94
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
104,
|
|
107
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
108,
|
|
109
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
120,
|
|
121
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
113,
|
|
122
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
104,
|
|
124
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
126,
|
|
129
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
130,
|
|
131
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
142,
|
|
143
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
135,
|
|
144
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
126,
|
|
146
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
147,
|
|
152
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
153,
|
|
154
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
165,
|
|
166
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
158,
|
|
167
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
147,
|
|
169
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
85,
|
|
171
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
85,
|
|
172
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
85,
|
|
172
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
85,
|
|
172
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
22
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
24
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
35,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
28,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
39
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
41,
|
|
44
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
45,
|
|
46
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
57,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
41,
|
|
61
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
62,
|
|
67
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
68,
|
|
69
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
80,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
73,
|
|
82
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
62,
|
|
84
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
86
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
87
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
87
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
87
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
178,
|
|
181
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
191,
|
|
194
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
195,
|
|
196
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
207,
|
|
208
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
200,
|
|
209
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
191,
|
|
211
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
213,
|
|
216
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
217,
|
|
218
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
229,
|
|
230
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
222,
|
|
231
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
213,
|
|
233
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
234,
|
|
239
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
240,
|
|
241
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
252,
|
|
253
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
245,
|
|
254
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
234,
|
|
256
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
172,
|
|
258
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
172,
|
|
259
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
172,
|
|
259
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
172,
|
|
259
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
87,
|
|
87
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
87,
|
|
87
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
259,
|
|
259
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
259,
|
|
259
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"class.js",
|
|
"class.js"
|
|
],
|
|
"oids": [
|
|
"8f6ae64dbe49f3d6f2043226aea0eb8148d2751f",
|
|
"b509437fd330d637bc4043a60bfc8202dfe8b258"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"class.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/class.js b/class.js",
|
|
"index 8f6ae64..b509437 100644",
|
|
"--- a/class.js",
|
|
"+++ b/class.js",
|
|
"@@ -1 +1,3 @@",
|
|
"+class Foo { static foo(a) { return a; }; bar(b) { return b; } baz(c) { return c; } }",
|
|
"+class Foo { static one(a) { return a; }; two(b) { return b; } three(c) { return c; } }",
|
|
" class Foo { static one(a) { return a; }; two(b) { return b; } three(c) { return c; } }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "b8c0b35327672fc19a3bbbb950aa826d0b501b1d..8385c4226c156fe5e6bf67a99d00305e085e535c"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-class-delete-insert-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
19,
|
|
22
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
24
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
35,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
28,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
39
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
41,
|
|
44
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
45,
|
|
46
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
57,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
41,
|
|
61
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
62,
|
|
65
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
66,
|
|
67
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
78,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
71,
|
|
80
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
62,
|
|
82
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
84
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
85
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
85
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
85
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
19,
|
|
22
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
24
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
35,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
28,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
39
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
41,
|
|
44
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
45,
|
|
46
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
57,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
41,
|
|
61
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
62,
|
|
67
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
68,
|
|
69
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
80,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
73,
|
|
82
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
62,
|
|
84
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
86
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
87
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
87
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
87
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
91,
|
|
94
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
104,
|
|
107
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
108,
|
|
109
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
120,
|
|
121
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
113,
|
|
122
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
104,
|
|
124
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
126,
|
|
129
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
130,
|
|
131
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
142,
|
|
143
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
135,
|
|
144
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
126,
|
|
146
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
147,
|
|
152
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
153,
|
|
154
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
165,
|
|
166
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
158,
|
|
167
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
147,
|
|
169
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
85,
|
|
171
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
85,
|
|
172
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
85,
|
|
172
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
85,
|
|
172
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
93,
|
|
96
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
106,
|
|
109
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
110,
|
|
111
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
122,
|
|
123
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
115,
|
|
124
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
106,
|
|
126
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
128,
|
|
131
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
132,
|
|
133
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
144,
|
|
145
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
137,
|
|
146
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
128,
|
|
148
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
149,
|
|
154
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
155,
|
|
156
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
167,
|
|
168
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
160,
|
|
169
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
149,
|
|
171
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
87,
|
|
173
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
87,
|
|
174
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
87,
|
|
174
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
87,
|
|
174
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
178,
|
|
181
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
191,
|
|
194
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
195,
|
|
196
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
207,
|
|
208
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
200,
|
|
209
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
191,
|
|
211
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
213,
|
|
216
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
217,
|
|
218
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
229,
|
|
230
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
222,
|
|
231
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
213,
|
|
233
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
234,
|
|
239
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
240,
|
|
241
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
252,
|
|
253
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
245,
|
|
254
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
234,
|
|
256
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
172,
|
|
258
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
172,
|
|
259
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
172,
|
|
259
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
172,
|
|
259
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
180,
|
|
183
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
193,
|
|
196
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
197,
|
|
198
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
209,
|
|
210
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
202,
|
|
211
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
193,
|
|
213
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
215,
|
|
218
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
219,
|
|
220
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
231,
|
|
232
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
224,
|
|
233
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
215,
|
|
235
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
236,
|
|
241
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
242,
|
|
243
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
254,
|
|
255
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
247,
|
|
256
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
236,
|
|
258
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
174,
|
|
260
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
174,
|
|
261
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
174,
|
|
261
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
174,
|
|
261
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
259,
|
|
259
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
259,
|
|
259
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
261,
|
|
261
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
261,
|
|
261
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"class.js",
|
|
"class.js"
|
|
],
|
|
"oids": [
|
|
"b509437fd330d637bc4043a60bfc8202dfe8b258",
|
|
"c4f5c91cec1c4f59df2ae283d70c8194697a777b"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"class.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/class.js b/class.js",
|
|
"index b509437..c4f5c91 100644",
|
|
"--- a/class.js",
|
|
"+++ b/class.js",
|
|
"@@ -1,3 +1,3 @@",
|
|
"-class Foo { static foo(a) { return a; }; bar(b) { return b; } baz(c) { return c; } }",
|
|
"+class Foo { static one(a) { return a; }; two(b) { return b; } three(c) { return c; } }",
|
|
" class Foo { static one(a) { return a; }; two(b) { return b; } three(c) { return c; } }",
|
|
" class Foo { static one(a) { return a; }; two(b) { return b; } three(c) { return c; } }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "8385c4226c156fe5e6bf67a99d00305e085e535c..ba68e53cd03ffdc79c72cd1d14aff85ac2bcbb6d"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-class-replacement-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
19,
|
|
22
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
24
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
35,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
28,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
39
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
41,
|
|
44
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
45,
|
|
46
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
57,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
41,
|
|
61
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
62,
|
|
67
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
68,
|
|
69
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
80,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
73,
|
|
82
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
62,
|
|
84
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
86
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
87
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
87
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
87
|
|
],
|
|
"number": 1
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"patch": "replace",
|
|
"range": [
|
|
19,
|
|
22
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
24
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
35,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
28,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
39
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
41,
|
|
44
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
45,
|
|
46
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
57,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
41,
|
|
61
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
62,
|
|
65
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
66,
|
|
67
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
78,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
71,
|
|
80
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
62,
|
|
82
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
84
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
85
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
85
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
85
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
93,
|
|
96
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
106,
|
|
109
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
110,
|
|
111
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
122,
|
|
123
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
115,
|
|
124
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
106,
|
|
126
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
128,
|
|
131
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
132,
|
|
133
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
144,
|
|
145
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
137,
|
|
146
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
128,
|
|
148
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
149,
|
|
154
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
155,
|
|
156
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
167,
|
|
168
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
160,
|
|
169
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
149,
|
|
171
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
87,
|
|
173
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
87,
|
|
174
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
87,
|
|
174
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
87,
|
|
174
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
91,
|
|
94
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
104,
|
|
107
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
108,
|
|
109
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
120,
|
|
121
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
113,
|
|
122
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
104,
|
|
124
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
126,
|
|
129
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
130,
|
|
131
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
142,
|
|
143
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
135,
|
|
144
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
126,
|
|
146
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
147,
|
|
152
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
153,
|
|
154
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
165,
|
|
166
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
158,
|
|
167
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
147,
|
|
169
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
85,
|
|
171
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
85,
|
|
172
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
85,
|
|
172
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
85,
|
|
172
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
180,
|
|
183
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
193,
|
|
196
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
197,
|
|
198
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
209,
|
|
210
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
202,
|
|
211
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
193,
|
|
213
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
215,
|
|
218
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
219,
|
|
220
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
231,
|
|
232
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
224,
|
|
233
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
215,
|
|
235
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
236,
|
|
241
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
242,
|
|
243
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
254,
|
|
255
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
247,
|
|
256
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
236,
|
|
258
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
174,
|
|
260
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
174,
|
|
261
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
174,
|
|
261
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
174,
|
|
261
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
178,
|
|
181
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
191,
|
|
194
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
195,
|
|
196
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
207,
|
|
208
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
200,
|
|
209
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
191,
|
|
211
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
213,
|
|
216
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
217,
|
|
218
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
229,
|
|
230
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
222,
|
|
231
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
213,
|
|
233
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
234,
|
|
239
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
240,
|
|
241
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
252,
|
|
253
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
245,
|
|
254
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
234,
|
|
256
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
172,
|
|
258
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
172,
|
|
259
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
172,
|
|
259
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
172,
|
|
259
|
|
],
|
|
"number": 3
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
261,
|
|
261
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
261,
|
|
261
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
259,
|
|
259
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
259,
|
|
259
|
|
],
|
|
"number": 4
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"class.js",
|
|
"class.js"
|
|
],
|
|
"oids": [
|
|
"c4f5c91cec1c4f59df2ae283d70c8194697a777b",
|
|
"b509437fd330d637bc4043a60bfc8202dfe8b258"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"class.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/class.js b/class.js",
|
|
"index c4f5c91..b509437 100644",
|
|
"--- a/class.js",
|
|
"+++ b/class.js",
|
|
"@@ -1,3 +1,3 @@",
|
|
"-class Foo { static one(a) { return a; }; two(b) { return b; } three(c) { return c; } }",
|
|
"+class Foo { static foo(a) { return a; }; bar(b) { return b; } baz(c) { return c; } }",
|
|
" class Foo { static one(a) { return a; }; two(b) { return b; } three(c) { return c; } }",
|
|
" class Foo { static one(a) { return a; }; two(b) { return b; } three(c) { return c; } }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "ba68e53cd03ffdc79c72cd1d14aff85ac2bcbb6d..ba852685e6014e0c26c2a092de5c242d5c3d34fc"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-class-delete-replacement-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
22
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
24
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
35,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
28,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
39
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
41,
|
|
44
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
45,
|
|
46
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
57,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
41,
|
|
61
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
62,
|
|
65
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
66,
|
|
67
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
78,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
71,
|
|
80
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
62,
|
|
82
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
84
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
85
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
85
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
85
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
91,
|
|
94
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
104,
|
|
107
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
108,
|
|
109
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
120,
|
|
121
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
113,
|
|
122
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
104,
|
|
124
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
126,
|
|
129
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
130,
|
|
131
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
142,
|
|
143
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
135,
|
|
144
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
126,
|
|
146
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
147,
|
|
152
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
153,
|
|
154
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
165,
|
|
166
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
158,
|
|
167
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
147,
|
|
169
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
85,
|
|
171
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
85,
|
|
172
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
85,
|
|
172
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
85,
|
|
172
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
178,
|
|
181
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
191,
|
|
194
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
195,
|
|
196
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
207,
|
|
208
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
200,
|
|
209
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
191,
|
|
211
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
213,
|
|
216
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
217,
|
|
218
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
229,
|
|
230
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
222,
|
|
231
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
213,
|
|
233
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
234,
|
|
239
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
240,
|
|
241
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
252,
|
|
253
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
245,
|
|
254
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
234,
|
|
256
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
172,
|
|
258
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
172,
|
|
259
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
172,
|
|
259
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
172,
|
|
259
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
22
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
24
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
35,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
28,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
39
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
41,
|
|
44
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
45,
|
|
46
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
57,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
41,
|
|
61
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
62,
|
|
67
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
68,
|
|
69
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
80,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
73,
|
|
82
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
62,
|
|
84
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
86
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
87
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
87
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
87
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
93,
|
|
96
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
106,
|
|
109
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
110,
|
|
111
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
122,
|
|
123
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
115,
|
|
124
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
106,
|
|
126
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
128,
|
|
131
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
132,
|
|
133
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
144,
|
|
145
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
137,
|
|
146
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
128,
|
|
148
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
149,
|
|
152
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
153,
|
|
154
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
165,
|
|
166
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
158,
|
|
167
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
149,
|
|
169
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
87,
|
|
171
|
|
]
|
|
}
|
|
],
|
|
"patch": "insert",
|
|
"range": [
|
|
87,
|
|
172
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
87,
|
|
172
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
87,
|
|
172
|
|
],
|
|
"number": 2
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
259,
|
|
259
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
259,
|
|
259
|
|
],
|
|
"number": 4
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
172,
|
|
172
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
172,
|
|
172
|
|
],
|
|
"number": 3
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"class.js",
|
|
"class.js"
|
|
],
|
|
"oids": [
|
|
"b509437fd330d637bc4043a60bfc8202dfe8b258",
|
|
"b1ef404f85e863410d324f59cc25d4506b4e3385"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"class.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/class.js b/class.js",
|
|
"index b509437..b1ef404 100644",
|
|
"--- a/class.js",
|
|
"+++ b/class.js",
|
|
"@@ -1,3 +1,2 @@",
|
|
"-class Foo { static foo(a) { return a; }; bar(b) { return b; } baz(c) { return c; } }",
|
|
"-class Foo { static one(a) { return a; }; two(b) { return b; } three(c) { return c; } }",
|
|
" class Foo { static one(a) { return a; }; two(b) { return b; } three(c) { return c; } }",
|
|
"+class Foo { static foo(a) { return a; }; bar(b) { return b; } baz(c) { return c; } }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "ba852685e6014e0c26c2a092de5c242d5c3d34fc..6ebb5eb0cca061d650120b97379df9a26bc1a7c3"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-class-delete-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
22
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
24
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
35,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
28,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
39
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
41,
|
|
44
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
45,
|
|
46
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
57,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
41,
|
|
61
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
62,
|
|
67
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
68,
|
|
69
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
80,
|
|
81
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
73,
|
|
82
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
62,
|
|
84
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
86
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
87
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
87
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
87
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
93,
|
|
96
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
106,
|
|
109
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
110,
|
|
111
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
122,
|
|
123
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
115,
|
|
124
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
106,
|
|
126
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
128,
|
|
131
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
132,
|
|
133
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
144,
|
|
145
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
137,
|
|
146
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
128,
|
|
148
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
149,
|
|
152
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
153,
|
|
154
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
165,
|
|
166
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
158,
|
|
167
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
149,
|
|
169
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
87,
|
|
171
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
87,
|
|
172
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
87,
|
|
172
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
87,
|
|
172
|
|
],
|
|
"number": 2
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
22
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
24
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
35,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
28,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
39
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
41,
|
|
44
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
45,
|
|
46
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
57,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
41,
|
|
61
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
62,
|
|
65
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
66,
|
|
67
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
78,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
71,
|
|
80
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
62,
|
|
82
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
84
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
85
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
85
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
0,
|
|
85
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
172,
|
|
172
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
172,
|
|
172
|
|
],
|
|
"number": 3
|
|
},
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"range": [
|
|
85,
|
|
85
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": false,
|
|
"range": [
|
|
85,
|
|
85
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"class.js",
|
|
"class.js"
|
|
],
|
|
"oids": [
|
|
"b1ef404f85e863410d324f59cc25d4506b4e3385",
|
|
"2c17f72f428aa0b184cb0b54ce069f9920b8a647"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"class.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/class.js b/class.js",
|
|
"index b1ef404..2c17f72 100644",
|
|
"--- a/class.js",
|
|
"+++ b/class.js",
|
|
"@@ -1,2 +1 @@",
|
|
"-class Foo { static one(a) { return a; }; two(b) { return b; } three(c) { return c; } }",
|
|
" class Foo { static foo(a) { return a; }; bar(b) { return b; } baz(c) { return c; } }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "6ebb5eb0cca061d650120b97379df9a26bc1a7c3..b990bf8d8e2680f56bc1fb39f8f36750ba4ba7fb"
|
|
}
|
|
,{
|
|
"testCaseDescription": "javascript-class-delete-rest-test",
|
|
"expectedResult": {
|
|
"rows": [
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [
|
|
{
|
|
"category": "ExpressionStatements",
|
|
"children": [
|
|
{
|
|
"category": "Class",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
6,
|
|
9
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
19,
|
|
22
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
23,
|
|
24
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
35,
|
|
36
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
28,
|
|
37
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
19,
|
|
39
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
41,
|
|
44
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
45,
|
|
46
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
57,
|
|
58
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
50,
|
|
59
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
41,
|
|
61
|
|
]
|
|
},
|
|
{
|
|
"category": "Method",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
62,
|
|
65
|
|
]
|
|
},
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
66,
|
|
67
|
|
]
|
|
},
|
|
{
|
|
"category": "Return",
|
|
"children": [
|
|
{
|
|
"category": "Identifier",
|
|
"range": [
|
|
78,
|
|
79
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
71,
|
|
80
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
62,
|
|
82
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
84
|
|
]
|
|
}
|
|
],
|
|
"range": [
|
|
0,
|
|
85
|
|
]
|
|
}
|
|
],
|
|
"patch": "delete",
|
|
"range": [
|
|
0,
|
|
85
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
0,
|
|
85
|
|
],
|
|
"number": 1
|
|
}
|
|
],
|
|
[
|
|
{
|
|
"terms": [
|
|
{
|
|
"category": "Program",
|
|
"children": [],
|
|
"patch": "delete",
|
|
"range": [
|
|
85,
|
|
85
|
|
]
|
|
}
|
|
],
|
|
"hasChanges": true,
|
|
"range": [
|
|
85,
|
|
85
|
|
],
|
|
"number": 2
|
|
}
|
|
]
|
|
],
|
|
"paths": [
|
|
"class.js",
|
|
"class.js"
|
|
],
|
|
"oids": [
|
|
"2c17f72f428aa0b184cb0b54ce069f9920b8a647",
|
|
"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
|
|
]
|
|
},
|
|
"filePaths": [
|
|
"class.js"
|
|
],
|
|
"patch": [
|
|
"diff --git a/class.js b/class.js",
|
|
"index 2c17f72..e69de29 100644",
|
|
"--- a/class.js",
|
|
"+++ b/class.js",
|
|
"@@ -1 +0,0 @@",
|
|
"-class Foo { static foo(a) { return a; }; bar(b) { return b; } baz(c) { return c; } }"
|
|
],
|
|
"gitDir": "test/corpus/repos/javascript",
|
|
"shas": "b990bf8d8e2680f56bc1fb39f8f36750ba4ba7fb..f24de0d24746d9f2408eda661698733705bd8a14"
|
|
}]
|