typescript 5.0.0-dev.20221201 → 5.0.0-dev.20221203
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/lib.es2022.sharedmemory.d.ts +15 -1
- package/lib/tsc.js +139 -138
- package/lib/tsserver.js +465 -176
- package/lib/tsserverlibrary.js +465 -176
- package/lib/typescript.js +458 -176
- package/lib/typingsInstaller.js +1 -1
- package/package.json +1 -1
package/lib/tsserverlibrary.js
CHANGED
|
@@ -42,7 +42,7 @@ var ts = (() => {
|
|
|
42
42
|
"src/compiler/corePublic.ts"() {
|
|
43
43
|
"use strict";
|
|
44
44
|
versionMajorMinor = "5.0";
|
|
45
|
-
version = `${versionMajorMinor}.0-dev.
|
|
45
|
+
version = `${versionMajorMinor}.0-dev.20221203`;
|
|
46
46
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
47
47
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
48
48
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -17095,6 +17095,32 @@ ${lanes.join("\n")}
|
|
|
17095
17095
|
function pseudoBigIntToString({ negative, base10Value }) {
|
|
17096
17096
|
return (negative && base10Value !== "0" ? "-" : "") + base10Value;
|
|
17097
17097
|
}
|
|
17098
|
+
function parseBigInt(text) {
|
|
17099
|
+
if (!isValidBigIntString(text, false)) {
|
|
17100
|
+
return void 0;
|
|
17101
|
+
}
|
|
17102
|
+
return parseValidBigInt(text);
|
|
17103
|
+
}
|
|
17104
|
+
function parseValidBigInt(text) {
|
|
17105
|
+
const negative = text.startsWith("-");
|
|
17106
|
+
const base10Value = parsePseudoBigInt(`${negative ? text.slice(1) : text}n`);
|
|
17107
|
+
return { negative, base10Value };
|
|
17108
|
+
}
|
|
17109
|
+
function isValidBigIntString(s, roundTripOnly) {
|
|
17110
|
+
if (s === "")
|
|
17111
|
+
return false;
|
|
17112
|
+
const scanner2 = createScanner(99 /* ESNext */, false);
|
|
17113
|
+
let success = true;
|
|
17114
|
+
scanner2.setOnError(() => success = false);
|
|
17115
|
+
scanner2.setText(s + "n");
|
|
17116
|
+
let result = scanner2.scan();
|
|
17117
|
+
const negative = result === 40 /* MinusToken */;
|
|
17118
|
+
if (negative) {
|
|
17119
|
+
result = scanner2.scan();
|
|
17120
|
+
}
|
|
17121
|
+
const flags = scanner2.getTokenFlags();
|
|
17122
|
+
return success && result === 9 /* BigIntLiteral */ && scanner2.getTextPos() === s.length + 1 && !(flags & 512 /* ContainsSeparator */) && (!roundTripOnly || s === pseudoBigIntToString({ negative, base10Value: parsePseudoBigInt(scanner2.getTokenValue()) }));
|
|
17123
|
+
}
|
|
17098
17124
|
function isValidTypeOnlyAliasUseSite(useSite) {
|
|
17099
17125
|
return !!(useSite.flags & 16777216 /* Ambient */) || isPartOfTypeQuery(useSite) || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite));
|
|
17100
17126
|
}
|
|
@@ -17421,6 +17447,17 @@ ${lanes.join("\n")}
|
|
|
17421
17447
|
const { isBracketed, typeExpression } = node;
|
|
17422
17448
|
return isBracketed || !!typeExpression && typeExpression.type.kind === 319 /* JSDocOptionalType */;
|
|
17423
17449
|
}
|
|
17450
|
+
function canUsePropertyAccess(name, languageVersion) {
|
|
17451
|
+
if (name.length === 0) {
|
|
17452
|
+
return false;
|
|
17453
|
+
}
|
|
17454
|
+
const firstChar = name.charCodeAt(0);
|
|
17455
|
+
return firstChar === 35 /* hash */ ? name.length > 1 && isIdentifierStart(name.charCodeAt(1), languageVersion) : isIdentifierStart(firstChar, languageVersion);
|
|
17456
|
+
}
|
|
17457
|
+
function hasTabstop(node) {
|
|
17458
|
+
var _a2;
|
|
17459
|
+
return ((_a2 = getSnippetElement(node)) == null ? void 0 : _a2.kind) === 0 /* TabStop */;
|
|
17460
|
+
}
|
|
17424
17461
|
var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashAMDReferencePathRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, AccessKind, objectAllocator, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, extensionsToRemove, emptyFileSystemEntries;
|
|
17425
17462
|
var init_utilities = __esm({
|
|
17426
17463
|
"src/compiler/utilities.ts"() {
|
|
@@ -35262,41 +35299,86 @@ ${lanes.join("\n")}
|
|
|
35262
35299
|
}
|
|
35263
35300
|
return result;
|
|
35264
35301
|
}
|
|
35265
|
-
function
|
|
35266
|
-
|
|
35302
|
+
function compilerOptionValueToString(value) {
|
|
35303
|
+
var _a2;
|
|
35304
|
+
if (value === null || typeof value !== "object") {
|
|
35305
|
+
return "" + value;
|
|
35306
|
+
}
|
|
35307
|
+
if (isArray(value)) {
|
|
35308
|
+
return `[${(_a2 = value.map((e) => compilerOptionValueToString(e))) == null ? void 0 : _a2.join(",")}]`;
|
|
35309
|
+
}
|
|
35310
|
+
let str = "{";
|
|
35311
|
+
for (const key in value) {
|
|
35312
|
+
if (hasProperty(value, key)) {
|
|
35313
|
+
str += `${key}: ${compilerOptionValueToString(value[key])}`;
|
|
35314
|
+
}
|
|
35315
|
+
}
|
|
35316
|
+
return str + "}";
|
|
35317
|
+
}
|
|
35318
|
+
function getKeyForCompilerOptions(options, affectingOptionDeclarations) {
|
|
35319
|
+
return affectingOptionDeclarations.map((option) => compilerOptionValueToString(getCompilerOptionValue(options, option))).join("|") + (options.pathsBasePath ? `|${options.pathsBasePath}` : void 0);
|
|
35320
|
+
}
|
|
35321
|
+
function createCacheWithRedirects(ownOptions) {
|
|
35267
35322
|
const redirectsMap = /* @__PURE__ */ new Map();
|
|
35323
|
+
const optionsToRedirectsKey = /* @__PURE__ */ new Map();
|
|
35324
|
+
const redirectsKeyToMap = /* @__PURE__ */ new Map();
|
|
35325
|
+
let ownMap = /* @__PURE__ */ new Map();
|
|
35326
|
+
if (ownOptions)
|
|
35327
|
+
redirectsMap.set(ownOptions, ownMap);
|
|
35268
35328
|
return {
|
|
35269
|
-
getOwnMap,
|
|
35270
|
-
redirectsMap,
|
|
35271
35329
|
getOrCreateMapOfCacheRedirects,
|
|
35272
|
-
|
|
35273
|
-
|
|
35274
|
-
setOwnMap
|
|
35330
|
+
update,
|
|
35331
|
+
clear: clear2
|
|
35275
35332
|
};
|
|
35276
|
-
function getOwnMap() {
|
|
35277
|
-
return ownMap;
|
|
35278
|
-
}
|
|
35279
|
-
function setOwnOptions(newOptions) {
|
|
35280
|
-
options = newOptions;
|
|
35281
|
-
}
|
|
35282
|
-
function setOwnMap(newOwnMap) {
|
|
35283
|
-
ownMap = newOwnMap;
|
|
35284
|
-
}
|
|
35285
35333
|
function getOrCreateMapOfCacheRedirects(redirectedReference) {
|
|
35286
|
-
|
|
35287
|
-
|
|
35334
|
+
return redirectedReference ? getOrCreateMap(redirectedReference.commandLine.options) : ownMap;
|
|
35335
|
+
}
|
|
35336
|
+
function update(newOptions) {
|
|
35337
|
+
if (ownOptions !== newOptions) {
|
|
35338
|
+
if (ownOptions)
|
|
35339
|
+
ownMap = getOrCreateMap(newOptions);
|
|
35340
|
+
else
|
|
35341
|
+
redirectsMap.set(newOptions, ownMap);
|
|
35342
|
+
ownOptions = newOptions;
|
|
35288
35343
|
}
|
|
35289
|
-
|
|
35290
|
-
|
|
35291
|
-
|
|
35292
|
-
|
|
35293
|
-
|
|
35344
|
+
}
|
|
35345
|
+
function getOrCreateMap(redirectOptions) {
|
|
35346
|
+
let result = redirectsMap.get(redirectOptions);
|
|
35347
|
+
if (result)
|
|
35348
|
+
return result;
|
|
35349
|
+
const key = getRedirectsCacheKey(redirectOptions);
|
|
35350
|
+
result = redirectsKeyToMap.get(key);
|
|
35351
|
+
if (!result) {
|
|
35352
|
+
if (ownOptions) {
|
|
35353
|
+
const ownKey = getRedirectsCacheKey(ownOptions);
|
|
35354
|
+
if (ownKey === key)
|
|
35355
|
+
result = ownMap;
|
|
35356
|
+
else if (!redirectsKeyToMap.has(ownKey))
|
|
35357
|
+
redirectsKeyToMap.set(ownKey, ownMap);
|
|
35358
|
+
}
|
|
35359
|
+
redirectsKeyToMap.set(key, result != null ? result : result = /* @__PURE__ */ new Map());
|
|
35294
35360
|
}
|
|
35295
|
-
|
|
35361
|
+
redirectsMap.set(redirectOptions, result);
|
|
35362
|
+
return result;
|
|
35296
35363
|
}
|
|
35297
35364
|
function clear2() {
|
|
35365
|
+
const ownKey = ownOptions && optionsToRedirectsKey.get(ownOptions);
|
|
35298
35366
|
ownMap.clear();
|
|
35299
35367
|
redirectsMap.clear();
|
|
35368
|
+
optionsToRedirectsKey.clear();
|
|
35369
|
+
redirectsKeyToMap.clear();
|
|
35370
|
+
if (ownOptions) {
|
|
35371
|
+
if (ownKey)
|
|
35372
|
+
optionsToRedirectsKey.set(ownOptions, ownKey);
|
|
35373
|
+
redirectsMap.set(ownOptions, ownMap);
|
|
35374
|
+
}
|
|
35375
|
+
}
|
|
35376
|
+
function getRedirectsCacheKey(options) {
|
|
35377
|
+
let result = optionsToRedirectsKey.get(options);
|
|
35378
|
+
if (!result) {
|
|
35379
|
+
optionsToRedirectsKey.set(options, result = getKeyForCompilerOptions(options, moduleResolutionOptionDeclarations));
|
|
35380
|
+
}
|
|
35381
|
+
return result;
|
|
35300
35382
|
}
|
|
35301
35383
|
}
|
|
35302
35384
|
function createPackageJsonInfoCache(currentDirectory, getCanonicalFileName) {
|
|
@@ -35328,27 +35410,6 @@ ${lanes.join("\n")}
|
|
|
35328
35410
|
}
|
|
35329
35411
|
return result;
|
|
35330
35412
|
}
|
|
35331
|
-
function updateRedirectsMap(options, directoryToModuleNameMap, moduleNameToDirectoryMap) {
|
|
35332
|
-
if (!options.configFile)
|
|
35333
|
-
return;
|
|
35334
|
-
if (directoryToModuleNameMap.redirectsMap.size === 0) {
|
|
35335
|
-
Debug.assert(!moduleNameToDirectoryMap || moduleNameToDirectoryMap.redirectsMap.size === 0);
|
|
35336
|
-
Debug.assert(directoryToModuleNameMap.getOwnMap().size === 0);
|
|
35337
|
-
Debug.assert(!moduleNameToDirectoryMap || moduleNameToDirectoryMap.getOwnMap().size === 0);
|
|
35338
|
-
directoryToModuleNameMap.redirectsMap.set(options.configFile.path, directoryToModuleNameMap.getOwnMap());
|
|
35339
|
-
moduleNameToDirectoryMap == null ? void 0 : moduleNameToDirectoryMap.redirectsMap.set(options.configFile.path, moduleNameToDirectoryMap.getOwnMap());
|
|
35340
|
-
} else {
|
|
35341
|
-
Debug.assert(!moduleNameToDirectoryMap || moduleNameToDirectoryMap.redirectsMap.size > 0);
|
|
35342
|
-
const ref = {
|
|
35343
|
-
sourceFile: options.configFile,
|
|
35344
|
-
commandLine: { options }
|
|
35345
|
-
};
|
|
35346
|
-
directoryToModuleNameMap.setOwnMap(directoryToModuleNameMap.getOrCreateMapOfCacheRedirects(ref));
|
|
35347
|
-
moduleNameToDirectoryMap == null ? void 0 : moduleNameToDirectoryMap.setOwnMap(moduleNameToDirectoryMap.getOrCreateMapOfCacheRedirects(ref));
|
|
35348
|
-
}
|
|
35349
|
-
directoryToModuleNameMap.setOwnOptions(options);
|
|
35350
|
-
moduleNameToDirectoryMap == null ? void 0 : moduleNameToDirectoryMap.setOwnOptions(options);
|
|
35351
|
-
}
|
|
35352
35413
|
function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap) {
|
|
35353
35414
|
return {
|
|
35354
35415
|
getOrCreateCacheForDirectory,
|
|
@@ -35359,13 +35420,16 @@ ${lanes.join("\n")}
|
|
|
35359
35420
|
directoryToModuleNameMap.clear();
|
|
35360
35421
|
}
|
|
35361
35422
|
function update(options) {
|
|
35362
|
-
|
|
35423
|
+
directoryToModuleNameMap.update(options);
|
|
35363
35424
|
}
|
|
35364
35425
|
function getOrCreateCacheForDirectory(directoryName, redirectedReference) {
|
|
35365
35426
|
const path = toPath(directoryName, currentDirectory, getCanonicalFileName);
|
|
35366
35427
|
return getOrCreateCache(directoryToModuleNameMap, redirectedReference, path, () => createModeAwareCache());
|
|
35367
35428
|
}
|
|
35368
35429
|
}
|
|
35430
|
+
function createModeAwareCacheKey(specifier, mode) {
|
|
35431
|
+
return mode === void 0 ? specifier : `${mode}|${specifier}`;
|
|
35432
|
+
}
|
|
35369
35433
|
function createModeAwareCache() {
|
|
35370
35434
|
const underlying = /* @__PURE__ */ new Map();
|
|
35371
35435
|
const memoizedReverseKeys = /* @__PURE__ */ new Map();
|
|
@@ -35396,7 +35460,7 @@ ${lanes.join("\n")}
|
|
|
35396
35460
|
};
|
|
35397
35461
|
return cache;
|
|
35398
35462
|
function getUnderlyingCacheKey(specifier, mode) {
|
|
35399
|
-
const result =
|
|
35463
|
+
const result = createModeAwareCacheKey(specifier, mode);
|
|
35400
35464
|
memoizedReverseKeys.set(result, [specifier, mode]);
|
|
35401
35465
|
return result;
|
|
35402
35466
|
}
|
|
@@ -35416,9 +35480,10 @@ ${lanes.join("\n")}
|
|
|
35416
35480
|
}
|
|
35417
35481
|
return map2;
|
|
35418
35482
|
}
|
|
35419
|
-
function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options
|
|
35420
|
-
const
|
|
35421
|
-
|
|
35483
|
+
function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options) {
|
|
35484
|
+
const directoryToModuleNameMap = createCacheWithRedirects(options);
|
|
35485
|
+
const perDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap);
|
|
35486
|
+
const moduleNameToDirectoryMap = createCacheWithRedirects(options);
|
|
35422
35487
|
const packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName);
|
|
35423
35488
|
return {
|
|
35424
35489
|
...packageJsonInfoCache,
|
|
@@ -35438,11 +35503,12 @@ ${lanes.join("\n")}
|
|
|
35438
35503
|
moduleNameToDirectoryMap.clear();
|
|
35439
35504
|
}
|
|
35440
35505
|
function update(options2) {
|
|
35441
|
-
|
|
35506
|
+
directoryToModuleNameMap.update(options2);
|
|
35507
|
+
moduleNameToDirectoryMap.update(options2);
|
|
35442
35508
|
}
|
|
35443
35509
|
function getOrCreateCacheForModuleName(nonRelativeModuleName, mode, redirectedReference) {
|
|
35444
35510
|
Debug.assert(!isExternalModuleNameRelative(nonRelativeModuleName));
|
|
35445
|
-
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference,
|
|
35511
|
+
return getOrCreateCache(moduleNameToDirectoryMap, redirectedReference, createModeAwareCacheKey(nonRelativeModuleName, mode), createPerModuleNameCache);
|
|
35446
35512
|
}
|
|
35447
35513
|
function createPerModuleNameCache() {
|
|
35448
35514
|
const directoryPathMap = /* @__PURE__ */ new Map();
|
|
@@ -35490,8 +35556,9 @@ ${lanes.join("\n")}
|
|
|
35490
35556
|
}
|
|
35491
35557
|
}
|
|
35492
35558
|
}
|
|
35493
|
-
function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache
|
|
35494
|
-
const
|
|
35559
|
+
function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache) {
|
|
35560
|
+
const directoryToModuleNameMap = createCacheWithRedirects(options);
|
|
35561
|
+
const perDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap);
|
|
35495
35562
|
packageJsonInfoCache || (packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName));
|
|
35496
35563
|
return {
|
|
35497
35564
|
...packageJsonInfoCache,
|
|
@@ -45171,7 +45238,7 @@ ${lanes.join("\n")}
|
|
|
45171
45238
|
}
|
|
45172
45239
|
const contextFile = getSourceFileOfNode(getOriginalNode(context.enclosingDeclaration));
|
|
45173
45240
|
const resolutionMode = overrideImportMode || (contextFile == null ? void 0 : contextFile.impliedNodeFormat);
|
|
45174
|
-
const cacheKey =
|
|
45241
|
+
const cacheKey = createModeAwareCacheKey(contextFile.path, resolutionMode);
|
|
45175
45242
|
const links = getSymbolLinks(symbol);
|
|
45176
45243
|
let specifier = links.specifierCache && links.specifierCache.get(cacheKey);
|
|
45177
45244
|
if (!specifier) {
|
|
@@ -45194,9 +45261,6 @@ ${lanes.join("\n")}
|
|
|
45194
45261
|
links.specifierCache.set(cacheKey, specifier);
|
|
45195
45262
|
}
|
|
45196
45263
|
return specifier;
|
|
45197
|
-
function getSpecifierCacheKey(path, mode) {
|
|
45198
|
-
return mode === void 0 ? path : `${mode}|${path}`;
|
|
45199
|
-
}
|
|
45200
45264
|
}
|
|
45201
45265
|
function symbolToEntityNameNode(symbol) {
|
|
45202
45266
|
const identifier = factory.createIdentifier(unescapeLeadingUnderscores(symbol.escapedName));
|
|
@@ -45410,8 +45474,7 @@ ${lanes.join("\n")}
|
|
|
45410
45474
|
if (isSingleOrDoubleQuote(firstChar) && some(symbol2.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
|
|
45411
45475
|
return factory.createStringLiteral(getSpecifierForModuleSymbol(symbol2, context));
|
|
45412
45476
|
}
|
|
45413
|
-
|
|
45414
|
-
if (index === 0 || canUsePropertyAccess) {
|
|
45477
|
+
if (index === 0 || canUsePropertyAccess(symbolName2, languageVersion)) {
|
|
45415
45478
|
const identifier = setEmitFlags(factory.createIdentifier(symbolName2, typeParameterNodes), 33554432 /* NoAsciiEscaping */);
|
|
45416
45479
|
identifier.symbol = symbol2;
|
|
45417
45480
|
return index > 0 ? factory.createPropertyAccessExpression(createExpressionFromSymbolChain(chain2, index - 1), identifier) : identifier;
|
|
@@ -57483,24 +57546,7 @@ ${lanes.join("\n")}
|
|
|
57483
57546
|
return isFinite(n) && (!roundTripOnly || "" + n === s);
|
|
57484
57547
|
}
|
|
57485
57548
|
function parseBigIntLiteralType(text) {
|
|
57486
|
-
|
|
57487
|
-
const base10Value = parsePseudoBigInt(`${negative ? text.slice(1) : text}n`);
|
|
57488
|
-
return getBigIntLiteralType({ negative, base10Value });
|
|
57489
|
-
}
|
|
57490
|
-
function isValidBigIntString(s, roundTripOnly) {
|
|
57491
|
-
if (s === "")
|
|
57492
|
-
return false;
|
|
57493
|
-
const scanner2 = createScanner(99 /* ESNext */, false);
|
|
57494
|
-
let success = true;
|
|
57495
|
-
scanner2.setOnError(() => success = false);
|
|
57496
|
-
scanner2.setText(s + "n");
|
|
57497
|
-
let result = scanner2.scan();
|
|
57498
|
-
const negative = result === 40 /* MinusToken */;
|
|
57499
|
-
if (negative) {
|
|
57500
|
-
result = scanner2.scan();
|
|
57501
|
-
}
|
|
57502
|
-
const flags = scanner2.getTokenFlags();
|
|
57503
|
-
return success && result === 9 /* BigIntLiteral */ && scanner2.getTextPos() === s.length + 1 && !(flags & 512 /* ContainsSeparator */) && (!roundTripOnly || s === pseudoBigIntToString({ negative, base10Value: parsePseudoBigInt(scanner2.getTokenValue()) }));
|
|
57549
|
+
return getBigIntLiteralType(parseValidBigInt(text));
|
|
57504
57550
|
}
|
|
57505
57551
|
function isMemberOfStringMapping(source, target) {
|
|
57506
57552
|
if (target.flags & (4 /* String */ | 1 /* Any */)) {
|
|
@@ -64972,11 +65018,11 @@ ${lanes.join("\n")}
|
|
|
64972
65018
|
}
|
|
64973
65019
|
function checkSatisfiesExpression(node) {
|
|
64974
65020
|
checkSourceElement(node.type);
|
|
65021
|
+
const exprType = checkExpression(node.expression);
|
|
64975
65022
|
const targetType = getTypeFromTypeNode(node.type);
|
|
64976
65023
|
if (isErrorType(targetType)) {
|
|
64977
65024
|
return targetType;
|
|
64978
65025
|
}
|
|
64979
|
-
const exprType = checkExpression(node.expression);
|
|
64980
65026
|
checkTypeAssignableToAndOptionallyElaborate(exprType, targetType, node.type, node.expression, Diagnostics.Type_0_does_not_satisfy_the_expected_type_1);
|
|
64981
65027
|
return exprType;
|
|
64982
65028
|
}
|
|
@@ -100158,16 +100204,15 @@ ${lanes.join("\n")}
|
|
|
100158
100204
|
return [];
|
|
100159
100205
|
}
|
|
100160
100206
|
const resolutions = [];
|
|
100161
|
-
const cache =
|
|
100207
|
+
const cache = createModeAwareCache();
|
|
100162
100208
|
for (const name of names) {
|
|
100163
100209
|
let result;
|
|
100164
100210
|
const mode = getModeForFileReference(name, containingFileMode);
|
|
100165
100211
|
const strName = getResolutionName(name);
|
|
100166
|
-
|
|
100167
|
-
|
|
100168
|
-
result = cache.get(cacheKey);
|
|
100212
|
+
if (cache.has(strName, mode)) {
|
|
100213
|
+
result = cache.get(strName, mode);
|
|
100169
100214
|
} else {
|
|
100170
|
-
cache.set(
|
|
100215
|
+
cache.set(strName, mode, result = loader(strName, containingFile, redirectedReference, mode));
|
|
100171
100216
|
}
|
|
100172
100217
|
resolutions.push(result);
|
|
100173
100218
|
}
|
|
@@ -100243,18 +100288,17 @@ ${lanes.join("\n")}
|
|
|
100243
100288
|
return [];
|
|
100244
100289
|
}
|
|
100245
100290
|
const resolutions = [];
|
|
100246
|
-
const cache =
|
|
100291
|
+
const cache = createModeAwareCache();
|
|
100247
100292
|
let i = 0;
|
|
100248
100293
|
for (const entry of resolutionInfo ? resolutionInfo.names : names) {
|
|
100249
100294
|
let result;
|
|
100250
100295
|
const mode = !isString(entry) ? getModeForUsageLocation(containingFile, entry) : getModeForResolutionAtIndex(containingFile, i);
|
|
100251
100296
|
i++;
|
|
100252
100297
|
const name = isString(entry) ? entry : entry.text;
|
|
100253
|
-
|
|
100254
|
-
|
|
100255
|
-
result = cache.get(cacheKey);
|
|
100298
|
+
if (cache.has(name, mode)) {
|
|
100299
|
+
result = cache.get(name, mode);
|
|
100256
100300
|
} else {
|
|
100257
|
-
cache.set(
|
|
100301
|
+
cache.set(name, mode, result = loader(name, mode, containingFileName, redirectedReference));
|
|
100258
100302
|
}
|
|
100259
100303
|
resolutions.push(result);
|
|
100260
100304
|
}
|
|
@@ -104830,23 +104874,17 @@ ${lanes.join("\n")}
|
|
|
104830
104874
|
const getCurrentDirectory = memoize(() => resolutionHost.getCurrentDirectory());
|
|
104831
104875
|
const cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost();
|
|
104832
104876
|
const resolvedModuleNames = /* @__PURE__ */ new Map();
|
|
104833
|
-
const perDirectoryResolvedModuleNames = createCacheWithRedirects();
|
|
104834
|
-
const nonRelativeModuleNameCache = createCacheWithRedirects();
|
|
104835
104877
|
const moduleResolutionCache = createModuleResolutionCache(
|
|
104836
104878
|
getCurrentDirectory(),
|
|
104837
104879
|
resolutionHost.getCanonicalFileName,
|
|
104838
|
-
|
|
104839
|
-
perDirectoryResolvedModuleNames,
|
|
104840
|
-
nonRelativeModuleNameCache
|
|
104880
|
+
resolutionHost.getCompilationSettings()
|
|
104841
104881
|
);
|
|
104842
104882
|
const resolvedTypeReferenceDirectives = /* @__PURE__ */ new Map();
|
|
104843
|
-
const perDirectoryResolvedTypeReferenceDirectives = createCacheWithRedirects();
|
|
104844
104883
|
const typeReferenceDirectiveResolutionCache = createTypeReferenceDirectiveResolutionCache(
|
|
104845
104884
|
getCurrentDirectory(),
|
|
104846
104885
|
resolutionHost.getCanonicalFileName,
|
|
104847
|
-
|
|
104848
|
-
moduleResolutionCache.getPackageJsonInfoCache()
|
|
104849
|
-
perDirectoryResolvedTypeReferenceDirectives
|
|
104886
|
+
resolutionHost.getCompilationSettings(),
|
|
104887
|
+
moduleResolutionCache.getPackageJsonInfoCache()
|
|
104850
104888
|
);
|
|
104851
104889
|
const failedLookupDefaultExtensions = [".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */, ".json" /* Json */];
|
|
104852
104890
|
const customFailedLookupPaths = /* @__PURE__ */ new Map();
|
|
@@ -104907,6 +104945,8 @@ ${lanes.join("\n")}
|
|
|
104907
104945
|
affectingPathChecksForFile = void 0;
|
|
104908
104946
|
moduleResolutionCache.clear();
|
|
104909
104947
|
typeReferenceDirectiveResolutionCache.clear();
|
|
104948
|
+
moduleResolutionCache.update(resolutionHost.getCompilationSettings());
|
|
104949
|
+
typeReferenceDirectiveResolutionCache.update(resolutionHost.getCompilationSettings());
|
|
104910
104950
|
impliedFormatPackageJsons.clear();
|
|
104911
104951
|
hasChangedAutomaticTypeDirectiveNames = false;
|
|
104912
104952
|
}
|
|
@@ -105011,8 +105051,7 @@ ${lanes.join("\n")}
|
|
|
105011
105051
|
names,
|
|
105012
105052
|
containingFile,
|
|
105013
105053
|
redirectedReference,
|
|
105014
|
-
|
|
105015
|
-
perDirectoryCacheWithRedirects,
|
|
105054
|
+
perFileCache,
|
|
105016
105055
|
loader,
|
|
105017
105056
|
getResolutionWithResolvedFileName,
|
|
105018
105057
|
shouldRetryResolution,
|
|
@@ -105022,16 +105061,9 @@ ${lanes.join("\n")}
|
|
|
105022
105061
|
containingSourceFile,
|
|
105023
105062
|
containingSourceFileMode
|
|
105024
105063
|
}) {
|
|
105025
|
-
var _a2, _b, _c
|
|
105064
|
+
var _a2, _b, _c;
|
|
105026
105065
|
const path = resolutionHost.toPath(containingFile);
|
|
105027
|
-
const resolutionsInFile =
|
|
105028
|
-
const dirPath = getDirectoryPath(path);
|
|
105029
|
-
const perDirectoryCache = perDirectoryCacheWithRedirects.getOrCreateMapOfCacheRedirects(redirectedReference);
|
|
105030
|
-
let perDirectoryResolution = perDirectoryCache.get(dirPath);
|
|
105031
|
-
if (!perDirectoryResolution) {
|
|
105032
|
-
perDirectoryResolution = createModeAwareCache();
|
|
105033
|
-
perDirectoryCache.set(dirPath, perDirectoryResolution);
|
|
105034
|
-
}
|
|
105066
|
+
const resolutionsInFile = perFileCache.get(path) || perFileCache.set(path, createModeAwareCache()).get(path);
|
|
105035
105067
|
const resolvedModules = [];
|
|
105036
105068
|
const compilerOptions = resolutionHost.getCompilationSettings();
|
|
105037
105069
|
const hasInvalidatedNonRelativeUnresolvedImport = logChanges && isFileWithInvalidatedNonRelativeUnresolvedImports(path);
|
|
@@ -105047,28 +105079,9 @@ ${lanes.join("\n")}
|
|
|
105047
105079
|
let resolution = resolutionsInFile.get(name, mode);
|
|
105048
105080
|
if (!seenNamesInFile.has(name, mode) && unmatchedRedirects || !resolution || resolution.isInvalidated || hasInvalidatedNonRelativeUnresolvedImport && !isExternalModuleNameRelative(name) && shouldRetryResolution(resolution)) {
|
|
105049
105081
|
const existingResolution = resolution;
|
|
105050
|
-
|
|
105051
|
-
if (
|
|
105052
|
-
|
|
105053
|
-
const host = ((_a2 = resolutionHost.getCompilerHost) == null ? void 0 : _a2.call(resolutionHost)) || resolutionHost;
|
|
105054
|
-
if (isTraceEnabled(compilerOptions, host)) {
|
|
105055
|
-
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
105056
|
-
trace(
|
|
105057
|
-
host,
|
|
105058
|
-
loader === resolveModuleName2 ? (resolved == null ? void 0 : resolved.resolvedFileName) ? resolved.packageId ? Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4 : Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3 : Diagnostics.Reusing_resolution_of_module_0_from_1_found_in_cache_from_location_2_it_was_not_resolved : (resolved == null ? void 0 : resolved.resolvedFileName) ? resolved.packageId ? Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3_with_Package_ID_4 : Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_successfully_resolved_to_3 : Diagnostics.Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved,
|
|
105059
|
-
name,
|
|
105060
|
-
containingFile,
|
|
105061
|
-
getDirectoryPath(containingFile),
|
|
105062
|
-
resolved == null ? void 0 : resolved.resolvedFileName,
|
|
105063
|
-
(resolved == null ? void 0 : resolved.packageId) && packageIdToString(resolved.packageId)
|
|
105064
|
-
);
|
|
105065
|
-
}
|
|
105066
|
-
} else {
|
|
105067
|
-
resolution = loader(name, containingFile, compilerOptions, ((_b = resolutionHost.getCompilerHost) == null ? void 0 : _b.call(resolutionHost)) || resolutionHost, redirectedReference, containingSourceFile, mode);
|
|
105068
|
-
perDirectoryResolution.set(name, mode, resolution);
|
|
105069
|
-
if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) {
|
|
105070
|
-
resolutionHost.onDiscoveredSymlink();
|
|
105071
|
-
}
|
|
105082
|
+
resolution = loader(name, containingFile, compilerOptions, ((_a2 = resolutionHost.getCompilerHost) == null ? void 0 : _a2.call(resolutionHost)) || resolutionHost, redirectedReference, containingSourceFile, mode);
|
|
105083
|
+
if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) {
|
|
105084
|
+
resolutionHost.onDiscoveredSymlink();
|
|
105072
105085
|
}
|
|
105073
105086
|
resolutionsInFile.set(name, mode, resolution);
|
|
105074
105087
|
watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName);
|
|
@@ -105080,7 +105093,7 @@ ${lanes.join("\n")}
|
|
|
105080
105093
|
logChanges = false;
|
|
105081
105094
|
}
|
|
105082
105095
|
} else {
|
|
105083
|
-
const host = ((
|
|
105096
|
+
const host = ((_b = resolutionHost.getCompilerHost) == null ? void 0 : _b.call(resolutionHost)) || resolutionHost;
|
|
105084
105097
|
if (isTraceEnabled(compilerOptions, host) && !seenNamesInFile.has(name, mode)) {
|
|
105085
105098
|
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
105086
105099
|
trace(
|
|
@@ -105098,7 +105111,7 @@ ${lanes.join("\n")}
|
|
|
105098
105111
|
resolvedModules.push(getResolutionWithResolvedFileName(resolution));
|
|
105099
105112
|
}
|
|
105100
105113
|
if (resolutionInfo && (loader === resolveTypeReferenceDirective2 || containingSourceFile)) {
|
|
105101
|
-
(
|
|
105114
|
+
(_c = resolutionInfo.reusedNames) == null ? void 0 : _c.forEach((entry) => seenNamesInFile.set(
|
|
105102
105115
|
getResolutionName(entry),
|
|
105103
105116
|
!isString(entry) && isStringLiteralLike(entry) ? getModeForUsageLocation(containingSourceFile, entry) : getModeForFileReference(entry, containingSourceFileMode),
|
|
105104
105117
|
true
|
|
@@ -105137,8 +105150,7 @@ ${lanes.join("\n")}
|
|
|
105137
105150
|
names: typeDirectiveNames,
|
|
105138
105151
|
containingFile,
|
|
105139
105152
|
redirectedReference,
|
|
105140
|
-
|
|
105141
|
-
perDirectoryCacheWithRedirects: perDirectoryResolvedTypeReferenceDirectives,
|
|
105153
|
+
perFileCache: resolvedTypeReferenceDirectives,
|
|
105142
105154
|
loader: resolveTypeReferenceDirective2,
|
|
105143
105155
|
getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective2,
|
|
105144
105156
|
shouldRetryResolution: (resolution) => resolution.resolvedTypeReferenceDirective === void 0,
|
|
@@ -105151,8 +105163,7 @@ ${lanes.join("\n")}
|
|
|
105151
105163
|
names: moduleNames,
|
|
105152
105164
|
containingFile,
|
|
105153
105165
|
redirectedReference,
|
|
105154
|
-
|
|
105155
|
-
perDirectoryCacheWithRedirects: perDirectoryResolvedModuleNames,
|
|
105166
|
+
perFileCache: resolvedModuleNames,
|
|
105156
105167
|
loader: resolveModuleName2,
|
|
105157
105168
|
getResolutionWithResolvedFileName: getResolvedModule2,
|
|
105158
105169
|
shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension),
|
|
@@ -113906,24 +113917,8 @@ ${lanes.join("\n")}
|
|
|
113906
113917
|
getKeyForCompilationSettings
|
|
113907
113918
|
};
|
|
113908
113919
|
}
|
|
113909
|
-
function compilerOptionValueToString(value) {
|
|
113910
|
-
var _a2;
|
|
113911
|
-
if (value === null || typeof value !== "object") {
|
|
113912
|
-
return "" + value;
|
|
113913
|
-
}
|
|
113914
|
-
if (isArray(value)) {
|
|
113915
|
-
return `[${(_a2 = map(value, (e) => compilerOptionValueToString(e))) == null ? void 0 : _a2.join(",")}]`;
|
|
113916
|
-
}
|
|
113917
|
-
let str = "{";
|
|
113918
|
-
for (const key in value) {
|
|
113919
|
-
if (hasProperty(value, key)) {
|
|
113920
|
-
str += `${key}: ${compilerOptionValueToString(value[key])}`;
|
|
113921
|
-
}
|
|
113922
|
-
}
|
|
113923
|
-
return str + "}";
|
|
113924
|
-
}
|
|
113925
113920
|
function getKeyForCompilationSettings(settings) {
|
|
113926
|
-
return
|
|
113921
|
+
return getKeyForCompilerOptions(settings, sourceFileAffectingCompilerOptions);
|
|
113927
113922
|
}
|
|
113928
113923
|
function getDocumentRegistryBucketKeyWithMode(key, mode) {
|
|
113929
113924
|
return mode ? `${key}|${mode}` : key;
|
|
@@ -116121,6 +116116,9 @@ ${lanes.join("\n")}
|
|
|
116121
116116
|
const textPos = scanner.getTextPos();
|
|
116122
116117
|
if (textPos <= end) {
|
|
116123
116118
|
if (token === 79 /* Identifier */) {
|
|
116119
|
+
if (hasTabstop(parent2)) {
|
|
116120
|
+
continue;
|
|
116121
|
+
}
|
|
116124
116122
|
Debug.fail(`Did not expect ${Debug.formatSyntaxKind(parent2.kind)} to have an Identifier in its trivia`);
|
|
116125
116123
|
}
|
|
116126
116124
|
nodes.push(createNode(token, pos, textPos, parent2));
|
|
@@ -129562,6 +129560,13 @@ ${lanes.join("\n")}
|
|
|
129562
129560
|
if (!isChecked) {
|
|
129563
129561
|
getJSCompletionEntries(sourceFile, location.pos, uniqueNames, getEmitScriptTarget(compilerOptions), entries);
|
|
129564
129562
|
}
|
|
129563
|
+
let caseBlock;
|
|
129564
|
+
if (preferences.includeCompletionsWithInsertText && contextToken && (caseBlock = findAncestor(contextToken, isCaseBlock))) {
|
|
129565
|
+
const cases = getExhaustiveCaseSnippets(caseBlock, sourceFile, preferences, compilerOptions, host, program, formatContext);
|
|
129566
|
+
if (cases) {
|
|
129567
|
+
entries.push(cases.entry);
|
|
129568
|
+
}
|
|
129569
|
+
}
|
|
129565
129570
|
return {
|
|
129566
129571
|
flags: completionData.flags,
|
|
129567
129572
|
isGlobalCompletion: isInSnippetScope,
|
|
@@ -129575,6 +129580,187 @@ ${lanes.join("\n")}
|
|
|
129575
129580
|
function isCheckedFile(sourceFile, compilerOptions) {
|
|
129576
129581
|
return !isSourceFileJS(sourceFile) || !!isCheckJsEnabledForFile(sourceFile, compilerOptions);
|
|
129577
129582
|
}
|
|
129583
|
+
function getExhaustiveCaseSnippets(caseBlock, sourceFile, preferences, options, host, program, formatContext) {
|
|
129584
|
+
const clauses = caseBlock.clauses;
|
|
129585
|
+
const checker = program.getTypeChecker();
|
|
129586
|
+
const switchType = checker.getTypeAtLocation(caseBlock.parent.expression);
|
|
129587
|
+
if (switchType && switchType.isUnion() && every(switchType.types, (type) => type.isLiteral())) {
|
|
129588
|
+
const tracker = newCaseClauseTracker(checker, clauses);
|
|
129589
|
+
const target = getEmitScriptTarget(options);
|
|
129590
|
+
const quotePreference = getQuotePreference(sourceFile, preferences);
|
|
129591
|
+
const importAdder = ts_codefix_exports.createImportAdder(sourceFile, program, preferences, host);
|
|
129592
|
+
const elements = [];
|
|
129593
|
+
for (const type of switchType.types) {
|
|
129594
|
+
if (type.flags & 1024 /* EnumLiteral */) {
|
|
129595
|
+
Debug.assert(type.symbol, "An enum member type should have a symbol");
|
|
129596
|
+
Debug.assert(type.symbol.parent, "An enum member type should have a parent symbol (the enum symbol)");
|
|
129597
|
+
const enumValue = type.symbol.valueDeclaration && checker.getConstantValue(type.symbol.valueDeclaration);
|
|
129598
|
+
if (enumValue !== void 0) {
|
|
129599
|
+
if (tracker.hasValue(enumValue)) {
|
|
129600
|
+
continue;
|
|
129601
|
+
}
|
|
129602
|
+
tracker.addValue(enumValue);
|
|
129603
|
+
}
|
|
129604
|
+
const typeNode = ts_codefix_exports.typeToAutoImportableTypeNode(checker, importAdder, type, caseBlock, target);
|
|
129605
|
+
if (!typeNode) {
|
|
129606
|
+
return void 0;
|
|
129607
|
+
}
|
|
129608
|
+
const expr = typeNodeToExpression(typeNode, target, quotePreference);
|
|
129609
|
+
if (!expr) {
|
|
129610
|
+
return void 0;
|
|
129611
|
+
}
|
|
129612
|
+
elements.push(expr);
|
|
129613
|
+
} else if (!tracker.hasValue(type.value)) {
|
|
129614
|
+
switch (typeof type.value) {
|
|
129615
|
+
case "object":
|
|
129616
|
+
elements.push(factory.createBigIntLiteral(type.value));
|
|
129617
|
+
break;
|
|
129618
|
+
case "number":
|
|
129619
|
+
elements.push(factory.createNumericLiteral(type.value));
|
|
129620
|
+
break;
|
|
129621
|
+
case "string":
|
|
129622
|
+
elements.push(factory.createStringLiteral(type.value));
|
|
129623
|
+
break;
|
|
129624
|
+
}
|
|
129625
|
+
}
|
|
129626
|
+
}
|
|
129627
|
+
if (elements.length === 0) {
|
|
129628
|
+
return void 0;
|
|
129629
|
+
}
|
|
129630
|
+
const newClauses = map(elements, (element) => factory.createCaseClause(element, []));
|
|
129631
|
+
const newLineChar = getNewLineCharacter(options, maybeBind(host, host.getNewLine));
|
|
129632
|
+
const printer = createSnippetPrinter({
|
|
129633
|
+
removeComments: true,
|
|
129634
|
+
module: options.module,
|
|
129635
|
+
target: options.target,
|
|
129636
|
+
newLine: getNewLineKind(newLineChar)
|
|
129637
|
+
});
|
|
129638
|
+
const printNode = formatContext ? (node) => printer.printAndFormatNode(4 /* Unspecified */, node, sourceFile, formatContext) : (node) => printer.printNode(4 /* Unspecified */, node, sourceFile);
|
|
129639
|
+
const insertText = map(newClauses, (clause, i) => {
|
|
129640
|
+
if (preferences.includeCompletionsWithSnippetText) {
|
|
129641
|
+
return `${printNode(clause)}$${i + 1}`;
|
|
129642
|
+
}
|
|
129643
|
+
return `${printNode(clause)}`;
|
|
129644
|
+
}).join(newLineChar);
|
|
129645
|
+
const firstClause = printer.printNode(4 /* Unspecified */, newClauses[0], sourceFile);
|
|
129646
|
+
return {
|
|
129647
|
+
entry: {
|
|
129648
|
+
name: `${firstClause} ...`,
|
|
129649
|
+
kind: "" /* unknown */,
|
|
129650
|
+
sortText: SortText.GlobalsOrKeywords,
|
|
129651
|
+
insertText,
|
|
129652
|
+
hasAction: importAdder.hasFixes() || void 0,
|
|
129653
|
+
source: "SwitchCases/" /* SwitchCases */,
|
|
129654
|
+
isSnippet: preferences.includeCompletionsWithSnippetText ? true : void 0
|
|
129655
|
+
},
|
|
129656
|
+
importAdder
|
|
129657
|
+
};
|
|
129658
|
+
}
|
|
129659
|
+
return void 0;
|
|
129660
|
+
}
|
|
129661
|
+
function newCaseClauseTracker(checker, clauses) {
|
|
129662
|
+
const existingStrings = /* @__PURE__ */ new Set();
|
|
129663
|
+
const existingNumbers = /* @__PURE__ */ new Set();
|
|
129664
|
+
const existingBigInts = /* @__PURE__ */ new Set();
|
|
129665
|
+
for (const clause of clauses) {
|
|
129666
|
+
if (!isDefaultClause(clause)) {
|
|
129667
|
+
if (isLiteralExpression(clause.expression)) {
|
|
129668
|
+
const expression = clause.expression;
|
|
129669
|
+
switch (expression.kind) {
|
|
129670
|
+
case 14 /* NoSubstitutionTemplateLiteral */:
|
|
129671
|
+
case 10 /* StringLiteral */:
|
|
129672
|
+
existingStrings.add(expression.text);
|
|
129673
|
+
break;
|
|
129674
|
+
case 8 /* NumericLiteral */:
|
|
129675
|
+
existingNumbers.add(parseInt(expression.text));
|
|
129676
|
+
break;
|
|
129677
|
+
case 9 /* BigIntLiteral */:
|
|
129678
|
+
const parsedBigInt = parseBigInt(endsWith(expression.text, "n") ? expression.text.slice(0, -1) : expression.text);
|
|
129679
|
+
if (parsedBigInt) {
|
|
129680
|
+
existingBigInts.add(pseudoBigIntToString(parsedBigInt));
|
|
129681
|
+
}
|
|
129682
|
+
break;
|
|
129683
|
+
}
|
|
129684
|
+
} else {
|
|
129685
|
+
const symbol = checker.getSymbolAtLocation(clause.expression);
|
|
129686
|
+
if (symbol && symbol.valueDeclaration && isEnumMember(symbol.valueDeclaration)) {
|
|
129687
|
+
const enumValue = checker.getConstantValue(symbol.valueDeclaration);
|
|
129688
|
+
if (enumValue !== void 0) {
|
|
129689
|
+
addValue(enumValue);
|
|
129690
|
+
}
|
|
129691
|
+
}
|
|
129692
|
+
}
|
|
129693
|
+
}
|
|
129694
|
+
}
|
|
129695
|
+
return {
|
|
129696
|
+
addValue,
|
|
129697
|
+
hasValue
|
|
129698
|
+
};
|
|
129699
|
+
function addValue(value) {
|
|
129700
|
+
switch (typeof value) {
|
|
129701
|
+
case "string":
|
|
129702
|
+
existingStrings.add(value);
|
|
129703
|
+
break;
|
|
129704
|
+
case "number":
|
|
129705
|
+
existingNumbers.add(value);
|
|
129706
|
+
}
|
|
129707
|
+
}
|
|
129708
|
+
function hasValue(value) {
|
|
129709
|
+
switch (typeof value) {
|
|
129710
|
+
case "string":
|
|
129711
|
+
return existingStrings.has(value);
|
|
129712
|
+
case "number":
|
|
129713
|
+
return existingNumbers.has(value);
|
|
129714
|
+
case "object":
|
|
129715
|
+
return existingBigInts.has(pseudoBigIntToString(value));
|
|
129716
|
+
}
|
|
129717
|
+
}
|
|
129718
|
+
}
|
|
129719
|
+
function typeNodeToExpression(typeNode, languageVersion, quotePreference) {
|
|
129720
|
+
switch (typeNode.kind) {
|
|
129721
|
+
case 180 /* TypeReference */:
|
|
129722
|
+
const typeName = typeNode.typeName;
|
|
129723
|
+
return entityNameToExpression(typeName, languageVersion, quotePreference);
|
|
129724
|
+
case 196 /* IndexedAccessType */:
|
|
129725
|
+
const objectExpression = typeNodeToExpression(typeNode.objectType, languageVersion, quotePreference);
|
|
129726
|
+
const indexExpression = typeNodeToExpression(typeNode.indexType, languageVersion, quotePreference);
|
|
129727
|
+
return objectExpression && indexExpression && factory.createElementAccessExpression(objectExpression, indexExpression);
|
|
129728
|
+
case 198 /* LiteralType */:
|
|
129729
|
+
const literal = typeNode.literal;
|
|
129730
|
+
switch (literal.kind) {
|
|
129731
|
+
case 10 /* StringLiteral */:
|
|
129732
|
+
return factory.createStringLiteral(literal.text, quotePreference === 0 /* Single */);
|
|
129733
|
+
case 8 /* NumericLiteral */:
|
|
129734
|
+
return factory.createNumericLiteral(literal.text, literal.numericLiteralFlags);
|
|
129735
|
+
}
|
|
129736
|
+
return void 0;
|
|
129737
|
+
case 193 /* ParenthesizedType */:
|
|
129738
|
+
const exp = typeNodeToExpression(typeNode.type, languageVersion, quotePreference);
|
|
129739
|
+
return exp && (isIdentifier(exp) ? exp : factory.createParenthesizedExpression(exp));
|
|
129740
|
+
case 183 /* TypeQuery */:
|
|
129741
|
+
return entityNameToExpression(typeNode.exprName, languageVersion, quotePreference);
|
|
129742
|
+
case 202 /* ImportType */:
|
|
129743
|
+
Debug.fail(`We should not get an import type after calling 'codefix.typeToAutoImportableTypeNode'.`);
|
|
129744
|
+
}
|
|
129745
|
+
return void 0;
|
|
129746
|
+
}
|
|
129747
|
+
function entityNameToExpression(entityName, languageVersion, quotePreference) {
|
|
129748
|
+
if (isIdentifier(entityName)) {
|
|
129749
|
+
return entityName;
|
|
129750
|
+
}
|
|
129751
|
+
const unescapedName = unescapeLeadingUnderscores(entityName.right.escapedText);
|
|
129752
|
+
if (canUsePropertyAccess(unescapedName, languageVersion)) {
|
|
129753
|
+
return factory.createPropertyAccessExpression(
|
|
129754
|
+
entityNameToExpression(entityName.left, languageVersion, quotePreference),
|
|
129755
|
+
unescapedName
|
|
129756
|
+
);
|
|
129757
|
+
} else {
|
|
129758
|
+
return factory.createElementAccessExpression(
|
|
129759
|
+
entityNameToExpression(entityName.left, languageVersion, quotePreference),
|
|
129760
|
+
factory.createStringLiteral(unescapedName, quotePreference === 0 /* Single */)
|
|
129761
|
+
);
|
|
129762
|
+
}
|
|
129763
|
+
}
|
|
129578
129764
|
function isMemberCompletionKind(kind) {
|
|
129579
129765
|
switch (kind) {
|
|
129580
129766
|
case CompletionKind.ObjectPropertyDeclaration:
|
|
@@ -129981,7 +130167,9 @@ ${lanes.join("\n")}
|
|
|
129981
130167
|
};
|
|
129982
130168
|
return {
|
|
129983
130169
|
printSnippetList,
|
|
129984
|
-
printAndFormatSnippetList
|
|
130170
|
+
printAndFormatSnippetList,
|
|
130171
|
+
printNode,
|
|
130172
|
+
printAndFormatNode
|
|
129985
130173
|
};
|
|
129986
130174
|
function escapingWrite(s, write) {
|
|
129987
130175
|
const escaped = escapeSnippetText(s);
|
|
@@ -130030,6 +130218,40 @@ ${lanes.join("\n")}
|
|
|
130030
130218
|
const allChanges = escapes ? stableSort(concatenate(changes, escapes), (a, b) => compareTextSpans(a.span, b.span)) : changes;
|
|
130031
130219
|
return ts_textChanges_exports.applyChanges(syntheticFile.text, allChanges);
|
|
130032
130220
|
}
|
|
130221
|
+
function printNode(hint, node, sourceFile) {
|
|
130222
|
+
const unescaped = printUnescapedNode(hint, node, sourceFile);
|
|
130223
|
+
return escapes ? ts_textChanges_exports.applyChanges(unescaped, escapes) : unescaped;
|
|
130224
|
+
}
|
|
130225
|
+
function printUnescapedNode(hint, node, sourceFile) {
|
|
130226
|
+
escapes = void 0;
|
|
130227
|
+
writer.clear();
|
|
130228
|
+
printer.writeNode(hint, node, sourceFile, writer);
|
|
130229
|
+
return writer.getText();
|
|
130230
|
+
}
|
|
130231
|
+
function printAndFormatNode(hint, node, sourceFile, formatContext) {
|
|
130232
|
+
const syntheticFile = {
|
|
130233
|
+
text: printUnescapedNode(
|
|
130234
|
+
hint,
|
|
130235
|
+
node,
|
|
130236
|
+
sourceFile
|
|
130237
|
+
),
|
|
130238
|
+
getLineAndCharacterOfPosition(pos) {
|
|
130239
|
+
return getLineAndCharacterOfPosition(this, pos);
|
|
130240
|
+
}
|
|
130241
|
+
};
|
|
130242
|
+
const formatOptions = getFormatCodeSettingsForWriting(formatContext, sourceFile);
|
|
130243
|
+
const nodeWithPos = ts_textChanges_exports.assignPositionsToNode(node);
|
|
130244
|
+
const changes = ts_formatting_exports.formatNodeGivenIndentation(
|
|
130245
|
+
nodeWithPos,
|
|
130246
|
+
syntheticFile,
|
|
130247
|
+
sourceFile.languageVariant,
|
|
130248
|
+
0,
|
|
130249
|
+
0,
|
|
130250
|
+
{ ...formatContext, options: formatOptions }
|
|
130251
|
+
);
|
|
130252
|
+
const allChanges = escapes ? stableSort(concatenate(changes, escapes), (a, b) => compareTextSpans(a.span, b.span)) : changes;
|
|
130253
|
+
return ts_textChanges_exports.applyChanges(syntheticFile.text, allChanges);
|
|
130254
|
+
}
|
|
130033
130255
|
}
|
|
130034
130256
|
function originToCompletionEntryData(origin) {
|
|
130035
130257
|
const ambientModuleName = origin.fileName ? void 0 : stripQuotes(origin.moduleSymbol.name);
|
|
@@ -130233,6 +130455,9 @@ ${lanes.join("\n")}
|
|
|
130233
130455
|
return entries;
|
|
130234
130456
|
}
|
|
130235
130457
|
function getSymbolCompletionFromEntryId(program, log, sourceFile, position, entryId, host, preferences) {
|
|
130458
|
+
if (entryId.source === "SwitchCases/" /* SwitchCases */) {
|
|
130459
|
+
return { type: "cases" };
|
|
130460
|
+
}
|
|
130236
130461
|
if (entryId.data) {
|
|
130237
130462
|
const autoImport = getAutoImportSymbolFromCompletionEntryData(entryId.name, entryId.data, program, host);
|
|
130238
130463
|
if (autoImport) {
|
|
@@ -130271,9 +130496,9 @@ ${lanes.join("\n")}
|
|
|
130271
130496
|
const typeChecker = program.getTypeChecker();
|
|
130272
130497
|
const compilerOptions = program.getCompilerOptions();
|
|
130273
130498
|
const { name, source, data } = entryId;
|
|
130274
|
-
const contextToken =
|
|
130275
|
-
if (isInString(sourceFile, position,
|
|
130276
|
-
return ts_Completions_StringCompletions_exports.getStringLiteralCompletionDetails(name, sourceFile, position,
|
|
130499
|
+
const { previousToken, contextToken } = getRelevantTokens(position, sourceFile);
|
|
130500
|
+
if (isInString(sourceFile, position, previousToken)) {
|
|
130501
|
+
return ts_Completions_StringCompletions_exports.getStringLiteralCompletionDetails(name, sourceFile, position, previousToken, typeChecker, compilerOptions, host, cancellationToken, preferences);
|
|
130277
130502
|
}
|
|
130278
130503
|
const symbolCompletion = getSymbolCompletionFromEntryId(program, log, sourceFile, position, entryId, host, preferences);
|
|
130279
130504
|
switch (symbolCompletion.type) {
|
|
@@ -130293,14 +130518,49 @@ ${lanes.join("\n")}
|
|
|
130293
130518
|
}
|
|
130294
130519
|
}
|
|
130295
130520
|
case "symbol": {
|
|
130296
|
-
const { symbol, location, contextToken: contextToken2, origin, previousToken } = symbolCompletion;
|
|
130297
|
-
const { codeActions, sourceDisplay } = getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextToken2, origin, symbol, program, host, compilerOptions, sourceFile, position,
|
|
130521
|
+
const { symbol, location, contextToken: contextToken2, origin, previousToken: previousToken2 } = symbolCompletion;
|
|
130522
|
+
const { codeActions, sourceDisplay } = getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextToken2, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken2, formatContext, preferences, data, source, cancellationToken);
|
|
130298
130523
|
return createCompletionDetailsForSymbol(symbol, typeChecker, sourceFile, location, cancellationToken, codeActions, sourceDisplay);
|
|
130299
130524
|
}
|
|
130300
130525
|
case "literal": {
|
|
130301
130526
|
const { literal } = symbolCompletion;
|
|
130302
130527
|
return createSimpleDetails(completionNameForLiteral(sourceFile, preferences, literal), "string" /* string */, typeof literal === "string" ? 8 /* stringLiteral */ : 7 /* numericLiteral */);
|
|
130303
130528
|
}
|
|
130529
|
+
case "cases": {
|
|
130530
|
+
const { entry, importAdder } = getExhaustiveCaseSnippets(
|
|
130531
|
+
contextToken.parent,
|
|
130532
|
+
sourceFile,
|
|
130533
|
+
preferences,
|
|
130534
|
+
program.getCompilerOptions(),
|
|
130535
|
+
host,
|
|
130536
|
+
program,
|
|
130537
|
+
void 0
|
|
130538
|
+
);
|
|
130539
|
+
if (importAdder.hasFixes()) {
|
|
130540
|
+
const changes = ts_textChanges_exports.ChangeTracker.with(
|
|
130541
|
+
{ host, formatContext, preferences },
|
|
130542
|
+
importAdder.writeFixes
|
|
130543
|
+
);
|
|
130544
|
+
return {
|
|
130545
|
+
name: entry.name,
|
|
130546
|
+
kind: "" /* unknown */,
|
|
130547
|
+
kindModifiers: "",
|
|
130548
|
+
displayParts: [],
|
|
130549
|
+
sourceDisplay: void 0,
|
|
130550
|
+
codeActions: [{
|
|
130551
|
+
changes,
|
|
130552
|
+
description: diagnosticToString([Diagnostics.Includes_imports_of_types_referenced_by_0, name])
|
|
130553
|
+
}]
|
|
130554
|
+
};
|
|
130555
|
+
}
|
|
130556
|
+
return {
|
|
130557
|
+
name: entry.name,
|
|
130558
|
+
kind: "" /* unknown */,
|
|
130559
|
+
kindModifiers: "",
|
|
130560
|
+
displayParts: [],
|
|
130561
|
+
sourceDisplay: void 0
|
|
130562
|
+
};
|
|
130563
|
+
}
|
|
130304
130564
|
case "none":
|
|
130305
130565
|
return allKeywordsCompletions().some((c) => c.name === name) ? createSimpleDetails(name, "keyword" /* keyword */, 5 /* keyword */) : void 0;
|
|
130306
130566
|
default:
|
|
@@ -132187,6 +132447,7 @@ ${lanes.join("\n")}
|
|
|
132187
132447
|
CompletionSource2["ClassMemberSnippet"] = "ClassMemberSnippet/";
|
|
132188
132448
|
CompletionSource2["TypeOnlyAlias"] = "TypeOnlyAlias/";
|
|
132189
132449
|
CompletionSource2["ObjectLiteralMethodSnippet"] = "ObjectLiteralMethodSnippet/";
|
|
132450
|
+
CompletionSource2["SwitchCases"] = "SwitchCases/";
|
|
132190
132451
|
return CompletionSource2;
|
|
132191
132452
|
})(CompletionSource || {});
|
|
132192
132453
|
SymbolOriginInfoKind = /* @__PURE__ */ ((SymbolOriginInfoKind2) => {
|
|
@@ -137501,12 +137762,14 @@ ${lanes.join("\n")}
|
|
|
137501
137762
|
if (!selection || !isTypeNode(selection))
|
|
137502
137763
|
return { error: getLocaleSpecificMessage(Diagnostics.Selection_is_not_a_valid_type_node) };
|
|
137503
137764
|
const checker = context.program.getTypeChecker();
|
|
137504
|
-
const
|
|
137505
|
-
|
|
137765
|
+
const enclosingNode = getEnclosingNode(selection, isJS);
|
|
137766
|
+
if (enclosingNode === void 0)
|
|
137767
|
+
return { error: getLocaleSpecificMessage(Diagnostics.No_type_could_be_extracted_from_this_type_node) };
|
|
137768
|
+
const typeParameters = collectTypeParameters(checker, selection, enclosingNode, file);
|
|
137506
137769
|
if (!typeParameters)
|
|
137507
137770
|
return { error: getLocaleSpecificMessage(Diagnostics.No_type_could_be_extracted_from_this_type_node) };
|
|
137508
137771
|
const typeElements = flattenTypeLiteralNodeReference(checker, selection);
|
|
137509
|
-
return { isJS, selection,
|
|
137772
|
+
return { isJS, selection, enclosingNode, typeParameters, typeElements };
|
|
137510
137773
|
}
|
|
137511
137774
|
function flattenTypeLiteralNodeReference(checker, node) {
|
|
137512
137775
|
if (!node)
|
|
@@ -137532,7 +137795,7 @@ ${lanes.join("\n")}
|
|
|
137532
137795
|
function rangeContainsSkipTrivia(r1, node, file) {
|
|
137533
137796
|
return rangeContainsStartEnd(r1, skipTrivia(file.text, node.pos), node.end);
|
|
137534
137797
|
}
|
|
137535
|
-
function collectTypeParameters(checker, selection,
|
|
137798
|
+
function collectTypeParameters(checker, selection, enclosingNode, file) {
|
|
137536
137799
|
const result = [];
|
|
137537
137800
|
return visitor(selection) ? void 0 : result;
|
|
137538
137801
|
function visitor(node) {
|
|
@@ -137545,7 +137808,7 @@ ${lanes.join("\n")}
|
|
|
137545
137808
|
if (decl.name.escapedText === typeName.escapedText && rangeContainsSkipTrivia(decl, selection, file)) {
|
|
137546
137809
|
return true;
|
|
137547
137810
|
}
|
|
137548
|
-
if (rangeContainsSkipTrivia(
|
|
137811
|
+
if (rangeContainsSkipTrivia(enclosingNode, decl, file) && !rangeContainsSkipTrivia(selection, decl, file)) {
|
|
137549
137812
|
pushIfUnique(result, decl);
|
|
137550
137813
|
break;
|
|
137551
137814
|
}
|
|
@@ -137565,7 +137828,7 @@ ${lanes.join("\n")}
|
|
|
137565
137828
|
} else if (isTypeQueryNode(node)) {
|
|
137566
137829
|
if (isIdentifier(node.exprName)) {
|
|
137567
137830
|
const symbol = checker.resolveName(node.exprName.text, node.exprName, 111551 /* Value */, false);
|
|
137568
|
-
if ((symbol == null ? void 0 : symbol.valueDeclaration) && rangeContainsSkipTrivia(
|
|
137831
|
+
if ((symbol == null ? void 0 : symbol.valueDeclaration) && rangeContainsSkipTrivia(enclosingNode, symbol.valueDeclaration, file) && !rangeContainsSkipTrivia(selection, symbol.valueDeclaration, file)) {
|
|
137569
137832
|
return true;
|
|
137570
137833
|
}
|
|
137571
137834
|
} else {
|
|
@@ -137581,19 +137844,19 @@ ${lanes.join("\n")}
|
|
|
137581
137844
|
}
|
|
137582
137845
|
}
|
|
137583
137846
|
function doTypeAliasChange(changes, file, name, info) {
|
|
137584
|
-
const {
|
|
137847
|
+
const { enclosingNode, selection, typeParameters } = info;
|
|
137585
137848
|
const newTypeNode = factory.createTypeAliasDeclaration(
|
|
137586
137849
|
void 0,
|
|
137587
137850
|
name,
|
|
137588
137851
|
typeParameters.map((id) => factory.updateTypeParameterDeclaration(id, id.modifiers, id.name, id.constraint, void 0)),
|
|
137589
137852
|
selection
|
|
137590
137853
|
);
|
|
137591
|
-
changes.insertNodeBefore(file,
|
|
137854
|
+
changes.insertNodeBefore(file, enclosingNode, ignoreSourceNewlines(newTypeNode), true);
|
|
137592
137855
|
changes.replaceNode(file, selection, factory.createTypeReferenceNode(name, typeParameters.map((id) => factory.createTypeReferenceNode(id.name, void 0))), { leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude, trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.ExcludeWhitespace });
|
|
137593
137856
|
}
|
|
137594
137857
|
function doInterfaceChange(changes, file, name, info) {
|
|
137595
137858
|
var _a2;
|
|
137596
|
-
const {
|
|
137859
|
+
const { enclosingNode, selection, typeParameters, typeElements } = info;
|
|
137597
137860
|
const newTypeNode = factory.createInterfaceDeclaration(
|
|
137598
137861
|
void 0,
|
|
137599
137862
|
name,
|
|
@@ -137602,11 +137865,11 @@ ${lanes.join("\n")}
|
|
|
137602
137865
|
typeElements
|
|
137603
137866
|
);
|
|
137604
137867
|
setTextRange(newTypeNode, (_a2 = typeElements[0]) == null ? void 0 : _a2.parent);
|
|
137605
|
-
changes.insertNodeBefore(file,
|
|
137868
|
+
changes.insertNodeBefore(file, enclosingNode, ignoreSourceNewlines(newTypeNode), true);
|
|
137606
137869
|
changes.replaceNode(file, selection, factory.createTypeReferenceNode(name, typeParameters.map((id) => factory.createTypeReferenceNode(id.name, void 0))), { leadingTriviaOption: ts_textChanges_exports.LeadingTriviaOption.Exclude, trailingTriviaOption: ts_textChanges_exports.TrailingTriviaOption.ExcludeWhitespace });
|
|
137607
137870
|
}
|
|
137608
|
-
function doTypedefChange(changes, file, name, info) {
|
|
137609
|
-
const {
|
|
137871
|
+
function doTypedefChange(changes, program, file, name, info) {
|
|
137872
|
+
const { enclosingNode, selection, typeParameters } = info;
|
|
137610
137873
|
setEmitFlags(selection, 3072 /* NoComments */ | 4096 /* NoNestedComments */);
|
|
137611
137874
|
const node = factory.createJSDocTypedefTag(
|
|
137612
137875
|
factory.createIdentifier("typedef"),
|
|
@@ -137624,9 +137887,21 @@ ${lanes.join("\n")}
|
|
|
137624
137887
|
);
|
|
137625
137888
|
templates.push(template);
|
|
137626
137889
|
});
|
|
137627
|
-
|
|
137890
|
+
const jsDoc = factory.createJSDocComment(void 0, factory.createNodeArray(concatenate(templates, [node])));
|
|
137891
|
+
if (isJSDoc(enclosingNode)) {
|
|
137892
|
+
const pos = enclosingNode.getStart(file);
|
|
137893
|
+
const newLineCharacter = getNewLineCharacter(program.getCompilerOptions());
|
|
137894
|
+
changes.insertNodeAt(file, enclosingNode.getStart(file), jsDoc, {
|
|
137895
|
+
suffix: newLineCharacter + newLineCharacter + file.text.slice(getPrecedingNonSpaceCharacterPosition(file.text, pos - 1), pos)
|
|
137896
|
+
});
|
|
137897
|
+
} else {
|
|
137898
|
+
changes.insertNodeBefore(file, enclosingNode, jsDoc, true);
|
|
137899
|
+
}
|
|
137628
137900
|
changes.replaceNode(file, selection, factory.createTypeReferenceNode(name, typeParameters.map((id) => factory.createTypeReferenceNode(id.name, void 0))));
|
|
137629
137901
|
}
|
|
137902
|
+
function getEnclosingNode(node, isJS) {
|
|
137903
|
+
return findAncestor(node, isStatement) || (isJS ? findAncestor(node, isJSDoc) : void 0);
|
|
137904
|
+
}
|
|
137630
137905
|
var refactorName3, extractToTypeAliasAction, extractToInterfaceAction, extractToTypeDefAction;
|
|
137631
137906
|
var init_extractType = __esm({
|
|
137632
137907
|
"src/services/refactors/extractType.ts"() {
|
|
@@ -137680,7 +137955,7 @@ ${lanes.join("\n")}
|
|
|
137680
137955
|
return emptyArray;
|
|
137681
137956
|
},
|
|
137682
137957
|
getEditsForAction: function getRefactorEditsToExtractType(context, actionName2) {
|
|
137683
|
-
const { file } = context;
|
|
137958
|
+
const { file, program } = context;
|
|
137684
137959
|
const info = getRangeToExtract(context);
|
|
137685
137960
|
Debug.assert(info && !isRefactorErrorInfo(info), "Expected to find a range to extract");
|
|
137686
137961
|
const name = getUniqueName("NewType", file);
|
|
@@ -137691,7 +137966,7 @@ ${lanes.join("\n")}
|
|
|
137691
137966
|
return doTypeAliasChange(changes, file, name, info);
|
|
137692
137967
|
case extractToTypeDefAction.name:
|
|
137693
137968
|
Debug.assert(info.isJS, "Invalid actionName/JS combo");
|
|
137694
|
-
return doTypedefChange(changes, file, name, info);
|
|
137969
|
+
return doTypedefChange(changes, program, file, name, info);
|
|
137695
137970
|
case extractToInterfaceAction.name:
|
|
137696
137971
|
Debug.assert(!info.isJS && !!info.typeElements, "Invalid actionName/JS combo");
|
|
137697
137972
|
return doInterfaceChange(changes, file, name, info);
|
|
@@ -158087,6 +158362,7 @@ ${e.message}`;
|
|
|
158087
158362
|
canHaveModifiers: () => canHaveModifiers,
|
|
158088
158363
|
canJsonReportNoInputFiles: () => canJsonReportNoInputFiles,
|
|
158089
158364
|
canProduceDiagnostics: () => canProduceDiagnostics,
|
|
158365
|
+
canUsePropertyAccess: () => canUsePropertyAccess,
|
|
158090
158366
|
canWatchDirectoryOrFile: () => canWatchDirectoryOrFile,
|
|
158091
158367
|
cartesianProduct: () => cartesianProduct,
|
|
158092
158368
|
cast: () => cast,
|
|
@@ -158363,6 +158639,7 @@ ${e.message}`;
|
|
|
158363
158639
|
createMethod: () => createMethod,
|
|
158364
158640
|
createMethodSignature: () => createMethodSignature,
|
|
158365
158641
|
createModeAwareCache: () => createModeAwareCache,
|
|
158642
|
+
createModeAwareCacheKey: () => createModeAwareCacheKey,
|
|
158366
158643
|
createModifier: () => createModifier,
|
|
158367
158644
|
createModifiersFromModifierFlags: () => createModifiersFromModifierFlags,
|
|
158368
158645
|
createModuleBlock: () => createModuleBlock,
|
|
@@ -158842,6 +159119,7 @@ ${e.message}`;
|
|
|
158842
159119
|
getJSXImplicitImportBase: () => getJSXImplicitImportBase,
|
|
158843
159120
|
getJSXRuntimeImport: () => getJSXRuntimeImport,
|
|
158844
159121
|
getJSXTransformEnabled: () => getJSXTransformEnabled,
|
|
159122
|
+
getKeyForCompilerOptions: () => getKeyForCompilerOptions,
|
|
158845
159123
|
getLanguageVariant: () => getLanguageVariant,
|
|
158846
159124
|
getLastChild: () => getLastChild,
|
|
158847
159125
|
getLeadingCommentRanges: () => getLeadingCommentRanges,
|
|
@@ -159113,6 +159391,7 @@ ${e.message}`;
|
|
|
159113
159391
|
hasSyntacticModifier: () => hasSyntacticModifier,
|
|
159114
159392
|
hasSyntacticModifiers: () => hasSyntacticModifiers,
|
|
159115
159393
|
hasTSFileExtension: () => hasTSFileExtension,
|
|
159394
|
+
hasTabstop: () => hasTabstop,
|
|
159116
159395
|
hasTrailingDirectorySeparator: () => hasTrailingDirectorySeparator,
|
|
159117
159396
|
hasType: () => hasType,
|
|
159118
159397
|
hasTypeArguments: () => hasTypeArguments,
|
|
@@ -159762,6 +160041,7 @@ ${e.message}`;
|
|
|
159762
160041
|
isUnparsedSource: () => isUnparsedSource,
|
|
159763
160042
|
isUnparsedTextLike: () => isUnparsedTextLike,
|
|
159764
160043
|
isUrl: () => isUrl,
|
|
160044
|
+
isValidBigIntString: () => isValidBigIntString,
|
|
159765
160045
|
isValidESSymbolDeclaration: () => isValidESSymbolDeclaration,
|
|
159766
160046
|
isValidTypeOnlyAliasUseSite: () => isValidTypeOnlyAliasUseSite,
|
|
159767
160047
|
isValueSignatureDeclaration: () => isValueSignatureDeclaration,
|
|
@@ -159893,6 +160173,7 @@ ${e.message}`;
|
|
|
159893
160173
|
parameterIsThisKeyword: () => parameterIsThisKeyword,
|
|
159894
160174
|
parameterNamePart: () => parameterNamePart,
|
|
159895
160175
|
parseBaseNodeFactory: () => parseBaseNodeFactory,
|
|
160176
|
+
parseBigInt: () => parseBigInt,
|
|
159896
160177
|
parseBuildCommand: () => parseBuildCommand,
|
|
159897
160178
|
parseCommandLine: () => parseCommandLine,
|
|
159898
160179
|
parseCommandLineWorker: () => parseCommandLineWorker,
|
|
@@ -159911,6 +160192,7 @@ ${e.message}`;
|
|
|
159911
160192
|
parseNodeModuleFromPath: () => parseNodeModuleFromPath,
|
|
159912
160193
|
parsePackageName: () => parsePackageName,
|
|
159913
160194
|
parsePseudoBigInt: () => parsePseudoBigInt,
|
|
160195
|
+
parseValidBigInt: () => parseValidBigInt,
|
|
159914
160196
|
patchWriteFileEnsuringDirectory: () => patchWriteFileEnsuringDirectory,
|
|
159915
160197
|
pathContainsNodeModules: () => pathContainsNodeModules,
|
|
159916
160198
|
pathIsAbsolute: () => pathIsAbsolute,
|
|
@@ -160702,6 +160984,7 @@ ${e.message}`;
|
|
|
160702
160984
|
canHaveModifiers: () => canHaveModifiers,
|
|
160703
160985
|
canJsonReportNoInputFiles: () => canJsonReportNoInputFiles,
|
|
160704
160986
|
canProduceDiagnostics: () => canProduceDiagnostics,
|
|
160987
|
+
canUsePropertyAccess: () => canUsePropertyAccess,
|
|
160705
160988
|
canWatchDirectoryOrFile: () => canWatchDirectoryOrFile,
|
|
160706
160989
|
cartesianProduct: () => cartesianProduct,
|
|
160707
160990
|
cast: () => cast,
|
|
@@ -160978,6 +161261,7 @@ ${e.message}`;
|
|
|
160978
161261
|
createMethod: () => createMethod,
|
|
160979
161262
|
createMethodSignature: () => createMethodSignature,
|
|
160980
161263
|
createModeAwareCache: () => createModeAwareCache,
|
|
161264
|
+
createModeAwareCacheKey: () => createModeAwareCacheKey,
|
|
160981
161265
|
createModifier: () => createModifier,
|
|
160982
161266
|
createModifiersFromModifierFlags: () => createModifiersFromModifierFlags,
|
|
160983
161267
|
createModuleBlock: () => createModuleBlock,
|
|
@@ -161457,6 +161741,7 @@ ${e.message}`;
|
|
|
161457
161741
|
getJSXImplicitImportBase: () => getJSXImplicitImportBase,
|
|
161458
161742
|
getJSXRuntimeImport: () => getJSXRuntimeImport,
|
|
161459
161743
|
getJSXTransformEnabled: () => getJSXTransformEnabled,
|
|
161744
|
+
getKeyForCompilerOptions: () => getKeyForCompilerOptions,
|
|
161460
161745
|
getLanguageVariant: () => getLanguageVariant,
|
|
161461
161746
|
getLastChild: () => getLastChild,
|
|
161462
161747
|
getLeadingCommentRanges: () => getLeadingCommentRanges,
|
|
@@ -161728,6 +162013,7 @@ ${e.message}`;
|
|
|
161728
162013
|
hasSyntacticModifier: () => hasSyntacticModifier,
|
|
161729
162014
|
hasSyntacticModifiers: () => hasSyntacticModifiers,
|
|
161730
162015
|
hasTSFileExtension: () => hasTSFileExtension,
|
|
162016
|
+
hasTabstop: () => hasTabstop,
|
|
161731
162017
|
hasTrailingDirectorySeparator: () => hasTrailingDirectorySeparator,
|
|
161732
162018
|
hasType: () => hasType,
|
|
161733
162019
|
hasTypeArguments: () => hasTypeArguments,
|
|
@@ -162377,6 +162663,7 @@ ${e.message}`;
|
|
|
162377
162663
|
isUnparsedSource: () => isUnparsedSource,
|
|
162378
162664
|
isUnparsedTextLike: () => isUnparsedTextLike,
|
|
162379
162665
|
isUrl: () => isUrl,
|
|
162666
|
+
isValidBigIntString: () => isValidBigIntString,
|
|
162380
162667
|
isValidESSymbolDeclaration: () => isValidESSymbolDeclaration,
|
|
162381
162668
|
isValidTypeOnlyAliasUseSite: () => isValidTypeOnlyAliasUseSite,
|
|
162382
162669
|
isValueSignatureDeclaration: () => isValueSignatureDeclaration,
|
|
@@ -162508,6 +162795,7 @@ ${e.message}`;
|
|
|
162508
162795
|
parameterIsThisKeyword: () => parameterIsThisKeyword,
|
|
162509
162796
|
parameterNamePart: () => parameterNamePart,
|
|
162510
162797
|
parseBaseNodeFactory: () => parseBaseNodeFactory,
|
|
162798
|
+
parseBigInt: () => parseBigInt,
|
|
162511
162799
|
parseBuildCommand: () => parseBuildCommand,
|
|
162512
162800
|
parseCommandLine: () => parseCommandLine,
|
|
162513
162801
|
parseCommandLineWorker: () => parseCommandLineWorker,
|
|
@@ -162526,6 +162814,7 @@ ${e.message}`;
|
|
|
162526
162814
|
parseNodeModuleFromPath: () => parseNodeModuleFromPath,
|
|
162527
162815
|
parsePackageName: () => parsePackageName,
|
|
162528
162816
|
parsePseudoBigInt: () => parsePseudoBigInt,
|
|
162817
|
+
parseValidBigInt: () => parseValidBigInt,
|
|
162529
162818
|
patchWriteFileEnsuringDirectory: () => patchWriteFileEnsuringDirectory,
|
|
162530
162819
|
pathContainsNodeModules: () => pathContainsNodeModules,
|
|
162531
162820
|
pathIsAbsolute: () => pathIsAbsolute,
|