@typescript-deploys/pr-build 5.4.0-pr-56640-15 → 5.4.0-pr-56555-7
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 +25 -27
- package/lib/tsserver.js +30 -36
- package/lib/typescript.d.ts +6 -0
- package/lib/typescript.js +30 -36
- package/lib/typingsInstaller.js +4 -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.4";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20231208`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -18839,8 +18839,10 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
18839
18839
|
return update(updated, original);
|
|
18840
18840
|
}
|
|
18841
18841
|
function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
|
|
18842
|
+
const text = typeof value === "number" ? value + "" : value;
|
|
18843
|
+
Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
|
|
18842
18844
|
const node = createBaseDeclaration(9 /* NumericLiteral */);
|
|
18843
|
-
node.text =
|
|
18845
|
+
node.text = text;
|
|
18844
18846
|
node.numericLiteralFlags = numericLiteralFlags;
|
|
18845
18847
|
if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
|
|
18846
18848
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
|
@@ -64305,16 +64307,6 @@ function createTypeChecker(host) {
|
|
|
64305
64307
|
} else if (target.flags & 134217728 /* TemplateLiteral */) {
|
|
64306
64308
|
inferToTemplateLiteralType(source, target);
|
|
64307
64309
|
} else {
|
|
64308
|
-
if (isGenericMappedType(source) && isGenericMappedType(target)) {
|
|
64309
|
-
invokeOnce(source, target, (source2, target2) => {
|
|
64310
|
-
inferFromTypes(getConstraintTypeFromMappedType(source2), getConstraintTypeFromMappedType(target2));
|
|
64311
|
-
inferFromTypes(getTemplateTypeFromMappedType(source2), getTemplateTypeFromMappedType(target2));
|
|
64312
|
-
const sourceNameType = getNameTypeFromMappedType(source2);
|
|
64313
|
-
const targetNameType = getNameTypeFromMappedType(target2);
|
|
64314
|
-
if (sourceNameType && targetNameType)
|
|
64315
|
-
inferFromTypes(sourceNameType, targetNameType);
|
|
64316
|
-
});
|
|
64317
|
-
}
|
|
64318
64310
|
source = getReducedType(source);
|
|
64319
64311
|
if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
|
|
64320
64312
|
const apparentSource = getApparentType(source);
|
|
@@ -68810,7 +68802,7 @@ function createTypeChecker(host) {
|
|
|
68810
68802
|
/*contextFlags*/
|
|
68811
68803
|
void 0
|
|
68812
68804
|
);
|
|
68813
|
-
const inTupleContext = isSpreadIntoCallOrNew(node) || !!contextualType && someType(contextualType, isTupleLikeType);
|
|
68805
|
+
const inTupleContext = isSpreadIntoCallOrNew(node) || !!contextualType && someType(contextualType, (t) => isTupleLikeType(t) || isGenericMappedType(t) && !t.nameType && !!getHomomorphicTypeVariable(t.target || t));
|
|
68814
68806
|
let hasOmittedExpression = false;
|
|
68815
68807
|
for (let i = 0; i < elementCount; i++) {
|
|
68816
68808
|
const e = elements[i];
|
|
@@ -82657,7 +82649,7 @@ function createTypeChecker(host) {
|
|
|
82657
82649
|
if (enumResult)
|
|
82658
82650
|
return enumResult;
|
|
82659
82651
|
const literalValue = type.value;
|
|
82660
|
-
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "
|
|
82652
|
+
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "string" ? factory.createStringLiteral(literalValue) : literalValue < 0 ? factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(-literalValue)) : factory.createNumericLiteral(literalValue);
|
|
82661
82653
|
}
|
|
82662
82654
|
function createLiteralConstValue(node, tracker) {
|
|
82663
82655
|
const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
|
|
@@ -89086,7 +89078,7 @@ function transformTypeScript(context) {
|
|
|
89086
89078
|
function transformEnumMemberDeclarationValue(member) {
|
|
89087
89079
|
const value = resolver.getConstantValue(member);
|
|
89088
89080
|
if (value !== void 0) {
|
|
89089
|
-
return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
|
|
89081
|
+
return typeof value === "string" ? factory2.createStringLiteral(value) : value < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-value)) : factory2.createNumericLiteral(value);
|
|
89090
89082
|
} else {
|
|
89091
89083
|
enableSubstitutionForNonQualifiedEnumMembers();
|
|
89092
89084
|
if (member.initializer) {
|
|
@@ -89616,7 +89608,7 @@ function transformTypeScript(context) {
|
|
|
89616
89608
|
const constantValue = tryGetConstEnumValue(node);
|
|
89617
89609
|
if (constantValue !== void 0) {
|
|
89618
89610
|
setConstantValue(node, constantValue);
|
|
89619
|
-
const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(
|
|
89611
|
+
const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constantValue)) : factory2.createNumericLiteral(constantValue);
|
|
89620
89612
|
if (!compilerOptions.removeComments) {
|
|
89621
89613
|
const originalNode = getOriginalNode(node, isAccessExpression);
|
|
89622
89614
|
addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, ` ${safeMultiLineComment(getTextOfNode(originalNode))} `);
|
|
@@ -103406,7 +103398,7 @@ function transformGenerators(context) {
|
|
|
103406
103398
|
if (labelExpressions === void 0) {
|
|
103407
103399
|
labelExpressions = [];
|
|
103408
103400
|
}
|
|
103409
|
-
const expression = factory2.createNumericLiteral(
|
|
103401
|
+
const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER);
|
|
103410
103402
|
if (labelExpressions[label] === void 0) {
|
|
103411
103403
|
labelExpressions[label] = [expression];
|
|
103412
103404
|
} else {
|
|
@@ -109281,7 +109273,8 @@ function transformDeclarations(context) {
|
|
|
109281
109273
|
if (shouldStripInternal(m))
|
|
109282
109274
|
return;
|
|
109283
109275
|
const constValue = resolver.getConstantValue(m);
|
|
109284
|
-
|
|
109276
|
+
const newInitializer = constValue === void 0 ? void 0 : typeof constValue === "string" ? factory2.createStringLiteral(constValue) : constValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constValue)) : factory2.createNumericLiteral(constValue);
|
|
109277
|
+
return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
|
|
109285
109278
|
}))
|
|
109286
109279
|
));
|
|
109287
109280
|
}
|
|
@@ -111171,6 +111164,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
111171
111164
|
);
|
|
111172
111165
|
if (hint === 3 /* MappedTypeParameter */)
|
|
111173
111166
|
return emitMappedTypeParameter(cast(node, isTypeParameterDeclaration));
|
|
111167
|
+
if (hint === 7 /* ImportTypeNodeAttributes */)
|
|
111168
|
+
return emitImportTypeNodeAttributes(cast(node, isImportAttributes));
|
|
111174
111169
|
if (hint === 5 /* EmbeddedStatement */) {
|
|
111175
111170
|
Debug.assertNode(node, isEmptyStatement);
|
|
111176
111171
|
return emitEmptyStatement(
|
|
@@ -112147,15 +112142,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
112147
112142
|
if (node.attributes) {
|
|
112148
112143
|
writePunctuation(",");
|
|
112149
112144
|
writeSpace();
|
|
112150
|
-
|
|
112151
|
-
writeSpace();
|
|
112152
|
-
writeKeyword(node.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
|
|
112153
|
-
writePunctuation(":");
|
|
112154
|
-
writeSpace();
|
|
112155
|
-
const elements = node.attributes.elements;
|
|
112156
|
-
emitList(node.attributes, elements, 526226 /* ImportAttributes */);
|
|
112157
|
-
writeSpace();
|
|
112158
|
-
writePunctuation("}");
|
|
112145
|
+
pipelineEmit(7 /* ImportTypeNodeAttributes */, node.attributes);
|
|
112159
112146
|
}
|
|
112160
112147
|
writePunctuation(")");
|
|
112161
112148
|
if (node.qualifier) {
|
|
@@ -113217,6 +113204,17 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
113217
113204
|
}
|
|
113218
113205
|
writeTrailingSemicolon();
|
|
113219
113206
|
}
|
|
113207
|
+
function emitImportTypeNodeAttributes(node) {
|
|
113208
|
+
writePunctuation("{");
|
|
113209
|
+
writeSpace();
|
|
113210
|
+
writeKeyword(node.token === 132 /* AssertKeyword */ ? "assert" : "with");
|
|
113211
|
+
writePunctuation(":");
|
|
113212
|
+
writeSpace();
|
|
113213
|
+
const elements = node.elements;
|
|
113214
|
+
emitList(node, elements, 526226 /* ImportAttributes */);
|
|
113215
|
+
writeSpace();
|
|
113216
|
+
writePunctuation("}");
|
|
113217
|
+
}
|
|
113220
113218
|
function emitImportAttributes(node) {
|
|
113221
113219
|
emitTokenWithComment(node.token, node.pos, writeKeyword, node);
|
|
113222
113220
|
writeSpace();
|
package/lib/tsserver.js
CHANGED
|
@@ -2334,7 +2334,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2334
2334
|
|
|
2335
2335
|
// src/compiler/corePublic.ts
|
|
2336
2336
|
var versionMajorMinor = "5.4";
|
|
2337
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2337
|
+
var version = `${versionMajorMinor}.0-insiders.20231208`;
|
|
2338
2338
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2339
2339
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2340
2340
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -7291,6 +7291,7 @@ var EmitHint = /* @__PURE__ */ ((EmitHint6) => {
|
|
|
7291
7291
|
EmitHint6[EmitHint6["Unspecified"] = 4] = "Unspecified";
|
|
7292
7292
|
EmitHint6[EmitHint6["EmbeddedStatement"] = 5] = "EmbeddedStatement";
|
|
7293
7293
|
EmitHint6[EmitHint6["JsxAttributeValue"] = 6] = "JsxAttributeValue";
|
|
7294
|
+
EmitHint6[EmitHint6["ImportTypeNodeAttributes"] = 7] = "ImportTypeNodeAttributes";
|
|
7294
7295
|
return EmitHint6;
|
|
7295
7296
|
})(EmitHint || {});
|
|
7296
7297
|
var OuterExpressionKinds = /* @__PURE__ */ ((OuterExpressionKinds2) => {
|
|
@@ -23072,8 +23073,10 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
23072
23073
|
return update(updated, original);
|
|
23073
23074
|
}
|
|
23074
23075
|
function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
|
|
23076
|
+
const text = typeof value === "number" ? value + "" : value;
|
|
23077
|
+
Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
|
|
23075
23078
|
const node = createBaseDeclaration(9 /* NumericLiteral */);
|
|
23076
|
-
node.text =
|
|
23079
|
+
node.text = text;
|
|
23077
23080
|
node.numericLiteralFlags = numericLiteralFlags;
|
|
23078
23081
|
if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
|
|
23079
23082
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
|
@@ -69034,16 +69037,6 @@ function createTypeChecker(host) {
|
|
|
69034
69037
|
} else if (target.flags & 134217728 /* TemplateLiteral */) {
|
|
69035
69038
|
inferToTemplateLiteralType(source, target);
|
|
69036
69039
|
} else {
|
|
69037
|
-
if (isGenericMappedType(source) && isGenericMappedType(target)) {
|
|
69038
|
-
invokeOnce(source, target, (source2, target2) => {
|
|
69039
|
-
inferFromTypes(getConstraintTypeFromMappedType(source2), getConstraintTypeFromMappedType(target2));
|
|
69040
|
-
inferFromTypes(getTemplateTypeFromMappedType(source2), getTemplateTypeFromMappedType(target2));
|
|
69041
|
-
const sourceNameType = getNameTypeFromMappedType(source2);
|
|
69042
|
-
const targetNameType = getNameTypeFromMappedType(target2);
|
|
69043
|
-
if (sourceNameType && targetNameType)
|
|
69044
|
-
inferFromTypes(sourceNameType, targetNameType);
|
|
69045
|
-
});
|
|
69046
|
-
}
|
|
69047
69040
|
source = getReducedType(source);
|
|
69048
69041
|
if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
|
|
69049
69042
|
const apparentSource = getApparentType(source);
|
|
@@ -73539,7 +73532,7 @@ function createTypeChecker(host) {
|
|
|
73539
73532
|
/*contextFlags*/
|
|
73540
73533
|
void 0
|
|
73541
73534
|
);
|
|
73542
|
-
const inTupleContext = isSpreadIntoCallOrNew(node) || !!contextualType && someType(contextualType, isTupleLikeType);
|
|
73535
|
+
const inTupleContext = isSpreadIntoCallOrNew(node) || !!contextualType && someType(contextualType, (t) => isTupleLikeType(t) || isGenericMappedType(t) && !t.nameType && !!getHomomorphicTypeVariable(t.target || t));
|
|
73543
73536
|
let hasOmittedExpression = false;
|
|
73544
73537
|
for (let i = 0; i < elementCount; i++) {
|
|
73545
73538
|
const e = elements[i];
|
|
@@ -87386,7 +87379,7 @@ function createTypeChecker(host) {
|
|
|
87386
87379
|
if (enumResult)
|
|
87387
87380
|
return enumResult;
|
|
87388
87381
|
const literalValue = type.value;
|
|
87389
|
-
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "
|
|
87382
|
+
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "string" ? factory.createStringLiteral(literalValue) : literalValue < 0 ? factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(-literalValue)) : factory.createNumericLiteral(literalValue);
|
|
87390
87383
|
}
|
|
87391
87384
|
function createLiteralConstValue(node, tracker) {
|
|
87392
87385
|
const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
|
|
@@ -93986,7 +93979,7 @@ function transformTypeScript(context) {
|
|
|
93986
93979
|
function transformEnumMemberDeclarationValue(member) {
|
|
93987
93980
|
const value = resolver.getConstantValue(member);
|
|
93988
93981
|
if (value !== void 0) {
|
|
93989
|
-
return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
|
|
93982
|
+
return typeof value === "string" ? factory2.createStringLiteral(value) : value < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-value)) : factory2.createNumericLiteral(value);
|
|
93990
93983
|
} else {
|
|
93991
93984
|
enableSubstitutionForNonQualifiedEnumMembers();
|
|
93992
93985
|
if (member.initializer) {
|
|
@@ -94516,7 +94509,7 @@ function transformTypeScript(context) {
|
|
|
94516
94509
|
const constantValue = tryGetConstEnumValue(node);
|
|
94517
94510
|
if (constantValue !== void 0) {
|
|
94518
94511
|
setConstantValue(node, constantValue);
|
|
94519
|
-
const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(
|
|
94512
|
+
const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constantValue)) : factory2.createNumericLiteral(constantValue);
|
|
94520
94513
|
if (!compilerOptions.removeComments) {
|
|
94521
94514
|
const originalNode = getOriginalNode(node, isAccessExpression);
|
|
94522
94515
|
addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, ` ${safeMultiLineComment(getTextOfNode(originalNode))} `);
|
|
@@ -108306,7 +108299,7 @@ function transformGenerators(context) {
|
|
|
108306
108299
|
if (labelExpressions === void 0) {
|
|
108307
108300
|
labelExpressions = [];
|
|
108308
108301
|
}
|
|
108309
|
-
const expression = factory2.createNumericLiteral(
|
|
108302
|
+
const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER);
|
|
108310
108303
|
if (labelExpressions[label] === void 0) {
|
|
108311
108304
|
labelExpressions[label] = [expression];
|
|
108312
108305
|
} else {
|
|
@@ -114181,7 +114174,8 @@ function transformDeclarations(context) {
|
|
|
114181
114174
|
if (shouldStripInternal(m))
|
|
114182
114175
|
return;
|
|
114183
114176
|
const constValue = resolver.getConstantValue(m);
|
|
114184
|
-
|
|
114177
|
+
const newInitializer = constValue === void 0 ? void 0 : typeof constValue === "string" ? factory2.createStringLiteral(constValue) : constValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constValue)) : factory2.createNumericLiteral(constValue);
|
|
114178
|
+
return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
|
|
114185
114179
|
}))
|
|
114186
114180
|
));
|
|
114187
114181
|
}
|
|
@@ -116082,6 +116076,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
116082
116076
|
);
|
|
116083
116077
|
if (hint === 3 /* MappedTypeParameter */)
|
|
116084
116078
|
return emitMappedTypeParameter(cast(node, isTypeParameterDeclaration));
|
|
116079
|
+
if (hint === 7 /* ImportTypeNodeAttributes */)
|
|
116080
|
+
return emitImportTypeNodeAttributes(cast(node, isImportAttributes));
|
|
116085
116081
|
if (hint === 5 /* EmbeddedStatement */) {
|
|
116086
116082
|
Debug.assertNode(node, isEmptyStatement);
|
|
116087
116083
|
return emitEmptyStatement(
|
|
@@ -117058,15 +117054,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
117058
117054
|
if (node.attributes) {
|
|
117059
117055
|
writePunctuation(",");
|
|
117060
117056
|
writeSpace();
|
|
117061
|
-
|
|
117062
|
-
writeSpace();
|
|
117063
|
-
writeKeyword(node.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
|
|
117064
|
-
writePunctuation(":");
|
|
117065
|
-
writeSpace();
|
|
117066
|
-
const elements = node.attributes.elements;
|
|
117067
|
-
emitList(node.attributes, elements, 526226 /* ImportAttributes */);
|
|
117068
|
-
writeSpace();
|
|
117069
|
-
writePunctuation("}");
|
|
117057
|
+
pipelineEmit(7 /* ImportTypeNodeAttributes */, node.attributes);
|
|
117070
117058
|
}
|
|
117071
117059
|
writePunctuation(")");
|
|
117072
117060
|
if (node.qualifier) {
|
|
@@ -118128,6 +118116,17 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
118128
118116
|
}
|
|
118129
118117
|
writeTrailingSemicolon();
|
|
118130
118118
|
}
|
|
118119
|
+
function emitImportTypeNodeAttributes(node) {
|
|
118120
|
+
writePunctuation("{");
|
|
118121
|
+
writeSpace();
|
|
118122
|
+
writeKeyword(node.token === 132 /* AssertKeyword */ ? "assert" : "with");
|
|
118123
|
+
writePunctuation(":");
|
|
118124
|
+
writeSpace();
|
|
118125
|
+
const elements = node.elements;
|
|
118126
|
+
emitList(node, elements, 526226 /* ImportAttributes */);
|
|
118127
|
+
writeSpace();
|
|
118128
|
+
writePunctuation("}");
|
|
118129
|
+
}
|
|
118131
118130
|
function emitImportAttributes(node) {
|
|
118132
118131
|
emitTokenWithComment(node.token, node.pos, writeKeyword, node);
|
|
118133
118132
|
writeSpace();
|
|
@@ -159771,7 +159770,6 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
159771
159770
|
}
|
|
159772
159771
|
const semanticStart = timestamp();
|
|
159773
159772
|
let completionKind = 5 /* None */;
|
|
159774
|
-
let isNonContextualObjectLiteral = false;
|
|
159775
159773
|
let hasUnresolvedAutoImports = false;
|
|
159776
159774
|
let symbols = [];
|
|
159777
159775
|
let importSpecifierResolver;
|
|
@@ -160131,8 +160129,6 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
160131
160129
|
function shouldOfferImportCompletions() {
|
|
160132
160130
|
if (importStatementCompletion)
|
|
160133
160131
|
return true;
|
|
160134
|
-
if (isNonContextualObjectLiteral)
|
|
160135
|
-
return false;
|
|
160136
160132
|
if (!preferences.includeCompletionsForModuleExports)
|
|
160137
160133
|
return false;
|
|
160138
160134
|
if (sourceFile.externalModuleIndicator || sourceFile.commonJsModuleIndicator)
|
|
@@ -160435,7 +160431,6 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
160435
160431
|
if (objectLikeContainer.flags & 67108864 /* InWithStatement */) {
|
|
160436
160432
|
return 2 /* Fail */;
|
|
160437
160433
|
}
|
|
160438
|
-
isNonContextualObjectLiteral = true;
|
|
160439
160434
|
return 0 /* Continue */;
|
|
160440
160435
|
}
|
|
160441
160436
|
const completionsType = typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */);
|
|
@@ -160446,7 +160441,6 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
160446
160441
|
existingMembers = objectLikeContainer.properties;
|
|
160447
160442
|
if (typeMembers.length === 0) {
|
|
160448
160443
|
if (!hasNumberIndextype) {
|
|
160449
|
-
isNonContextualObjectLiteral = true;
|
|
160450
160444
|
return 0 /* Continue */;
|
|
160451
160445
|
}
|
|
160452
160446
|
}
|
|
@@ -167631,16 +167625,16 @@ function getRenameInfoForModule(node, sourceFile, moduleSymbol) {
|
|
|
167631
167625
|
if (!moduleSourceFile)
|
|
167632
167626
|
return void 0;
|
|
167633
167627
|
const withoutIndex = endsWith(node.text, "/index") || endsWith(node.text, "/index.js") ? void 0 : tryRemoveSuffix(removeFileExtension(moduleSourceFile.fileName), "/index");
|
|
167634
|
-
const
|
|
167628
|
+
const fileName = withoutIndex === void 0 ? moduleSourceFile.fileName : withoutIndex;
|
|
167635
167629
|
const kind = withoutIndex === void 0 ? "module" /* moduleElement */ : "directory" /* directory */;
|
|
167636
167630
|
const indexAfterLastSlash = node.text.lastIndexOf("/") + 1;
|
|
167637
167631
|
const triggerSpan = createTextSpan(node.getStart(sourceFile) + 1 + indexAfterLastSlash, node.text.length - indexAfterLastSlash);
|
|
167638
167632
|
return {
|
|
167639
167633
|
canRename: true,
|
|
167640
|
-
fileToRename:
|
|
167634
|
+
fileToRename: fileName,
|
|
167641
167635
|
kind,
|
|
167642
|
-
displayName:
|
|
167643
|
-
fullDisplayName:
|
|
167636
|
+
displayName: fileName,
|
|
167637
|
+
fullDisplayName: node.text,
|
|
167644
167638
|
kindModifiers: "" /* none */,
|
|
167645
167639
|
triggerSpan
|
|
167646
167640
|
};
|
package/lib/typescript.d.ts
CHANGED
|
@@ -1087,6 +1087,7 @@ declare namespace ts {
|
|
|
1087
1087
|
displayName: string;
|
|
1088
1088
|
/**
|
|
1089
1089
|
* Full display name of item to be renamed.
|
|
1090
|
+
* If item to be renamed is a file, then this is the original text of the module specifer
|
|
1090
1091
|
*/
|
|
1091
1092
|
fullDisplayName: string;
|
|
1092
1093
|
/**
|
|
@@ -7896,6 +7897,7 @@ declare namespace ts {
|
|
|
7896
7897
|
Unspecified = 4,
|
|
7897
7898
|
EmbeddedStatement = 5,
|
|
7898
7899
|
JsxAttributeValue = 6,
|
|
7900
|
+
ImportTypeNodeAttributes = 7,
|
|
7899
7901
|
}
|
|
7900
7902
|
enum OuterExpressionKinds {
|
|
7901
7903
|
Parentheses = 1,
|
|
@@ -11091,6 +11093,10 @@ declare namespace ts {
|
|
|
11091
11093
|
*/
|
|
11092
11094
|
fileToRename?: string;
|
|
11093
11095
|
displayName: string;
|
|
11096
|
+
/**
|
|
11097
|
+
* Full display name of item to be renamed.
|
|
11098
|
+
* If item to be renamed is a file, then this is the original text of the module specifer
|
|
11099
|
+
*/
|
|
11094
11100
|
fullDisplayName: string;
|
|
11095
11101
|
kind: ScriptElementKind;
|
|
11096
11102
|
kindModifiers: string;
|
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.4";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20231208`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -5046,6 +5046,7 @@ ${lanes.join("\n")}
|
|
|
5046
5046
|
EmitHint6[EmitHint6["Unspecified"] = 4] = "Unspecified";
|
|
5047
5047
|
EmitHint6[EmitHint6["EmbeddedStatement"] = 5] = "EmbeddedStatement";
|
|
5048
5048
|
EmitHint6[EmitHint6["JsxAttributeValue"] = 6] = "JsxAttributeValue";
|
|
5049
|
+
EmitHint6[EmitHint6["ImportTypeNodeAttributes"] = 7] = "ImportTypeNodeAttributes";
|
|
5049
5050
|
return EmitHint6;
|
|
5050
5051
|
})(EmitHint || {});
|
|
5051
5052
|
OuterExpressionKinds = /* @__PURE__ */ ((OuterExpressionKinds2) => {
|
|
@@ -20880,8 +20881,10 @@ ${lanes.join("\n")}
|
|
|
20880
20881
|
return update(updated, original);
|
|
20881
20882
|
}
|
|
20882
20883
|
function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
|
|
20884
|
+
const text = typeof value === "number" ? value + "" : value;
|
|
20885
|
+
Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
|
|
20883
20886
|
const node = createBaseDeclaration(9 /* NumericLiteral */);
|
|
20884
|
-
node.text =
|
|
20887
|
+
node.text = text;
|
|
20885
20888
|
node.numericLiteralFlags = numericLiteralFlags;
|
|
20886
20889
|
if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
|
|
20887
20890
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
|
@@ -66795,16 +66798,6 @@ ${lanes.join("\n")}
|
|
|
66795
66798
|
} else if (target.flags & 134217728 /* TemplateLiteral */) {
|
|
66796
66799
|
inferToTemplateLiteralType(source, target);
|
|
66797
66800
|
} else {
|
|
66798
|
-
if (isGenericMappedType(source) && isGenericMappedType(target)) {
|
|
66799
|
-
invokeOnce(source, target, (source2, target2) => {
|
|
66800
|
-
inferFromTypes(getConstraintTypeFromMappedType(source2), getConstraintTypeFromMappedType(target2));
|
|
66801
|
-
inferFromTypes(getTemplateTypeFromMappedType(source2), getTemplateTypeFromMappedType(target2));
|
|
66802
|
-
const sourceNameType = getNameTypeFromMappedType(source2);
|
|
66803
|
-
const targetNameType = getNameTypeFromMappedType(target2);
|
|
66804
|
-
if (sourceNameType && targetNameType)
|
|
66805
|
-
inferFromTypes(sourceNameType, targetNameType);
|
|
66806
|
-
});
|
|
66807
|
-
}
|
|
66808
66801
|
source = getReducedType(source);
|
|
66809
66802
|
if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
|
|
66810
66803
|
const apparentSource = getApparentType(source);
|
|
@@ -71300,7 +71293,7 @@ ${lanes.join("\n")}
|
|
|
71300
71293
|
/*contextFlags*/
|
|
71301
71294
|
void 0
|
|
71302
71295
|
);
|
|
71303
|
-
const inTupleContext = isSpreadIntoCallOrNew(node) || !!contextualType && someType(contextualType, isTupleLikeType);
|
|
71296
|
+
const inTupleContext = isSpreadIntoCallOrNew(node) || !!contextualType && someType(contextualType, (t) => isTupleLikeType(t) || isGenericMappedType(t) && !t.nameType && !!getHomomorphicTypeVariable(t.target || t));
|
|
71304
71297
|
let hasOmittedExpression = false;
|
|
71305
71298
|
for (let i = 0; i < elementCount; i++) {
|
|
71306
71299
|
const e = elements[i];
|
|
@@ -85147,7 +85140,7 @@ ${lanes.join("\n")}
|
|
|
85147
85140
|
if (enumResult)
|
|
85148
85141
|
return enumResult;
|
|
85149
85142
|
const literalValue = type.value;
|
|
85150
|
-
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "
|
|
85143
|
+
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "string" ? factory.createStringLiteral(literalValue) : literalValue < 0 ? factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(-literalValue)) : factory.createNumericLiteral(literalValue);
|
|
85151
85144
|
}
|
|
85152
85145
|
function createLiteralConstValue(node, tracker) {
|
|
85153
85146
|
const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
|
|
@@ -91927,7 +91920,7 @@ ${lanes.join("\n")}
|
|
|
91927
91920
|
function transformEnumMemberDeclarationValue(member) {
|
|
91928
91921
|
const value = resolver.getConstantValue(member);
|
|
91929
91922
|
if (value !== void 0) {
|
|
91930
|
-
return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
|
|
91923
|
+
return typeof value === "string" ? factory2.createStringLiteral(value) : value < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-value)) : factory2.createNumericLiteral(value);
|
|
91931
91924
|
} else {
|
|
91932
91925
|
enableSubstitutionForNonQualifiedEnumMembers();
|
|
91933
91926
|
if (member.initializer) {
|
|
@@ -92457,7 +92450,7 @@ ${lanes.join("\n")}
|
|
|
92457
92450
|
const constantValue = tryGetConstEnumValue(node);
|
|
92458
92451
|
if (constantValue !== void 0) {
|
|
92459
92452
|
setConstantValue(node, constantValue);
|
|
92460
|
-
const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(
|
|
92453
|
+
const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constantValue)) : factory2.createNumericLiteral(constantValue);
|
|
92461
92454
|
if (!compilerOptions.removeComments) {
|
|
92462
92455
|
const originalNode = getOriginalNode(node, isAccessExpression);
|
|
92463
92456
|
addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, ` ${safeMultiLineComment(getTextOfNode(originalNode))} `);
|
|
@@ -106340,7 +106333,7 @@ ${lanes.join("\n")}
|
|
|
106340
106333
|
if (labelExpressions === void 0) {
|
|
106341
106334
|
labelExpressions = [];
|
|
106342
106335
|
}
|
|
106343
|
-
const expression = factory2.createNumericLiteral(
|
|
106336
|
+
const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER);
|
|
106344
106337
|
if (labelExpressions[label] === void 0) {
|
|
106345
106338
|
labelExpressions[label] = [expression];
|
|
106346
106339
|
} else {
|
|
@@ -112251,7 +112244,8 @@ ${lanes.join("\n")}
|
|
|
112251
112244
|
if (shouldStripInternal(m))
|
|
112252
112245
|
return;
|
|
112253
112246
|
const constValue = resolver.getConstantValue(m);
|
|
112254
|
-
|
|
112247
|
+
const newInitializer = constValue === void 0 ? void 0 : typeof constValue === "string" ? factory2.createStringLiteral(constValue) : constValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constValue)) : factory2.createNumericLiteral(constValue);
|
|
112248
|
+
return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
|
|
112255
112249
|
}))
|
|
112256
112250
|
));
|
|
112257
112251
|
}
|
|
@@ -114119,6 +114113,8 @@ ${lanes.join("\n")}
|
|
|
114119
114113
|
);
|
|
114120
114114
|
if (hint === 3 /* MappedTypeParameter */)
|
|
114121
114115
|
return emitMappedTypeParameter(cast(node, isTypeParameterDeclaration));
|
|
114116
|
+
if (hint === 7 /* ImportTypeNodeAttributes */)
|
|
114117
|
+
return emitImportTypeNodeAttributes(cast(node, isImportAttributes));
|
|
114122
114118
|
if (hint === 5 /* EmbeddedStatement */) {
|
|
114123
114119
|
Debug.assertNode(node, isEmptyStatement);
|
|
114124
114120
|
return emitEmptyStatement(
|
|
@@ -115095,15 +115091,7 @@ ${lanes.join("\n")}
|
|
|
115095
115091
|
if (node.attributes) {
|
|
115096
115092
|
writePunctuation(",");
|
|
115097
115093
|
writeSpace();
|
|
115098
|
-
|
|
115099
|
-
writeSpace();
|
|
115100
|
-
writeKeyword(node.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
|
|
115101
|
-
writePunctuation(":");
|
|
115102
|
-
writeSpace();
|
|
115103
|
-
const elements = node.attributes.elements;
|
|
115104
|
-
emitList(node.attributes, elements, 526226 /* ImportAttributes */);
|
|
115105
|
-
writeSpace();
|
|
115106
|
-
writePunctuation("}");
|
|
115094
|
+
pipelineEmit(7 /* ImportTypeNodeAttributes */, node.attributes);
|
|
115107
115095
|
}
|
|
115108
115096
|
writePunctuation(")");
|
|
115109
115097
|
if (node.qualifier) {
|
|
@@ -116165,6 +116153,17 @@ ${lanes.join("\n")}
|
|
|
116165
116153
|
}
|
|
116166
116154
|
writeTrailingSemicolon();
|
|
116167
116155
|
}
|
|
116156
|
+
function emitImportTypeNodeAttributes(node) {
|
|
116157
|
+
writePunctuation("{");
|
|
116158
|
+
writeSpace();
|
|
116159
|
+
writeKeyword(node.token === 132 /* AssertKeyword */ ? "assert" : "with");
|
|
116160
|
+
writePunctuation(":");
|
|
116161
|
+
writeSpace();
|
|
116162
|
+
const elements = node.elements;
|
|
116163
|
+
emitList(node, elements, 526226 /* ImportAttributes */);
|
|
116164
|
+
writeSpace();
|
|
116165
|
+
writePunctuation("}");
|
|
116166
|
+
}
|
|
116168
116167
|
function emitImportAttributes(node) {
|
|
116169
116168
|
emitTokenWithComment(node.token, node.pos, writeKeyword, node);
|
|
116170
116169
|
writeSpace();
|
|
@@ -158981,7 +158980,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
158981
158980
|
}
|
|
158982
158981
|
const semanticStart = timestamp();
|
|
158983
158982
|
let completionKind = 5 /* None */;
|
|
158984
|
-
let isNonContextualObjectLiteral = false;
|
|
158985
158983
|
let hasUnresolvedAutoImports = false;
|
|
158986
158984
|
let symbols = [];
|
|
158987
158985
|
let importSpecifierResolver;
|
|
@@ -159341,8 +159339,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159341
159339
|
function shouldOfferImportCompletions() {
|
|
159342
159340
|
if (importStatementCompletion)
|
|
159343
159341
|
return true;
|
|
159344
|
-
if (isNonContextualObjectLiteral)
|
|
159345
|
-
return false;
|
|
159346
159342
|
if (!preferences.includeCompletionsForModuleExports)
|
|
159347
159343
|
return false;
|
|
159348
159344
|
if (sourceFile.externalModuleIndicator || sourceFile.commonJsModuleIndicator)
|
|
@@ -159645,7 +159641,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159645
159641
|
if (objectLikeContainer.flags & 67108864 /* InWithStatement */) {
|
|
159646
159642
|
return 2 /* Fail */;
|
|
159647
159643
|
}
|
|
159648
|
-
isNonContextualObjectLiteral = true;
|
|
159649
159644
|
return 0 /* Continue */;
|
|
159650
159645
|
}
|
|
159651
159646
|
const completionsType = typeChecker.getContextualType(objectLikeContainer, 4 /* Completions */);
|
|
@@ -159656,7 +159651,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159656
159651
|
existingMembers = objectLikeContainer.properties;
|
|
159657
159652
|
if (typeMembers.length === 0) {
|
|
159658
159653
|
if (!hasNumberIndextype) {
|
|
159659
|
-
isNonContextualObjectLiteral = true;
|
|
159660
159654
|
return 0 /* Continue */;
|
|
159661
159655
|
}
|
|
159662
159656
|
}
|
|
@@ -167023,16 +167017,16 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
167023
167017
|
if (!moduleSourceFile)
|
|
167024
167018
|
return void 0;
|
|
167025
167019
|
const withoutIndex = endsWith(node.text, "/index") || endsWith(node.text, "/index.js") ? void 0 : tryRemoveSuffix(removeFileExtension(moduleSourceFile.fileName), "/index");
|
|
167026
|
-
const
|
|
167020
|
+
const fileName = withoutIndex === void 0 ? moduleSourceFile.fileName : withoutIndex;
|
|
167027
167021
|
const kind = withoutIndex === void 0 ? "module" /* moduleElement */ : "directory" /* directory */;
|
|
167028
167022
|
const indexAfterLastSlash = node.text.lastIndexOf("/") + 1;
|
|
167029
167023
|
const triggerSpan = createTextSpan(node.getStart(sourceFile) + 1 + indexAfterLastSlash, node.text.length - indexAfterLastSlash);
|
|
167030
167024
|
return {
|
|
167031
167025
|
canRename: true,
|
|
167032
|
-
fileToRename:
|
|
167026
|
+
fileToRename: fileName,
|
|
167033
167027
|
kind,
|
|
167034
|
-
displayName:
|
|
167035
|
-
fullDisplayName:
|
|
167028
|
+
displayName: fileName,
|
|
167029
|
+
fullDisplayName: node.text,
|
|
167036
167030
|
kindModifiers: "" /* none */,
|
|
167037
167031
|
triggerSpan
|
|
167038
167032
|
};
|
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.4";
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20231208`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -13054,8 +13054,10 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13054
13054
|
return update(updated, original);
|
|
13055
13055
|
}
|
|
13056
13056
|
function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
|
|
13057
|
+
const text = typeof value === "number" ? value + "" : value;
|
|
13058
|
+
Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
|
|
13057
13059
|
const node = createBaseDeclaration(9 /* NumericLiteral */);
|
|
13058
|
-
node.text =
|
|
13060
|
+
node.text = text;
|
|
13059
13061
|
node.numericLiteralFlags = numericLiteralFlags;
|
|
13060
13062
|
if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
|
|
13061
13063
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
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.4.0-pr-
|
|
5
|
+
"version": "5.4.0-pr-56555-7",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"node": "20.1.0",
|
|
116
116
|
"npm": "8.19.4"
|
|
117
117
|
},
|
|
118
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "64057cbfa7d3c28f0f6071d063db39f14b9dc16f"
|
|
119
119
|
}
|