typescript 5.3.0-dev.20231009 → 5.3.0-dev.20231011
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 +168 -76
- package/lib/tsserver.js +265 -179
- package/lib/typescript.d.ts +15 -3
- package/lib/typescript.js +265 -179
- package/lib/typingsInstaller.js +39 -16
- package/package.json +4 -3
package/lib/tsserver.js
CHANGED
|
@@ -58,7 +58,6 @@ __export(server_exports, {
|
|
|
58
58
|
CompletionInfoFlags: () => CompletionInfoFlags,
|
|
59
59
|
CompletionTriggerKind: () => CompletionTriggerKind,
|
|
60
60
|
Completions: () => ts_Completions_exports,
|
|
61
|
-
ConfigFileProgramReloadLevel: () => ConfigFileProgramReloadLevel,
|
|
62
61
|
ContainerFlags: () => ContainerFlags,
|
|
63
62
|
ContextFlags: () => ContextFlags,
|
|
64
63
|
Debug: () => Debug,
|
|
@@ -145,6 +144,7 @@ __export(server_exports, {
|
|
|
145
144
|
PragmaKindFlags: () => PragmaKindFlags,
|
|
146
145
|
PrivateIdentifierKind: () => PrivateIdentifierKind,
|
|
147
146
|
ProcessLevel: () => ProcessLevel,
|
|
147
|
+
ProgramUpdateLevel: () => ProgramUpdateLevel,
|
|
148
148
|
QuotePreference: () => QuotePreference,
|
|
149
149
|
RelationComparisonResult: () => RelationComparisonResult,
|
|
150
150
|
Rename: () => ts_Rename_exports,
|
|
@@ -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-dev.
|
|
2331
|
+
var version = `${versionMajorMinor}.0-dev.20231011`;
|
|
2332
2332
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2333
2333
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2334
2334
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -17481,6 +17481,7 @@ function tryGetModuleSpecifierFromDeclaration(node) {
|
|
|
17481
17481
|
true
|
|
17482
17482
|
))) == null ? void 0 : _a.arguments[0];
|
|
17483
17483
|
case 272 /* ImportDeclaration */:
|
|
17484
|
+
case 278 /* ExportDeclaration */:
|
|
17484
17485
|
return tryCast(node.moduleSpecifier, isStringLiteralLike);
|
|
17485
17486
|
case 271 /* ImportEqualsDeclaration */:
|
|
17486
17487
|
return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike);
|
|
@@ -17492,6 +17493,8 @@ function tryGetModuleSpecifierFromDeclaration(node) {
|
|
|
17492
17493
|
return tryCast(node.parent.parent.moduleSpecifier, isStringLiteralLike);
|
|
17493
17494
|
case 276 /* ImportSpecifier */:
|
|
17494
17495
|
return tryCast(node.parent.parent.parent.moduleSpecifier, isStringLiteralLike);
|
|
17496
|
+
case 205 /* ImportType */:
|
|
17497
|
+
return isLiteralImportTypeNode(node) ? node.argument.literal : void 0;
|
|
17495
17498
|
default:
|
|
17496
17499
|
Debug.assertNever(node);
|
|
17497
17500
|
}
|
|
@@ -41390,7 +41393,7 @@ function resolvedTypeScriptOnly(resolved) {
|
|
|
41390
41393
|
Debug.assert(extensionIsTS(resolved.extension));
|
|
41391
41394
|
return { fileName: resolved.path, packageId: resolved.packageId };
|
|
41392
41395
|
}
|
|
41393
|
-
function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, legacyResult) {
|
|
41396
|
+
function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName, resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state, cache, legacyResult) {
|
|
41394
41397
|
if (!state.resultFromCache && !state.compilerOptions.preserveSymlinks && resolved && isExternalLibraryImport && !resolved.originalPath && !isExternalModuleNameRelative(moduleName)) {
|
|
41395
41398
|
const { resolvedFileName, originalPath } = getOriginalAndResolvedFileName(resolved.path, state.host, state.traceEnabled);
|
|
41396
41399
|
if (originalPath)
|
|
@@ -41403,15 +41406,25 @@ function createResolvedModuleWithFailedLookupLocationsHandlingSymlink(moduleName
|
|
|
41403
41406
|
affectingLocations,
|
|
41404
41407
|
diagnostics,
|
|
41405
41408
|
state.resultFromCache,
|
|
41409
|
+
cache,
|
|
41406
41410
|
legacyResult
|
|
41407
41411
|
);
|
|
41408
41412
|
}
|
|
41409
|
-
function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, legacyResult) {
|
|
41413
|
+
function createResolvedModuleWithFailedLookupLocations(resolved, isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, resultFromCache, cache, legacyResult) {
|
|
41410
41414
|
if (resultFromCache) {
|
|
41411
|
-
|
|
41412
|
-
|
|
41413
|
-
|
|
41414
|
-
|
|
41415
|
+
if (!(cache == null ? void 0 : cache.isReadonly)) {
|
|
41416
|
+
resultFromCache.failedLookupLocations = updateResolutionField(resultFromCache.failedLookupLocations, failedLookupLocations);
|
|
41417
|
+
resultFromCache.affectingLocations = updateResolutionField(resultFromCache.affectingLocations, affectingLocations);
|
|
41418
|
+
resultFromCache.resolutionDiagnostics = updateResolutionField(resultFromCache.resolutionDiagnostics, diagnostics);
|
|
41419
|
+
return resultFromCache;
|
|
41420
|
+
} else {
|
|
41421
|
+
return {
|
|
41422
|
+
...resultFromCache,
|
|
41423
|
+
failedLookupLocations: initializeResolutionFieldForReadonlyCache(resultFromCache.failedLookupLocations, failedLookupLocations),
|
|
41424
|
+
affectingLocations: initializeResolutionFieldForReadonlyCache(resultFromCache.affectingLocations, affectingLocations),
|
|
41425
|
+
resolutionDiagnostics: initializeResolutionFieldForReadonlyCache(resultFromCache.resolutionDiagnostics, diagnostics)
|
|
41426
|
+
};
|
|
41427
|
+
}
|
|
41415
41428
|
}
|
|
41416
41429
|
return {
|
|
41417
41430
|
resolvedModule: resolved && {
|
|
@@ -41439,6 +41452,13 @@ function updateResolutionField(to, value) {
|
|
|
41439
41452
|
to.push(...value);
|
|
41440
41453
|
return to;
|
|
41441
41454
|
}
|
|
41455
|
+
function initializeResolutionFieldForReadonlyCache(fromCache, value) {
|
|
41456
|
+
if (!(fromCache == null ? void 0 : fromCache.length))
|
|
41457
|
+
return initializeResolutionField(value);
|
|
41458
|
+
if (!value.length)
|
|
41459
|
+
return fromCache.slice();
|
|
41460
|
+
return [...fromCache, ...value];
|
|
41461
|
+
}
|
|
41442
41462
|
function readPackageJsonField(jsonContent, fieldName, typeOfTag, state) {
|
|
41443
41463
|
if (!hasProperty(jsonContent, fieldName)) {
|
|
41444
41464
|
if (state.traceEnabled) {
|
|
@@ -41666,15 +41686,15 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
41666
41686
|
affectingLocations: initializeResolutionField(affectingLocations),
|
|
41667
41687
|
resolutionDiagnostics: initializeResolutionField(diagnostics)
|
|
41668
41688
|
};
|
|
41669
|
-
if (containingDirectory) {
|
|
41670
|
-
cache
|
|
41689
|
+
if (containingDirectory && cache && !cache.isReadonly) {
|
|
41690
|
+
cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(
|
|
41671
41691
|
typeReferenceDirectiveName,
|
|
41672
41692
|
/*mode*/
|
|
41673
41693
|
resolutionMode,
|
|
41674
41694
|
result
|
|
41675
41695
|
);
|
|
41676
41696
|
if (!isExternalModuleNameRelative(typeReferenceDirectiveName)) {
|
|
41677
|
-
cache
|
|
41697
|
+
cache.getOrCreateCacheForNonRelativeName(typeReferenceDirectiveName, resolutionMode, redirectedReference).set(containingDirectory, result);
|
|
41678
41698
|
}
|
|
41679
41699
|
}
|
|
41680
41700
|
if (traceEnabled)
|
|
@@ -41881,7 +41901,8 @@ function createCacheWithRedirects(ownOptions, optionsToRedirectsKey) {
|
|
|
41881
41901
|
getMapOfCacheRedirects,
|
|
41882
41902
|
getOrCreateMapOfCacheRedirects,
|
|
41883
41903
|
update,
|
|
41884
|
-
clear: clear2
|
|
41904
|
+
clear: clear2,
|
|
41905
|
+
getOwnMap: () => ownMap
|
|
41885
41906
|
};
|
|
41886
41907
|
function getMapOfCacheRedirects(redirectedReference) {
|
|
41887
41908
|
return redirectedReference ? getOrCreateMap(
|
|
@@ -41988,7 +42009,8 @@ function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileNam
|
|
|
41988
42009
|
getFromDirectoryCache,
|
|
41989
42010
|
getOrCreateCacheForDirectory,
|
|
41990
42011
|
clear: clear2,
|
|
41991
|
-
update
|
|
42012
|
+
update,
|
|
42013
|
+
directoryToModuleNameMap
|
|
41992
42014
|
};
|
|
41993
42015
|
function clear2() {
|
|
41994
42016
|
directoryToModuleNameMap.clear();
|
|
@@ -42262,9 +42284,11 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
42262
42284
|
if (result && result.resolvedModule)
|
|
42263
42285
|
(_b = perfLogger) == null ? void 0 : _b.logInfoEvent(`Module "${moduleName}" resolved to "${result.resolvedModule.resolvedFileName}"`);
|
|
42264
42286
|
(_c = perfLogger) == null ? void 0 : _c.logStopResolveModule(result && result.resolvedModule ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
42265
|
-
cache
|
|
42266
|
-
|
|
42267
|
-
|
|
42287
|
+
if (cache && !cache.isReadonly) {
|
|
42288
|
+
cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(moduleName, resolutionMode, result);
|
|
42289
|
+
if (!isExternalModuleNameRelative(moduleName)) {
|
|
42290
|
+
cache.getOrCreateCacheForNonRelativeName(moduleName, resolutionMode, redirectedReference).set(containingDirectory, result);
|
|
42291
|
+
}
|
|
42268
42292
|
}
|
|
42269
42293
|
}
|
|
42270
42294
|
if (traceEnabled) {
|
|
@@ -42579,6 +42603,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
42579
42603
|
affectingLocations,
|
|
42580
42604
|
diagnostics,
|
|
42581
42605
|
state,
|
|
42606
|
+
cache,
|
|
42582
42607
|
legacyResult
|
|
42583
42608
|
);
|
|
42584
42609
|
function tryResolve(extensions2, state2) {
|
|
@@ -42980,7 +43005,7 @@ function getVersionPathsOfPackageJsonInfo(packageJsonInfo, state) {
|
|
|
42980
43005
|
return packageJsonInfo.contents.versionPaths || void 0;
|
|
42981
43006
|
}
|
|
42982
43007
|
function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
42983
|
-
var _a, _b, _c, _d, _e, _f
|
|
43008
|
+
var _a, _b, _c, _d, _e, _f;
|
|
42984
43009
|
const { host, traceEnabled } = state;
|
|
42985
43010
|
const packageJsonPath = combinePaths(packageDirectory, "package.json");
|
|
42986
43011
|
if (onlyRecordFailures) {
|
|
@@ -43008,15 +43033,17 @@ function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {
|
|
|
43008
43033
|
trace(host, Diagnostics.Found_package_json_at_0, packageJsonPath);
|
|
43009
43034
|
}
|
|
43010
43035
|
const result = { packageDirectory, contents: { packageJsonContent, versionPaths: void 0, resolvedEntrypoints: void 0 } };
|
|
43011
|
-
(
|
|
43012
|
-
|
|
43036
|
+
if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly)
|
|
43037
|
+
state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, result);
|
|
43038
|
+
(_e = state.affectingLocations) == null ? void 0 : _e.push(packageJsonPath);
|
|
43013
43039
|
return result;
|
|
43014
43040
|
} else {
|
|
43015
43041
|
if (directoryExists && traceEnabled) {
|
|
43016
43042
|
trace(host, Diagnostics.File_0_does_not_exist, packageJsonPath);
|
|
43017
43043
|
}
|
|
43018
|
-
(
|
|
43019
|
-
|
|
43044
|
+
if (state.packageJsonInfoCache && !state.packageJsonInfoCache.isReadonly)
|
|
43045
|
+
state.packageJsonInfoCache.setPackageJsonInfo(packageJsonPath, directoryExists);
|
|
43046
|
+
(_f = state.failedLookupLocations) == null ? void 0 : _f.push(packageJsonPath);
|
|
43020
43047
|
}
|
|
43021
43048
|
}
|
|
43022
43049
|
function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, jsonContent, versionPaths) {
|
|
@@ -43806,7 +43833,8 @@ function classicNameResolver(moduleName, containingFile, compilerOptions, host,
|
|
|
43806
43833
|
failedLookupLocations,
|
|
43807
43834
|
affectingLocations,
|
|
43808
43835
|
diagnostics,
|
|
43809
|
-
state
|
|
43836
|
+
state,
|
|
43837
|
+
cache
|
|
43810
43838
|
);
|
|
43811
43839
|
function tryResolve(extensions) {
|
|
43812
43840
|
const resolvedUsingSettings = tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, containingDirectory, loadModuleFromFileNoPackageId, state);
|
|
@@ -43925,7 +43953,9 @@ function loadModuleFromGlobalCache(moduleName, projectName, compilerOptions, hos
|
|
|
43925
43953
|
failedLookupLocations,
|
|
43926
43954
|
affectingLocations,
|
|
43927
43955
|
diagnostics,
|
|
43928
|
-
state.resultFromCache
|
|
43956
|
+
state.resultFromCache,
|
|
43957
|
+
/*cache*/
|
|
43958
|
+
void 0
|
|
43929
43959
|
);
|
|
43930
43960
|
}
|
|
43931
43961
|
function toSearchResult(value) {
|
|
@@ -70444,7 +70474,7 @@ function createTypeChecker(host) {
|
|
|
70444
70474
|
return createFlowType(narrowedType, isIncomplete(flowType));
|
|
70445
70475
|
}
|
|
70446
70476
|
function getTypeAtSwitchClause(flow) {
|
|
70447
|
-
const expr = flow.switchStatement.expression;
|
|
70477
|
+
const expr = skipParentheses(flow.switchStatement.expression);
|
|
70448
70478
|
const flowType = getTypeAtFlowNode(flow.antecedent);
|
|
70449
70479
|
let type = getTypeFromFlowType(flowType);
|
|
70450
70480
|
if (isMatchingReference(reference, expr)) {
|
|
@@ -78060,8 +78090,20 @@ function createTypeChecker(host) {
|
|
|
78060
78090
|
let hasReturnWithNoExpression = functionHasImplicitReturn(func);
|
|
78061
78091
|
let hasReturnOfTypeNever = false;
|
|
78062
78092
|
forEachReturnStatement(func.body, (returnStatement) => {
|
|
78063
|
-
|
|
78093
|
+
let expr = returnStatement.expression;
|
|
78064
78094
|
if (expr) {
|
|
78095
|
+
expr = skipParentheses(
|
|
78096
|
+
expr,
|
|
78097
|
+
/*excludeJSDocTypeAssertions*/
|
|
78098
|
+
true
|
|
78099
|
+
);
|
|
78100
|
+
if (functionFlags & 2 /* Async */ && expr.kind === 223 /* AwaitExpression */) {
|
|
78101
|
+
expr = skipParentheses(
|
|
78102
|
+
expr.expression,
|
|
78103
|
+
/*excludeJSDocTypeAssertions*/
|
|
78104
|
+
true
|
|
78105
|
+
);
|
|
78106
|
+
}
|
|
78065
78107
|
if (expr.kind === 213 /* CallExpression */ && expr.expression.kind === 80 /* Identifier */ && checkExpressionCached(expr.expression).symbol === func.symbol) {
|
|
78066
78108
|
hasReturnOfTypeNever = true;
|
|
78067
78109
|
return;
|
|
@@ -87038,7 +87080,16 @@ function createTypeChecker(host) {
|
|
|
87038
87080
|
}
|
|
87039
87081
|
return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, tracker, bundled);
|
|
87040
87082
|
},
|
|
87041
|
-
isImportRequiredByAugmentation
|
|
87083
|
+
isImportRequiredByAugmentation,
|
|
87084
|
+
tryFindAmbientModule: (moduleReferenceExpression) => {
|
|
87085
|
+
const node = getParseTreeNode(moduleReferenceExpression);
|
|
87086
|
+
const moduleSpecifier = node && isStringLiteralLike(node) ? node.text : void 0;
|
|
87087
|
+
return moduleSpecifier !== void 0 ? tryFindAmbientModule(
|
|
87088
|
+
moduleSpecifier,
|
|
87089
|
+
/*withAugmentations*/
|
|
87090
|
+
true
|
|
87091
|
+
) : void 0;
|
|
87092
|
+
}
|
|
87042
87093
|
};
|
|
87043
87094
|
function isImportRequiredByAugmentation(node) {
|
|
87044
87095
|
const file = getSourceFileOfNode(node);
|
|
@@ -111969,6 +112020,17 @@ function transformDeclarations(context) {
|
|
|
111969
112020
|
const container = getSourceFileOfNode(node);
|
|
111970
112021
|
refs.set(getOriginalNodeId(container), container);
|
|
111971
112022
|
}
|
|
112023
|
+
function trackReferencedAmbientModuleFromImport(node) {
|
|
112024
|
+
const moduleSpecifier = tryGetModuleSpecifierFromDeclaration(node);
|
|
112025
|
+
const symbol = moduleSpecifier && resolver.tryFindAmbientModule(moduleSpecifier);
|
|
112026
|
+
if (symbol == null ? void 0 : symbol.declarations) {
|
|
112027
|
+
for (const decl of symbol.declarations) {
|
|
112028
|
+
if (isAmbientModule(decl) && getSourceFileOfNode(decl) !== currentSourceFile) {
|
|
112029
|
+
trackReferencedAmbientModule(decl, symbol);
|
|
112030
|
+
}
|
|
112031
|
+
}
|
|
112032
|
+
}
|
|
112033
|
+
}
|
|
111972
112034
|
function handleSymbolAccessibilityError(symbolAccessibilityResult) {
|
|
111973
112035
|
if (symbolAccessibilityResult.accessibility === 0 /* Accessible */) {
|
|
111974
112036
|
if (symbolAccessibilityResult && symbolAccessibilityResult.aliasesToMakeVisible) {
|
|
@@ -112916,6 +112978,7 @@ function transformDeclarations(context) {
|
|
|
112916
112978
|
case 205 /* ImportType */: {
|
|
112917
112979
|
if (!isLiteralImportTypeNode(input))
|
|
112918
112980
|
return cleanup(input);
|
|
112981
|
+
trackReferencedAmbientModuleFromImport(input);
|
|
112919
112982
|
return cleanup(factory2.updateImportTypeNode(
|
|
112920
112983
|
input,
|
|
112921
112984
|
factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)),
|
|
@@ -112967,6 +113030,7 @@ function transformDeclarations(context) {
|
|
|
112967
113030
|
resultHasExternalModuleIndicator = true;
|
|
112968
113031
|
}
|
|
112969
113032
|
resultHasScopeMarker = true;
|
|
113033
|
+
trackReferencedAmbientModuleFromImport(input);
|
|
112970
113034
|
return factory2.updateExportDeclaration(
|
|
112971
113035
|
input,
|
|
112972
113036
|
input.modifiers,
|
|
@@ -113041,10 +113105,18 @@ function transformDeclarations(context) {
|
|
|
113041
113105
|
return;
|
|
113042
113106
|
switch (input.kind) {
|
|
113043
113107
|
case 271 /* ImportEqualsDeclaration */: {
|
|
113044
|
-
|
|
113108
|
+
const transformed = transformImportEqualsDeclaration(input);
|
|
113109
|
+
if (transformed) {
|
|
113110
|
+
trackReferencedAmbientModuleFromImport(input);
|
|
113111
|
+
}
|
|
113112
|
+
return transformed;
|
|
113045
113113
|
}
|
|
113046
113114
|
case 272 /* ImportDeclaration */: {
|
|
113047
|
-
|
|
113115
|
+
const transformed = transformImportDeclaration(input);
|
|
113116
|
+
if (transformed) {
|
|
113117
|
+
trackReferencedAmbientModuleFromImport(input);
|
|
113118
|
+
}
|
|
113119
|
+
return transformed;
|
|
113048
113120
|
}
|
|
113049
113121
|
}
|
|
113050
113122
|
if (isDeclaration(input) && isDeclarationAndNotVisible(input))
|
|
@@ -114658,7 +114730,8 @@ var notImplementedResolver = {
|
|
|
114658
114730
|
getSymbolOfExternalModuleSpecifier: notImplemented,
|
|
114659
114731
|
isBindingCapturedByNode: notImplemented,
|
|
114660
114732
|
getDeclarationStatementsForSourceFile: notImplemented,
|
|
114661
|
-
isImportRequiredByAugmentation: notImplemented
|
|
114733
|
+
isImportRequiredByAugmentation: notImplemented,
|
|
114734
|
+
tryFindAmbientModule: notImplemented
|
|
114662
114735
|
};
|
|
114663
114736
|
function createSourceFilesFromBundleBuildInfo(bundle, buildInfoDirectory, host) {
|
|
114664
114737
|
var _a;
|
|
@@ -119733,12 +119806,12 @@ function createCachedDirectoryStructureHost(host, currentDirectory, useCaseSensi
|
|
|
119733
119806
|
cachedReadDirectoryResult.clear();
|
|
119734
119807
|
}
|
|
119735
119808
|
}
|
|
119736
|
-
var
|
|
119737
|
-
|
|
119738
|
-
|
|
119739
|
-
|
|
119740
|
-
return
|
|
119741
|
-
})(
|
|
119809
|
+
var ProgramUpdateLevel = /* @__PURE__ */ ((ProgramUpdateLevel2) => {
|
|
119810
|
+
ProgramUpdateLevel2[ProgramUpdateLevel2["Update"] = 0] = "Update";
|
|
119811
|
+
ProgramUpdateLevel2[ProgramUpdateLevel2["RootNamesAndUpdate"] = 1] = "RootNamesAndUpdate";
|
|
119812
|
+
ProgramUpdateLevel2[ProgramUpdateLevel2["Full"] = 2] = "Full";
|
|
119813
|
+
return ProgramUpdateLevel2;
|
|
119814
|
+
})(ProgramUpdateLevel || {});
|
|
119742
119815
|
function updateSharedExtendedConfigFileWatcher(projectPath, options, extendedConfigFilesMap, createExtendedConfigFileWatch, toPath3) {
|
|
119743
119816
|
var _a;
|
|
119744
119817
|
const extendedConfigs = arrayToMap(((_a = options == null ? void 0 : options.configFile) == null ? void 0 : _a.extendedSourceFiles) || emptyArray, toPath3);
|
|
@@ -125949,6 +126022,10 @@ function getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirec
|
|
|
125949
126022
|
function getRootPathSplitLength(rootPath) {
|
|
125950
126023
|
return rootPath.split(directorySeparator).length - (hasTrailingDirectorySeparator(rootPath) ? 1 : 0);
|
|
125951
126024
|
}
|
|
126025
|
+
function getModuleResolutionHost(resolutionHost) {
|
|
126026
|
+
var _a;
|
|
126027
|
+
return ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
|
|
126028
|
+
}
|
|
125952
126029
|
function createModuleResolutionLoaderUsingGlobalCache(containingFile, redirectedReference, options, resolutionHost, moduleResolutionCache) {
|
|
125953
126030
|
return {
|
|
125954
126031
|
nameAndMode: moduleResolutionNameAndModeGetter,
|
|
@@ -125964,8 +126041,7 @@ function createModuleResolutionLoaderUsingGlobalCache(containingFile, redirected
|
|
|
125964
126041
|
};
|
|
125965
126042
|
}
|
|
125966
126043
|
function resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, compilerOptions, redirectedReference, mode) {
|
|
125967
|
-
|
|
125968
|
-
const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
|
|
126044
|
+
const host = getModuleResolutionHost(resolutionHost);
|
|
125969
126045
|
const primaryResult = resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode);
|
|
125970
126046
|
if (!resolutionHost.getGlobalCache) {
|
|
125971
126047
|
return primaryResult;
|
|
@@ -126136,6 +126212,10 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
126136
126212
|
};
|
|
126137
126213
|
}
|
|
126138
126214
|
function startCachingPerDirectoryResolution() {
|
|
126215
|
+
moduleResolutionCache.isReadonly = void 0;
|
|
126216
|
+
typeReferenceDirectiveResolutionCache.isReadonly = void 0;
|
|
126217
|
+
libraryResolutionCache.isReadonly = void 0;
|
|
126218
|
+
moduleResolutionCache.getPackageJsonInfoCache().isReadonly = void 0;
|
|
126139
126219
|
moduleResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
126140
126220
|
typeReferenceDirectiveResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
126141
126221
|
libraryResolutionCache.clearAllExceptPackageJsonInfoCache();
|
|
@@ -126193,6 +126273,10 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
126193
126273
|
directoryWatchesOfFailedLookups.forEach(closeDirectoryWatchesOfFailedLookup);
|
|
126194
126274
|
fileWatchesOfAffectingLocations.forEach(closeFileWatcherOfAffectingLocation);
|
|
126195
126275
|
hasChangedAutomaticTypeDirectiveNames = false;
|
|
126276
|
+
moduleResolutionCache.isReadonly = true;
|
|
126277
|
+
typeReferenceDirectiveResolutionCache.isReadonly = true;
|
|
126278
|
+
libraryResolutionCache.isReadonly = true;
|
|
126279
|
+
moduleResolutionCache.getPackageJsonInfoCache().isReadonly = true;
|
|
126196
126280
|
}
|
|
126197
126281
|
function closeDirectoryWatchesOfFailedLookup(watcher, path) {
|
|
126198
126282
|
if (watcher.refCount === 0) {
|
|
@@ -126221,7 +126305,6 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
126221
126305
|
shouldRetryResolution,
|
|
126222
126306
|
logChanges
|
|
126223
126307
|
}) {
|
|
126224
|
-
var _a;
|
|
126225
126308
|
const path = resolutionHost.toPath(containingFile);
|
|
126226
126309
|
const resolutionsInFile = perFileCache.get(path) || perFileCache.set(path, createModeAwareCache()).get(path);
|
|
126227
126310
|
const resolvedModules = [];
|
|
@@ -126253,7 +126336,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
126253
126336
|
logChanges = false;
|
|
126254
126337
|
}
|
|
126255
126338
|
} else {
|
|
126256
|
-
const host = (
|
|
126339
|
+
const host = getModuleResolutionHost(resolutionHost);
|
|
126257
126340
|
if (isTraceEnabled(options, host) && !seenNamesInFile.has(name, mode)) {
|
|
126258
126341
|
const resolved = getResolutionWithResolvedFileName(resolution);
|
|
126259
126342
|
trace(
|
|
@@ -126305,7 +126388,6 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
126305
126388
|
}
|
|
126306
126389
|
}
|
|
126307
126390
|
function resolveTypeReferenceDirectiveReferences(typeDirectiveReferences, containingFile, redirectedReference, options, containingSourceFile, reusedNames) {
|
|
126308
|
-
var _a;
|
|
126309
126391
|
return resolveNamesWithLocalCache({
|
|
126310
126392
|
entries: typeDirectiveReferences,
|
|
126311
126393
|
containingFile,
|
|
@@ -126318,7 +126400,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
126318
126400
|
containingFile,
|
|
126319
126401
|
redirectedReference,
|
|
126320
126402
|
options,
|
|
126321
|
-
(
|
|
126403
|
+
getModuleResolutionHost(resolutionHost),
|
|
126322
126404
|
typeReferenceDirectiveResolutionCache
|
|
126323
126405
|
),
|
|
126324
126406
|
getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective,
|
|
@@ -126350,8 +126432,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
126350
126432
|
});
|
|
126351
126433
|
}
|
|
126352
126434
|
function resolveLibrary2(libraryName, resolveFrom, options, libFileName) {
|
|
126353
|
-
|
|
126354
|
-
const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
|
|
126435
|
+
const host = getModuleResolutionHost(resolutionHost);
|
|
126355
126436
|
let resolution = resolvedLibraries == null ? void 0 : resolvedLibraries.get(libFileName);
|
|
126356
126437
|
if (!resolution || resolution.isInvalidated) {
|
|
126357
126438
|
const existingResolution = resolution;
|
|
@@ -126385,6 +126466,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
126385
126466
|
return resolution;
|
|
126386
126467
|
}
|
|
126387
126468
|
function resolveSingleModuleNameWithoutWatching(moduleName, containingFile) {
|
|
126469
|
+
var _a, _b;
|
|
126388
126470
|
const path = resolutionHost.toPath(containingFile);
|
|
126389
126471
|
const resolutionsInFile = resolvedModuleNames.get(path);
|
|
126390
126472
|
const resolution = resolutionsInFile == null ? void 0 : resolutionsInFile.get(
|
|
@@ -126394,7 +126476,17 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
126394
126476
|
);
|
|
126395
126477
|
if (resolution && !resolution.isInvalidated)
|
|
126396
126478
|
return resolution;
|
|
126397
|
-
|
|
126479
|
+
const data = (_a = resolutionHost.beforeResolveSingleModuleNameWithoutWatching) == null ? void 0 : _a.call(resolutionHost, moduleResolutionCache);
|
|
126480
|
+
const host = getModuleResolutionHost(resolutionHost);
|
|
126481
|
+
const result = resolveModuleName(
|
|
126482
|
+
moduleName,
|
|
126483
|
+
containingFile,
|
|
126484
|
+
resolutionHost.getCompilationSettings(),
|
|
126485
|
+
host,
|
|
126486
|
+
moduleResolutionCache
|
|
126487
|
+
);
|
|
126488
|
+
(_b = resolutionHost.afterResolveSingleModuleNameWithoutWatching) == null ? void 0 : _b.call(resolutionHost, moduleResolutionCache, moduleName, containingFile, result, data);
|
|
126489
|
+
return result;
|
|
126398
126490
|
}
|
|
126399
126491
|
function isNodeModulesAtTypesDirectory(dirPath) {
|
|
126400
126492
|
return endsWith(dirPath, "/node_modules/@types");
|
|
@@ -127565,7 +127657,7 @@ function createWatchCompilerHost2(rootFilesOrConfigFileName, options, system, cr
|
|
|
127565
127657
|
}
|
|
127566
127658
|
function createWatchProgram(host) {
|
|
127567
127659
|
let builderProgram;
|
|
127568
|
-
let
|
|
127660
|
+
let updateLevel;
|
|
127569
127661
|
let missingFilesMap;
|
|
127570
127662
|
let watchedWildcardDirectories;
|
|
127571
127663
|
let timerToUpdateProgram;
|
|
@@ -127924,7 +128016,7 @@ function createWatchProgram(host) {
|
|
|
127924
128016
|
}
|
|
127925
128017
|
function scheduleProgramReload() {
|
|
127926
128018
|
Debug.assert(!!configFileName);
|
|
127927
|
-
|
|
128019
|
+
updateLevel = 2 /* Full */;
|
|
127928
128020
|
scheduleProgramUpdate();
|
|
127929
128021
|
}
|
|
127930
128022
|
function updateProgramWithWatchStatus() {
|
|
@@ -127934,8 +128026,8 @@ function createWatchProgram(host) {
|
|
|
127934
128026
|
}
|
|
127935
128027
|
function updateProgram() {
|
|
127936
128028
|
var _a, _b, _c, _d;
|
|
127937
|
-
switch (
|
|
127938
|
-
case 1 /*
|
|
128029
|
+
switch (updateLevel) {
|
|
128030
|
+
case 1 /* RootNamesAndUpdate */:
|
|
127939
128031
|
(_a = perfLogger) == null ? void 0 : _a.logStartUpdateProgram("PartialConfigReload");
|
|
127940
128032
|
reloadFileNamesFromConfigFile();
|
|
127941
128033
|
break;
|
|
@@ -127955,7 +128047,7 @@ function createWatchProgram(host) {
|
|
|
127955
128047
|
writeLog("Reloading new file names and options");
|
|
127956
128048
|
Debug.assert(compilerOptions);
|
|
127957
128049
|
Debug.assert(configFileName);
|
|
127958
|
-
|
|
128050
|
+
updateLevel = 0 /* Update */;
|
|
127959
128051
|
rootFileNames = getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
|
|
127960
128052
|
if (updateErrorForNoInputFiles(rootFileNames, getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) {
|
|
127961
128053
|
hasChangedConfigFileParsingErrors = true;
|
|
@@ -127965,7 +128057,7 @@ function createWatchProgram(host) {
|
|
|
127965
128057
|
function reloadConfigFile() {
|
|
127966
128058
|
Debug.assert(configFileName);
|
|
127967
128059
|
writeLog(`Reloading config file: ${configFileName}`);
|
|
127968
|
-
|
|
128060
|
+
updateLevel = 0 /* Update */;
|
|
127969
128061
|
if (cachedDirectoryStructureHost) {
|
|
127970
128062
|
cachedDirectoryStructureHost.clearCache();
|
|
127971
128063
|
}
|
|
@@ -128002,9 +128094,9 @@ function createWatchProgram(host) {
|
|
|
128002
128094
|
const configPath = toPath3(configFileName2);
|
|
128003
128095
|
let config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath);
|
|
128004
128096
|
if (config) {
|
|
128005
|
-
if (!config.
|
|
128097
|
+
if (!config.updateLevel)
|
|
128006
128098
|
return config.parsedCommandLine;
|
|
128007
|
-
if (config.parsedCommandLine && config.
|
|
128099
|
+
if (config.parsedCommandLine && config.updateLevel === 1 /* RootNamesAndUpdate */ && !host.getParsedCommandLine) {
|
|
128008
128100
|
writeLog("Reloading new file names and options");
|
|
128009
128101
|
Debug.assert(compilerOptions);
|
|
128010
128102
|
const fileNames = getFileNamesFromConfigSpecs(
|
|
@@ -128014,7 +128106,7 @@ function createWatchProgram(host) {
|
|
|
128014
128106
|
parseConfigFileHost
|
|
128015
128107
|
);
|
|
128016
128108
|
config.parsedCommandLine = { ...config.parsedCommandLine, fileNames };
|
|
128017
|
-
config.
|
|
128109
|
+
config.updateLevel = void 0;
|
|
128018
128110
|
return config.parsedCommandLine;
|
|
128019
128111
|
}
|
|
128020
128112
|
}
|
|
@@ -128022,7 +128114,7 @@ function createWatchProgram(host) {
|
|
|
128022
128114
|
const parsedCommandLine = host.getParsedCommandLine ? host.getParsedCommandLine(configFileName2) : getParsedCommandLineFromConfigFileHost(configFileName2);
|
|
128023
128115
|
if (config) {
|
|
128024
128116
|
config.parsedCommandLine = parsedCommandLine;
|
|
128025
|
-
config.
|
|
128117
|
+
config.updateLevel = void 0;
|
|
128026
128118
|
} else {
|
|
128027
128119
|
(parsedConfigs || (parsedConfigs = /* @__PURE__ */ new Map())).set(configPath, config = { parsedCommandLine });
|
|
128028
128120
|
}
|
|
@@ -128119,8 +128211,8 @@ function createWatchProgram(host) {
|
|
|
128119
128211
|
toPath: toPath3
|
|
128120
128212
|
}))
|
|
128121
128213
|
return;
|
|
128122
|
-
if (
|
|
128123
|
-
|
|
128214
|
+
if (updateLevel !== 2 /* Full */) {
|
|
128215
|
+
updateLevel = 1 /* RootNamesAndUpdate */;
|
|
128124
128216
|
scheduleProgramUpdate();
|
|
128125
128217
|
}
|
|
128126
128218
|
},
|
|
@@ -128146,11 +128238,11 @@ function createWatchProgram(host) {
|
|
|
128146
128238
|
return;
|
|
128147
128239
|
projects.forEach((projectPath) => {
|
|
128148
128240
|
if (configFileName && toPath3(configFileName) === projectPath) {
|
|
128149
|
-
|
|
128241
|
+
updateLevel = 2 /* Full */;
|
|
128150
128242
|
} else {
|
|
128151
128243
|
const config = parsedConfigs == null ? void 0 : parsedConfigs.get(projectPath);
|
|
128152
128244
|
if (config)
|
|
128153
|
-
config.
|
|
128245
|
+
config.updateLevel = 2 /* Full */;
|
|
128154
128246
|
resolutionCache.removeResolutionsFromProjectReferenceRedirects(projectPath);
|
|
128155
128247
|
}
|
|
128156
128248
|
scheduleProgramUpdate();
|
|
@@ -128171,7 +128263,7 @@ function createWatchProgram(host) {
|
|
|
128171
128263
|
updateCachedSystemWithFile(configFileName2, configPath, eventKind);
|
|
128172
128264
|
const config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath);
|
|
128173
128265
|
if (config)
|
|
128174
|
-
config.
|
|
128266
|
+
config.updateLevel = 2 /* Full */;
|
|
128175
128267
|
resolutionCache.removeResolutionsFromProjectReferenceRedirects(configPath);
|
|
128176
128268
|
scheduleProgramUpdate();
|
|
128177
128269
|
},
|
|
@@ -128209,8 +128301,8 @@ function createWatchProgram(host) {
|
|
|
128209
128301
|
toPath: toPath3
|
|
128210
128302
|
}))
|
|
128211
128303
|
return;
|
|
128212
|
-
if (config.
|
|
128213
|
-
config.
|
|
128304
|
+
if (config.updateLevel !== 2 /* Full */) {
|
|
128305
|
+
config.updateLevel = 1 /* RootNamesAndUpdate */;
|
|
128214
128306
|
scheduleProgramUpdate();
|
|
128215
128307
|
}
|
|
128216
128308
|
},
|
|
@@ -128673,12 +128765,12 @@ function clearProjectStatus(state, resolved) {
|
|
|
128673
128765
|
state.projectStatus.delete(resolved);
|
|
128674
128766
|
state.diagnostics.delete(resolved);
|
|
128675
128767
|
}
|
|
128676
|
-
function addProjToQueue({ projectPendingBuild }, proj,
|
|
128768
|
+
function addProjToQueue({ projectPendingBuild }, proj, updateLevel) {
|
|
128677
128769
|
const value = projectPendingBuild.get(proj);
|
|
128678
128770
|
if (value === void 0) {
|
|
128679
|
-
projectPendingBuild.set(proj,
|
|
128680
|
-
} else if (value <
|
|
128681
|
-
projectPendingBuild.set(proj,
|
|
128771
|
+
projectPendingBuild.set(proj, updateLevel);
|
|
128772
|
+
} else if (value < updateLevel) {
|
|
128773
|
+
projectPendingBuild.set(proj, updateLevel);
|
|
128682
128774
|
}
|
|
128683
128775
|
}
|
|
128684
128776
|
function setupInitialBuild(state, cancellationToken) {
|
|
@@ -128692,7 +128784,7 @@ function setupInitialBuild(state, cancellationToken) {
|
|
|
128692
128784
|
buildOrder.forEach(
|
|
128693
128785
|
(configFileName) => state.projectPendingBuild.set(
|
|
128694
128786
|
toResolvedConfigFilePath(state, configFileName),
|
|
128695
|
-
0 /*
|
|
128787
|
+
0 /* Update */
|
|
128696
128788
|
)
|
|
128697
128789
|
);
|
|
128698
128790
|
if (cancellationToken) {
|
|
@@ -129134,8 +129226,8 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
|
|
|
129134
129226
|
for (let projectIndex = 0; projectIndex < buildOrder.length; projectIndex++) {
|
|
129135
129227
|
const project = buildOrder[projectIndex];
|
|
129136
129228
|
const projectPath = toResolvedConfigFilePath(state, project);
|
|
129137
|
-
const
|
|
129138
|
-
if (
|
|
129229
|
+
const updateLevel = state.projectPendingBuild.get(projectPath);
|
|
129230
|
+
if (updateLevel === void 0)
|
|
129139
129231
|
continue;
|
|
129140
129232
|
if (reportQueue) {
|
|
129141
129233
|
reportQueue = false;
|
|
@@ -129147,13 +129239,13 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
|
|
|
129147
129239
|
projectPendingBuild.delete(projectPath);
|
|
129148
129240
|
continue;
|
|
129149
129241
|
}
|
|
129150
|
-
if (
|
|
129242
|
+
if (updateLevel === 2 /* Full */) {
|
|
129151
129243
|
watchConfigFile(state, project, projectPath, config);
|
|
129152
129244
|
watchExtendedConfigFiles(state, projectPath, config);
|
|
129153
129245
|
watchWildCardDirectories(state, project, projectPath, config);
|
|
129154
129246
|
watchInputFiles(state, project, projectPath, config);
|
|
129155
129247
|
watchPackageJsonFiles(state, project, projectPath, config);
|
|
129156
|
-
} else if (
|
|
129248
|
+
} else if (updateLevel === 1 /* RootNamesAndUpdate */) {
|
|
129157
129249
|
config.fileNames = getFileNamesFromConfigSpecs(config.options.configFile.configFileSpecs, getDirectoryPath(project), config.options, state.parseConfigFileHost);
|
|
129158
129250
|
updateErrorForNoInputFiles(config.fileNames, project, config.options.configFile.configFileSpecs, config.errors, canJsonReportNoInputFiles(config.raw));
|
|
129159
129251
|
watchInputFiles(state, project, projectPath, config);
|
|
@@ -129740,7 +129832,7 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con
|
|
|
129740
129832
|
break;
|
|
129741
129833
|
}
|
|
129742
129834
|
}
|
|
129743
|
-
addProjToQueue(state, nextProjectPath, 0 /*
|
|
129835
|
+
addProjToQueue(state, nextProjectPath, 0 /* Update */);
|
|
129744
129836
|
break;
|
|
129745
129837
|
}
|
|
129746
129838
|
}
|
|
@@ -129809,7 +129901,7 @@ function cleanWorker(state, project, onlyReferences) {
|
|
|
129809
129901
|
filesToDelete.push(output);
|
|
129810
129902
|
} else {
|
|
129811
129903
|
host.deleteFile(output);
|
|
129812
|
-
invalidateProject(state, resolvedPath, 0 /*
|
|
129904
|
+
invalidateProject(state, resolvedPath, 0 /* Update */);
|
|
129813
129905
|
}
|
|
129814
129906
|
}
|
|
129815
129907
|
}
|
|
@@ -129820,22 +129912,22 @@ function cleanWorker(state, project, onlyReferences) {
|
|
|
129820
129912
|
}
|
|
129821
129913
|
return 0 /* Success */;
|
|
129822
129914
|
}
|
|
129823
|
-
function invalidateProject(state, resolved,
|
|
129824
|
-
if (state.host.getParsedCommandLine &&
|
|
129825
|
-
|
|
129915
|
+
function invalidateProject(state, resolved, updateLevel) {
|
|
129916
|
+
if (state.host.getParsedCommandLine && updateLevel === 1 /* RootNamesAndUpdate */) {
|
|
129917
|
+
updateLevel = 2 /* Full */;
|
|
129826
129918
|
}
|
|
129827
|
-
if (
|
|
129919
|
+
if (updateLevel === 2 /* Full */) {
|
|
129828
129920
|
state.configFileCache.delete(resolved);
|
|
129829
129921
|
state.buildOrder = void 0;
|
|
129830
129922
|
}
|
|
129831
129923
|
state.needsSummary = true;
|
|
129832
129924
|
clearProjectStatus(state, resolved);
|
|
129833
|
-
addProjToQueue(state, resolved,
|
|
129925
|
+
addProjToQueue(state, resolved, updateLevel);
|
|
129834
129926
|
enableCache(state);
|
|
129835
129927
|
}
|
|
129836
|
-
function invalidateProjectAndScheduleBuilds(state, resolvedPath,
|
|
129928
|
+
function invalidateProjectAndScheduleBuilds(state, resolvedPath, updateLevel) {
|
|
129837
129929
|
state.reportFileChangeDetected = true;
|
|
129838
|
-
invalidateProject(state, resolvedPath,
|
|
129930
|
+
invalidateProject(state, resolvedPath, updateLevel);
|
|
129839
129931
|
scheduleBuildInvalidatedProject(
|
|
129840
129932
|
state,
|
|
129841
129933
|
250,
|
|
@@ -129966,7 +130058,7 @@ function watchWildCardDirectories(state, resolved, resolvedPath, parsed) {
|
|
|
129966
130058
|
toPath: (fileName) => toPath2(state, fileName)
|
|
129967
130059
|
}))
|
|
129968
130060
|
return;
|
|
129969
|
-
invalidateProjectAndScheduleBuilds(state, resolvedPath, 1 /*
|
|
130061
|
+
invalidateProjectAndScheduleBuilds(state, resolvedPath, 1 /* RootNamesAndUpdate */);
|
|
129970
130062
|
},
|
|
129971
130063
|
flags,
|
|
129972
130064
|
parsed == null ? void 0 : parsed.watchOptions,
|
|
@@ -129985,7 +130077,7 @@ function watchInputFiles(state, resolved, resolvedPath, parsed) {
|
|
|
129985
130077
|
createNewValue: (_path, input) => watchFile(
|
|
129986
130078
|
state,
|
|
129987
130079
|
input,
|
|
129988
|
-
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /*
|
|
130080
|
+
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */),
|
|
129989
130081
|
250 /* Low */,
|
|
129990
130082
|
parsed == null ? void 0 : parsed.watchOptions,
|
|
129991
130083
|
WatchType.SourceFile,
|
|
@@ -130005,7 +130097,7 @@ function watchPackageJsonFiles(state, resolved, resolvedPath, parsed) {
|
|
|
130005
130097
|
createNewValue: (path, _input) => watchFile(
|
|
130006
130098
|
state,
|
|
130007
130099
|
path,
|
|
130008
|
-
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /*
|
|
130100
|
+
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */),
|
|
130009
130101
|
2e3 /* High */,
|
|
130010
130102
|
parsed == null ? void 0 : parsed.watchOptions,
|
|
130011
130103
|
WatchType.PackageJson,
|
|
@@ -130076,7 +130168,7 @@ function createSolutionBuilderWorker(watch, hostOrHostWithWatch, rootNames, opti
|
|
|
130076
130168
|
const configFilePath = toResolvedConfigFilePath(state, configFileName);
|
|
130077
130169
|
return getUpToDateStatus(state, parseConfigFile(state, configFileName, configFilePath), configFilePath);
|
|
130078
130170
|
},
|
|
130079
|
-
invalidateProject: (configFilePath,
|
|
130171
|
+
invalidateProject: (configFilePath, updateLevel) => invalidateProject(state, configFilePath, updateLevel || 0 /* Update */),
|
|
130080
130172
|
close: () => stopWatching(state)
|
|
130081
130173
|
};
|
|
130082
130174
|
}
|
|
@@ -172020,7 +172112,6 @@ __export(ts_exports2, {
|
|
|
172020
172112
|
CompletionInfoFlags: () => CompletionInfoFlags,
|
|
172021
172113
|
CompletionTriggerKind: () => CompletionTriggerKind,
|
|
172022
172114
|
Completions: () => ts_Completions_exports,
|
|
172023
|
-
ConfigFileProgramReloadLevel: () => ConfigFileProgramReloadLevel,
|
|
172024
172115
|
ContainerFlags: () => ContainerFlags,
|
|
172025
172116
|
ContextFlags: () => ContextFlags,
|
|
172026
172117
|
Debug: () => Debug,
|
|
@@ -172107,6 +172198,7 @@ __export(ts_exports2, {
|
|
|
172107
172198
|
PragmaKindFlags: () => PragmaKindFlags,
|
|
172108
172199
|
PrivateIdentifierKind: () => PrivateIdentifierKind,
|
|
172109
172200
|
ProcessLevel: () => ProcessLevel,
|
|
172201
|
+
ProgramUpdateLevel: () => ProgramUpdateLevel,
|
|
172110
172202
|
QuotePreference: () => QuotePreference,
|
|
172111
172203
|
RelationComparisonResult: () => RelationComparisonResult,
|
|
172112
172204
|
Rename: () => ts_Rename_exports,
|
|
@@ -174498,6 +174590,7 @@ __export(ts_server_exports3, {
|
|
|
174498
174590
|
hasArgument: () => hasArgument,
|
|
174499
174591
|
hasNoTypeScriptSource: () => hasNoTypeScriptSource,
|
|
174500
174592
|
indent: () => indent2,
|
|
174593
|
+
isBackgroundProject: () => isBackgroundProject,
|
|
174501
174594
|
isConfigFile: () => isConfigFile,
|
|
174502
174595
|
isConfiguredProject: () => isConfiguredProject,
|
|
174503
174596
|
isDynamicFileName: () => isDynamicFileName,
|
|
@@ -175765,7 +175858,7 @@ var ScriptInfo = class {
|
|
|
175765
175858
|
isContainedByBackgroundProject() {
|
|
175766
175859
|
return some(
|
|
175767
175860
|
this.containingProjects,
|
|
175768
|
-
|
|
175861
|
+
isBackgroundProject
|
|
175769
175862
|
);
|
|
175770
175863
|
}
|
|
175771
175864
|
/**
|
|
@@ -175796,7 +175889,7 @@ var ScriptInfo = class {
|
|
|
175796
175889
|
}
|
|
175797
175890
|
};
|
|
175798
175891
|
function ensurePrimaryProjectKind(project) {
|
|
175799
|
-
if (!project || project
|
|
175892
|
+
if (!project || isBackgroundProject(project)) {
|
|
175800
175893
|
return Errors.ThrowNoProject();
|
|
175801
175894
|
}
|
|
175802
175895
|
return project;
|
|
@@ -176082,9 +176175,10 @@ var Project3 = class _Project {
|
|
|
176082
176175
|
this.disableLanguageService(lastFileExceededProgramSize);
|
|
176083
176176
|
}
|
|
176084
176177
|
this.markAsDirty();
|
|
176085
|
-
if (
|
|
176178
|
+
if (!isBackgroundProject(this)) {
|
|
176086
176179
|
this.projectService.pendingEnsureProjectForOpenFiles = true;
|
|
176087
176180
|
}
|
|
176181
|
+
this.projectService.onProjectCreation(this);
|
|
176088
176182
|
}
|
|
176089
176183
|
/** @internal */
|
|
176090
176184
|
getResolvedProjectReferenceToRedirect(_fileName) {
|
|
@@ -176254,6 +176348,7 @@ var Project3 = class _Project {
|
|
|
176254
176348
|
resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames) {
|
|
176255
176349
|
return this.resolutionCache.resolveModuleNameLiterals(moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames);
|
|
176256
176350
|
}
|
|
176351
|
+
/** @internal */
|
|
176257
176352
|
getModuleResolutionCache() {
|
|
176258
176353
|
return this.resolutionCache.getModuleResolutionCache();
|
|
176259
176354
|
}
|
|
@@ -176519,12 +176614,12 @@ var Project3 = class _Project {
|
|
|
176519
176614
|
}
|
|
176520
176615
|
return { ...newTypeAcquisition, include: this.removeExistingTypings(newTypeAcquisition.include) };
|
|
176521
176616
|
}
|
|
176522
|
-
getExternalFiles() {
|
|
176617
|
+
getExternalFiles(updateLevel) {
|
|
176523
176618
|
return sort(flatMap(this.plugins, (plugin) => {
|
|
176524
176619
|
if (typeof plugin.module.getExternalFiles !== "function")
|
|
176525
176620
|
return;
|
|
176526
176621
|
try {
|
|
176527
|
-
return plugin.module.getExternalFiles(this);
|
|
176622
|
+
return plugin.module.getExternalFiles(this, updateLevel || 0 /* Update */);
|
|
176528
176623
|
} catch (e) {
|
|
176529
176624
|
this.projectService.logger.info(`A plugin threw an exception in getExternalFiles: ${e}`);
|
|
176530
176625
|
if (e.stack) {
|
|
@@ -177259,6 +177354,7 @@ var Project3 = class _Project {
|
|
|
177259
177354
|
}
|
|
177260
177355
|
/** @internal */
|
|
177261
177356
|
getChangesSinceVersion(lastKnownVersion, includeProjectReferenceRedirectInfo) {
|
|
177357
|
+
var _a, _b;
|
|
177262
177358
|
const includeProjectReferenceRedirectInfoIfRequested = includeProjectReferenceRedirectInfo ? (files) => arrayFrom(files.entries(), ([fileName, isSourceOfProjectReferenceRedirect]) => ({
|
|
177263
177359
|
fileName,
|
|
177264
177360
|
isSourceOfProjectReferenceRedirect
|
|
@@ -177281,10 +177377,10 @@ var Project3 = class _Project {
|
|
|
177281
177377
|
return { info, projectErrors: this.getGlobalProjectErrors() };
|
|
177282
177378
|
}
|
|
177283
177379
|
const lastReportedFileNames = this.lastReportedFileNames;
|
|
177284
|
-
const externalFiles = this.
|
|
177380
|
+
const externalFiles = ((_a = this.externalFiles) == null ? void 0 : _a.map((f) => ({
|
|
177285
177381
|
fileName: toNormalizedPath(f),
|
|
177286
177382
|
isSourceOfProjectReferenceRedirect: false
|
|
177287
|
-
}));
|
|
177383
|
+
}))) || emptyArray2;
|
|
177288
177384
|
const currentFiles = arrayToMap(
|
|
177289
177385
|
this.getFileNamesWithRedirectInfo(!!includeProjectReferenceRedirectInfo).concat(externalFiles),
|
|
177290
177386
|
(info2) => info2.fileName,
|
|
@@ -177326,10 +177422,10 @@ var Project3 = class _Project {
|
|
|
177326
177422
|
};
|
|
177327
177423
|
} else {
|
|
177328
177424
|
const projectFileNames = this.getFileNamesWithRedirectInfo(!!includeProjectReferenceRedirectInfo);
|
|
177329
|
-
const externalFiles = this.
|
|
177425
|
+
const externalFiles = ((_b = this.externalFiles) == null ? void 0 : _b.map((f) => ({
|
|
177330
177426
|
fileName: toNormalizedPath(f),
|
|
177331
177427
|
isSourceOfProjectReferenceRedirect: false
|
|
177332
|
-
}));
|
|
177428
|
+
}))) || emptyArray2;
|
|
177333
177429
|
const allFiles = projectFileNames.concat(externalFiles);
|
|
177334
177430
|
this.lastReportedFileNames = arrayToMap(
|
|
177335
177431
|
allFiles,
|
|
@@ -177531,32 +177627,15 @@ var Project3 = class _Project {
|
|
|
177531
177627
|
return this.projectService.getIncompleteCompletionsCache();
|
|
177532
177628
|
}
|
|
177533
177629
|
/** @internal */
|
|
177534
|
-
getNoDtsResolutionProject(
|
|
177630
|
+
getNoDtsResolutionProject(rootFile) {
|
|
177535
177631
|
Debug.assert(this.projectService.serverMode === 0 /* Semantic */);
|
|
177536
177632
|
if (!this.noDtsResolutionProject) {
|
|
177537
177633
|
this.noDtsResolutionProject = new AuxiliaryProject(this.projectService, this.documentRegistry, this.getCompilerOptionsForNoDtsResolutionProject(), this.currentDirectory);
|
|
177538
177634
|
}
|
|
177539
|
-
|
|
177540
|
-
|
|
177541
|
-
this.noDtsResolutionProject.
|
|
177542
|
-
|
|
177543
|
-
(pathToAdd) => {
|
|
177544
|
-
const info = this.projectService.getOrCreateScriptInfoNotOpenedByClient(
|
|
177545
|
-
pathToAdd,
|
|
177546
|
-
this.currentDirectory,
|
|
177547
|
-
this.noDtsResolutionProject.directoryStructureHost
|
|
177548
|
-
);
|
|
177549
|
-
if (info) {
|
|
177550
|
-
this.noDtsResolutionProject.addRoot(info, pathToAdd);
|
|
177551
|
-
}
|
|
177552
|
-
},
|
|
177553
|
-
(pathToRemove) => {
|
|
177554
|
-
const info = this.noDtsResolutionProject.getScriptInfo(pathToRemove);
|
|
177555
|
-
if (info) {
|
|
177556
|
-
this.noDtsResolutionProject.removeRoot(info);
|
|
177557
|
-
}
|
|
177558
|
-
}
|
|
177559
|
-
);
|
|
177635
|
+
if (this.noDtsResolutionProject.rootFile !== rootFile) {
|
|
177636
|
+
this.projectService.setFileNamesOfAutpImportProviderOrAuxillaryProject(this.noDtsResolutionProject, [rootFile]);
|
|
177637
|
+
this.noDtsResolutionProject.rootFile = rootFile;
|
|
177638
|
+
}
|
|
177560
177639
|
return this.noDtsResolutionProject;
|
|
177561
177640
|
}
|
|
177562
177641
|
/** @internal */
|
|
@@ -177888,7 +177967,7 @@ var _AutoImportProviderProject = class _AutoImportProviderProject extends Projec
|
|
|
177888
177967
|
this.getCompilationSettings()
|
|
177889
177968
|
);
|
|
177890
177969
|
}
|
|
177891
|
-
this.projectService.
|
|
177970
|
+
this.projectService.setFileNamesOfAutpImportProviderOrAuxillaryProject(this, rootFileNames);
|
|
177892
177971
|
this.rootFileNames = rootFileNames;
|
|
177893
177972
|
const oldProgram = this.getCurrentProgram();
|
|
177894
177973
|
const hasSameSetOfFiles = super.updateGraph();
|
|
@@ -178033,18 +178112,18 @@ var ConfiguredProject2 = class extends Project3 {
|
|
|
178033
178112
|
updateGraph() {
|
|
178034
178113
|
const isInitialLoad = this.isInitialLoadPending();
|
|
178035
178114
|
this.isInitialLoadPending = returnFalse;
|
|
178036
|
-
const
|
|
178037
|
-
this.
|
|
178115
|
+
const updateLevel = this.pendingUpdateLevel;
|
|
178116
|
+
this.pendingUpdateLevel = 0 /* Update */;
|
|
178038
178117
|
let result;
|
|
178039
|
-
switch (
|
|
178040
|
-
case 1 /*
|
|
178118
|
+
switch (updateLevel) {
|
|
178119
|
+
case 1 /* RootNamesAndUpdate */:
|
|
178041
178120
|
this.openFileWatchTriggered.clear();
|
|
178042
178121
|
result = this.projectService.reloadFileNamesOfConfiguredProject(this);
|
|
178043
178122
|
break;
|
|
178044
178123
|
case 2 /* Full */:
|
|
178045
178124
|
this.openFileWatchTriggered.clear();
|
|
178046
|
-
const reason = Debug.checkDefined(this.
|
|
178047
|
-
this.
|
|
178125
|
+
const reason = Debug.checkDefined(this.pendingUpdateReason);
|
|
178126
|
+
this.pendingUpdateReason = void 0;
|
|
178048
178127
|
this.projectService.reloadConfiguredProject(
|
|
178049
178128
|
this,
|
|
178050
178129
|
reason,
|
|
@@ -178244,6 +178323,9 @@ function isConfiguredProject(project) {
|
|
|
178244
178323
|
function isExternalProject(project) {
|
|
178245
178324
|
return project.projectKind === 2 /* External */;
|
|
178246
178325
|
}
|
|
178326
|
+
function isBackgroundProject(project) {
|
|
178327
|
+
return project.projectKind === 3 /* AutoImportProvider */ || project.projectKind === 4 /* Auxiliary */;
|
|
178328
|
+
}
|
|
178247
178329
|
|
|
178248
178330
|
// src/server/editorServices.ts
|
|
178249
178331
|
var maxProgramSizeForNonTsFiles = 20 * 1024 * 1024;
|
|
@@ -178684,6 +178766,8 @@ var _ProjectService = class _ProjectService {
|
|
|
178684
178766
|
this.verifyDocumentRegistry = noop;
|
|
178685
178767
|
/** @internal */
|
|
178686
178768
|
this.verifyProgram = noop;
|
|
178769
|
+
/** @internal */
|
|
178770
|
+
this.onProjectCreation = noop;
|
|
178687
178771
|
var _a;
|
|
178688
178772
|
this.host = opts.host;
|
|
178689
178773
|
this.logger = opts.logger;
|
|
@@ -178851,20 +178935,20 @@ var _ProjectService = class _ProjectService {
|
|
|
178851
178935
|
}
|
|
178852
178936
|
delayUpdateProjectGraph(project) {
|
|
178853
178937
|
project.markAsDirty();
|
|
178854
|
-
if (project
|
|
178855
|
-
|
|
178856
|
-
|
|
178857
|
-
|
|
178858
|
-
|
|
178859
|
-
|
|
178860
|
-
|
|
178861
|
-
|
|
178862
|
-
|
|
178863
|
-
|
|
178864
|
-
|
|
178938
|
+
if (isBackgroundProject(project))
|
|
178939
|
+
return;
|
|
178940
|
+
const projectName = project.getProjectName();
|
|
178941
|
+
this.pendingProjectUpdates.set(projectName, project);
|
|
178942
|
+
this.throttledOperations.schedule(
|
|
178943
|
+
projectName,
|
|
178944
|
+
/*delay*/
|
|
178945
|
+
250,
|
|
178946
|
+
() => {
|
|
178947
|
+
if (this.pendingProjectUpdates.delete(projectName)) {
|
|
178948
|
+
updateProjectIfDirty(project);
|
|
178865
178949
|
}
|
|
178866
|
-
|
|
178867
|
-
|
|
178950
|
+
}
|
|
178951
|
+
);
|
|
178868
178952
|
}
|
|
178869
178953
|
/** @internal */
|
|
178870
178954
|
hasPendingProjectUpdate(project) {
|
|
@@ -179140,28 +179224,28 @@ var _ProjectService = class _ProjectService {
|
|
|
179140
179224
|
getScriptKind: configuredProjectForConfig ? (fileName) => configuredProjectForConfig.getScriptKind(fileName) : void 0
|
|
179141
179225
|
}))
|
|
179142
179226
|
return;
|
|
179143
|
-
if (config.
|
|
179144
|
-
config.
|
|
179227
|
+
if (config.updateLevel !== 2 /* Full */)
|
|
179228
|
+
config.updateLevel = 1 /* RootNamesAndUpdate */;
|
|
179145
179229
|
config.projects.forEach((watchWildcardDirectories, projectCanonicalPath) => {
|
|
179146
179230
|
if (!watchWildcardDirectories)
|
|
179147
179231
|
return;
|
|
179148
179232
|
const project = this.getConfiguredProjectByCanonicalConfigFilePath(projectCanonicalPath);
|
|
179149
179233
|
if (!project)
|
|
179150
179234
|
return;
|
|
179151
|
-
const
|
|
179152
|
-
if (project.
|
|
179235
|
+
const updateLevel = configuredProjectForConfig === project ? 1 /* RootNamesAndUpdate */ : 0 /* Update */;
|
|
179236
|
+
if (project.pendingUpdateLevel !== void 0 && project.pendingUpdateLevel > updateLevel)
|
|
179153
179237
|
return;
|
|
179154
179238
|
if (this.openFiles.has(fileOrDirectoryPath)) {
|
|
179155
179239
|
const info = Debug.checkDefined(this.getScriptInfoForPath(fileOrDirectoryPath));
|
|
179156
179240
|
if (info.isAttached(project)) {
|
|
179157
|
-
const loadLevelToSet = Math.max(
|
|
179241
|
+
const loadLevelToSet = Math.max(updateLevel, project.openFileWatchTriggered.get(fileOrDirectoryPath) || 0 /* Update */);
|
|
179158
179242
|
project.openFileWatchTriggered.set(fileOrDirectoryPath, loadLevelToSet);
|
|
179159
179243
|
} else {
|
|
179160
|
-
project.
|
|
179244
|
+
project.pendingUpdateLevel = updateLevel;
|
|
179161
179245
|
this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project);
|
|
179162
179246
|
}
|
|
179163
179247
|
} else {
|
|
179164
|
-
project.
|
|
179248
|
+
project.pendingUpdateLevel = updateLevel;
|
|
179165
179249
|
this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project);
|
|
179166
179250
|
}
|
|
179167
179251
|
});
|
|
@@ -179173,12 +179257,12 @@ var _ProjectService = class _ProjectService {
|
|
|
179173
179257
|
);
|
|
179174
179258
|
}
|
|
179175
179259
|
/** @internal */
|
|
179176
|
-
delayUpdateProjectsFromParsedConfigOnConfigFileChange(canonicalConfigFilePath,
|
|
179260
|
+
delayUpdateProjectsFromParsedConfigOnConfigFileChange(canonicalConfigFilePath, loadReason) {
|
|
179177
179261
|
const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath);
|
|
179178
179262
|
if (!(configFileExistenceInfo == null ? void 0 : configFileExistenceInfo.config))
|
|
179179
179263
|
return false;
|
|
179180
179264
|
let scheduledAnyProjectUpdate = false;
|
|
179181
|
-
configFileExistenceInfo.config.
|
|
179265
|
+
configFileExistenceInfo.config.updateLevel = 2 /* Full */;
|
|
179182
179266
|
configFileExistenceInfo.config.projects.forEach((_watchWildcardDirectories, projectCanonicalPath) => {
|
|
179183
179267
|
const project = this.getConfiguredProjectByCanonicalConfigFilePath(projectCanonicalPath);
|
|
179184
179268
|
if (!project)
|
|
@@ -179187,8 +179271,8 @@ var _ProjectService = class _ProjectService {
|
|
|
179187
179271
|
if (projectCanonicalPath === canonicalConfigFilePath) {
|
|
179188
179272
|
if (project.isInitialLoadPending())
|
|
179189
179273
|
return;
|
|
179190
|
-
project.
|
|
179191
|
-
project.
|
|
179274
|
+
project.pendingUpdateLevel = 2 /* Full */;
|
|
179275
|
+
project.pendingUpdateReason = loadReason;
|
|
179192
179276
|
this.delayUpdateProjectGraph(project);
|
|
179193
179277
|
} else {
|
|
179194
179278
|
project.resolutionCache.removeResolutionsFromProjectReferenceRedirects(this.toPath(canonicalConfigFilePath));
|
|
@@ -179337,11 +179421,11 @@ var _ProjectService = class _ProjectService {
|
|
|
179337
179421
|
if (info.hasMixedContent) {
|
|
179338
179422
|
info.registerFileUpdate();
|
|
179339
179423
|
}
|
|
179340
|
-
const
|
|
179341
|
-
if (
|
|
179424
|
+
const updateLevel = p.openFileWatchTriggered.get(info.path);
|
|
179425
|
+
if (updateLevel !== void 0) {
|
|
179342
179426
|
p.openFileWatchTriggered.delete(info.path);
|
|
179343
|
-
if (p.
|
|
179344
|
-
p.
|
|
179427
|
+
if (p.pendingUpdateLevel !== void 0 && p.pendingUpdateLevel < updateLevel) {
|
|
179428
|
+
p.pendingUpdateLevel = updateLevel;
|
|
179345
179429
|
p.markFileAsDirty(info.path);
|
|
179346
179430
|
}
|
|
179347
179431
|
}
|
|
@@ -179721,6 +179805,7 @@ var _ProjectService = class _ProjectService {
|
|
|
179721
179805
|
addFilesToNonInferredProject(project, files, propertyReader, typeAcquisition) {
|
|
179722
179806
|
this.updateNonInferredProjectFiles(project, files, propertyReader);
|
|
179723
179807
|
project.setTypeAcquisition(typeAcquisition);
|
|
179808
|
+
project.markAsDirty();
|
|
179724
179809
|
}
|
|
179725
179810
|
/** @internal */
|
|
179726
179811
|
createConfiguredProject(configFileName) {
|
|
@@ -179738,7 +179823,7 @@ var _ProjectService = class _ProjectService {
|
|
|
179738
179823
|
configFileExistenceInfo.config = {
|
|
179739
179824
|
cachedDirectoryStructureHost: createCachedDirectoryStructureHost(this.host, this.host.getCurrentDirectory(), this.host.useCaseSensitiveFileNames),
|
|
179740
179825
|
projects: /* @__PURE__ */ new Map(),
|
|
179741
|
-
|
|
179826
|
+
updateLevel: 2 /* Full */
|
|
179742
179827
|
};
|
|
179743
179828
|
}
|
|
179744
179829
|
const project = new ConfiguredProject2(
|
|
@@ -179755,8 +179840,8 @@ var _ProjectService = class _ProjectService {
|
|
|
179755
179840
|
/** @internal */
|
|
179756
179841
|
createConfiguredProjectWithDelayLoad(configFileName, reason) {
|
|
179757
179842
|
const project = this.createConfiguredProject(configFileName);
|
|
179758
|
-
project.
|
|
179759
|
-
project.
|
|
179843
|
+
project.pendingUpdateLevel = 2 /* Full */;
|
|
179844
|
+
project.pendingUpdateReason = reason;
|
|
179760
179845
|
return project;
|
|
179761
179846
|
}
|
|
179762
179847
|
/** @internal */
|
|
@@ -179812,7 +179897,7 @@ var _ProjectService = class _ProjectService {
|
|
|
179812
179897
|
this.watchWildcards(configFilename, configFileExistenceInfo, project);
|
|
179813
179898
|
}
|
|
179814
179899
|
project.enablePluginsWithOptions(compilerOptions);
|
|
179815
|
-
const filesToAdd = parsedCommandLine.fileNames.concat(project.getExternalFiles());
|
|
179900
|
+
const filesToAdd = parsedCommandLine.fileNames.concat(project.getExternalFiles(2 /* Full */));
|
|
179816
179901
|
this.updateRootAndOptionsOfNonInferredProject(project, filesToAdd, fileNamePropertyReader, compilerOptions, parsedCommandLine.typeAcquisition, parsedCommandLine.compileOnSave, parsedCommandLine.watchOptions);
|
|
179817
179902
|
(_b = tracing) == null ? void 0 : _b.pop();
|
|
179818
179903
|
}
|
|
@@ -179820,9 +179905,9 @@ var _ProjectService = class _ProjectService {
|
|
|
179820
179905
|
ensureParsedConfigUptoDate(configFilename, canonicalConfigFilePath, configFileExistenceInfo, forProject) {
|
|
179821
179906
|
var _a, _b, _c;
|
|
179822
179907
|
if (configFileExistenceInfo.config) {
|
|
179823
|
-
if (!configFileExistenceInfo.config.
|
|
179908
|
+
if (!configFileExistenceInfo.config.updateLevel)
|
|
179824
179909
|
return configFileExistenceInfo;
|
|
179825
|
-
if (configFileExistenceInfo.config.
|
|
179910
|
+
if (configFileExistenceInfo.config.updateLevel === 1 /* RootNamesAndUpdate */) {
|
|
179826
179911
|
this.reloadFileNamesOfParsedConfig(configFilename, configFileExistenceInfo.config);
|
|
179827
179912
|
return configFileExistenceInfo;
|
|
179828
179913
|
}
|
|
@@ -179865,7 +179950,7 @@ var _ProjectService = class _ProjectService {
|
|
|
179865
179950
|
} else {
|
|
179866
179951
|
configFileExistenceInfo.config.parsedCommandLine = parsedCommandLine;
|
|
179867
179952
|
configFileExistenceInfo.config.watchedDirectoriesStale = true;
|
|
179868
|
-
configFileExistenceInfo.config.
|
|
179953
|
+
configFileExistenceInfo.config.updateLevel = void 0;
|
|
179869
179954
|
}
|
|
179870
179955
|
if (!oldCommandLine && !isJsonEqual(
|
|
179871
179956
|
// Old options
|
|
@@ -180006,7 +180091,6 @@ var _ProjectService = class _ProjectService {
|
|
|
180006
180091
|
}
|
|
180007
180092
|
});
|
|
180008
180093
|
}
|
|
180009
|
-
project.markAsDirty();
|
|
180010
180094
|
}
|
|
180011
180095
|
updateRootAndOptionsOfNonInferredProject(project, newUncheckedFiles, propertyReader, newOptions, newTypeAcquisition, compileOnSave, watchOptions) {
|
|
180012
180096
|
project.setCompilerOptions(newOptions);
|
|
@@ -180024,14 +180108,15 @@ var _ProjectService = class _ProjectService {
|
|
|
180024
180108
|
reloadFileNamesOfConfiguredProject(project) {
|
|
180025
180109
|
const fileNames = this.reloadFileNamesOfParsedConfig(project.getConfigFilePath(), this.configFileExistenceInfoCache.get(project.canonicalConfigFilePath).config);
|
|
180026
180110
|
project.updateErrorOnNoInputFiles(fileNames);
|
|
180027
|
-
this.updateNonInferredProjectFiles(project, fileNames.concat(project.getExternalFiles()), fileNamePropertyReader);
|
|
180111
|
+
this.updateNonInferredProjectFiles(project, fileNames.concat(project.getExternalFiles(1 /* RootNamesAndUpdate */)), fileNamePropertyReader);
|
|
180112
|
+
project.markAsDirty();
|
|
180028
180113
|
return project.updateGraph();
|
|
180029
180114
|
}
|
|
180030
180115
|
/** @internal */
|
|
180031
180116
|
reloadFileNamesOfParsedConfig(configFileName, config) {
|
|
180032
|
-
if (config.
|
|
180117
|
+
if (config.updateLevel === void 0)
|
|
180033
180118
|
return config.parsedCommandLine.fileNames;
|
|
180034
|
-
Debug.assert(config.
|
|
180119
|
+
Debug.assert(config.updateLevel === 1 /* RootNamesAndUpdate */);
|
|
180035
180120
|
const configFileSpecs = config.parsedCommandLine.options.configFile.configFileSpecs;
|
|
180036
180121
|
const fileNames = getFileNamesFromConfigSpecs(
|
|
180037
180122
|
configFileSpecs,
|
|
@@ -180044,7 +180129,7 @@ var _ProjectService = class _ProjectService {
|
|
|
180044
180129
|
return fileNames;
|
|
180045
180130
|
}
|
|
180046
180131
|
/** @internal */
|
|
180047
|
-
|
|
180132
|
+
setFileNamesOfAutpImportProviderOrAuxillaryProject(project, fileNames) {
|
|
180048
180133
|
this.updateNonInferredProjectFiles(project, fileNames, fileNamePropertyReader);
|
|
180049
180134
|
}
|
|
180050
180135
|
/**
|
|
@@ -180573,7 +180658,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
180573
180658
|
this.hostConfiguration.preferences = { ...this.hostConfiguration.preferences, ...args.preferences };
|
|
180574
180659
|
if (lazyConfiguredProjectsFromExternalProject && !this.hostConfiguration.preferences.lazyConfiguredProjectsFromExternalProject) {
|
|
180575
180660
|
this.configuredProjects.forEach((project) => {
|
|
180576
|
-
if (project.hasExternalProjectRef() && project.
|
|
180661
|
+
if (project.hasExternalProjectRef() && project.pendingUpdateLevel === 2 /* Full */ && !this.pendingProjectUpdates.has(project.getProjectName())) {
|
|
180577
180662
|
project.updateGraph();
|
|
180578
180663
|
}
|
|
180579
180664
|
});
|
|
@@ -180628,7 +180713,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
180628
180713
|
this.pendingEnsureProjectForOpenFiles = false;
|
|
180629
180714
|
this.configFileExistenceInfoCache.forEach((info) => {
|
|
180630
180715
|
if (info.config)
|
|
180631
|
-
info.config.
|
|
180716
|
+
info.config.updateLevel = 2 /* Full */;
|
|
180632
180717
|
});
|
|
180633
180718
|
this.reloadConfiguredProjectForFiles(
|
|
180634
180719
|
this.openFiles,
|
|
@@ -180680,8 +180765,8 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
180680
180765
|
if (!updatedProjects.has(project.canonicalConfigFilePath)) {
|
|
180681
180766
|
updatedProjects.set(project.canonicalConfigFilePath, true);
|
|
180682
180767
|
if (delayReload) {
|
|
180683
|
-
project.
|
|
180684
|
-
project.
|
|
180768
|
+
project.pendingUpdateLevel = 2 /* Full */;
|
|
180769
|
+
project.pendingUpdateReason = reason;
|
|
180685
180770
|
if (clearSemanticCache)
|
|
180686
180771
|
this.clearSemanticCache(project);
|
|
180687
180772
|
this.delayUpdateProjectGraph(project);
|
|
@@ -183440,7 +183525,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
183440
183525
|
if (needsJsResolution) {
|
|
183441
183526
|
const definitionSet = createSet((d) => d.textSpan.start, documentSpansEqual);
|
|
183442
183527
|
definitions == null ? void 0 : definitions.forEach((d) => definitionSet.add(d));
|
|
183443
|
-
const noDtsProject = project.getNoDtsResolutionProject(
|
|
183528
|
+
const noDtsProject = project.getNoDtsResolutionProject(file);
|
|
183444
183529
|
const ls = noDtsProject.getLanguageService();
|
|
183445
183530
|
const jsDefinitions = (_a = ls.getDefinitionAtPosition(
|
|
183446
183531
|
file,
|
|
@@ -183467,8 +183552,18 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
183467
183552
|
const ambientCandidates = definitions.filter((d) => toNormalizedPath(d.fileName) !== file && d.isAmbient);
|
|
183468
183553
|
for (const candidate of some(ambientCandidates) ? ambientCandidates : getAmbientCandidatesByClimbingAccessChain()) {
|
|
183469
183554
|
const fileNameToSearch = findImplementationFileFromDtsFileName(candidate.fileName, file, noDtsProject);
|
|
183470
|
-
if (!fileNameToSearch
|
|
183555
|
+
if (!fileNameToSearch)
|
|
183556
|
+
continue;
|
|
183557
|
+
const info = this.projectService.getOrCreateScriptInfoNotOpenedByClient(
|
|
183558
|
+
fileNameToSearch,
|
|
183559
|
+
noDtsProject.currentDirectory,
|
|
183560
|
+
noDtsProject.directoryStructureHost
|
|
183561
|
+
);
|
|
183562
|
+
if (!info)
|
|
183471
183563
|
continue;
|
|
183564
|
+
if (!noDtsProject.containsScriptInfo(info)) {
|
|
183565
|
+
noDtsProject.addRoot(info);
|
|
183566
|
+
noDtsProject.updateGraph();
|
|
183472
183567
|
}
|
|
183473
183568
|
const noDtsProgram = ls.getProgram();
|
|
183474
183569
|
const fileToSearch = Debug.checkDefined(noDtsProgram.getSourceFile(fileNameToSearch));
|
|
@@ -183571,16 +183666,6 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
183571
183666
|
}
|
|
183572
183667
|
});
|
|
183573
183668
|
}
|
|
183574
|
-
function ensureRoot(project2, fileName) {
|
|
183575
|
-
const info = project2.getScriptInfo(fileName);
|
|
183576
|
-
if (!info)
|
|
183577
|
-
return false;
|
|
183578
|
-
if (!project2.containsScriptInfo(info)) {
|
|
183579
|
-
project2.addRoot(info);
|
|
183580
|
-
project2.updateGraph();
|
|
183581
|
-
}
|
|
183582
|
-
return true;
|
|
183583
|
-
}
|
|
183584
183669
|
}
|
|
183585
183670
|
getEmitOutput(args) {
|
|
183586
183671
|
const { file, project } = this.getFileAndProject(args);
|
|
@@ -185907,6 +185992,7 @@ __export(ts_server_exports4, {
|
|
|
185907
185992
|
hasNoTypeScriptSource: () => hasNoTypeScriptSource,
|
|
185908
185993
|
indent: () => indent2,
|
|
185909
185994
|
initializeNodeSystem: () => initializeNodeSystem,
|
|
185995
|
+
isBackgroundProject: () => isBackgroundProject,
|
|
185910
185996
|
isConfigFile: () => isConfigFile,
|
|
185911
185997
|
isConfiguredProject: () => isConfiguredProject,
|
|
185912
185998
|
isDynamicFileName: () => isDynamicFileName,
|
|
@@ -186699,7 +186785,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
186699
186785
|
CompletionInfoFlags,
|
|
186700
186786
|
CompletionTriggerKind,
|
|
186701
186787
|
Completions,
|
|
186702
|
-
ConfigFileProgramReloadLevel,
|
|
186703
186788
|
ContainerFlags,
|
|
186704
186789
|
ContextFlags,
|
|
186705
186790
|
Debug,
|
|
@@ -186786,6 +186871,7 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
186786
186871
|
PragmaKindFlags,
|
|
186787
186872
|
PrivateIdentifierKind,
|
|
186788
186873
|
ProcessLevel,
|
|
186874
|
+
ProgramUpdateLevel,
|
|
186789
186875
|
QuotePreference,
|
|
186790
186876
|
RelationComparisonResult,
|
|
186791
186877
|
Rename,
|