Skip to content

Commit d5f5c6d

Browse files
authored
Convert many tests from verify.singleReferenceGroup to verify.baselineFindAllReferences (#48518)
* Convert referenceToClass to baselining * Delete stray marker from findAllRefsInsideWithBlock * Bulk convert tests that just call verify.singleReferenceGroup * Update tests with duplicate names * Bulk update verify.singleReferenceGroup tests with BOMs * Semi-automatically convert FAR tests with explicit range code * Convert findAllReferencesDynamicImport2 to baselines
1 parent 9962011 commit d5f5c6d

File tree

295 files changed

+62661
-1043
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

295 files changed

+62661
-1043
lines changed
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
// === /tests/cases/fourslash/user.ts ===
2+
// import {/*FIND ALL REFS*/[|x|]} from "jquery";
3+
4+
[
5+
{
6+
"definition": {
7+
"containerKind": "",
8+
"containerName": "",
9+
"fileName": "/tests/cases/fourslash/user.ts",
10+
"kind": "alias",
11+
"name": "(alias) module \"jquery\"\nimport x",
12+
"textSpan": {
13+
"start": 8,
14+
"length": 1
15+
},
16+
"displayParts": [
17+
{
18+
"text": "(",
19+
"kind": "punctuation"
20+
},
21+
{
22+
"text": "alias",
23+
"kind": "text"
24+
},
25+
{
26+
"text": ")",
27+
"kind": "punctuation"
28+
},
29+
{
30+
"text": " ",
31+
"kind": "space"
32+
},
33+
{
34+
"text": "module",
35+
"kind": "keyword"
36+
},
37+
{
38+
"text": " ",
39+
"kind": "space"
40+
},
41+
{
42+
"text": "\"jquery\"",
43+
"kind": "stringLiteral"
44+
},
45+
{
46+
"text": "\n",
47+
"kind": "lineBreak"
48+
},
49+
{
50+
"text": "import",
51+
"kind": "keyword"
52+
},
53+
{
54+
"text": " ",
55+
"kind": "space"
56+
},
57+
{
58+
"text": "x",
59+
"kind": "aliasName"
60+
}
61+
],
62+
"contextSpan": {
63+
"start": 0,
64+
"length": 25
65+
}
66+
},
67+
"references": [
68+
{
69+
"textSpan": {
70+
"start": 8,
71+
"length": 1
72+
},
73+
"fileName": "/tests/cases/fourslash/user.ts",
74+
"contextSpan": {
75+
"start": 0,
76+
"length": 25
77+
},
78+
"isWriteAccess": true,
79+
"isDefinition": true
80+
}
81+
]
82+
}
83+
]
84+
85+
// === /tests/cases/fourslash/user2.ts ===
86+
// import {/*FIND ALL REFS*/[|x|]} from "jquery";
87+
88+
[
89+
{
90+
"definition": {
91+
"containerKind": "",
92+
"containerName": "",
93+
"fileName": "/tests/cases/fourslash/user2.ts",
94+
"kind": "alias",
95+
"name": "(alias) module \"jquery\"\nimport x",
96+
"textSpan": {
97+
"start": 8,
98+
"length": 1
99+
},
100+
"displayParts": [
101+
{
102+
"text": "(",
103+
"kind": "punctuation"
104+
},
105+
{
106+
"text": "alias",
107+
"kind": "text"
108+
},
109+
{
110+
"text": ")",
111+
"kind": "punctuation"
112+
},
113+
{
114+
"text": " ",
115+
"kind": "space"
116+
},
117+
{
118+
"text": "module",
119+
"kind": "keyword"
120+
},
121+
{
122+
"text": " ",
123+
"kind": "space"
124+
},
125+
{
126+
"text": "\"jquery\"",
127+
"kind": "stringLiteral"
128+
},
129+
{
130+
"text": "\n",
131+
"kind": "lineBreak"
132+
},
133+
{
134+
"text": "import",
135+
"kind": "keyword"
136+
},
137+
{
138+
"text": " ",
139+
"kind": "space"
140+
},
141+
{
142+
"text": "x",
143+
"kind": "aliasName"
144+
}
145+
],
146+
"contextSpan": {
147+
"start": 0,
148+
"length": 25
149+
}
150+
},
151+
"references": [
152+
{
153+
"textSpan": {
154+
"start": 8,
155+
"length": 1
156+
},
157+
"fileName": "/tests/cases/fourslash/user2.ts",
158+
"contextSpan": {
159+
"start": 0,
160+
"length": 25
161+
},
162+
"isWriteAccess": true,
163+
"isDefinition": true
164+
}
165+
]
166+
}
167+
]
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
undefined
2+
3+
// === /b.ts ===
4+
// import a from "a";
5+
// a.[|x|];
6+
7+
// === /abc.d.ts ===
8+
// declare module "a" {
9+
// export const /*FIND ALL REFS*/[|x|]: number;
10+
// }
11+
12+
[
13+
{
14+
"definition": {
15+
"containerKind": "",
16+
"containerName": "",
17+
"fileName": "/abc.d.ts",
18+
"kind": "const",
19+
"name": "const x: number",
20+
"textSpan": {
21+
"start": 38,
22+
"length": 1
23+
},
24+
"displayParts": [
25+
{
26+
"text": "const",
27+
"kind": "keyword"
28+
},
29+
{
30+
"text": " ",
31+
"kind": "space"
32+
},
33+
{
34+
"text": "x",
35+
"kind": "localName"
36+
},
37+
{
38+
"text": ":",
39+
"kind": "punctuation"
40+
},
41+
{
42+
"text": " ",
43+
"kind": "space"
44+
},
45+
{
46+
"text": "number",
47+
"kind": "keyword"
48+
}
49+
],
50+
"contextSpan": {
51+
"start": 25,
52+
"length": 23
53+
}
54+
},
55+
"references": [
56+
{
57+
"textSpan": {
58+
"start": 38,
59+
"length": 1
60+
},
61+
"fileName": "/abc.d.ts",
62+
"contextSpan": {
63+
"start": 25,
64+
"length": 23
65+
},
66+
"isWriteAccess": true,
67+
"isDefinition": true
68+
},
69+
{
70+
"textSpan": {
71+
"start": 21,
72+
"length": 1
73+
},
74+
"fileName": "/b.ts",
75+
"isWriteAccess": false,
76+
"isDefinition": false
77+
}
78+
]
79+
}
80+
]
81+
82+
// === /b.ts ===
83+
// import a from "a";
84+
// a./*FIND ALL REFS*/[|x|];
85+
86+
// === /abc.d.ts ===
87+
// declare module "a" {
88+
// export const [|x|]: number;
89+
// }
90+
91+
[
92+
{
93+
"definition": {
94+
"containerKind": "",
95+
"containerName": "",
96+
"fileName": "/abc.d.ts",
97+
"kind": "const",
98+
"name": "const x: number",
99+
"textSpan": {
100+
"start": 38,
101+
"length": 1
102+
},
103+
"displayParts": [
104+
{
105+
"text": "const",
106+
"kind": "keyword"
107+
},
108+
{
109+
"text": " ",
110+
"kind": "space"
111+
},
112+
{
113+
"text": "x",
114+
"kind": "localName"
115+
},
116+
{
117+
"text": ":",
118+
"kind": "punctuation"
119+
},
120+
{
121+
"text": " ",
122+
"kind": "space"
123+
},
124+
{
125+
"text": "number",
126+
"kind": "keyword"
127+
}
128+
],
129+
"contextSpan": {
130+
"start": 25,
131+
"length": 23
132+
}
133+
},
134+
"references": [
135+
{
136+
"textSpan": {
137+
"start": 38,
138+
"length": 1
139+
},
140+
"fileName": "/abc.d.ts",
141+
"contextSpan": {
142+
"start": 25,
143+
"length": 23
144+
},
145+
"isWriteAccess": true,
146+
"isDefinition": true
147+
},
148+
{
149+
"textSpan": {
150+
"start": 21,
151+
"length": 1
152+
},
153+
"fileName": "/b.ts",
154+
"isWriteAccess": false,
155+
"isDefinition": false
156+
}
157+
]
158+
}
159+
]

0 commit comments

Comments
 (0)