@typescript-deploys/pr-build 5.1.0-pr-53225-3 → 5.1.0-pr-52840-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +46 -25
- package/lib/tsserver.js +100 -77
- package/lib/tsserverlibrary.js +100 -77
- package/lib/typescript.js +100 -77
- package/lib/typingsInstaller.js +3 -2
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.1";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20230328`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -7740,7 +7740,8 @@ var Diagnostics = {
|
|
|
7740
7740
|
_0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
|
|
7741
7741
|
_0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
|
|
7742
7742
|
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
|
|
7743
|
-
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.")
|
|
7743
|
+
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
|
|
7744
|
+
Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'")
|
|
7744
7745
|
};
|
|
7745
7746
|
|
|
7746
7747
|
// src/compiler/scanner.ts
|
|
@@ -78206,8 +78207,9 @@ function createTypeChecker(host) {
|
|
|
78206
78207
|
return filter(symbol.declarations, (d) => d.kind === 261 /* ClassDeclaration */ || d.kind === 262 /* InterfaceDeclaration */);
|
|
78207
78208
|
}
|
|
78208
78209
|
function checkKindsOfPropertyMemberOverrides(type, baseType) {
|
|
78209
|
-
var _a2, _b, _c, _d;
|
|
78210
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
78210
78211
|
const baseProperties = getPropertiesOfType(baseType);
|
|
78212
|
+
let inheritedAbstractMemberNotImplementedError;
|
|
78211
78213
|
basePropertyCheck:
|
|
78212
78214
|
for (const baseProperty of baseProperties) {
|
|
78213
78215
|
const base = getTargetSymbol(baseProperty);
|
|
@@ -78233,20 +78235,34 @@ function createTypeChecker(host) {
|
|
|
78233
78235
|
continue basePropertyCheck;
|
|
78234
78236
|
}
|
|
78235
78237
|
}
|
|
78236
|
-
if (
|
|
78237
|
-
error(
|
|
78238
|
+
if (!inheritedAbstractMemberNotImplementedError) {
|
|
78239
|
+
inheritedAbstractMemberNotImplementedError = error(
|
|
78238
78240
|
derivedClassDecl,
|
|
78239
|
-
Diagnostics.
|
|
78240
|
-
|
|
78241
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1,
|
|
78242
|
+
typeToString(type),
|
|
78241
78243
|
typeToString(baseType)
|
|
78242
78244
|
);
|
|
78245
|
+
}
|
|
78246
|
+
if (derivedClassDecl.kind === 229 /* ClassExpression */) {
|
|
78247
|
+
addRelatedInfo(
|
|
78248
|
+
inheritedAbstractMemberNotImplementedError,
|
|
78249
|
+
createDiagnosticForNode(
|
|
78250
|
+
(_b = (_a2 = baseProperty.valueDeclaration) != null ? _a2 : baseProperty.declarations && first(baseProperty.declarations)) != null ? _b : derivedClassDecl,
|
|
78251
|
+
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,
|
|
78252
|
+
symbolToString(baseProperty),
|
|
78253
|
+
typeToString(baseType)
|
|
78254
|
+
)
|
|
78255
|
+
);
|
|
78243
78256
|
} else {
|
|
78244
|
-
|
|
78245
|
-
|
|
78246
|
-
|
|
78247
|
-
|
|
78248
|
-
|
|
78249
|
-
|
|
78257
|
+
addRelatedInfo(
|
|
78258
|
+
inheritedAbstractMemberNotImplementedError,
|
|
78259
|
+
createDiagnosticForNode(
|
|
78260
|
+
(_d = (_c = baseProperty.valueDeclaration) != null ? _c : baseProperty.declarations && first(baseProperty.declarations)) != null ? _d : derivedClassDecl,
|
|
78261
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,
|
|
78262
|
+
typeToString(type),
|
|
78263
|
+
symbolToString(baseProperty),
|
|
78264
|
+
typeToString(baseType)
|
|
78265
|
+
)
|
|
78250
78266
|
);
|
|
78251
78267
|
}
|
|
78252
78268
|
}
|
|
@@ -78259,7 +78275,7 @@ function createTypeChecker(host) {
|
|
|
78259
78275
|
const basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
|
|
78260
78276
|
const derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
|
|
78261
78277
|
if (basePropertyFlags && derivedPropertyFlags) {
|
|
78262
|
-
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (
|
|
78278
|
+
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (_e = base.declarations) == null ? void 0 : _e.some((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags)) : (_f = base.declarations) == null ? void 0 : _f.every((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags))) || getCheckFlags(base) & 262144 /* Mapped */ || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) {
|
|
78263
78279
|
continue;
|
|
78264
78280
|
}
|
|
78265
78281
|
const overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
|
|
@@ -78268,8 +78284,8 @@ function createTypeChecker(host) {
|
|
|
78268
78284
|
const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
|
|
78269
78285
|
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
|
|
78270
78286
|
} else if (useDefineForClassFields) {
|
|
78271
|
-
const uninitialized = (
|
|
78272
|
-
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((
|
|
78287
|
+
const uninitialized = (_g = derived.declarations) == null ? void 0 : _g.find((d) => d.kind === 170 /* PropertyDeclaration */ && !d.initializer);
|
|
78288
|
+
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((_h = derived.declarations) == null ? void 0 : _h.some((d) => !!(d.flags & 16777216 /* Ambient */)))) {
|
|
78273
78289
|
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
|
|
78274
78290
|
const propName = uninitialized.name;
|
|
78275
78291
|
if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName) || !strictNullChecks || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -88380,16 +88396,17 @@ function transformClassFields(context) {
|
|
|
88380
88396
|
if (isAssignmentExpression(node)) {
|
|
88381
88397
|
if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) {
|
|
88382
88398
|
const assignedName = getAssignedNameOfIdentifier(node.left, node.right);
|
|
88383
|
-
const
|
|
88399
|
+
const left2 = visitNode(node.left, visitor, isExpression);
|
|
88384
88400
|
const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression);
|
|
88385
|
-
return factory2.updateBinaryExpression(node,
|
|
88401
|
+
return factory2.updateBinaryExpression(node, left2, node.operatorToken, right);
|
|
88386
88402
|
}
|
|
88387
|
-
|
|
88388
|
-
|
|
88403
|
+
const left = skipOuterExpressions(node.left, 8 /* PartiallyEmittedExpressions */ | 1 /* Parentheses */);
|
|
88404
|
+
if (isPrivateIdentifierPropertyAccessExpression(left)) {
|
|
88405
|
+
const info = accessPrivateIdentifier2(left.name);
|
|
88389
88406
|
if (info) {
|
|
88390
88407
|
return setTextRange(
|
|
88391
88408
|
setOriginalNode(
|
|
88392
|
-
createPrivateIdentifierAssignment(info,
|
|
88409
|
+
createPrivateIdentifierAssignment(info, left.expression, node.right, node.operatorToken.kind),
|
|
88393
88410
|
node
|
|
88394
88411
|
),
|
|
88395
88412
|
node
|
|
@@ -91324,10 +91341,14 @@ function transformESDecorators(context) {
|
|
|
91324
91341
|
visitor
|
|
91325
91342
|
);
|
|
91326
91343
|
const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart);
|
|
91327
|
-
|
|
91328
|
-
|
|
91329
|
-
|
|
91330
|
-
|
|
91344
|
+
if (superStatementIndex >= 0) {
|
|
91345
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, superStatementIndex + 1 - nonPrologueStart));
|
|
91346
|
+
addRange(statements, initializerStatements);
|
|
91347
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, superStatementIndex + 1));
|
|
91348
|
+
} else {
|
|
91349
|
+
addRange(statements, initializerStatements);
|
|
91350
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement));
|
|
91351
|
+
}
|
|
91331
91352
|
body = factory2.createBlock(
|
|
91332
91353
|
statements,
|
|
91333
91354
|
/*multiLine*/
|
package/lib/tsserver.js
CHANGED
|
@@ -2286,7 +2286,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2286
2286
|
|
|
2287
2287
|
// src/compiler/corePublic.ts
|
|
2288
2288
|
var versionMajorMinor = "5.1";
|
|
2289
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2289
|
+
var version = `${versionMajorMinor}.0-insiders.20230328`;
|
|
2290
2290
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2291
2291
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2292
2292
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -11233,7 +11233,8 @@ var Diagnostics = {
|
|
|
11233
11233
|
_0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
|
|
11234
11234
|
_0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
|
|
11235
11235
|
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
|
|
11236
|
-
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.")
|
|
11236
|
+
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
|
|
11237
|
+
Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'")
|
|
11237
11238
|
};
|
|
11238
11239
|
|
|
11239
11240
|
// src/compiler/scanner.ts
|
|
@@ -82848,8 +82849,9 @@ function createTypeChecker(host) {
|
|
|
82848
82849
|
return filter(symbol.declarations, (d) => d.kind === 261 /* ClassDeclaration */ || d.kind === 262 /* InterfaceDeclaration */);
|
|
82849
82850
|
}
|
|
82850
82851
|
function checkKindsOfPropertyMemberOverrides(type, baseType) {
|
|
82851
|
-
var _a2, _b, _c, _d;
|
|
82852
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
82852
82853
|
const baseProperties = getPropertiesOfType(baseType);
|
|
82854
|
+
let inheritedAbstractMemberNotImplementedError;
|
|
82853
82855
|
basePropertyCheck:
|
|
82854
82856
|
for (const baseProperty of baseProperties) {
|
|
82855
82857
|
const base = getTargetSymbol(baseProperty);
|
|
@@ -82875,20 +82877,34 @@ function createTypeChecker(host) {
|
|
|
82875
82877
|
continue basePropertyCheck;
|
|
82876
82878
|
}
|
|
82877
82879
|
}
|
|
82878
|
-
if (
|
|
82879
|
-
error(
|
|
82880
|
+
if (!inheritedAbstractMemberNotImplementedError) {
|
|
82881
|
+
inheritedAbstractMemberNotImplementedError = error(
|
|
82880
82882
|
derivedClassDecl,
|
|
82881
|
-
Diagnostics.
|
|
82882
|
-
|
|
82883
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1,
|
|
82884
|
+
typeToString(type),
|
|
82883
82885
|
typeToString(baseType)
|
|
82884
82886
|
);
|
|
82887
|
+
}
|
|
82888
|
+
if (derivedClassDecl.kind === 229 /* ClassExpression */) {
|
|
82889
|
+
addRelatedInfo(
|
|
82890
|
+
inheritedAbstractMemberNotImplementedError,
|
|
82891
|
+
createDiagnosticForNode(
|
|
82892
|
+
(_b = (_a2 = baseProperty.valueDeclaration) != null ? _a2 : baseProperty.declarations && first(baseProperty.declarations)) != null ? _b : derivedClassDecl,
|
|
82893
|
+
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,
|
|
82894
|
+
symbolToString(baseProperty),
|
|
82895
|
+
typeToString(baseType)
|
|
82896
|
+
)
|
|
82897
|
+
);
|
|
82885
82898
|
} else {
|
|
82886
|
-
|
|
82887
|
-
|
|
82888
|
-
|
|
82889
|
-
|
|
82890
|
-
|
|
82891
|
-
|
|
82899
|
+
addRelatedInfo(
|
|
82900
|
+
inheritedAbstractMemberNotImplementedError,
|
|
82901
|
+
createDiagnosticForNode(
|
|
82902
|
+
(_d = (_c = baseProperty.valueDeclaration) != null ? _c : baseProperty.declarations && first(baseProperty.declarations)) != null ? _d : derivedClassDecl,
|
|
82903
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,
|
|
82904
|
+
typeToString(type),
|
|
82905
|
+
symbolToString(baseProperty),
|
|
82906
|
+
typeToString(baseType)
|
|
82907
|
+
)
|
|
82892
82908
|
);
|
|
82893
82909
|
}
|
|
82894
82910
|
}
|
|
@@ -82901,7 +82917,7 @@ function createTypeChecker(host) {
|
|
|
82901
82917
|
const basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
|
|
82902
82918
|
const derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
|
|
82903
82919
|
if (basePropertyFlags && derivedPropertyFlags) {
|
|
82904
|
-
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (
|
|
82920
|
+
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (_e = base.declarations) == null ? void 0 : _e.some((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags)) : (_f = base.declarations) == null ? void 0 : _f.every((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags))) || getCheckFlags(base) & 262144 /* Mapped */ || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) {
|
|
82905
82921
|
continue;
|
|
82906
82922
|
}
|
|
82907
82923
|
const overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
|
|
@@ -82910,8 +82926,8 @@ function createTypeChecker(host) {
|
|
|
82910
82926
|
const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
|
|
82911
82927
|
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
|
|
82912
82928
|
} else if (useDefineForClassFields) {
|
|
82913
|
-
const uninitialized = (
|
|
82914
|
-
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((
|
|
82929
|
+
const uninitialized = (_g = derived.declarations) == null ? void 0 : _g.find((d) => d.kind === 170 /* PropertyDeclaration */ && !d.initializer);
|
|
82930
|
+
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((_h = derived.declarations) == null ? void 0 : _h.some((d) => !!(d.flags & 16777216 /* Ambient */)))) {
|
|
82915
82931
|
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
|
|
82916
82932
|
const propName = uninitialized.name;
|
|
82917
82933
|
if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName) || !strictNullChecks || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -93193,16 +93209,17 @@ function transformClassFields(context) {
|
|
|
93193
93209
|
if (isAssignmentExpression(node)) {
|
|
93194
93210
|
if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) {
|
|
93195
93211
|
const assignedName = getAssignedNameOfIdentifier(node.left, node.right);
|
|
93196
|
-
const
|
|
93212
|
+
const left2 = visitNode(node.left, visitor, isExpression);
|
|
93197
93213
|
const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression);
|
|
93198
|
-
return factory2.updateBinaryExpression(node,
|
|
93214
|
+
return factory2.updateBinaryExpression(node, left2, node.operatorToken, right);
|
|
93199
93215
|
}
|
|
93200
|
-
|
|
93201
|
-
|
|
93216
|
+
const left = skipOuterExpressions(node.left, 8 /* PartiallyEmittedExpressions */ | 1 /* Parentheses */);
|
|
93217
|
+
if (isPrivateIdentifierPropertyAccessExpression(left)) {
|
|
93218
|
+
const info = accessPrivateIdentifier2(left.name);
|
|
93202
93219
|
if (info) {
|
|
93203
93220
|
return setTextRange(
|
|
93204
93221
|
setOriginalNode(
|
|
93205
|
-
createPrivateIdentifierAssignment(info,
|
|
93222
|
+
createPrivateIdentifierAssignment(info, left.expression, node.right, node.operatorToken.kind),
|
|
93206
93223
|
node
|
|
93207
93224
|
),
|
|
93208
93225
|
node
|
|
@@ -96137,10 +96154,14 @@ function transformESDecorators(context) {
|
|
|
96137
96154
|
visitor
|
|
96138
96155
|
);
|
|
96139
96156
|
const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart);
|
|
96140
|
-
|
|
96141
|
-
|
|
96142
|
-
|
|
96143
|
-
|
|
96157
|
+
if (superStatementIndex >= 0) {
|
|
96158
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, superStatementIndex + 1 - nonPrologueStart));
|
|
96159
|
+
addRange(statements, initializerStatements);
|
|
96160
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, superStatementIndex + 1));
|
|
96161
|
+
} else {
|
|
96162
|
+
addRange(statements, initializerStatements);
|
|
96163
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement));
|
|
96164
|
+
}
|
|
96144
96165
|
body = factory2.createBlock(
|
|
96145
96166
|
statements,
|
|
96146
96167
|
/*multiLine*/
|
|
@@ -144824,8 +144845,7 @@ function getTypesPackageNameToInstall(packageName, host, diagCode) {
|
|
|
144824
144845
|
|
|
144825
144846
|
// src/services/codefixes/fixClassDoesntImplementInheritedAbstractMember.ts
|
|
144826
144847
|
var errorCodes30 = [
|
|
144827
|
-
Diagnostics.
|
|
144828
|
-
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code
|
|
144848
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1.code
|
|
144829
144849
|
];
|
|
144830
144850
|
var fixId25 = "fixClassDoesntImplementInheritedAbstractMember";
|
|
144831
144851
|
registerCodeFix({
|
|
@@ -152471,10 +152491,34 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
|
|
|
152471
152491
|
switch (parent2.kind) {
|
|
152472
152492
|
case 199 /* LiteralType */: {
|
|
152473
152493
|
const grandParent = walkUpParentheses(parent2.parent);
|
|
152474
|
-
|
|
152475
|
-
|
|
152494
|
+
switch (grandParent.kind) {
|
|
152495
|
+
case 231 /* ExpressionWithTypeArguments */:
|
|
152496
|
+
case 181 /* TypeReference */: {
|
|
152497
|
+
const typeArgument = findAncestor(parent2, (n) => n.parent === grandParent);
|
|
152498
|
+
if (typeArgument) {
|
|
152499
|
+
return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false };
|
|
152500
|
+
}
|
|
152501
|
+
return void 0;
|
|
152502
|
+
}
|
|
152503
|
+
case 197 /* IndexedAccessType */:
|
|
152504
|
+
const { indexType, objectType } = grandParent;
|
|
152505
|
+
if (!rangeContainsPosition(indexType, position)) {
|
|
152506
|
+
return void 0;
|
|
152507
|
+
}
|
|
152508
|
+
return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType));
|
|
152509
|
+
case 203 /* ImportType */:
|
|
152510
|
+
return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) };
|
|
152511
|
+
case 190 /* UnionType */: {
|
|
152512
|
+
if (!isTypeReferenceNode(grandParent.parent)) {
|
|
152513
|
+
return void 0;
|
|
152514
|
+
}
|
|
152515
|
+
const alreadyUsedTypes = getAlreadyUsedTypesInStringLiteralUnion(grandParent, parent2);
|
|
152516
|
+
const types = getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(grandParent)).filter((t) => !contains(alreadyUsedTypes, t.value));
|
|
152517
|
+
return { kind: 2 /* Types */, types, isNewIdentifier: false };
|
|
152518
|
+
}
|
|
152519
|
+
default:
|
|
152520
|
+
return void 0;
|
|
152476
152521
|
}
|
|
152477
|
-
return fromUnionableLiteralType(grandParent);
|
|
152478
152522
|
}
|
|
152479
152523
|
case 300 /* PropertyAssignment */:
|
|
152480
152524
|
if (isObjectLiteralExpression(parent2.parent) && parent2.name === node) {
|
|
@@ -152508,38 +152552,7 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
|
|
|
152508
152552
|
const literals = contextualTypes.types.filter((literal) => !tracker.hasValue(literal.value));
|
|
152509
152553
|
return { kind: 2 /* Types */, types: literals, isNewIdentifier: false };
|
|
152510
152554
|
default:
|
|
152511
|
-
return fromContextualType();
|
|
152512
|
-
}
|
|
152513
|
-
function fromUnionableLiteralType(grandParent) {
|
|
152514
|
-
switch (grandParent.kind) {
|
|
152515
|
-
case 231 /* ExpressionWithTypeArguments */:
|
|
152516
|
-
case 181 /* TypeReference */: {
|
|
152517
|
-
const typeArgument = findAncestor(parent2, (n) => n.parent === grandParent);
|
|
152518
|
-
if (typeArgument) {
|
|
152519
|
-
return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false };
|
|
152520
|
-
}
|
|
152521
|
-
return void 0;
|
|
152522
|
-
}
|
|
152523
|
-
case 197 /* IndexedAccessType */:
|
|
152524
|
-
const { indexType, objectType } = grandParent;
|
|
152525
|
-
if (!rangeContainsPosition(indexType, position)) {
|
|
152526
|
-
return void 0;
|
|
152527
|
-
}
|
|
152528
|
-
return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType));
|
|
152529
|
-
case 190 /* UnionType */: {
|
|
152530
|
-
const result = fromUnionableLiteralType(walkUpParentheses(grandParent.parent));
|
|
152531
|
-
if (!result) {
|
|
152532
|
-
return void 0;
|
|
152533
|
-
}
|
|
152534
|
-
const alreadyUsedTypes = getAlreadyUsedTypesInStringLiteralUnion(grandParent, parent2);
|
|
152535
|
-
if (result.kind === 1 /* Properties */) {
|
|
152536
|
-
return { kind: 1 /* Properties */, symbols: result.symbols.filter((sym) => !contains(alreadyUsedTypes, sym.name)), hasIndexSignature: result.hasIndexSignature };
|
|
152537
|
-
}
|
|
152538
|
-
return { kind: 2 /* Types */, types: result.types.filter((t) => !contains(alreadyUsedTypes, t.value)), isNewIdentifier: false };
|
|
152539
|
-
}
|
|
152540
|
-
default:
|
|
152541
|
-
return void 0;
|
|
152542
|
-
}
|
|
152555
|
+
return fromContextualType() || fromContextualType(0 /* None */);
|
|
152543
152556
|
}
|
|
152544
152557
|
function fromContextualType(contextFlags = 4 /* Completions */) {
|
|
152545
152558
|
const types = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags));
|
|
@@ -154197,7 +154210,7 @@ var Core;
|
|
|
154197
154210
|
((Core2) => {
|
|
154198
154211
|
function getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options = {}, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) {
|
|
154199
154212
|
var _a2, _b, _c;
|
|
154200
|
-
node =
|
|
154213
|
+
node = getAdjustedNode2(node, options);
|
|
154201
154214
|
if (isSourceFile(node)) {
|
|
154202
154215
|
const resolvedRef = ts_GoToDefinition_exports.getReferenceAtPosition(node, position, program);
|
|
154203
154216
|
if (!(resolvedRef == null ? void 0 : resolvedRef.file)) {
|
|
@@ -154265,7 +154278,7 @@ var Core;
|
|
|
154265
154278
|
return mergeReferences(program, moduleReferences, references, moduleReferencesOfExportTarget);
|
|
154266
154279
|
}
|
|
154267
154280
|
Core2.getReferencedSymbolsForNode = getReferencedSymbolsForNode;
|
|
154268
|
-
function
|
|
154281
|
+
function getAdjustedNode2(node, options) {
|
|
154269
154282
|
if (options.use === 1 /* References */) {
|
|
154270
154283
|
node = getAdjustedReferenceLocation(node);
|
|
154271
154284
|
} else if (options.use === 2 /* Rename */) {
|
|
@@ -154273,7 +154286,7 @@ var Core;
|
|
|
154273
154286
|
}
|
|
154274
154287
|
return node;
|
|
154275
154288
|
}
|
|
154276
|
-
Core2.getAdjustedNode =
|
|
154289
|
+
Core2.getAdjustedNode = getAdjustedNode2;
|
|
154277
154290
|
function getReferencesForFileName(fileName, program, sourceFiles, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) {
|
|
154278
154291
|
var _a2, _b;
|
|
154279
154292
|
const moduleSymbol = (_a2 = program.getSourceFile(fileName)) == null ? void 0 : _a2.symbol;
|
|
@@ -161604,9 +161617,9 @@ function extractFunctionInScope(node, scope, { usages: usagesInScope, typeParame
|
|
|
161604
161617
|
}
|
|
161605
161618
|
callArguments.push(factory.createIdentifier(name));
|
|
161606
161619
|
});
|
|
161607
|
-
const typeParametersAndDeclarations = arrayFrom(typeParameterUsages.values(), (type) => ({ type, declaration:
|
|
161620
|
+
const typeParametersAndDeclarations = arrayFrom(typeParameterUsages.values(), (type) => ({ type, declaration: getFirstDeclarationBeforePosition(type, context.startPosition) }));
|
|
161608
161621
|
const sortedTypeParametersAndDeclarations = typeParametersAndDeclarations.sort(compareTypesByDeclarationOrder);
|
|
161609
|
-
const typeParameters = sortedTypeParametersAndDeclarations.length === 0 ? void 0 : sortedTypeParametersAndDeclarations
|
|
161622
|
+
const typeParameters = sortedTypeParametersAndDeclarations.length === 0 ? void 0 : mapDefined(sortedTypeParametersAndDeclarations, ({ declaration }) => declaration);
|
|
161610
161623
|
const callTypeArguments = typeParameters !== void 0 ? typeParameters.map((decl) => factory.createTypeReferenceNode(
|
|
161611
161624
|
decl.name,
|
|
161612
161625
|
/*typeArguments*/
|
|
@@ -162083,12 +162096,12 @@ function getContainingVariableDeclarationIfInList(node, scope) {
|
|
|
162083
162096
|
node = node.parent;
|
|
162084
162097
|
}
|
|
162085
162098
|
}
|
|
162086
|
-
function
|
|
162099
|
+
function getFirstDeclarationBeforePosition(type, position) {
|
|
162087
162100
|
let firstDeclaration;
|
|
162088
162101
|
const symbol = type.symbol;
|
|
162089
162102
|
if (symbol && symbol.declarations) {
|
|
162090
162103
|
for (const declaration of symbol.declarations) {
|
|
162091
|
-
if (firstDeclaration === void 0 || declaration.pos < firstDeclaration.pos) {
|
|
162104
|
+
if ((firstDeclaration === void 0 || declaration.pos < firstDeclaration.pos) && declaration.pos < position) {
|
|
162092
162105
|
firstDeclaration = declaration;
|
|
162093
162106
|
}
|
|
162094
162107
|
}
|
|
@@ -163087,8 +163100,11 @@ function countBinaryExpressionParameters(b) {
|
|
|
163087
163100
|
return isBinaryExpression(b.left) ? countBinaryExpressionParameters(b.left) + 1 : 2;
|
|
163088
163101
|
}
|
|
163089
163102
|
function tryGetParameterInfo(startingToken, position, sourceFile, checker) {
|
|
163090
|
-
const
|
|
163091
|
-
if (
|
|
163103
|
+
const node = getAdjustedNode(startingToken);
|
|
163104
|
+
if (node === void 0)
|
|
163105
|
+
return void 0;
|
|
163106
|
+
const info = getContextualSignatureLocationInfo(node, sourceFile, position, checker);
|
|
163107
|
+
if (info === void 0)
|
|
163092
163108
|
return void 0;
|
|
163093
163109
|
const { contextualType, argumentIndex, argumentCount, argumentsSpan } = info;
|
|
163094
163110
|
const nonNullableContextualType = contextualType.getNonNullableType();
|
|
@@ -163101,16 +163117,23 @@ function tryGetParameterInfo(startingToken, position, sourceFile, checker) {
|
|
|
163101
163117
|
const invocation = { kind: 2 /* Contextual */, signature, node: startingToken, symbol: chooseBetterSymbol(symbol) };
|
|
163102
163118
|
return { isTypeParameterList: false, invocation, argumentsSpan, argumentIndex, argumentCount };
|
|
163103
163119
|
}
|
|
163104
|
-
function
|
|
163105
|
-
|
|
163106
|
-
|
|
163107
|
-
|
|
163120
|
+
function getAdjustedNode(node) {
|
|
163121
|
+
switch (node.kind) {
|
|
163122
|
+
case 20 /* OpenParenToken */:
|
|
163123
|
+
case 27 /* CommaToken */:
|
|
163124
|
+
return node;
|
|
163125
|
+
default:
|
|
163126
|
+
return findAncestor(node.parent, (n) => isParameter(n) ? true : isBindingElement(n) || isObjectBindingPattern(n) || isArrayBindingPattern(n) ? false : "quit");
|
|
163127
|
+
}
|
|
163128
|
+
}
|
|
163129
|
+
function getContextualSignatureLocationInfo(node, sourceFile, position, checker) {
|
|
163130
|
+
const { parent: parent2 } = node;
|
|
163108
163131
|
switch (parent2.kind) {
|
|
163109
163132
|
case 215 /* ParenthesizedExpression */:
|
|
163110
163133
|
case 172 /* MethodDeclaration */:
|
|
163111
163134
|
case 216 /* FunctionExpression */:
|
|
163112
163135
|
case 217 /* ArrowFunction */:
|
|
163113
|
-
const info = getArgumentOrParameterListInfo(
|
|
163136
|
+
const info = getArgumentOrParameterListInfo(node, position, sourceFile);
|
|
163114
163137
|
if (!info)
|
|
163115
163138
|
return void 0;
|
|
163116
163139
|
const { argumentIndex, argumentCount, argumentsSpan } = info;
|
|
@@ -163119,7 +163142,7 @@ function getContextualSignatureLocationInfo(startingToken, sourceFile, position,
|
|
|
163119
163142
|
case 224 /* BinaryExpression */: {
|
|
163120
163143
|
const highestBinary = getHighestBinary(parent2);
|
|
163121
163144
|
const contextualType2 = checker.getContextualType(highestBinary);
|
|
163122
|
-
const argumentIndex2 =
|
|
163145
|
+
const argumentIndex2 = node.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent2) - 1;
|
|
163123
163146
|
const argumentCount2 = countBinaryExpressionParameters(highestBinary);
|
|
163124
163147
|
return contextualType2 && { contextualType: contextualType2, argumentIndex: argumentIndex2, argumentCount: argumentCount2, argumentsSpan: createTextSpanFromNode(parent2) };
|
|
163125
163148
|
}
|
package/lib/tsserverlibrary.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230328`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -9056,7 +9056,8 @@ ${lanes.join("\n")}
|
|
|
9056
9056
|
_0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
|
|
9057
9057
|
_0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
|
|
9058
9058
|
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
|
|
9059
|
-
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.")
|
|
9059
|
+
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
|
|
9060
|
+
Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'")
|
|
9060
9061
|
};
|
|
9061
9062
|
}
|
|
9062
9063
|
});
|
|
@@ -80656,8 +80657,9 @@ ${lanes.join("\n")}
|
|
|
80656
80657
|
return filter(symbol.declarations, (d) => d.kind === 261 /* ClassDeclaration */ || d.kind === 262 /* InterfaceDeclaration */);
|
|
80657
80658
|
}
|
|
80658
80659
|
function checkKindsOfPropertyMemberOverrides(type, baseType) {
|
|
80659
|
-
var _a2, _b, _c, _d;
|
|
80660
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
80660
80661
|
const baseProperties = getPropertiesOfType(baseType);
|
|
80662
|
+
let inheritedAbstractMemberNotImplementedError;
|
|
80661
80663
|
basePropertyCheck:
|
|
80662
80664
|
for (const baseProperty of baseProperties) {
|
|
80663
80665
|
const base = getTargetSymbol(baseProperty);
|
|
@@ -80683,20 +80685,34 @@ ${lanes.join("\n")}
|
|
|
80683
80685
|
continue basePropertyCheck;
|
|
80684
80686
|
}
|
|
80685
80687
|
}
|
|
80686
|
-
if (
|
|
80687
|
-
error(
|
|
80688
|
+
if (!inheritedAbstractMemberNotImplementedError) {
|
|
80689
|
+
inheritedAbstractMemberNotImplementedError = error(
|
|
80688
80690
|
derivedClassDecl,
|
|
80689
|
-
Diagnostics.
|
|
80690
|
-
|
|
80691
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1,
|
|
80692
|
+
typeToString(type),
|
|
80691
80693
|
typeToString(baseType)
|
|
80692
80694
|
);
|
|
80695
|
+
}
|
|
80696
|
+
if (derivedClassDecl.kind === 229 /* ClassExpression */) {
|
|
80697
|
+
addRelatedInfo(
|
|
80698
|
+
inheritedAbstractMemberNotImplementedError,
|
|
80699
|
+
createDiagnosticForNode(
|
|
80700
|
+
(_b = (_a2 = baseProperty.valueDeclaration) != null ? _a2 : baseProperty.declarations && first(baseProperty.declarations)) != null ? _b : derivedClassDecl,
|
|
80701
|
+
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,
|
|
80702
|
+
symbolToString(baseProperty),
|
|
80703
|
+
typeToString(baseType)
|
|
80704
|
+
)
|
|
80705
|
+
);
|
|
80693
80706
|
} else {
|
|
80694
|
-
|
|
80695
|
-
|
|
80696
|
-
|
|
80697
|
-
|
|
80698
|
-
|
|
80699
|
-
|
|
80707
|
+
addRelatedInfo(
|
|
80708
|
+
inheritedAbstractMemberNotImplementedError,
|
|
80709
|
+
createDiagnosticForNode(
|
|
80710
|
+
(_d = (_c = baseProperty.valueDeclaration) != null ? _c : baseProperty.declarations && first(baseProperty.declarations)) != null ? _d : derivedClassDecl,
|
|
80711
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,
|
|
80712
|
+
typeToString(type),
|
|
80713
|
+
symbolToString(baseProperty),
|
|
80714
|
+
typeToString(baseType)
|
|
80715
|
+
)
|
|
80700
80716
|
);
|
|
80701
80717
|
}
|
|
80702
80718
|
}
|
|
@@ -80709,7 +80725,7 @@ ${lanes.join("\n")}
|
|
|
80709
80725
|
const basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
|
|
80710
80726
|
const derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
|
|
80711
80727
|
if (basePropertyFlags && derivedPropertyFlags) {
|
|
80712
|
-
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (
|
|
80728
|
+
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (_e = base.declarations) == null ? void 0 : _e.some((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags)) : (_f = base.declarations) == null ? void 0 : _f.every((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags))) || getCheckFlags(base) & 262144 /* Mapped */ || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) {
|
|
80713
80729
|
continue;
|
|
80714
80730
|
}
|
|
80715
80731
|
const overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
|
|
@@ -80718,8 +80734,8 @@ ${lanes.join("\n")}
|
|
|
80718
80734
|
const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
|
|
80719
80735
|
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
|
|
80720
80736
|
} else if (useDefineForClassFields) {
|
|
80721
|
-
const uninitialized = (
|
|
80722
|
-
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((
|
|
80737
|
+
const uninitialized = (_g = derived.declarations) == null ? void 0 : _g.find((d) => d.kind === 170 /* PropertyDeclaration */ && !d.initializer);
|
|
80738
|
+
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((_h = derived.declarations) == null ? void 0 : _h.some((d) => !!(d.flags & 16777216 /* Ambient */)))) {
|
|
80723
80739
|
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
|
|
80724
80740
|
const propName = uninitialized.name;
|
|
80725
80741
|
if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName) || !strictNullChecks || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -91176,16 +91192,17 @@ ${lanes.join("\n")}
|
|
|
91176
91192
|
if (isAssignmentExpression(node)) {
|
|
91177
91193
|
if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) {
|
|
91178
91194
|
const assignedName = getAssignedNameOfIdentifier(node.left, node.right);
|
|
91179
|
-
const
|
|
91195
|
+
const left2 = visitNode(node.left, visitor, isExpression);
|
|
91180
91196
|
const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression);
|
|
91181
|
-
return factory2.updateBinaryExpression(node,
|
|
91197
|
+
return factory2.updateBinaryExpression(node, left2, node.operatorToken, right);
|
|
91182
91198
|
}
|
|
91183
|
-
|
|
91184
|
-
|
|
91199
|
+
const left = skipOuterExpressions(node.left, 8 /* PartiallyEmittedExpressions */ | 1 /* Parentheses */);
|
|
91200
|
+
if (isPrivateIdentifierPropertyAccessExpression(left)) {
|
|
91201
|
+
const info = accessPrivateIdentifier2(left.name);
|
|
91185
91202
|
if (info) {
|
|
91186
91203
|
return setTextRange(
|
|
91187
91204
|
setOriginalNode(
|
|
91188
|
-
createPrivateIdentifierAssignment(info,
|
|
91205
|
+
createPrivateIdentifierAssignment(info, left.expression, node.right, node.operatorToken.kind),
|
|
91189
91206
|
node
|
|
91190
91207
|
),
|
|
91191
91208
|
node
|
|
@@ -94138,10 +94155,14 @@ ${lanes.join("\n")}
|
|
|
94138
94155
|
visitor
|
|
94139
94156
|
);
|
|
94140
94157
|
const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart);
|
|
94141
|
-
|
|
94142
|
-
|
|
94143
|
-
|
|
94144
|
-
|
|
94158
|
+
if (superStatementIndex >= 0) {
|
|
94159
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, superStatementIndex + 1 - nonPrologueStart));
|
|
94160
|
+
addRange(statements, initializerStatements);
|
|
94161
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, superStatementIndex + 1));
|
|
94162
|
+
} else {
|
|
94163
|
+
addRange(statements, initializerStatements);
|
|
94164
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement));
|
|
94165
|
+
}
|
|
94145
94166
|
body = factory2.createBlock(
|
|
94146
94167
|
statements,
|
|
94147
94168
|
/*multiLine*/
|
|
@@ -143547,8 +143568,7 @@ ${lanes.join("\n")}
|
|
|
143547
143568
|
init_ts4();
|
|
143548
143569
|
init_ts_codefix();
|
|
143549
143570
|
errorCodes30 = [
|
|
143550
|
-
Diagnostics.
|
|
143551
|
-
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code
|
|
143571
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1.code
|
|
143552
143572
|
];
|
|
143553
143573
|
fixId25 = "fixClassDoesntImplementInheritedAbstractMember";
|
|
143554
143574
|
registerCodeFix({
|
|
@@ -151568,10 +151588,34 @@ ${lanes.join("\n")}
|
|
|
151568
151588
|
switch (parent2.kind) {
|
|
151569
151589
|
case 199 /* LiteralType */: {
|
|
151570
151590
|
const grandParent = walkUpParentheses(parent2.parent);
|
|
151571
|
-
|
|
151572
|
-
|
|
151591
|
+
switch (grandParent.kind) {
|
|
151592
|
+
case 231 /* ExpressionWithTypeArguments */:
|
|
151593
|
+
case 181 /* TypeReference */: {
|
|
151594
|
+
const typeArgument = findAncestor(parent2, (n) => n.parent === grandParent);
|
|
151595
|
+
if (typeArgument) {
|
|
151596
|
+
return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false };
|
|
151597
|
+
}
|
|
151598
|
+
return void 0;
|
|
151599
|
+
}
|
|
151600
|
+
case 197 /* IndexedAccessType */:
|
|
151601
|
+
const { indexType, objectType } = grandParent;
|
|
151602
|
+
if (!rangeContainsPosition(indexType, position)) {
|
|
151603
|
+
return void 0;
|
|
151604
|
+
}
|
|
151605
|
+
return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType));
|
|
151606
|
+
case 203 /* ImportType */:
|
|
151607
|
+
return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) };
|
|
151608
|
+
case 190 /* UnionType */: {
|
|
151609
|
+
if (!isTypeReferenceNode(grandParent.parent)) {
|
|
151610
|
+
return void 0;
|
|
151611
|
+
}
|
|
151612
|
+
const alreadyUsedTypes = getAlreadyUsedTypesInStringLiteralUnion(grandParent, parent2);
|
|
151613
|
+
const types = getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(grandParent)).filter((t) => !contains(alreadyUsedTypes, t.value));
|
|
151614
|
+
return { kind: 2 /* Types */, types, isNewIdentifier: false };
|
|
151615
|
+
}
|
|
151616
|
+
default:
|
|
151617
|
+
return void 0;
|
|
151573
151618
|
}
|
|
151574
|
-
return fromUnionableLiteralType(grandParent);
|
|
151575
151619
|
}
|
|
151576
151620
|
case 300 /* PropertyAssignment */:
|
|
151577
151621
|
if (isObjectLiteralExpression(parent2.parent) && parent2.name === node) {
|
|
@@ -151605,38 +151649,7 @@ ${lanes.join("\n")}
|
|
|
151605
151649
|
const literals = contextualTypes.types.filter((literal) => !tracker.hasValue(literal.value));
|
|
151606
151650
|
return { kind: 2 /* Types */, types: literals, isNewIdentifier: false };
|
|
151607
151651
|
default:
|
|
151608
|
-
return fromContextualType();
|
|
151609
|
-
}
|
|
151610
|
-
function fromUnionableLiteralType(grandParent) {
|
|
151611
|
-
switch (grandParent.kind) {
|
|
151612
|
-
case 231 /* ExpressionWithTypeArguments */:
|
|
151613
|
-
case 181 /* TypeReference */: {
|
|
151614
|
-
const typeArgument = findAncestor(parent2, (n) => n.parent === grandParent);
|
|
151615
|
-
if (typeArgument) {
|
|
151616
|
-
return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false };
|
|
151617
|
-
}
|
|
151618
|
-
return void 0;
|
|
151619
|
-
}
|
|
151620
|
-
case 197 /* IndexedAccessType */:
|
|
151621
|
-
const { indexType, objectType } = grandParent;
|
|
151622
|
-
if (!rangeContainsPosition(indexType, position)) {
|
|
151623
|
-
return void 0;
|
|
151624
|
-
}
|
|
151625
|
-
return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType));
|
|
151626
|
-
case 190 /* UnionType */: {
|
|
151627
|
-
const result = fromUnionableLiteralType(walkUpParentheses(grandParent.parent));
|
|
151628
|
-
if (!result) {
|
|
151629
|
-
return void 0;
|
|
151630
|
-
}
|
|
151631
|
-
const alreadyUsedTypes = getAlreadyUsedTypesInStringLiteralUnion(grandParent, parent2);
|
|
151632
|
-
if (result.kind === 1 /* Properties */) {
|
|
151633
|
-
return { kind: 1 /* Properties */, symbols: result.symbols.filter((sym) => !contains(alreadyUsedTypes, sym.name)), hasIndexSignature: result.hasIndexSignature };
|
|
151634
|
-
}
|
|
151635
|
-
return { kind: 2 /* Types */, types: result.types.filter((t) => !contains(alreadyUsedTypes, t.value)), isNewIdentifier: false };
|
|
151636
|
-
}
|
|
151637
|
-
default:
|
|
151638
|
-
return void 0;
|
|
151639
|
-
}
|
|
151652
|
+
return fromContextualType() || fromContextualType(0 /* None */);
|
|
151640
151653
|
}
|
|
151641
151654
|
function fromContextualType(contextFlags = 4 /* Completions */) {
|
|
151642
151655
|
const types = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags));
|
|
@@ -153330,7 +153343,7 @@ ${lanes.join("\n")}
|
|
|
153330
153343
|
((Core2) => {
|
|
153331
153344
|
function getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options = {}, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) {
|
|
153332
153345
|
var _a2, _b, _c;
|
|
153333
|
-
node =
|
|
153346
|
+
node = getAdjustedNode2(node, options);
|
|
153334
153347
|
if (isSourceFile(node)) {
|
|
153335
153348
|
const resolvedRef = ts_GoToDefinition_exports.getReferenceAtPosition(node, position, program);
|
|
153336
153349
|
if (!(resolvedRef == null ? void 0 : resolvedRef.file)) {
|
|
@@ -153398,7 +153411,7 @@ ${lanes.join("\n")}
|
|
|
153398
153411
|
return mergeReferences(program, moduleReferences, references, moduleReferencesOfExportTarget);
|
|
153399
153412
|
}
|
|
153400
153413
|
Core2.getReferencedSymbolsForNode = getReferencedSymbolsForNode;
|
|
153401
|
-
function
|
|
153414
|
+
function getAdjustedNode2(node, options) {
|
|
153402
153415
|
if (options.use === 1 /* References */) {
|
|
153403
153416
|
node = getAdjustedReferenceLocation(node);
|
|
153404
153417
|
} else if (options.use === 2 /* Rename */) {
|
|
@@ -153406,7 +153419,7 @@ ${lanes.join("\n")}
|
|
|
153406
153419
|
}
|
|
153407
153420
|
return node;
|
|
153408
153421
|
}
|
|
153409
|
-
Core2.getAdjustedNode =
|
|
153422
|
+
Core2.getAdjustedNode = getAdjustedNode2;
|
|
153410
153423
|
function getReferencesForFileName(fileName, program, sourceFiles, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) {
|
|
153411
153424
|
var _a2, _b;
|
|
153412
153425
|
const moduleSymbol = (_a2 = program.getSourceFile(fileName)) == null ? void 0 : _a2.symbol;
|
|
@@ -160874,9 +160887,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160874
160887
|
}
|
|
160875
160888
|
callArguments.push(factory.createIdentifier(name));
|
|
160876
160889
|
});
|
|
160877
|
-
const typeParametersAndDeclarations = arrayFrom(typeParameterUsages.values(), (type) => ({ type, declaration:
|
|
160890
|
+
const typeParametersAndDeclarations = arrayFrom(typeParameterUsages.values(), (type) => ({ type, declaration: getFirstDeclarationBeforePosition(type, context.startPosition) }));
|
|
160878
160891
|
const sortedTypeParametersAndDeclarations = typeParametersAndDeclarations.sort(compareTypesByDeclarationOrder);
|
|
160879
|
-
const typeParameters = sortedTypeParametersAndDeclarations.length === 0 ? void 0 : sortedTypeParametersAndDeclarations
|
|
160892
|
+
const typeParameters = sortedTypeParametersAndDeclarations.length === 0 ? void 0 : mapDefined(sortedTypeParametersAndDeclarations, ({ declaration }) => declaration);
|
|
160880
160893
|
const callTypeArguments = typeParameters !== void 0 ? typeParameters.map((decl) => factory.createTypeReferenceNode(
|
|
160881
160894
|
decl.name,
|
|
160882
160895
|
/*typeArguments*/
|
|
@@ -161353,12 +161366,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
161353
161366
|
node = node.parent;
|
|
161354
161367
|
}
|
|
161355
161368
|
}
|
|
161356
|
-
function
|
|
161369
|
+
function getFirstDeclarationBeforePosition(type, position) {
|
|
161357
161370
|
let firstDeclaration;
|
|
161358
161371
|
const symbol = type.symbol;
|
|
161359
161372
|
if (symbol && symbol.declarations) {
|
|
161360
161373
|
for (const declaration of symbol.declarations) {
|
|
161361
|
-
if (firstDeclaration === void 0 || declaration.pos < firstDeclaration.pos) {
|
|
161374
|
+
if ((firstDeclaration === void 0 || declaration.pos < firstDeclaration.pos) && declaration.pos < position) {
|
|
161362
161375
|
firstDeclaration = declaration;
|
|
161363
161376
|
}
|
|
161364
161377
|
}
|
|
@@ -162509,8 +162522,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162509
162522
|
return isBinaryExpression(b.left) ? countBinaryExpressionParameters(b.left) + 1 : 2;
|
|
162510
162523
|
}
|
|
162511
162524
|
function tryGetParameterInfo(startingToken, position, sourceFile, checker) {
|
|
162512
|
-
const
|
|
162513
|
-
if (
|
|
162525
|
+
const node = getAdjustedNode(startingToken);
|
|
162526
|
+
if (node === void 0)
|
|
162527
|
+
return void 0;
|
|
162528
|
+
const info = getContextualSignatureLocationInfo(node, sourceFile, position, checker);
|
|
162529
|
+
if (info === void 0)
|
|
162514
162530
|
return void 0;
|
|
162515
162531
|
const { contextualType, argumentIndex, argumentCount, argumentsSpan } = info;
|
|
162516
162532
|
const nonNullableContextualType = contextualType.getNonNullableType();
|
|
@@ -162523,16 +162539,23 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162523
162539
|
const invocation = { kind: 2 /* Contextual */, signature, node: startingToken, symbol: chooseBetterSymbol(symbol) };
|
|
162524
162540
|
return { isTypeParameterList: false, invocation, argumentsSpan, argumentIndex, argumentCount };
|
|
162525
162541
|
}
|
|
162526
|
-
function
|
|
162527
|
-
|
|
162528
|
-
|
|
162529
|
-
|
|
162542
|
+
function getAdjustedNode(node) {
|
|
162543
|
+
switch (node.kind) {
|
|
162544
|
+
case 20 /* OpenParenToken */:
|
|
162545
|
+
case 27 /* CommaToken */:
|
|
162546
|
+
return node;
|
|
162547
|
+
default:
|
|
162548
|
+
return findAncestor(node.parent, (n) => isParameter(n) ? true : isBindingElement(n) || isObjectBindingPattern(n) || isArrayBindingPattern(n) ? false : "quit");
|
|
162549
|
+
}
|
|
162550
|
+
}
|
|
162551
|
+
function getContextualSignatureLocationInfo(node, sourceFile, position, checker) {
|
|
162552
|
+
const { parent: parent2 } = node;
|
|
162530
162553
|
switch (parent2.kind) {
|
|
162531
162554
|
case 215 /* ParenthesizedExpression */:
|
|
162532
162555
|
case 172 /* MethodDeclaration */:
|
|
162533
162556
|
case 216 /* FunctionExpression */:
|
|
162534
162557
|
case 217 /* ArrowFunction */:
|
|
162535
|
-
const info = getArgumentOrParameterListInfo(
|
|
162558
|
+
const info = getArgumentOrParameterListInfo(node, position, sourceFile);
|
|
162536
162559
|
if (!info)
|
|
162537
162560
|
return void 0;
|
|
162538
162561
|
const { argumentIndex, argumentCount, argumentsSpan } = info;
|
|
@@ -162541,7 +162564,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162541
162564
|
case 224 /* BinaryExpression */: {
|
|
162542
162565
|
const highestBinary = getHighestBinary(parent2);
|
|
162543
162566
|
const contextualType2 = checker.getContextualType(highestBinary);
|
|
162544
|
-
const argumentIndex2 =
|
|
162567
|
+
const argumentIndex2 = node.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent2) - 1;
|
|
162545
162568
|
const argumentCount2 = countBinaryExpressionParameters(highestBinary);
|
|
162546
162569
|
return contextualType2 && { contextualType: contextualType2, argumentIndex: argumentIndex2, argumentCount: argumentCount2, argumentsSpan: createTextSpanFromNode(parent2) };
|
|
162547
162570
|
}
|
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.1";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230328`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -9056,7 +9056,8 @@ ${lanes.join("\n")}
|
|
|
9056
9056
|
_0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
|
|
9057
9057
|
_0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
|
|
9058
9058
|
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
|
|
9059
|
-
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.")
|
|
9059
|
+
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
|
|
9060
|
+
Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'")
|
|
9060
9061
|
};
|
|
9061
9062
|
}
|
|
9062
9063
|
});
|
|
@@ -80656,8 +80657,9 @@ ${lanes.join("\n")}
|
|
|
80656
80657
|
return filter(symbol.declarations, (d) => d.kind === 261 /* ClassDeclaration */ || d.kind === 262 /* InterfaceDeclaration */);
|
|
80657
80658
|
}
|
|
80658
80659
|
function checkKindsOfPropertyMemberOverrides(type, baseType) {
|
|
80659
|
-
var _a2, _b, _c, _d;
|
|
80660
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
80660
80661
|
const baseProperties = getPropertiesOfType(baseType);
|
|
80662
|
+
let inheritedAbstractMemberNotImplementedError;
|
|
80661
80663
|
basePropertyCheck:
|
|
80662
80664
|
for (const baseProperty of baseProperties) {
|
|
80663
80665
|
const base = getTargetSymbol(baseProperty);
|
|
@@ -80683,20 +80685,34 @@ ${lanes.join("\n")}
|
|
|
80683
80685
|
continue basePropertyCheck;
|
|
80684
80686
|
}
|
|
80685
80687
|
}
|
|
80686
|
-
if (
|
|
80687
|
-
error(
|
|
80688
|
+
if (!inheritedAbstractMemberNotImplementedError) {
|
|
80689
|
+
inheritedAbstractMemberNotImplementedError = error(
|
|
80688
80690
|
derivedClassDecl,
|
|
80689
|
-
Diagnostics.
|
|
80690
|
-
|
|
80691
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1,
|
|
80692
|
+
typeToString(type),
|
|
80691
80693
|
typeToString(baseType)
|
|
80692
80694
|
);
|
|
80695
|
+
}
|
|
80696
|
+
if (derivedClassDecl.kind === 229 /* ClassExpression */) {
|
|
80697
|
+
addRelatedInfo(
|
|
80698
|
+
inheritedAbstractMemberNotImplementedError,
|
|
80699
|
+
createDiagnosticForNode(
|
|
80700
|
+
(_b = (_a2 = baseProperty.valueDeclaration) != null ? _a2 : baseProperty.declarations && first(baseProperty.declarations)) != null ? _b : derivedClassDecl,
|
|
80701
|
+
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,
|
|
80702
|
+
symbolToString(baseProperty),
|
|
80703
|
+
typeToString(baseType)
|
|
80704
|
+
)
|
|
80705
|
+
);
|
|
80693
80706
|
} else {
|
|
80694
|
-
|
|
80695
|
-
|
|
80696
|
-
|
|
80697
|
-
|
|
80698
|
-
|
|
80699
|
-
|
|
80707
|
+
addRelatedInfo(
|
|
80708
|
+
inheritedAbstractMemberNotImplementedError,
|
|
80709
|
+
createDiagnosticForNode(
|
|
80710
|
+
(_d = (_c = baseProperty.valueDeclaration) != null ? _c : baseProperty.declarations && first(baseProperty.declarations)) != null ? _d : derivedClassDecl,
|
|
80711
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,
|
|
80712
|
+
typeToString(type),
|
|
80713
|
+
symbolToString(baseProperty),
|
|
80714
|
+
typeToString(baseType)
|
|
80715
|
+
)
|
|
80700
80716
|
);
|
|
80701
80717
|
}
|
|
80702
80718
|
}
|
|
@@ -80709,7 +80725,7 @@ ${lanes.join("\n")}
|
|
|
80709
80725
|
const basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
|
|
80710
80726
|
const derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
|
|
80711
80727
|
if (basePropertyFlags && derivedPropertyFlags) {
|
|
80712
|
-
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (
|
|
80728
|
+
if ((getCheckFlags(base) & 6 /* Synthetic */ ? (_e = base.declarations) == null ? void 0 : _e.some((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags)) : (_f = base.declarations) == null ? void 0 : _f.every((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags))) || getCheckFlags(base) & 262144 /* Mapped */ || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) {
|
|
80713
80729
|
continue;
|
|
80714
80730
|
}
|
|
80715
80731
|
const overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
|
|
@@ -80718,8 +80734,8 @@ ${lanes.join("\n")}
|
|
|
80718
80734
|
const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
|
|
80719
80735
|
error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
|
|
80720
80736
|
} else if (useDefineForClassFields) {
|
|
80721
|
-
const uninitialized = (
|
|
80722
|
-
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((
|
|
80737
|
+
const uninitialized = (_g = derived.declarations) == null ? void 0 : _g.find((d) => d.kind === 170 /* PropertyDeclaration */ && !d.initializer);
|
|
80738
|
+
if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 256 /* Abstract */) && !(derivedDeclarationFlags & 256 /* Abstract */) && !((_h = derived.declarations) == null ? void 0 : _h.some((d) => !!(d.flags & 16777216 /* Ambient */)))) {
|
|
80723
80739
|
const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
|
|
80724
80740
|
const propName = uninitialized.name;
|
|
80725
80741
|
if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName) || !strictNullChecks || !isPropertyInitializedInConstructor(propName, type, constructor)) {
|
|
@@ -91176,16 +91192,17 @@ ${lanes.join("\n")}
|
|
|
91176
91192
|
if (isAssignmentExpression(node)) {
|
|
91177
91193
|
if (isNamedEvaluation(node, isAnonymousClassNeedingAssignedName)) {
|
|
91178
91194
|
const assignedName = getAssignedNameOfIdentifier(node.left, node.right);
|
|
91179
|
-
const
|
|
91195
|
+
const left2 = visitNode(node.left, visitor, isExpression);
|
|
91180
91196
|
const right = visitNode(node.right, (node2) => namedEvaluationVisitor(node2, assignedName), isExpression);
|
|
91181
|
-
return factory2.updateBinaryExpression(node,
|
|
91197
|
+
return factory2.updateBinaryExpression(node, left2, node.operatorToken, right);
|
|
91182
91198
|
}
|
|
91183
|
-
|
|
91184
|
-
|
|
91199
|
+
const left = skipOuterExpressions(node.left, 8 /* PartiallyEmittedExpressions */ | 1 /* Parentheses */);
|
|
91200
|
+
if (isPrivateIdentifierPropertyAccessExpression(left)) {
|
|
91201
|
+
const info = accessPrivateIdentifier2(left.name);
|
|
91185
91202
|
if (info) {
|
|
91186
91203
|
return setTextRange(
|
|
91187
91204
|
setOriginalNode(
|
|
91188
|
-
createPrivateIdentifierAssignment(info,
|
|
91205
|
+
createPrivateIdentifierAssignment(info, left.expression, node.right, node.operatorToken.kind),
|
|
91189
91206
|
node
|
|
91190
91207
|
),
|
|
91191
91208
|
node
|
|
@@ -94138,10 +94155,14 @@ ${lanes.join("\n")}
|
|
|
94138
94155
|
visitor
|
|
94139
94156
|
);
|
|
94140
94157
|
const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart);
|
|
94141
|
-
|
|
94142
|
-
|
|
94143
|
-
|
|
94144
|
-
|
|
94158
|
+
if (superStatementIndex >= 0) {
|
|
94159
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, superStatementIndex + 1 - nonPrologueStart));
|
|
94160
|
+
addRange(statements, initializerStatements);
|
|
94161
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, superStatementIndex + 1));
|
|
94162
|
+
} else {
|
|
94163
|
+
addRange(statements, initializerStatements);
|
|
94164
|
+
addRange(statements, visitNodes2(node.body.statements, visitor, isStatement));
|
|
94165
|
+
}
|
|
94145
94166
|
body = factory2.createBlock(
|
|
94146
94167
|
statements,
|
|
94147
94168
|
/*multiLine*/
|
|
@@ -143561,8 +143582,7 @@ ${lanes.join("\n")}
|
|
|
143561
143582
|
init_ts4();
|
|
143562
143583
|
init_ts_codefix();
|
|
143563
143584
|
errorCodes30 = [
|
|
143564
|
-
Diagnostics.
|
|
143565
|
-
Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code
|
|
143585
|
+
Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1.code
|
|
143566
143586
|
];
|
|
143567
143587
|
fixId25 = "fixClassDoesntImplementInheritedAbstractMember";
|
|
143568
143588
|
registerCodeFix({
|
|
@@ -151582,10 +151602,34 @@ ${lanes.join("\n")}
|
|
|
151582
151602
|
switch (parent2.kind) {
|
|
151583
151603
|
case 199 /* LiteralType */: {
|
|
151584
151604
|
const grandParent = walkUpParentheses(parent2.parent);
|
|
151585
|
-
|
|
151586
|
-
|
|
151605
|
+
switch (grandParent.kind) {
|
|
151606
|
+
case 231 /* ExpressionWithTypeArguments */:
|
|
151607
|
+
case 181 /* TypeReference */: {
|
|
151608
|
+
const typeArgument = findAncestor(parent2, (n) => n.parent === grandParent);
|
|
151609
|
+
if (typeArgument) {
|
|
151610
|
+
return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false };
|
|
151611
|
+
}
|
|
151612
|
+
return void 0;
|
|
151613
|
+
}
|
|
151614
|
+
case 197 /* IndexedAccessType */:
|
|
151615
|
+
const { indexType, objectType } = grandParent;
|
|
151616
|
+
if (!rangeContainsPosition(indexType, position)) {
|
|
151617
|
+
return void 0;
|
|
151618
|
+
}
|
|
151619
|
+
return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType));
|
|
151620
|
+
case 203 /* ImportType */:
|
|
151621
|
+
return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) };
|
|
151622
|
+
case 190 /* UnionType */: {
|
|
151623
|
+
if (!isTypeReferenceNode(grandParent.parent)) {
|
|
151624
|
+
return void 0;
|
|
151625
|
+
}
|
|
151626
|
+
const alreadyUsedTypes = getAlreadyUsedTypesInStringLiteralUnion(grandParent, parent2);
|
|
151627
|
+
const types = getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(grandParent)).filter((t) => !contains(alreadyUsedTypes, t.value));
|
|
151628
|
+
return { kind: 2 /* Types */, types, isNewIdentifier: false };
|
|
151629
|
+
}
|
|
151630
|
+
default:
|
|
151631
|
+
return void 0;
|
|
151587
151632
|
}
|
|
151588
|
-
return fromUnionableLiteralType(grandParent);
|
|
151589
151633
|
}
|
|
151590
151634
|
case 300 /* PropertyAssignment */:
|
|
151591
151635
|
if (isObjectLiteralExpression(parent2.parent) && parent2.name === node) {
|
|
@@ -151619,38 +151663,7 @@ ${lanes.join("\n")}
|
|
|
151619
151663
|
const literals = contextualTypes.types.filter((literal) => !tracker.hasValue(literal.value));
|
|
151620
151664
|
return { kind: 2 /* Types */, types: literals, isNewIdentifier: false };
|
|
151621
151665
|
default:
|
|
151622
|
-
return fromContextualType();
|
|
151623
|
-
}
|
|
151624
|
-
function fromUnionableLiteralType(grandParent) {
|
|
151625
|
-
switch (grandParent.kind) {
|
|
151626
|
-
case 231 /* ExpressionWithTypeArguments */:
|
|
151627
|
-
case 181 /* TypeReference */: {
|
|
151628
|
-
const typeArgument = findAncestor(parent2, (n) => n.parent === grandParent);
|
|
151629
|
-
if (typeArgument) {
|
|
151630
|
-
return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false };
|
|
151631
|
-
}
|
|
151632
|
-
return void 0;
|
|
151633
|
-
}
|
|
151634
|
-
case 197 /* IndexedAccessType */:
|
|
151635
|
-
const { indexType, objectType } = grandParent;
|
|
151636
|
-
if (!rangeContainsPosition(indexType, position)) {
|
|
151637
|
-
return void 0;
|
|
151638
|
-
}
|
|
151639
|
-
return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType));
|
|
151640
|
-
case 190 /* UnionType */: {
|
|
151641
|
-
const result = fromUnionableLiteralType(walkUpParentheses(grandParent.parent));
|
|
151642
|
-
if (!result) {
|
|
151643
|
-
return void 0;
|
|
151644
|
-
}
|
|
151645
|
-
const alreadyUsedTypes = getAlreadyUsedTypesInStringLiteralUnion(grandParent, parent2);
|
|
151646
|
-
if (result.kind === 1 /* Properties */) {
|
|
151647
|
-
return { kind: 1 /* Properties */, symbols: result.symbols.filter((sym) => !contains(alreadyUsedTypes, sym.name)), hasIndexSignature: result.hasIndexSignature };
|
|
151648
|
-
}
|
|
151649
|
-
return { kind: 2 /* Types */, types: result.types.filter((t) => !contains(alreadyUsedTypes, t.value)), isNewIdentifier: false };
|
|
151650
|
-
}
|
|
151651
|
-
default:
|
|
151652
|
-
return void 0;
|
|
151653
|
-
}
|
|
151666
|
+
return fromContextualType() || fromContextualType(0 /* None */);
|
|
151654
151667
|
}
|
|
151655
151668
|
function fromContextualType(contextFlags = 4 /* Completions */) {
|
|
151656
151669
|
const types = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags));
|
|
@@ -153344,7 +153357,7 @@ ${lanes.join("\n")}
|
|
|
153344
153357
|
((Core2) => {
|
|
153345
153358
|
function getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options = {}, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) {
|
|
153346
153359
|
var _a2, _b, _c;
|
|
153347
|
-
node =
|
|
153360
|
+
node = getAdjustedNode2(node, options);
|
|
153348
153361
|
if (isSourceFile(node)) {
|
|
153349
153362
|
const resolvedRef = ts_GoToDefinition_exports.getReferenceAtPosition(node, position, program);
|
|
153350
153363
|
if (!(resolvedRef == null ? void 0 : resolvedRef.file)) {
|
|
@@ -153412,7 +153425,7 @@ ${lanes.join("\n")}
|
|
|
153412
153425
|
return mergeReferences(program, moduleReferences, references, moduleReferencesOfExportTarget);
|
|
153413
153426
|
}
|
|
153414
153427
|
Core2.getReferencedSymbolsForNode = getReferencedSymbolsForNode;
|
|
153415
|
-
function
|
|
153428
|
+
function getAdjustedNode2(node, options) {
|
|
153416
153429
|
if (options.use === 1 /* References */) {
|
|
153417
153430
|
node = getAdjustedReferenceLocation(node);
|
|
153418
153431
|
} else if (options.use === 2 /* Rename */) {
|
|
@@ -153420,7 +153433,7 @@ ${lanes.join("\n")}
|
|
|
153420
153433
|
}
|
|
153421
153434
|
return node;
|
|
153422
153435
|
}
|
|
153423
|
-
Core2.getAdjustedNode =
|
|
153436
|
+
Core2.getAdjustedNode = getAdjustedNode2;
|
|
153424
153437
|
function getReferencesForFileName(fileName, program, sourceFiles, sourceFilesSet = new Set(sourceFiles.map((f) => f.fileName))) {
|
|
153425
153438
|
var _a2, _b;
|
|
153426
153439
|
const moduleSymbol = (_a2 = program.getSourceFile(fileName)) == null ? void 0 : _a2.symbol;
|
|
@@ -160888,9 +160901,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
160888
160901
|
}
|
|
160889
160902
|
callArguments.push(factory.createIdentifier(name));
|
|
160890
160903
|
});
|
|
160891
|
-
const typeParametersAndDeclarations = arrayFrom(typeParameterUsages.values(), (type) => ({ type, declaration:
|
|
160904
|
+
const typeParametersAndDeclarations = arrayFrom(typeParameterUsages.values(), (type) => ({ type, declaration: getFirstDeclarationBeforePosition(type, context.startPosition) }));
|
|
160892
160905
|
const sortedTypeParametersAndDeclarations = typeParametersAndDeclarations.sort(compareTypesByDeclarationOrder);
|
|
160893
|
-
const typeParameters = sortedTypeParametersAndDeclarations.length === 0 ? void 0 : sortedTypeParametersAndDeclarations
|
|
160906
|
+
const typeParameters = sortedTypeParametersAndDeclarations.length === 0 ? void 0 : mapDefined(sortedTypeParametersAndDeclarations, ({ declaration }) => declaration);
|
|
160894
160907
|
const callTypeArguments = typeParameters !== void 0 ? typeParameters.map((decl) => factory.createTypeReferenceNode(
|
|
160895
160908
|
decl.name,
|
|
160896
160909
|
/*typeArguments*/
|
|
@@ -161367,12 +161380,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
161367
161380
|
node = node.parent;
|
|
161368
161381
|
}
|
|
161369
161382
|
}
|
|
161370
|
-
function
|
|
161383
|
+
function getFirstDeclarationBeforePosition(type, position) {
|
|
161371
161384
|
let firstDeclaration;
|
|
161372
161385
|
const symbol = type.symbol;
|
|
161373
161386
|
if (symbol && symbol.declarations) {
|
|
161374
161387
|
for (const declaration of symbol.declarations) {
|
|
161375
|
-
if (firstDeclaration === void 0 || declaration.pos < firstDeclaration.pos) {
|
|
161388
|
+
if ((firstDeclaration === void 0 || declaration.pos < firstDeclaration.pos) && declaration.pos < position) {
|
|
161376
161389
|
firstDeclaration = declaration;
|
|
161377
161390
|
}
|
|
161378
161391
|
}
|
|
@@ -162523,8 +162536,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162523
162536
|
return isBinaryExpression(b.left) ? countBinaryExpressionParameters(b.left) + 1 : 2;
|
|
162524
162537
|
}
|
|
162525
162538
|
function tryGetParameterInfo(startingToken, position, sourceFile, checker) {
|
|
162526
|
-
const
|
|
162527
|
-
if (
|
|
162539
|
+
const node = getAdjustedNode(startingToken);
|
|
162540
|
+
if (node === void 0)
|
|
162541
|
+
return void 0;
|
|
162542
|
+
const info = getContextualSignatureLocationInfo(node, sourceFile, position, checker);
|
|
162543
|
+
if (info === void 0)
|
|
162528
162544
|
return void 0;
|
|
162529
162545
|
const { contextualType, argumentIndex, argumentCount, argumentsSpan } = info;
|
|
162530
162546
|
const nonNullableContextualType = contextualType.getNonNullableType();
|
|
@@ -162537,16 +162553,23 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162537
162553
|
const invocation = { kind: 2 /* Contextual */, signature, node: startingToken, symbol: chooseBetterSymbol(symbol) };
|
|
162538
162554
|
return { isTypeParameterList: false, invocation, argumentsSpan, argumentIndex, argumentCount };
|
|
162539
162555
|
}
|
|
162540
|
-
function
|
|
162541
|
-
|
|
162542
|
-
|
|
162543
|
-
|
|
162556
|
+
function getAdjustedNode(node) {
|
|
162557
|
+
switch (node.kind) {
|
|
162558
|
+
case 20 /* OpenParenToken */:
|
|
162559
|
+
case 27 /* CommaToken */:
|
|
162560
|
+
return node;
|
|
162561
|
+
default:
|
|
162562
|
+
return findAncestor(node.parent, (n) => isParameter(n) ? true : isBindingElement(n) || isObjectBindingPattern(n) || isArrayBindingPattern(n) ? false : "quit");
|
|
162563
|
+
}
|
|
162564
|
+
}
|
|
162565
|
+
function getContextualSignatureLocationInfo(node, sourceFile, position, checker) {
|
|
162566
|
+
const { parent: parent2 } = node;
|
|
162544
162567
|
switch (parent2.kind) {
|
|
162545
162568
|
case 215 /* ParenthesizedExpression */:
|
|
162546
162569
|
case 172 /* MethodDeclaration */:
|
|
162547
162570
|
case 216 /* FunctionExpression */:
|
|
162548
162571
|
case 217 /* ArrowFunction */:
|
|
162549
|
-
const info = getArgumentOrParameterListInfo(
|
|
162572
|
+
const info = getArgumentOrParameterListInfo(node, position, sourceFile);
|
|
162550
162573
|
if (!info)
|
|
162551
162574
|
return void 0;
|
|
162552
162575
|
const { argumentIndex, argumentCount, argumentsSpan } = info;
|
|
@@ -162555,7 +162578,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
162555
162578
|
case 224 /* BinaryExpression */: {
|
|
162556
162579
|
const highestBinary = getHighestBinary(parent2);
|
|
162557
162580
|
const contextualType2 = checker.getContextualType(highestBinary);
|
|
162558
|
-
const argumentIndex2 =
|
|
162581
|
+
const argumentIndex2 = node.kind === 20 /* OpenParenToken */ ? 0 : countBinaryExpressionParameters(parent2) - 1;
|
|
162559
162582
|
const argumentCount2 = countBinaryExpressionParameters(highestBinary);
|
|
162560
162583
|
return contextualType2 && { contextualType: contextualType2, argumentIndex: argumentIndex2, argumentCount: argumentCount2, argumentsSpan: createTextSpanFromNode(parent2) };
|
|
162561
162584
|
}
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.1";
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20230328`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -7120,7 +7120,8 @@ var Diagnostics = {
|
|
|
7120
7120
|
_0_is_possibly_undefined: diag(18048, 1 /* Error */, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
|
|
7121
7121
|
_0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
|
|
7122
7122
|
The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
|
|
7123
|
-
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string.")
|
|
7123
|
+
Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
|
|
7124
|
+
Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'")
|
|
7124
7125
|
};
|
|
7125
7126
|
|
|
7126
7127
|
// src/compiler/scanner.ts
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.1.0-pr-
|
|
5
|
+
"version": "5.1.0-pr-52840-4",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"node": "14.21.1",
|
|
115
115
|
"npm": "8.19.3"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "23770b0defac3e1a7e70e24a5ece622625a10321"
|
|
118
118
|
}
|