Skip to content

Commit 8ec3804

Browse files
authored
fix test/basellines (#59663)
1 parent 26c4320 commit 8ec3804

File tree

2 files changed

+77
-20
lines changed

2 files changed

+77
-20
lines changed

tests/baselines/reference/goToDefinitionClassConstructors.baseline.jsonc

Lines changed: 74 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,88 @@
11
// === goToDefinition ===
2+
// === /tests/cases/fourslash/definitions.ts ===
3+
// export class Base {
4+
// [|{| defId: 1 |}constructor(protected readonly cArg: string) {}|]
5+
// }
6+
//
7+
// <|export class [|{| defId: 0 |}Derived|] extends Base {
8+
// readonly email = this.cArg.getByLabel('Email')
9+
// readonly password = this.cArg.getByLabel('Password')
10+
// }|>
11+
212
// === /tests/cases/fourslash/main.ts ===
3-
// <|import { [|Derived|] } from './base'|>
4-
// const derived = new /*GOTO DEF*/Derived(cArg)
13+
// import { Derived } from './definitions'
14+
// const derived = new /*GOTO DEF*/[|Derived|](cArg)
515

616
// === Details ===
717
[
818
{
9-
"kind": "alias",
19+
"defId": 0,
20+
"kind": "class",
1021
"name": "Derived",
11-
"containerName": "",
12-
"isLocal": true,
22+
"containerName": "\"/tests/cases/fourslash/definitions\"",
23+
"isLocal": false,
1324
"isAmbient": false,
14-
"unverified": false,
15-
"failedAliasResolution": true
25+
"unverified": false
26+
},
27+
{
28+
"defId": 1,
29+
"kind": "constructor",
30+
"name": "__constructor",
31+
"containerName": "Base",
32+
"isLocal": false,
33+
"isAmbient": false,
34+
"unverified": false
1635
}
1736
]
1837

1938

2039

2140
// === goToDefinition ===
2241
// === /tests/cases/fourslash/defInSameFile.ts ===
23-
// import { Base } from './base'
24-
// <|class [|SameFile|] extends Base {
42+
// import { Base } from './definitions'
43+
// <|class [|{| defId: 0 |}SameFile|] extends Base {
2544
// readonly name: string = 'SameFile'
2645
// }|>
2746
// const SameFile = new /*GOTO DEF*/SameFile(cArg)
2847
// const wrapper = new Base(cArg)
2948

49+
// === /tests/cases/fourslash/definitions.ts ===
50+
// export class Base {
51+
// [|{| defId: 1 |}constructor(protected readonly cArg: string) {}|]
52+
// }
53+
//
54+
// export class Derived extends Base {
55+
// --- (line: 6) skipped ---
56+
3057
// === Details ===
3158
[
3259
{
60+
"defId": 0,
3361
"kind": "class",
3462
"name": "SameFile",
3563
"containerName": "",
3664
"isLocal": true,
3765
"isAmbient": false,
3866
"unverified": false,
3967
"failedAliasResolution": false
68+
},
69+
{
70+
"defId": 1,
71+
"kind": "constructor",
72+
"name": "__constructor",
73+
"containerName": "Base",
74+
"isLocal": false,
75+
"isAmbient": false,
76+
"unverified": false,
77+
"failedAliasResolution": false
4078
}
4179
]
4280

4381

4482

4583
// === goToDefinition ===
4684
// === /tests/cases/fourslash/hasConstructor.ts ===
47-
// import { Base } from './base'
85+
// import { Base } from './definitions'
4886
// <|class [|{| defId: 0 |}HasConstructor|] extends Base {
4987
// [|{| defId: 1 |}constructor() {}|]
5088
// readonly name: string = '';
@@ -78,23 +116,42 @@
78116

79117

80118
// === goToDefinition ===
119+
// === /tests/cases/fourslash/definitions.ts ===
120+
// <|export class [|{| defId: 0 |}Base|] {
121+
// [|{| defId: 1 |}constructor(protected readonly cArg: string) {}|]
122+
// }|>
123+
//
124+
// export class Derived extends Base {
125+
// readonly email = this.cArg.getByLabel('Email')
126+
// readonly password = this.cArg.getByLabel('Password')
127+
// }
128+
81129
// === /tests/cases/fourslash/defInSameFile.ts ===
82-
// <|import { [|Base|] } from './base'|>
130+
// import { Base } from './definitions'
83131
// class SameFile extends Base {
84132
// readonly name: string = 'SameFile'
85133
// }
86134
// const SameFile = new SameFile(cArg)
87-
// const wrapper = new /*GOTO DEF*/Base(cArg)
135+
// const wrapper = new /*GOTO DEF*/[|Base|](cArg)
88136

89137
// === Details ===
90138
[
91139
{
92-
"kind": "alias",
140+
"defId": 0,
141+
"kind": "class",
93142
"name": "Base",
94-
"containerName": "",
95-
"isLocal": true,
143+
"containerName": "\"/tests/cases/fourslash/definitions\"",
144+
"isLocal": false,
96145
"isAmbient": false,
97-
"unverified": false,
98-
"failedAliasResolution": true
146+
"unverified": false
147+
},
148+
{
149+
"defId": 1,
150+
"kind": "constructor",
151+
"name": "__constructor",
152+
"containerName": "Base",
153+
"isLocal": false,
154+
"isAmbient": false,
155+
"unverified": false
99156
}
100157
]

tests/cases/fourslash/goToDefinitionClassConstructors.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111
//// }
1212

1313
// @filename: main.ts
14-
//// import { Derived } from './base'
14+
//// import { Derived } from './definitions'
1515
//// const derived = new [|/*Derived*/Derived|](cArg)
1616

1717
// @filename: defInSameFile.ts
18-
//// import { Base } from './base'
18+
//// import { Base } from './definitions'
1919
//// class SameFile extends Base {
2020
//// readonly name: string = 'SameFile'
2121
//// }
2222
//// const SameFile = new [|/*SameFile*/SameFile|](cArg)
2323
//// const wrapper = new [|/*Base*/Base|](cArg)
2424

2525
// @filename: hasConstructor.ts
26-
//// import { Base } from './base'
26+
//// import { Base } from './definitions'
2727
//// class HasConstructor extends Base {
2828
//// constructor() {}
2929
//// readonly name: string = '';

0 commit comments

Comments
 (0)