@typescript-deploys/pr-build 5.3.0-pr-55842-7 → 5.3.0-pr-55943-2
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 +26 -19
- package/lib/tsserver.js +54 -30
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +54 -30
- 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.3";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20231004`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -14270,6 +14270,7 @@ function getPropertyNameForPropertyNameNode(name) {
|
|
|
14270
14270
|
case 81 /* PrivateIdentifier */:
|
|
14271
14271
|
return name.escapedText;
|
|
14272
14272
|
case 11 /* StringLiteral */:
|
|
14273
|
+
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
14273
14274
|
case 9 /* NumericLiteral */:
|
|
14274
14275
|
return escapeLeadingUnderscores(name.text);
|
|
14275
14276
|
case 167 /* ComputedPropertyName */:
|
|
@@ -42360,10 +42361,12 @@ function getModuleSpecifiers(moduleSymbol, checker, compilerOptions, importingSo
|
|
|
42360
42361
|
importingSourceFile,
|
|
42361
42362
|
host,
|
|
42362
42363
|
userPreferences,
|
|
42363
|
-
options
|
|
42364
|
+
options,
|
|
42365
|
+
/*forAutoImport*/
|
|
42366
|
+
false
|
|
42364
42367
|
).moduleSpecifiers;
|
|
42365
42368
|
}
|
|
42366
|
-
function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options = {}) {
|
|
42369
|
+
function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) {
|
|
42367
42370
|
let computedWithoutCache = false;
|
|
42368
42371
|
const ambient = tryGetModuleNameFromAmbientModule(moduleSymbol, checker);
|
|
42369
42372
|
if (ambient)
|
|
@@ -42381,11 +42384,19 @@ function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions
|
|
|
42381
42384
|
return { moduleSpecifiers: emptyArray, computedWithoutCache };
|
|
42382
42385
|
computedWithoutCache = true;
|
|
42383
42386
|
modulePaths || (modulePaths = getAllModulePathsWorker(importingSourceFile.path, moduleSourceFile.originalFileName, host));
|
|
42384
|
-
const result = computeModuleSpecifiers(
|
|
42387
|
+
const result = computeModuleSpecifiers(
|
|
42388
|
+
modulePaths,
|
|
42389
|
+
compilerOptions,
|
|
42390
|
+
importingSourceFile,
|
|
42391
|
+
host,
|
|
42392
|
+
userPreferences,
|
|
42393
|
+
options,
|
|
42394
|
+
forAutoImport
|
|
42395
|
+
);
|
|
42385
42396
|
cache == null ? void 0 : cache.set(importingSourceFile.path, moduleSourceFile.path, userPreferences, options, modulePaths, result);
|
|
42386
42397
|
return { moduleSpecifiers: result, computedWithoutCache };
|
|
42387
42398
|
}
|
|
42388
|
-
function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options = {}) {
|
|
42399
|
+
function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) {
|
|
42389
42400
|
const info = getInfo(importingSourceFile.path, host);
|
|
42390
42401
|
const preferences = getPreferences(userPreferences, compilerOptions, importingSourceFile);
|
|
42391
42402
|
const existingSpecifier = forEach(modulePaths, (modulePath) => forEach(
|
|
@@ -42442,7 +42453,7 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
|
|
|
42442
42453
|
redirectPathsSpecifiers = append(redirectPathsSpecifiers, local);
|
|
42443
42454
|
} else if (pathIsBareSpecifier(local)) {
|
|
42444
42455
|
pathsSpecifiers = append(pathsSpecifiers, local);
|
|
42445
|
-
} else if (!importedFileIsInNodeModules || modulePath.isInNodeModules) {
|
|
42456
|
+
} else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) {
|
|
42446
42457
|
relativeSpecifiers = append(relativeSpecifiers, local);
|
|
42447
42458
|
}
|
|
42448
42459
|
}
|
|
@@ -52235,9 +52246,6 @@ function createTypeChecker(host) {
|
|
|
52235
52246
|
if (reportErrors2) {
|
|
52236
52247
|
reportErrorsFromWidening(declaration, type);
|
|
52237
52248
|
}
|
|
52238
|
-
if (type.flags & 8192 /* UniqueESSymbol */ && (isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfDeclaration(declaration)) {
|
|
52239
|
-
type = esSymbolType;
|
|
52240
|
-
}
|
|
52241
52249
|
return getWidenedType(type);
|
|
52242
52250
|
}
|
|
52243
52251
|
type = isParameter(declaration) && declaration.dotDotDotToken ? anyArrayType : anyType;
|
|
@@ -57578,9 +57586,6 @@ function createTypeChecker(host) {
|
|
|
57578
57586
|
if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) {
|
|
57579
57587
|
return objectType;
|
|
57580
57588
|
}
|
|
57581
|
-
if (indexType.flags & 131072 /* Never */) {
|
|
57582
|
-
return neverType;
|
|
57583
|
-
}
|
|
57584
57589
|
const indexInfo = getApplicableIndexInfo(objectType, indexType) || getIndexInfoOfType(objectType, stringType);
|
|
57585
57590
|
if (indexInfo) {
|
|
57586
57591
|
if (accessFlags & 2 /* NoIndexSignatures */ && indexInfo.keyType !== numberType) {
|
|
@@ -57600,6 +57605,9 @@ function createTypeChecker(host) {
|
|
|
57600
57605
|
}
|
|
57601
57606
|
return indexInfo.type;
|
|
57602
57607
|
}
|
|
57608
|
+
if (indexType.flags & 131072 /* Never */) {
|
|
57609
|
+
return neverType;
|
|
57610
|
+
}
|
|
57603
57611
|
if (isJSLiteralType(objectType)) {
|
|
57604
57612
|
return anyType;
|
|
57605
57613
|
}
|
|
@@ -68820,7 +68828,7 @@ function createTypeChecker(host) {
|
|
|
68820
68828
|
}
|
|
68821
68829
|
}
|
|
68822
68830
|
const parent = openingLikeElement.parent.kind === 284 /* JsxElement */ ? openingLikeElement.parent : void 0;
|
|
68823
|
-
if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) {
|
|
68831
|
+
if (parent && parent.openingElement === openingLikeElement && getSemanticJsxChildren(parent.children).length > 0) {
|
|
68824
68832
|
const childrenTypes = checkJsxChildren(parent, checkMode);
|
|
68825
68833
|
if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") {
|
|
68826
68834
|
if (explicitlySpecifyChildrenAttribute) {
|
|
@@ -70443,9 +70451,11 @@ function createTypeChecker(host) {
|
|
|
70443
70451
|
}
|
|
70444
70452
|
if (arg.kind === 237 /* SyntheticExpression */ && arg.tupleNameSource) {
|
|
70445
70453
|
names.push(arg.tupleNameSource);
|
|
70454
|
+
} else {
|
|
70455
|
+
names.push(void 0);
|
|
70446
70456
|
}
|
|
70447
70457
|
}
|
|
70448
|
-
return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType),
|
|
70458
|
+
return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType), names);
|
|
70449
70459
|
}
|
|
70450
70460
|
function checkTypeArguments(signature, typeArgumentNodes, reportErrors2, headMessage) {
|
|
70451
70461
|
const isJavascript = isInJSFile(signature.declaration);
|
|
@@ -72580,12 +72590,9 @@ function createTypeChecker(host) {
|
|
|
72580
72590
|
types.push(restType);
|
|
72581
72591
|
flags.push(8 /* Variadic */);
|
|
72582
72592
|
}
|
|
72583
|
-
|
|
72584
|
-
if (name) {
|
|
72585
|
-
names.push(name);
|
|
72586
|
-
}
|
|
72593
|
+
names.push(getNameableDeclarationAtPosition(source, i));
|
|
72587
72594
|
}
|
|
72588
|
-
return createTupleType(types, flags, readonly,
|
|
72595
|
+
return createTupleType(types, flags, readonly, names);
|
|
72589
72596
|
}
|
|
72590
72597
|
function getParameterCount(signature) {
|
|
72591
72598
|
const length2 = signature.parameters.length;
|
package/lib/tsserver.js
CHANGED
|
@@ -2328,7 +2328,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2328
2328
|
|
|
2329
2329
|
// src/compiler/corePublic.ts
|
|
2330
2330
|
var versionMajorMinor = "5.3";
|
|
2331
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2331
|
+
var version = `${versionMajorMinor}.0-insiders.20231004`;
|
|
2332
2332
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2333
2333
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2334
2334
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -18197,6 +18197,7 @@ function getPropertyNameForPropertyNameNode(name) {
|
|
|
18197
18197
|
case 81 /* PrivateIdentifier */:
|
|
18198
18198
|
return name.escapedText;
|
|
18199
18199
|
case 11 /* StringLiteral */:
|
|
18200
|
+
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
18200
18201
|
case 9 /* NumericLiteral */:
|
|
18201
18202
|
return escapeLeadingUnderscores(name.text);
|
|
18202
18203
|
case 167 /* ComputedPropertyName */:
|
|
@@ -47072,10 +47073,12 @@ function getModuleSpecifiers(moduleSymbol, checker, compilerOptions, importingSo
|
|
|
47072
47073
|
importingSourceFile,
|
|
47073
47074
|
host,
|
|
47074
47075
|
userPreferences,
|
|
47075
|
-
options
|
|
47076
|
+
options,
|
|
47077
|
+
/*forAutoImport*/
|
|
47078
|
+
false
|
|
47076
47079
|
).moduleSpecifiers;
|
|
47077
47080
|
}
|
|
47078
|
-
function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options = {}) {
|
|
47081
|
+
function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) {
|
|
47079
47082
|
let computedWithoutCache = false;
|
|
47080
47083
|
const ambient = tryGetModuleNameFromAmbientModule(moduleSymbol, checker);
|
|
47081
47084
|
if (ambient)
|
|
@@ -47093,11 +47096,19 @@ function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions
|
|
|
47093
47096
|
return { moduleSpecifiers: emptyArray, computedWithoutCache };
|
|
47094
47097
|
computedWithoutCache = true;
|
|
47095
47098
|
modulePaths || (modulePaths = getAllModulePathsWorker(importingSourceFile.path, moduleSourceFile.originalFileName, host));
|
|
47096
|
-
const result = computeModuleSpecifiers(
|
|
47099
|
+
const result = computeModuleSpecifiers(
|
|
47100
|
+
modulePaths,
|
|
47101
|
+
compilerOptions,
|
|
47102
|
+
importingSourceFile,
|
|
47103
|
+
host,
|
|
47104
|
+
userPreferences,
|
|
47105
|
+
options,
|
|
47106
|
+
forAutoImport
|
|
47107
|
+
);
|
|
47097
47108
|
cache == null ? void 0 : cache.set(importingSourceFile.path, moduleSourceFile.path, userPreferences, options, modulePaths, result);
|
|
47098
47109
|
return { moduleSpecifiers: result, computedWithoutCache };
|
|
47099
47110
|
}
|
|
47100
|
-
function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options = {}) {
|
|
47111
|
+
function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) {
|
|
47101
47112
|
const info = getInfo(importingSourceFile.path, host);
|
|
47102
47113
|
const preferences = getPreferences(userPreferences, compilerOptions, importingSourceFile);
|
|
47103
47114
|
const existingSpecifier = forEach(modulePaths, (modulePath) => forEach(
|
|
@@ -47154,7 +47165,7 @@ function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFi
|
|
|
47154
47165
|
redirectPathsSpecifiers = append(redirectPathsSpecifiers, local);
|
|
47155
47166
|
} else if (pathIsBareSpecifier(local)) {
|
|
47156
47167
|
pathsSpecifiers = append(pathsSpecifiers, local);
|
|
47157
|
-
} else if (!importedFileIsInNodeModules || modulePath.isInNodeModules) {
|
|
47168
|
+
} else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) {
|
|
47158
47169
|
relativeSpecifiers = append(relativeSpecifiers, local);
|
|
47159
47170
|
}
|
|
47160
47171
|
}
|
|
@@ -56947,9 +56958,6 @@ function createTypeChecker(host) {
|
|
|
56947
56958
|
if (reportErrors2) {
|
|
56948
56959
|
reportErrorsFromWidening(declaration, type);
|
|
56949
56960
|
}
|
|
56950
|
-
if (type.flags & 8192 /* UniqueESSymbol */ && (isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfDeclaration(declaration)) {
|
|
56951
|
-
type = esSymbolType;
|
|
56952
|
-
}
|
|
56953
56961
|
return getWidenedType(type);
|
|
56954
56962
|
}
|
|
56955
56963
|
type = isParameter(declaration) && declaration.dotDotDotToken ? anyArrayType : anyType;
|
|
@@ -62290,9 +62298,6 @@ function createTypeChecker(host) {
|
|
|
62290
62298
|
if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) {
|
|
62291
62299
|
return objectType;
|
|
62292
62300
|
}
|
|
62293
|
-
if (indexType.flags & 131072 /* Never */) {
|
|
62294
|
-
return neverType;
|
|
62295
|
-
}
|
|
62296
62301
|
const indexInfo = getApplicableIndexInfo(objectType, indexType) || getIndexInfoOfType(objectType, stringType);
|
|
62297
62302
|
if (indexInfo) {
|
|
62298
62303
|
if (accessFlags & 2 /* NoIndexSignatures */ && indexInfo.keyType !== numberType) {
|
|
@@ -62312,6 +62317,9 @@ function createTypeChecker(host) {
|
|
|
62312
62317
|
}
|
|
62313
62318
|
return indexInfo.type;
|
|
62314
62319
|
}
|
|
62320
|
+
if (indexType.flags & 131072 /* Never */) {
|
|
62321
|
+
return neverType;
|
|
62322
|
+
}
|
|
62315
62323
|
if (isJSLiteralType(objectType)) {
|
|
62316
62324
|
return anyType;
|
|
62317
62325
|
}
|
|
@@ -73532,7 +73540,7 @@ function createTypeChecker(host) {
|
|
|
73532
73540
|
}
|
|
73533
73541
|
}
|
|
73534
73542
|
const parent2 = openingLikeElement.parent.kind === 284 /* JsxElement */ ? openingLikeElement.parent : void 0;
|
|
73535
|
-
if (parent2 && parent2.openingElement === openingLikeElement && parent2.children.length > 0) {
|
|
73543
|
+
if (parent2 && parent2.openingElement === openingLikeElement && getSemanticJsxChildren(parent2.children).length > 0) {
|
|
73536
73544
|
const childrenTypes = checkJsxChildren(parent2, checkMode);
|
|
73537
73545
|
if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") {
|
|
73538
73546
|
if (explicitlySpecifyChildrenAttribute) {
|
|
@@ -75155,9 +75163,11 @@ function createTypeChecker(host) {
|
|
|
75155
75163
|
}
|
|
75156
75164
|
if (arg.kind === 237 /* SyntheticExpression */ && arg.tupleNameSource) {
|
|
75157
75165
|
names.push(arg.tupleNameSource);
|
|
75166
|
+
} else {
|
|
75167
|
+
names.push(void 0);
|
|
75158
75168
|
}
|
|
75159
75169
|
}
|
|
75160
|
-
return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType),
|
|
75170
|
+
return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType), names);
|
|
75161
75171
|
}
|
|
75162
75172
|
function checkTypeArguments(signature, typeArgumentNodes, reportErrors2, headMessage) {
|
|
75163
75173
|
const isJavascript = isInJSFile(signature.declaration);
|
|
@@ -77292,12 +77302,9 @@ function createTypeChecker(host) {
|
|
|
77292
77302
|
types.push(restType);
|
|
77293
77303
|
flags.push(8 /* Variadic */);
|
|
77294
77304
|
}
|
|
77295
|
-
|
|
77296
|
-
if (name) {
|
|
77297
|
-
names.push(name);
|
|
77298
|
-
}
|
|
77305
|
+
names.push(getNameableDeclarationAtPosition(source, i));
|
|
77299
77306
|
}
|
|
77300
|
-
return createTupleType(types, flags, readonly,
|
|
77307
|
+
return createTupleType(types, flags, readonly, names);
|
|
77301
77308
|
}
|
|
77302
77309
|
function getParameterCount(signature) {
|
|
77303
77310
|
const length2 = signature.parameters.length;
|
|
@@ -143081,7 +143088,7 @@ function doChange7(sourceFile, changes, declaration, typeNode) {
|
|
|
143081
143088
|
function getInfo4(context) {
|
|
143082
143089
|
if (isInJSFile(context.file) || !refactorKindBeginsWith(inferReturnTypeAction.kind, context.kind))
|
|
143083
143090
|
return;
|
|
143084
|
-
const token =
|
|
143091
|
+
const token = getTouchingPropertyName(context.file, context.startPosition);
|
|
143085
143092
|
const declaration = findAncestor(token, (n) => isBlock(n) || n.parent && isArrowFunction(n.parent) && (n.kind === 39 /* EqualsGreaterThanToken */ || n.parent.body === n) ? "quit" : isConvertibleDeclaration(n));
|
|
143086
143093
|
if (!declaration || !declaration.body || declaration.type) {
|
|
143087
143094
|
return { error: getLocaleSpecificMessage(Diagnostics.Return_type_must_be_inferred_from_a_function) };
|
|
@@ -150091,7 +150098,18 @@ function getNewImportFixes(program, sourceFile, usagePosition, isValidTypeOnlyUs
|
|
|
150091
150098
|
const getChecker = createGetChecker(program, host);
|
|
150092
150099
|
const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
|
|
150093
150100
|
const rejectNodeModulesRelativePaths = moduleResolutionUsesNodeModules(moduleResolution);
|
|
150094
|
-
const getModuleSpecifiers2 = fromCacheOnly ? (moduleSymbol) => ({ moduleSpecifiers: ts_moduleSpecifiers_exports.tryGetModuleSpecifiersFromCache(moduleSymbol, sourceFile, moduleSpecifierResolutionHost, preferences), computedWithoutCache: false }) : (moduleSymbol, checker) => ts_moduleSpecifiers_exports.getModuleSpecifiersWithCacheInfo(
|
|
150101
|
+
const getModuleSpecifiers2 = fromCacheOnly ? (moduleSymbol) => ({ moduleSpecifiers: ts_moduleSpecifiers_exports.tryGetModuleSpecifiersFromCache(moduleSymbol, sourceFile, moduleSpecifierResolutionHost, preferences), computedWithoutCache: false }) : (moduleSymbol, checker) => ts_moduleSpecifiers_exports.getModuleSpecifiersWithCacheInfo(
|
|
150102
|
+
moduleSymbol,
|
|
150103
|
+
checker,
|
|
150104
|
+
compilerOptions,
|
|
150105
|
+
sourceFile,
|
|
150106
|
+
moduleSpecifierResolutionHost,
|
|
150107
|
+
preferences,
|
|
150108
|
+
/*options*/
|
|
150109
|
+
void 0,
|
|
150110
|
+
/*forAutoImport*/
|
|
150111
|
+
true
|
|
150112
|
+
);
|
|
150095
150113
|
let computedWithoutCacheCount = 0;
|
|
150096
150114
|
const fixes = flatMap(exportInfo, (exportInfo2, i) => {
|
|
150097
150115
|
const checker = getChecker(exportInfo2.isFromPackageJson);
|
|
@@ -158303,7 +158321,7 @@ function getCompletionEntryDetails(program, log, sourceFile, position, entryId,
|
|
|
158303
158321
|
return createSimpleDetails(completionNameForLiteral(sourceFile, preferences, literal), "string" /* string */, typeof literal === "string" ? 8 /* stringLiteral */ : 7 /* numericLiteral */);
|
|
158304
158322
|
}
|
|
158305
158323
|
case "cases": {
|
|
158306
|
-
const
|
|
158324
|
+
const snippets = getExhaustiveCaseSnippets(
|
|
158307
158325
|
contextToken.parent,
|
|
158308
158326
|
sourceFile,
|
|
158309
158327
|
preferences,
|
|
@@ -158313,7 +158331,8 @@ function getCompletionEntryDetails(program, log, sourceFile, position, entryId,
|
|
|
158313
158331
|
/*formatContext*/
|
|
158314
158332
|
void 0
|
|
158315
158333
|
);
|
|
158316
|
-
if (importAdder.hasFixes()) {
|
|
158334
|
+
if (snippets == null ? void 0 : snippets.importAdder.hasFixes()) {
|
|
158335
|
+
const { entry, importAdder } = snippets;
|
|
158317
158336
|
const changes = ts_textChanges_exports.ChangeTracker.with(
|
|
158318
158337
|
{ host, formatContext, preferences },
|
|
158319
158338
|
importAdder.writeFixes
|
|
@@ -158331,7 +158350,7 @@ function getCompletionEntryDetails(program, log, sourceFile, position, entryId,
|
|
|
158331
158350
|
};
|
|
158332
158351
|
}
|
|
158333
158352
|
return {
|
|
158334
|
-
name
|
|
158353
|
+
name,
|
|
158335
158354
|
kind: "" /* unknown */,
|
|
158336
158355
|
kindModifiers: "",
|
|
158337
158356
|
displayParts: [],
|
|
@@ -164283,6 +164302,7 @@ function provideInlayHints(context) {
|
|
|
164283
164302
|
const { file, program, span, cancellationToken, preferences } = context;
|
|
164284
164303
|
const sourceFileText = file.text;
|
|
164285
164304
|
const compilerOptions = program.getCompilerOptions();
|
|
164305
|
+
const quotePreference = getQuotePreference(file, preferences);
|
|
164286
164306
|
const checker = program.getTypeChecker();
|
|
164287
164307
|
const result = [];
|
|
164288
164308
|
visitor(file);
|
|
@@ -164590,6 +164610,10 @@ function provideInlayHints(context) {
|
|
|
164590
164610
|
parts.push({ text: tokenString });
|
|
164591
164611
|
return;
|
|
164592
164612
|
}
|
|
164613
|
+
if (isLiteralExpression(node)) {
|
|
164614
|
+
parts.push({ text: getLiteralText2(node) });
|
|
164615
|
+
return;
|
|
164616
|
+
}
|
|
164593
164617
|
switch (node.kind) {
|
|
164594
164618
|
case 80 /* Identifier */:
|
|
164595
164619
|
const identifier = node;
|
|
@@ -164601,12 +164625,6 @@ function provideInlayHints(context) {
|
|
|
164601
164625
|
parts.push({ text: identifierText });
|
|
164602
164626
|
}
|
|
164603
164627
|
break;
|
|
164604
|
-
case 9 /* NumericLiteral */:
|
|
164605
|
-
parts.push({ text: node.text });
|
|
164606
|
-
break;
|
|
164607
|
-
case 11 /* StringLiteral */:
|
|
164608
|
-
parts.push({ text: `"${node.text}"` });
|
|
164609
|
-
break;
|
|
164610
164628
|
case 166 /* QualifiedName */:
|
|
164611
164629
|
const qualifiedName = node;
|
|
164612
164630
|
visitForDisplayParts(qualifiedName.left);
|
|
@@ -164862,6 +164880,12 @@ function provideInlayHints(context) {
|
|
|
164862
164880
|
visitForDisplayParts(node);
|
|
164863
164881
|
});
|
|
164864
164882
|
}
|
|
164883
|
+
function getLiteralText2(node) {
|
|
164884
|
+
if (isStringLiteral(node)) {
|
|
164885
|
+
return quotePreference === 0 /* Single */ ? `'${escapeString(node.text, 39 /* singleQuote */)}'` : `"${escapeString(node.text, 34 /* doubleQuote */)}"`;
|
|
164886
|
+
}
|
|
164887
|
+
return node.text;
|
|
164888
|
+
}
|
|
164865
164889
|
}
|
|
164866
164890
|
function isUndefined(name) {
|
|
164867
164891
|
return name === "undefined";
|
package/lib/typescript.d.ts
CHANGED
|
@@ -4976,7 +4976,7 @@ declare namespace ts {
|
|
|
4976
4976
|
readonly right: Identifier;
|
|
4977
4977
|
}
|
|
4978
4978
|
type EntityName = Identifier | QualifiedName;
|
|
4979
|
-
type PropertyName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier;
|
|
4979
|
+
type PropertyName = Identifier | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier;
|
|
4980
4980
|
type MemberName = Identifier | PrivateIdentifier;
|
|
4981
4981
|
type DeclarationName = PropertyName | JsxAttributeName | StringLiteralLike | ElementAccessExpression | BindingPattern | EntityNameExpression;
|
|
4982
4982
|
interface Declaration extends Node {
|
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.3";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20231004`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -15566,6 +15566,7 @@ ${lanes.join("\n")}
|
|
|
15566
15566
|
case 81 /* PrivateIdentifier */:
|
|
15567
15567
|
return name.escapedText;
|
|
15568
15568
|
case 11 /* StringLiteral */:
|
|
15569
|
+
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
15569
15570
|
case 9 /* NumericLiteral */:
|
|
15570
15571
|
return escapeLeadingUnderscores(name.text);
|
|
15571
15572
|
case 167 /* ComputedPropertyName */:
|
|
@@ -44937,10 +44938,12 @@ ${lanes.join("\n")}
|
|
|
44937
44938
|
importingSourceFile,
|
|
44938
44939
|
host,
|
|
44939
44940
|
userPreferences,
|
|
44940
|
-
options
|
|
44941
|
+
options,
|
|
44942
|
+
/*forAutoImport*/
|
|
44943
|
+
false
|
|
44941
44944
|
).moduleSpecifiers;
|
|
44942
44945
|
}
|
|
44943
|
-
function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options = {}) {
|
|
44946
|
+
function getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) {
|
|
44944
44947
|
let computedWithoutCache = false;
|
|
44945
44948
|
const ambient = tryGetModuleNameFromAmbientModule(moduleSymbol, checker);
|
|
44946
44949
|
if (ambient)
|
|
@@ -44958,11 +44961,19 @@ ${lanes.join("\n")}
|
|
|
44958
44961
|
return { moduleSpecifiers: emptyArray, computedWithoutCache };
|
|
44959
44962
|
computedWithoutCache = true;
|
|
44960
44963
|
modulePaths || (modulePaths = getAllModulePathsWorker(importingSourceFile.path, moduleSourceFile.originalFileName, host));
|
|
44961
|
-
const result = computeModuleSpecifiers(
|
|
44964
|
+
const result = computeModuleSpecifiers(
|
|
44965
|
+
modulePaths,
|
|
44966
|
+
compilerOptions,
|
|
44967
|
+
importingSourceFile,
|
|
44968
|
+
host,
|
|
44969
|
+
userPreferences,
|
|
44970
|
+
options,
|
|
44971
|
+
forAutoImport
|
|
44972
|
+
);
|
|
44962
44973
|
cache == null ? void 0 : cache.set(importingSourceFile.path, moduleSourceFile.path, userPreferences, options, modulePaths, result);
|
|
44963
44974
|
return { moduleSpecifiers: result, computedWithoutCache };
|
|
44964
44975
|
}
|
|
44965
|
-
function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options = {}) {
|
|
44976
|
+
function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) {
|
|
44966
44977
|
const info = getInfo(importingSourceFile.path, host);
|
|
44967
44978
|
const preferences = getPreferences(userPreferences, compilerOptions, importingSourceFile);
|
|
44968
44979
|
const existingSpecifier = forEach(modulePaths, (modulePath) => forEach(
|
|
@@ -45019,7 +45030,7 @@ ${lanes.join("\n")}
|
|
|
45019
45030
|
redirectPathsSpecifiers = append(redirectPathsSpecifiers, local);
|
|
45020
45031
|
} else if (pathIsBareSpecifier(local)) {
|
|
45021
45032
|
pathsSpecifiers = append(pathsSpecifiers, local);
|
|
45022
|
-
} else if (!importedFileIsInNodeModules || modulePath.isInNodeModules) {
|
|
45033
|
+
} else if (forAutoImport || !importedFileIsInNodeModules || modulePath.isInNodeModules) {
|
|
45023
45034
|
relativeSpecifiers = append(relativeSpecifiers, local);
|
|
45024
45035
|
}
|
|
45025
45036
|
}
|
|
@@ -54714,9 +54725,6 @@ ${lanes.join("\n")}
|
|
|
54714
54725
|
if (reportErrors2) {
|
|
54715
54726
|
reportErrorsFromWidening(declaration, type);
|
|
54716
54727
|
}
|
|
54717
|
-
if (type.flags & 8192 /* UniqueESSymbol */ && (isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfDeclaration(declaration)) {
|
|
54718
|
-
type = esSymbolType;
|
|
54719
|
-
}
|
|
54720
54728
|
return getWidenedType(type);
|
|
54721
54729
|
}
|
|
54722
54730
|
type = isParameter(declaration) && declaration.dotDotDotToken ? anyArrayType : anyType;
|
|
@@ -60057,9 +60065,6 @@ ${lanes.join("\n")}
|
|
|
60057
60065
|
if (objectType.flags & (1 /* Any */ | 131072 /* Never */)) {
|
|
60058
60066
|
return objectType;
|
|
60059
60067
|
}
|
|
60060
|
-
if (indexType.flags & 131072 /* Never */) {
|
|
60061
|
-
return neverType;
|
|
60062
|
-
}
|
|
60063
60068
|
const indexInfo = getApplicableIndexInfo(objectType, indexType) || getIndexInfoOfType(objectType, stringType);
|
|
60064
60069
|
if (indexInfo) {
|
|
60065
60070
|
if (accessFlags & 2 /* NoIndexSignatures */ && indexInfo.keyType !== numberType) {
|
|
@@ -60079,6 +60084,9 @@ ${lanes.join("\n")}
|
|
|
60079
60084
|
}
|
|
60080
60085
|
return indexInfo.type;
|
|
60081
60086
|
}
|
|
60087
|
+
if (indexType.flags & 131072 /* Never */) {
|
|
60088
|
+
return neverType;
|
|
60089
|
+
}
|
|
60082
60090
|
if (isJSLiteralType(objectType)) {
|
|
60083
60091
|
return anyType;
|
|
60084
60092
|
}
|
|
@@ -71299,7 +71307,7 @@ ${lanes.join("\n")}
|
|
|
71299
71307
|
}
|
|
71300
71308
|
}
|
|
71301
71309
|
const parent2 = openingLikeElement.parent.kind === 284 /* JsxElement */ ? openingLikeElement.parent : void 0;
|
|
71302
|
-
if (parent2 && parent2.openingElement === openingLikeElement && parent2.children.length > 0) {
|
|
71310
|
+
if (parent2 && parent2.openingElement === openingLikeElement && getSemanticJsxChildren(parent2.children).length > 0) {
|
|
71303
71311
|
const childrenTypes = checkJsxChildren(parent2, checkMode);
|
|
71304
71312
|
if (!hasSpreadAnyType && jsxChildrenPropertyName && jsxChildrenPropertyName !== "") {
|
|
71305
71313
|
if (explicitlySpecifyChildrenAttribute) {
|
|
@@ -72922,9 +72930,11 @@ ${lanes.join("\n")}
|
|
|
72922
72930
|
}
|
|
72923
72931
|
if (arg.kind === 237 /* SyntheticExpression */ && arg.tupleNameSource) {
|
|
72924
72932
|
names.push(arg.tupleNameSource);
|
|
72933
|
+
} else {
|
|
72934
|
+
names.push(void 0);
|
|
72925
72935
|
}
|
|
72926
72936
|
}
|
|
72927
|
-
return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType),
|
|
72937
|
+
return createTupleType(types, flags, inConstContext && !someType(restType, isMutableArrayLikeType), names);
|
|
72928
72938
|
}
|
|
72929
72939
|
function checkTypeArguments(signature, typeArgumentNodes, reportErrors2, headMessage) {
|
|
72930
72940
|
const isJavascript = isInJSFile(signature.declaration);
|
|
@@ -75059,12 +75069,9 @@ ${lanes.join("\n")}
|
|
|
75059
75069
|
types.push(restType);
|
|
75060
75070
|
flags.push(8 /* Variadic */);
|
|
75061
75071
|
}
|
|
75062
|
-
|
|
75063
|
-
if (name) {
|
|
75064
|
-
names.push(name);
|
|
75065
|
-
}
|
|
75072
|
+
names.push(getNameableDeclarationAtPosition(source, i));
|
|
75066
75073
|
}
|
|
75067
|
-
return createTupleType(types, flags, readonly,
|
|
75074
|
+
return createTupleType(types, flags, readonly, names);
|
|
75068
75075
|
}
|
|
75069
75076
|
function getParameterCount(signature) {
|
|
75070
75077
|
const length2 = signature.parameters.length;
|
|
@@ -141597,7 +141604,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
141597
141604
|
function getInfo4(context) {
|
|
141598
141605
|
if (isInJSFile(context.file) || !refactorKindBeginsWith(inferReturnTypeAction.kind, context.kind))
|
|
141599
141606
|
return;
|
|
141600
|
-
const token =
|
|
141607
|
+
const token = getTouchingPropertyName(context.file, context.startPosition);
|
|
141601
141608
|
const declaration = findAncestor(token, (n) => isBlock(n) || n.parent && isArrowFunction(n.parent) && (n.kind === 39 /* EqualsGreaterThanToken */ || n.parent.body === n) ? "quit" : isConvertibleDeclaration(n));
|
|
141602
141609
|
if (!declaration || !declaration.body || declaration.type) {
|
|
141603
141610
|
return { error: getLocaleSpecificMessage(Diagnostics.Return_type_must_be_inferred_from_a_function) };
|
|
@@ -148811,7 +148818,18 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
148811
148818
|
const getChecker = createGetChecker(program, host);
|
|
148812
148819
|
const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
|
|
148813
148820
|
const rejectNodeModulesRelativePaths = moduleResolutionUsesNodeModules(moduleResolution);
|
|
148814
|
-
const getModuleSpecifiers2 = fromCacheOnly ? (moduleSymbol) => ({ moduleSpecifiers: ts_moduleSpecifiers_exports.tryGetModuleSpecifiersFromCache(moduleSymbol, sourceFile, moduleSpecifierResolutionHost, preferences), computedWithoutCache: false }) : (moduleSymbol, checker) => ts_moduleSpecifiers_exports.getModuleSpecifiersWithCacheInfo(
|
|
148821
|
+
const getModuleSpecifiers2 = fromCacheOnly ? (moduleSymbol) => ({ moduleSpecifiers: ts_moduleSpecifiers_exports.tryGetModuleSpecifiersFromCache(moduleSymbol, sourceFile, moduleSpecifierResolutionHost, preferences), computedWithoutCache: false }) : (moduleSymbol, checker) => ts_moduleSpecifiers_exports.getModuleSpecifiersWithCacheInfo(
|
|
148822
|
+
moduleSymbol,
|
|
148823
|
+
checker,
|
|
148824
|
+
compilerOptions,
|
|
148825
|
+
sourceFile,
|
|
148826
|
+
moduleSpecifierResolutionHost,
|
|
148827
|
+
preferences,
|
|
148828
|
+
/*options*/
|
|
148829
|
+
void 0,
|
|
148830
|
+
/*forAutoImport*/
|
|
148831
|
+
true
|
|
148832
|
+
);
|
|
148815
148833
|
let computedWithoutCacheCount = 0;
|
|
148816
148834
|
const fixes = flatMap(exportInfo, (exportInfo2, i) => {
|
|
148817
148835
|
const checker = getChecker(exportInfo2.isFromPackageJson);
|
|
@@ -157527,7 +157545,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157527
157545
|
return createSimpleDetails(completionNameForLiteral(sourceFile, preferences, literal), "string" /* string */, typeof literal === "string" ? 8 /* stringLiteral */ : 7 /* numericLiteral */);
|
|
157528
157546
|
}
|
|
157529
157547
|
case "cases": {
|
|
157530
|
-
const
|
|
157548
|
+
const snippets = getExhaustiveCaseSnippets(
|
|
157531
157549
|
contextToken.parent,
|
|
157532
157550
|
sourceFile,
|
|
157533
157551
|
preferences,
|
|
@@ -157537,7 +157555,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157537
157555
|
/*formatContext*/
|
|
157538
157556
|
void 0
|
|
157539
157557
|
);
|
|
157540
|
-
if (importAdder.hasFixes()) {
|
|
157558
|
+
if (snippets == null ? void 0 : snippets.importAdder.hasFixes()) {
|
|
157559
|
+
const { entry, importAdder } = snippets;
|
|
157541
157560
|
const changes = ts_textChanges_exports.ChangeTracker.with(
|
|
157542
157561
|
{ host, formatContext, preferences },
|
|
157543
157562
|
importAdder.writeFixes
|
|
@@ -157555,7 +157574,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
157555
157574
|
};
|
|
157556
157575
|
}
|
|
157557
157576
|
return {
|
|
157558
|
-
name
|
|
157577
|
+
name,
|
|
157559
157578
|
kind: "" /* unknown */,
|
|
157560
157579
|
kindModifiers: "",
|
|
157561
157580
|
displayParts: [],
|
|
@@ -163628,6 +163647,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
163628
163647
|
const { file, program, span, cancellationToken, preferences } = context;
|
|
163629
163648
|
const sourceFileText = file.text;
|
|
163630
163649
|
const compilerOptions = program.getCompilerOptions();
|
|
163650
|
+
const quotePreference = getQuotePreference(file, preferences);
|
|
163631
163651
|
const checker = program.getTypeChecker();
|
|
163632
163652
|
const result = [];
|
|
163633
163653
|
visitor(file);
|
|
@@ -163935,6 +163955,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
163935
163955
|
parts.push({ text: tokenString });
|
|
163936
163956
|
return;
|
|
163937
163957
|
}
|
|
163958
|
+
if (isLiteralExpression(node)) {
|
|
163959
|
+
parts.push({ text: getLiteralText2(node) });
|
|
163960
|
+
return;
|
|
163961
|
+
}
|
|
163938
163962
|
switch (node.kind) {
|
|
163939
163963
|
case 80 /* Identifier */:
|
|
163940
163964
|
const identifier = node;
|
|
@@ -163946,12 +163970,6 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
163946
163970
|
parts.push({ text: identifierText });
|
|
163947
163971
|
}
|
|
163948
163972
|
break;
|
|
163949
|
-
case 9 /* NumericLiteral */:
|
|
163950
|
-
parts.push({ text: node.text });
|
|
163951
|
-
break;
|
|
163952
|
-
case 11 /* StringLiteral */:
|
|
163953
|
-
parts.push({ text: `"${node.text}"` });
|
|
163954
|
-
break;
|
|
163955
163973
|
case 166 /* QualifiedName */:
|
|
163956
163974
|
const qualifiedName = node;
|
|
163957
163975
|
visitForDisplayParts(qualifiedName.left);
|
|
@@ -164207,6 +164225,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
164207
164225
|
visitForDisplayParts(node);
|
|
164208
164226
|
});
|
|
164209
164227
|
}
|
|
164228
|
+
function getLiteralText2(node) {
|
|
164229
|
+
if (isStringLiteral(node)) {
|
|
164230
|
+
return quotePreference === 0 /* Single */ ? `'${escapeString(node.text, 39 /* singleQuote */)}'` : `"${escapeString(node.text, 34 /* doubleQuote */)}"`;
|
|
164231
|
+
}
|
|
164232
|
+
return node.text;
|
|
164233
|
+
}
|
|
164210
164234
|
}
|
|
164211
164235
|
function isUndefined(name) {
|
|
164212
164236
|
return name === "undefined";
|
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.3";
|
|
57
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
57
|
+
var version = `${versionMajorMinor}.0-insiders.20231004`;
|
|
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.3.0-pr-
|
|
5
|
+
"version": "5.3.0-pr-55943-2",
|
|
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": "20.1.0",
|
|
115
115
|
"npm": "8.19.4"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "8205dde71f0b85f0eb2c7e1de4c7533999e92e49"
|
|
118
118
|
}
|