@typescript-deploys/pr-build 5.1.0-pr-53502-7 → 5.1.0-pr-53225-3
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 +11 -5
- package/lib/tsserver.js +45 -32
- package/lib/tsserverlibrary.js +45 -32
- package/lib/typescript.js +45 -32
- package/lib/typingsInstaller.js +1 -1
- 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.20230327`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -49912,6 +49912,7 @@ function createTypeChecker(host) {
|
|
|
49912
49912
|
), 0 /* None */);
|
|
49913
49913
|
}
|
|
49914
49914
|
function serializeMaybeAliasAssignment(symbol) {
|
|
49915
|
+
var _a2;
|
|
49915
49916
|
if (symbol.flags & 4194304 /* Prototype */) {
|
|
49916
49917
|
return false;
|
|
49917
49918
|
}
|
|
@@ -49991,7 +49992,7 @@ function createTypeChecker(host) {
|
|
|
49991
49992
|
void 0,
|
|
49992
49993
|
serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled)
|
|
49993
49994
|
)
|
|
49994
|
-
], 2 /* Const */)
|
|
49995
|
+
], ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 265 /* ModuleDeclaration */ ? 1 /* Let */ : 2 /* Const */)
|
|
49995
49996
|
);
|
|
49996
49997
|
addResult(
|
|
49997
49998
|
statement,
|
|
@@ -50027,7 +50028,7 @@ function createTypeChecker(host) {
|
|
|
50027
50028
|
if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) {
|
|
50028
50029
|
return [];
|
|
50029
50030
|
}
|
|
50030
|
-
if (p.flags & 4194304 /* Prototype */ || baseType && getPropertyOfType(baseType, p.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p.escapedName)) === isReadonlySymbol(p) && (p.flags & 16777216 /* Optional */) === (getPropertyOfType(baseType, p.escapedName).flags & 16777216 /* Optional */) && isTypeIdenticalTo(getTypeOfSymbol(p), getTypeOfPropertyOfType(baseType, p.escapedName))) {
|
|
50031
|
+
if (p.flags & 4194304 /* Prototype */ || p.escapedName === "constructor" || baseType && getPropertyOfType(baseType, p.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p.escapedName)) === isReadonlySymbol(p) && (p.flags & 16777216 /* Optional */) === (getPropertyOfType(baseType, p.escapedName).flags & 16777216 /* Optional */) && isTypeIdenticalTo(getTypeOfSymbol(p), getTypeOfPropertyOfType(baseType, p.escapedName))) {
|
|
50031
50032
|
return [];
|
|
50032
50033
|
}
|
|
50033
50034
|
const flag = modifierFlags & ~512 /* Async */ | (isStatic2 ? 32 /* Static */ : 0);
|
|
@@ -53527,6 +53528,9 @@ function createTypeChecker(host) {
|
|
|
53527
53528
|
return type.resolvedDefaultConstraint;
|
|
53528
53529
|
}
|
|
53529
53530
|
function getConstraintOfDistributiveConditionalType(type) {
|
|
53531
|
+
if (type.resolvedConstraintOfDistributive !== void 0) {
|
|
53532
|
+
return type.resolvedConstraintOfDistributive || void 0;
|
|
53533
|
+
}
|
|
53530
53534
|
if (type.root.isDistributive && type.restrictiveInstantiation !== type) {
|
|
53531
53535
|
const simplified = getSimplifiedType(
|
|
53532
53536
|
type.checkType,
|
|
@@ -53537,10 +53541,12 @@ function createTypeChecker(host) {
|
|
|
53537
53541
|
if (constraint && constraint !== type.checkType) {
|
|
53538
53542
|
const instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));
|
|
53539
53543
|
if (!(instantiated.flags & 131072 /* Never */)) {
|
|
53544
|
+
type.resolvedConstraintOfDistributive = instantiated;
|
|
53540
53545
|
return instantiated;
|
|
53541
53546
|
}
|
|
53542
53547
|
}
|
|
53543
53548
|
}
|
|
53549
|
+
type.resolvedConstraintOfDistributive = false;
|
|
53544
53550
|
return void 0;
|
|
53545
53551
|
}
|
|
53546
53552
|
function getConstraintFromConditionalType(type) {
|
|
@@ -66803,7 +66809,7 @@ function createTypeChecker(host) {
|
|
|
66803
66809
|
return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType(conditional, contextFlags) : void 0;
|
|
66804
66810
|
}
|
|
66805
66811
|
function getContextualTypeForChildJsxExpression(node, child, contextFlags) {
|
|
66806
|
-
const attributesType = getApparentTypeOfContextualType(node.openingElement.
|
|
66812
|
+
const attributesType = getApparentTypeOfContextualType(node.openingElement.tagName, contextFlags);
|
|
66807
66813
|
const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node));
|
|
66808
66814
|
if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) {
|
|
66809
66815
|
return void 0;
|
|
@@ -72228,7 +72234,7 @@ function createTypeChecker(host) {
|
|
|
72228
72234
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics() {
|
|
72229
72235
|
const functionFlags = getFunctionFlags(func);
|
|
72230
72236
|
const type = returnType && unwrapReturnType(returnType, functionFlags);
|
|
72231
|
-
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */)) {
|
|
72237
|
+
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */ | 2 /* Unknown */)) {
|
|
72232
72238
|
return;
|
|
72233
72239
|
}
|
|
72234
72240
|
if (func.kind === 171 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 239 /* Block */ || !functionHasImplicitReturn(func)) {
|
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.20230327`;
|
|
2290
2290
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2291
2291
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2292
2292
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -54554,6 +54554,7 @@ function createTypeChecker(host) {
|
|
|
54554
54554
|
), 0 /* None */);
|
|
54555
54555
|
}
|
|
54556
54556
|
function serializeMaybeAliasAssignment(symbol) {
|
|
54557
|
+
var _a2;
|
|
54557
54558
|
if (symbol.flags & 4194304 /* Prototype */) {
|
|
54558
54559
|
return false;
|
|
54559
54560
|
}
|
|
@@ -54633,7 +54634,7 @@ function createTypeChecker(host) {
|
|
|
54633
54634
|
void 0,
|
|
54634
54635
|
serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled)
|
|
54635
54636
|
)
|
|
54636
|
-
], 2 /* Const */)
|
|
54637
|
+
], ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 265 /* ModuleDeclaration */ ? 1 /* Let */ : 2 /* Const */)
|
|
54637
54638
|
);
|
|
54638
54639
|
addResult(
|
|
54639
54640
|
statement,
|
|
@@ -54669,7 +54670,7 @@ function createTypeChecker(host) {
|
|
|
54669
54670
|
if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) {
|
|
54670
54671
|
return [];
|
|
54671
54672
|
}
|
|
54672
|
-
if (p.flags & 4194304 /* Prototype */ || baseType && getPropertyOfType(baseType, p.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p.escapedName)) === isReadonlySymbol(p) && (p.flags & 16777216 /* Optional */) === (getPropertyOfType(baseType, p.escapedName).flags & 16777216 /* Optional */) && isTypeIdenticalTo(getTypeOfSymbol(p), getTypeOfPropertyOfType(baseType, p.escapedName))) {
|
|
54673
|
+
if (p.flags & 4194304 /* Prototype */ || p.escapedName === "constructor" || baseType && getPropertyOfType(baseType, p.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p.escapedName)) === isReadonlySymbol(p) && (p.flags & 16777216 /* Optional */) === (getPropertyOfType(baseType, p.escapedName).flags & 16777216 /* Optional */) && isTypeIdenticalTo(getTypeOfSymbol(p), getTypeOfPropertyOfType(baseType, p.escapedName))) {
|
|
54673
54674
|
return [];
|
|
54674
54675
|
}
|
|
54675
54676
|
const flag = modifierFlags & ~512 /* Async */ | (isStatic2 ? 32 /* Static */ : 0);
|
|
@@ -58169,6 +58170,9 @@ function createTypeChecker(host) {
|
|
|
58169
58170
|
return type.resolvedDefaultConstraint;
|
|
58170
58171
|
}
|
|
58171
58172
|
function getConstraintOfDistributiveConditionalType(type) {
|
|
58173
|
+
if (type.resolvedConstraintOfDistributive !== void 0) {
|
|
58174
|
+
return type.resolvedConstraintOfDistributive || void 0;
|
|
58175
|
+
}
|
|
58172
58176
|
if (type.root.isDistributive && type.restrictiveInstantiation !== type) {
|
|
58173
58177
|
const simplified = getSimplifiedType(
|
|
58174
58178
|
type.checkType,
|
|
@@ -58179,10 +58183,12 @@ function createTypeChecker(host) {
|
|
|
58179
58183
|
if (constraint && constraint !== type.checkType) {
|
|
58180
58184
|
const instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));
|
|
58181
58185
|
if (!(instantiated.flags & 131072 /* Never */)) {
|
|
58186
|
+
type.resolvedConstraintOfDistributive = instantiated;
|
|
58182
58187
|
return instantiated;
|
|
58183
58188
|
}
|
|
58184
58189
|
}
|
|
58185
58190
|
}
|
|
58191
|
+
type.resolvedConstraintOfDistributive = false;
|
|
58186
58192
|
return void 0;
|
|
58187
58193
|
}
|
|
58188
58194
|
function getConstraintFromConditionalType(type) {
|
|
@@ -71445,7 +71451,7 @@ function createTypeChecker(host) {
|
|
|
71445
71451
|
return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType2(conditional, contextFlags) : void 0;
|
|
71446
71452
|
}
|
|
71447
71453
|
function getContextualTypeForChildJsxExpression(node, child, contextFlags) {
|
|
71448
|
-
const attributesType = getApparentTypeOfContextualType(node.openingElement.
|
|
71454
|
+
const attributesType = getApparentTypeOfContextualType(node.openingElement.tagName, contextFlags);
|
|
71449
71455
|
const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node));
|
|
71450
71456
|
if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) {
|
|
71451
71457
|
return void 0;
|
|
@@ -76870,7 +76876,7 @@ function createTypeChecker(host) {
|
|
|
76870
76876
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics() {
|
|
76871
76877
|
const functionFlags = getFunctionFlags(func);
|
|
76872
76878
|
const type = returnType && unwrapReturnType(returnType, functionFlags);
|
|
76873
|
-
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */)) {
|
|
76879
|
+
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */ | 2 /* Unknown */)) {
|
|
76874
76880
|
return;
|
|
76875
76881
|
}
|
|
76876
76882
|
if (func.kind === 171 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 239 /* Block */ || !functionHasImplicitReturn(func)) {
|
|
@@ -152465,34 +152471,10 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
|
|
|
152465
152471
|
switch (parent2.kind) {
|
|
152466
152472
|
case 199 /* LiteralType */: {
|
|
152467
152473
|
const grandParent = walkUpParentheses(parent2.parent);
|
|
152468
|
-
|
|
152469
|
-
|
|
152470
|
-
case 181 /* TypeReference */: {
|
|
152471
|
-
const typeArgument = findAncestor(parent2, (n) => n.parent === grandParent);
|
|
152472
|
-
if (typeArgument) {
|
|
152473
|
-
return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false };
|
|
152474
|
-
}
|
|
152475
|
-
return void 0;
|
|
152476
|
-
}
|
|
152477
|
-
case 197 /* IndexedAccessType */:
|
|
152478
|
-
const { indexType, objectType } = grandParent;
|
|
152479
|
-
if (!rangeContainsPosition(indexType, position)) {
|
|
152480
|
-
return void 0;
|
|
152481
|
-
}
|
|
152482
|
-
return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType));
|
|
152483
|
-
case 203 /* ImportType */:
|
|
152484
|
-
return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) };
|
|
152485
|
-
case 190 /* UnionType */: {
|
|
152486
|
-
if (!isTypeReferenceNode(grandParent.parent)) {
|
|
152487
|
-
return void 0;
|
|
152488
|
-
}
|
|
152489
|
-
const alreadyUsedTypes = getAlreadyUsedTypesInStringLiteralUnion(grandParent, parent2);
|
|
152490
|
-
const types = getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(grandParent)).filter((t) => !contains(alreadyUsedTypes, t.value));
|
|
152491
|
-
return { kind: 2 /* Types */, types, isNewIdentifier: false };
|
|
152492
|
-
}
|
|
152493
|
-
default:
|
|
152494
|
-
return void 0;
|
|
152474
|
+
if (grandParent.kind === 203 /* ImportType */) {
|
|
152475
|
+
return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) };
|
|
152495
152476
|
}
|
|
152477
|
+
return fromUnionableLiteralType(grandParent);
|
|
152496
152478
|
}
|
|
152497
152479
|
case 300 /* PropertyAssignment */:
|
|
152498
152480
|
if (isObjectLiteralExpression(parent2.parent) && parent2.name === node) {
|
|
@@ -152528,6 +152510,37 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, typeCheck
|
|
|
152528
152510
|
default:
|
|
152529
152511
|
return fromContextualType();
|
|
152530
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
|
+
}
|
|
152543
|
+
}
|
|
152531
152544
|
function fromContextualType(contextFlags = 4 /* Completions */) {
|
|
152532
152545
|
const types = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags));
|
|
152533
152546
|
if (!types.length) {
|
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.20230327`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -52362,6 +52362,7 @@ ${lanes.join("\n")}
|
|
|
52362
52362
|
), 0 /* None */);
|
|
52363
52363
|
}
|
|
52364
52364
|
function serializeMaybeAliasAssignment(symbol) {
|
|
52365
|
+
var _a2;
|
|
52365
52366
|
if (symbol.flags & 4194304 /* Prototype */) {
|
|
52366
52367
|
return false;
|
|
52367
52368
|
}
|
|
@@ -52441,7 +52442,7 @@ ${lanes.join("\n")}
|
|
|
52441
52442
|
void 0,
|
|
52442
52443
|
serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled)
|
|
52443
52444
|
)
|
|
52444
|
-
], 2 /* Const */)
|
|
52445
|
+
], ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 265 /* ModuleDeclaration */ ? 1 /* Let */ : 2 /* Const */)
|
|
52445
52446
|
);
|
|
52446
52447
|
addResult(
|
|
52447
52448
|
statement,
|
|
@@ -52477,7 +52478,7 @@ ${lanes.join("\n")}
|
|
|
52477
52478
|
if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) {
|
|
52478
52479
|
return [];
|
|
52479
52480
|
}
|
|
52480
|
-
if (p.flags & 4194304 /* Prototype */ || baseType && getPropertyOfType(baseType, p.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p.escapedName)) === isReadonlySymbol(p) && (p.flags & 16777216 /* Optional */) === (getPropertyOfType(baseType, p.escapedName).flags & 16777216 /* Optional */) && isTypeIdenticalTo(getTypeOfSymbol(p), getTypeOfPropertyOfType(baseType, p.escapedName))) {
|
|
52481
|
+
if (p.flags & 4194304 /* Prototype */ || p.escapedName === "constructor" || baseType && getPropertyOfType(baseType, p.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p.escapedName)) === isReadonlySymbol(p) && (p.flags & 16777216 /* Optional */) === (getPropertyOfType(baseType, p.escapedName).flags & 16777216 /* Optional */) && isTypeIdenticalTo(getTypeOfSymbol(p), getTypeOfPropertyOfType(baseType, p.escapedName))) {
|
|
52481
52482
|
return [];
|
|
52482
52483
|
}
|
|
52483
52484
|
const flag = modifierFlags & ~512 /* Async */ | (isStatic2 ? 32 /* Static */ : 0);
|
|
@@ -55977,6 +55978,9 @@ ${lanes.join("\n")}
|
|
|
55977
55978
|
return type.resolvedDefaultConstraint;
|
|
55978
55979
|
}
|
|
55979
55980
|
function getConstraintOfDistributiveConditionalType(type) {
|
|
55981
|
+
if (type.resolvedConstraintOfDistributive !== void 0) {
|
|
55982
|
+
return type.resolvedConstraintOfDistributive || void 0;
|
|
55983
|
+
}
|
|
55980
55984
|
if (type.root.isDistributive && type.restrictiveInstantiation !== type) {
|
|
55981
55985
|
const simplified = getSimplifiedType(
|
|
55982
55986
|
type.checkType,
|
|
@@ -55987,10 +55991,12 @@ ${lanes.join("\n")}
|
|
|
55987
55991
|
if (constraint && constraint !== type.checkType) {
|
|
55988
55992
|
const instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));
|
|
55989
55993
|
if (!(instantiated.flags & 131072 /* Never */)) {
|
|
55994
|
+
type.resolvedConstraintOfDistributive = instantiated;
|
|
55990
55995
|
return instantiated;
|
|
55991
55996
|
}
|
|
55992
55997
|
}
|
|
55993
55998
|
}
|
|
55999
|
+
type.resolvedConstraintOfDistributive = false;
|
|
55994
56000
|
return void 0;
|
|
55995
56001
|
}
|
|
55996
56002
|
function getConstraintFromConditionalType(type) {
|
|
@@ -69253,7 +69259,7 @@ ${lanes.join("\n")}
|
|
|
69253
69259
|
return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType2(conditional, contextFlags) : void 0;
|
|
69254
69260
|
}
|
|
69255
69261
|
function getContextualTypeForChildJsxExpression(node, child, contextFlags) {
|
|
69256
|
-
const attributesType = getApparentTypeOfContextualType(node.openingElement.
|
|
69262
|
+
const attributesType = getApparentTypeOfContextualType(node.openingElement.tagName, contextFlags);
|
|
69257
69263
|
const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node));
|
|
69258
69264
|
if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) {
|
|
69259
69265
|
return void 0;
|
|
@@ -74678,7 +74684,7 @@ ${lanes.join("\n")}
|
|
|
74678
74684
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics() {
|
|
74679
74685
|
const functionFlags = getFunctionFlags(func);
|
|
74680
74686
|
const type = returnType && unwrapReturnType(returnType, functionFlags);
|
|
74681
|
-
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */)) {
|
|
74687
|
+
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */ | 2 /* Unknown */)) {
|
|
74682
74688
|
return;
|
|
74683
74689
|
}
|
|
74684
74690
|
if (func.kind === 171 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 239 /* Block */ || !functionHasImplicitReturn(func)) {
|
|
@@ -151562,34 +151568,10 @@ ${lanes.join("\n")}
|
|
|
151562
151568
|
switch (parent2.kind) {
|
|
151563
151569
|
case 199 /* LiteralType */: {
|
|
151564
151570
|
const grandParent = walkUpParentheses(parent2.parent);
|
|
151565
|
-
|
|
151566
|
-
|
|
151567
|
-
case 181 /* TypeReference */: {
|
|
151568
|
-
const typeArgument = findAncestor(parent2, (n) => n.parent === grandParent);
|
|
151569
|
-
if (typeArgument) {
|
|
151570
|
-
return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false };
|
|
151571
|
-
}
|
|
151572
|
-
return void 0;
|
|
151573
|
-
}
|
|
151574
|
-
case 197 /* IndexedAccessType */:
|
|
151575
|
-
const { indexType, objectType } = grandParent;
|
|
151576
|
-
if (!rangeContainsPosition(indexType, position)) {
|
|
151577
|
-
return void 0;
|
|
151578
|
-
}
|
|
151579
|
-
return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType));
|
|
151580
|
-
case 203 /* ImportType */:
|
|
151581
|
-
return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) };
|
|
151582
|
-
case 190 /* UnionType */: {
|
|
151583
|
-
if (!isTypeReferenceNode(grandParent.parent)) {
|
|
151584
|
-
return void 0;
|
|
151585
|
-
}
|
|
151586
|
-
const alreadyUsedTypes = getAlreadyUsedTypesInStringLiteralUnion(grandParent, parent2);
|
|
151587
|
-
const types = getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(grandParent)).filter((t) => !contains(alreadyUsedTypes, t.value));
|
|
151588
|
-
return { kind: 2 /* Types */, types, isNewIdentifier: false };
|
|
151589
|
-
}
|
|
151590
|
-
default:
|
|
151591
|
-
return void 0;
|
|
151571
|
+
if (grandParent.kind === 203 /* ImportType */) {
|
|
151572
|
+
return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) };
|
|
151592
151573
|
}
|
|
151574
|
+
return fromUnionableLiteralType(grandParent);
|
|
151593
151575
|
}
|
|
151594
151576
|
case 300 /* PropertyAssignment */:
|
|
151595
151577
|
if (isObjectLiteralExpression(parent2.parent) && parent2.name === node) {
|
|
@@ -151625,6 +151607,37 @@ ${lanes.join("\n")}
|
|
|
151625
151607
|
default:
|
|
151626
151608
|
return fromContextualType();
|
|
151627
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
|
+
}
|
|
151640
|
+
}
|
|
151628
151641
|
function fromContextualType(contextFlags = 4 /* Completions */) {
|
|
151629
151642
|
const types = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags));
|
|
151630
151643
|
if (!types.length) {
|
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.20230327`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -52362,6 +52362,7 @@ ${lanes.join("\n")}
|
|
|
52362
52362
|
), 0 /* None */);
|
|
52363
52363
|
}
|
|
52364
52364
|
function serializeMaybeAliasAssignment(symbol) {
|
|
52365
|
+
var _a2;
|
|
52365
52366
|
if (symbol.flags & 4194304 /* Prototype */) {
|
|
52366
52367
|
return false;
|
|
52367
52368
|
}
|
|
@@ -52441,7 +52442,7 @@ ${lanes.join("\n")}
|
|
|
52441
52442
|
void 0,
|
|
52442
52443
|
serializeTypeForDeclaration(context, typeToSerialize, symbol, enclosingDeclaration, includePrivateSymbol, bundled)
|
|
52443
52444
|
)
|
|
52444
|
-
], 2 /* Const */)
|
|
52445
|
+
], ((_a2 = context.enclosingDeclaration) == null ? void 0 : _a2.kind) === 265 /* ModuleDeclaration */ ? 1 /* Let */ : 2 /* Const */)
|
|
52445
52446
|
);
|
|
52446
52447
|
addResult(
|
|
52447
52448
|
statement,
|
|
@@ -52477,7 +52478,7 @@ ${lanes.join("\n")}
|
|
|
52477
52478
|
if (isStatic2 && p.flags & (788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)) {
|
|
52478
52479
|
return [];
|
|
52479
52480
|
}
|
|
52480
|
-
if (p.flags & 4194304 /* Prototype */ || baseType && getPropertyOfType(baseType, p.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p.escapedName)) === isReadonlySymbol(p) && (p.flags & 16777216 /* Optional */) === (getPropertyOfType(baseType, p.escapedName).flags & 16777216 /* Optional */) && isTypeIdenticalTo(getTypeOfSymbol(p), getTypeOfPropertyOfType(baseType, p.escapedName))) {
|
|
52481
|
+
if (p.flags & 4194304 /* Prototype */ || p.escapedName === "constructor" || baseType && getPropertyOfType(baseType, p.escapedName) && isReadonlySymbol(getPropertyOfType(baseType, p.escapedName)) === isReadonlySymbol(p) && (p.flags & 16777216 /* Optional */) === (getPropertyOfType(baseType, p.escapedName).flags & 16777216 /* Optional */) && isTypeIdenticalTo(getTypeOfSymbol(p), getTypeOfPropertyOfType(baseType, p.escapedName))) {
|
|
52481
52482
|
return [];
|
|
52482
52483
|
}
|
|
52483
52484
|
const flag = modifierFlags & ~512 /* Async */ | (isStatic2 ? 32 /* Static */ : 0);
|
|
@@ -55977,6 +55978,9 @@ ${lanes.join("\n")}
|
|
|
55977
55978
|
return type.resolvedDefaultConstraint;
|
|
55978
55979
|
}
|
|
55979
55980
|
function getConstraintOfDistributiveConditionalType(type) {
|
|
55981
|
+
if (type.resolvedConstraintOfDistributive !== void 0) {
|
|
55982
|
+
return type.resolvedConstraintOfDistributive || void 0;
|
|
55983
|
+
}
|
|
55980
55984
|
if (type.root.isDistributive && type.restrictiveInstantiation !== type) {
|
|
55981
55985
|
const simplified = getSimplifiedType(
|
|
55982
55986
|
type.checkType,
|
|
@@ -55987,10 +55991,12 @@ ${lanes.join("\n")}
|
|
|
55987
55991
|
if (constraint && constraint !== type.checkType) {
|
|
55988
55992
|
const instantiated = getConditionalTypeInstantiation(type, prependTypeMapping(type.root.checkType, constraint, type.mapper));
|
|
55989
55993
|
if (!(instantiated.flags & 131072 /* Never */)) {
|
|
55994
|
+
type.resolvedConstraintOfDistributive = instantiated;
|
|
55990
55995
|
return instantiated;
|
|
55991
55996
|
}
|
|
55992
55997
|
}
|
|
55993
55998
|
}
|
|
55999
|
+
type.resolvedConstraintOfDistributive = false;
|
|
55994
56000
|
return void 0;
|
|
55995
56001
|
}
|
|
55996
56002
|
function getConstraintFromConditionalType(type) {
|
|
@@ -69253,7 +69259,7 @@ ${lanes.join("\n")}
|
|
|
69253
69259
|
return node === conditional.whenTrue || node === conditional.whenFalse ? getContextualType2(conditional, contextFlags) : void 0;
|
|
69254
69260
|
}
|
|
69255
69261
|
function getContextualTypeForChildJsxExpression(node, child, contextFlags) {
|
|
69256
|
-
const attributesType = getApparentTypeOfContextualType(node.openingElement.
|
|
69262
|
+
const attributesType = getApparentTypeOfContextualType(node.openingElement.tagName, contextFlags);
|
|
69257
69263
|
const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node));
|
|
69258
69264
|
if (!(attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "")) {
|
|
69259
69265
|
return void 0;
|
|
@@ -74678,7 +74684,7 @@ ${lanes.join("\n")}
|
|
|
74678
74684
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics() {
|
|
74679
74685
|
const functionFlags = getFunctionFlags(func);
|
|
74680
74686
|
const type = returnType && unwrapReturnType(returnType, functionFlags);
|
|
74681
|
-
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */)) {
|
|
74687
|
+
if (type && maybeTypeOfKind(type, 32768 /* Undefined */ | 16384 /* Void */ | 1 /* Any */ | 2 /* Unknown */)) {
|
|
74682
74688
|
return;
|
|
74683
74689
|
}
|
|
74684
74690
|
if (func.kind === 171 /* MethodSignature */ || nodeIsMissing(func.body) || func.body.kind !== 239 /* Block */ || !functionHasImplicitReturn(func)) {
|
|
@@ -151576,34 +151582,10 @@ ${lanes.join("\n")}
|
|
|
151576
151582
|
switch (parent2.kind) {
|
|
151577
151583
|
case 199 /* LiteralType */: {
|
|
151578
151584
|
const grandParent = walkUpParentheses(parent2.parent);
|
|
151579
|
-
|
|
151580
|
-
|
|
151581
|
-
case 181 /* TypeReference */: {
|
|
151582
|
-
const typeArgument = findAncestor(parent2, (n) => n.parent === grandParent);
|
|
151583
|
-
if (typeArgument) {
|
|
151584
|
-
return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(typeArgument)), isNewIdentifier: false };
|
|
151585
|
-
}
|
|
151586
|
-
return void 0;
|
|
151587
|
-
}
|
|
151588
|
-
case 197 /* IndexedAccessType */:
|
|
151589
|
-
const { indexType, objectType } = grandParent;
|
|
151590
|
-
if (!rangeContainsPosition(indexType, position)) {
|
|
151591
|
-
return void 0;
|
|
151592
|
-
}
|
|
151593
|
-
return stringLiteralCompletionsFromProperties(typeChecker.getTypeFromTypeNode(objectType));
|
|
151594
|
-
case 203 /* ImportType */:
|
|
151595
|
-
return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) };
|
|
151596
|
-
case 190 /* UnionType */: {
|
|
151597
|
-
if (!isTypeReferenceNode(grandParent.parent)) {
|
|
151598
|
-
return void 0;
|
|
151599
|
-
}
|
|
151600
|
-
const alreadyUsedTypes = getAlreadyUsedTypesInStringLiteralUnion(grandParent, parent2);
|
|
151601
|
-
const types = getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(grandParent)).filter((t) => !contains(alreadyUsedTypes, t.value));
|
|
151602
|
-
return { kind: 2 /* Types */, types, isNewIdentifier: false };
|
|
151603
|
-
}
|
|
151604
|
-
default:
|
|
151605
|
-
return void 0;
|
|
151585
|
+
if (grandParent.kind === 203 /* ImportType */) {
|
|
151586
|
+
return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker, preferences) };
|
|
151606
151587
|
}
|
|
151588
|
+
return fromUnionableLiteralType(grandParent);
|
|
151607
151589
|
}
|
|
151608
151590
|
case 300 /* PropertyAssignment */:
|
|
151609
151591
|
if (isObjectLiteralExpression(parent2.parent) && parent2.name === node) {
|
|
@@ -151639,6 +151621,37 @@ ${lanes.join("\n")}
|
|
|
151639
151621
|
default:
|
|
151640
151622
|
return fromContextualType();
|
|
151641
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
|
+
}
|
|
151654
|
+
}
|
|
151642
151655
|
function fromContextualType(contextFlags = 4 /* Completions */) {
|
|
151643
151656
|
const types = getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker, contextFlags));
|
|
151644
151657
|
if (!types.length) {
|
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.20230327`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
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-53225-3",
|
|
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": "40752246a29a1d9984ce52601e401eb72bbec8bb"
|
|
118
118
|
}
|