typescript 5.3.0-dev.20231008 → 5.3.0-dev.20231010
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 +79 -45
- package/lib/tsserver.js +130 -95
- package/lib/typescript.d.ts +15 -2
- package/lib/typescript.js +130 -95
- package/lib/typingsInstaller.js +1 -1
- package/package.json +2 -2
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.3";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20231010`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -14864,6 +14864,7 @@ ${lanes.join("\n")}
|
|
|
14864
14864
|
true
|
|
14865
14865
|
))) == null ? void 0 : _a.arguments[0];
|
|
14866
14866
|
case 272 /* ImportDeclaration */:
|
|
14867
|
+
case 278 /* ExportDeclaration */:
|
|
14867
14868
|
return tryCast(node.moduleSpecifier, isStringLiteralLike);
|
|
14868
14869
|
case 271 /* ImportEqualsDeclaration */:
|
|
14869
14870
|
return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike);
|
|
@@ -14875,6 +14876,8 @@ ${lanes.join("\n")}
|
|
|
14875
14876
|
return tryCast(node.parent.parent.moduleSpecifier, isStringLiteralLike);
|
|
14876
14877
|
case 276 /* ImportSpecifier */:
|
|
14877
14878
|
return tryCast(node.parent.parent.parent.moduleSpecifier, isStringLiteralLike);
|
|
14879
|
+
case 205 /* ImportType */:
|
|
14880
|
+
return isLiteralImportTypeNode(node) ? node.argument.literal : void 0;
|
|
14878
14881
|
default:
|
|
14879
14882
|
Debug.assertNever(node);
|
|
14880
14883
|
}
|
|
@@ -68211,7 +68214,7 @@ ${lanes.join("\n")}
|
|
|
68211
68214
|
return createFlowType(narrowedType, isIncomplete(flowType));
|
|
68212
68215
|
}
|
|
68213
68216
|
function getTypeAtSwitchClause(flow) {
|
|
68214
|
-
const expr = flow.switchStatement.expression;
|
|
68217
|
+
const expr = skipParentheses(flow.switchStatement.expression);
|
|
68215
68218
|
const flowType = getTypeAtFlowNode(flow.antecedent);
|
|
68216
68219
|
let type = getTypeFromFlowType(flowType);
|
|
68217
68220
|
if (isMatchingReference(reference, expr)) {
|
|
@@ -84805,7 +84808,16 @@ ${lanes.join("\n")}
|
|
|
84805
84808
|
}
|
|
84806
84809
|
return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, tracker, bundled);
|
|
84807
84810
|
},
|
|
84808
|
-
isImportRequiredByAugmentation
|
|
84811
|
+
isImportRequiredByAugmentation,
|
|
84812
|
+
tryFindAmbientModule: (moduleReferenceExpression) => {
|
|
84813
|
+
const node = getParseTreeNode(moduleReferenceExpression);
|
|
84814
|
+
const moduleSpecifier = node && isStringLiteralLike(node) ? node.text : void 0;
|
|
84815
|
+
return moduleSpecifier !== void 0 ? tryFindAmbientModule(
|
|
84816
|
+
moduleSpecifier,
|
|
84817
|
+
/*withAugmentations*/
|
|
84818
|
+
true
|
|
84819
|
+
) : void 0;
|
|
84820
|
+
}
|
|
84809
84821
|
};
|
|
84810
84822
|
function isImportRequiredByAugmentation(node) {
|
|
84811
84823
|
const file = getSourceFileOfNode(node);
|
|
@@ -110045,6 +110057,17 @@ ${lanes.join("\n")}
|
|
|
110045
110057
|
const container = getSourceFileOfNode(node);
|
|
110046
110058
|
refs.set(getOriginalNodeId(container), container);
|
|
110047
110059
|
}
|
|
110060
|
+
function trackReferencedAmbientModuleFromImport(node) {
|
|
110061
|
+
const moduleSpecifier = tryGetModuleSpecifierFromDeclaration(node);
|
|
110062
|
+
const symbol = moduleSpecifier && resolver.tryFindAmbientModule(moduleSpecifier);
|
|
110063
|
+
if (symbol == null ? void 0 : symbol.declarations) {
|
|
110064
|
+
for (const decl of symbol.declarations) {
|
|
110065
|
+
if (isAmbientModule(decl) && getSourceFileOfNode(decl) !== currentSourceFile) {
|
|
110066
|
+
trackReferencedAmbientModule(decl, symbol);
|
|
110067
|
+
}
|
|
110068
|
+
}
|
|
110069
|
+
}
|
|
110070
|
+
}
|
|
110048
110071
|
function handleSymbolAccessibilityError(symbolAccessibilityResult) {
|
|
110049
110072
|
if (symbolAccessibilityResult.accessibility === 0 /* Accessible */) {
|
|
110050
110073
|
if (symbolAccessibilityResult && symbolAccessibilityResult.aliasesToMakeVisible) {
|
|
@@ -110992,6 +111015,7 @@ ${lanes.join("\n")}
|
|
|
110992
111015
|
case 205 /* ImportType */: {
|
|
110993
111016
|
if (!isLiteralImportTypeNode(input))
|
|
110994
111017
|
return cleanup(input);
|
|
111018
|
+
trackReferencedAmbientModuleFromImport(input);
|
|
110995
111019
|
return cleanup(factory2.updateImportTypeNode(
|
|
110996
111020
|
input,
|
|
110997
111021
|
factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)),
|
|
@@ -111043,6 +111067,7 @@ ${lanes.join("\n")}
|
|
|
111043
111067
|
resultHasExternalModuleIndicator = true;
|
|
111044
111068
|
}
|
|
111045
111069
|
resultHasScopeMarker = true;
|
|
111070
|
+
trackReferencedAmbientModuleFromImport(input);
|
|
111046
111071
|
return factory2.updateExportDeclaration(
|
|
111047
111072
|
input,
|
|
111048
111073
|
input.modifiers,
|
|
@@ -111117,10 +111142,18 @@ ${lanes.join("\n")}
|
|
|
111117
111142
|
return;
|
|
111118
111143
|
switch (input.kind) {
|
|
111119
111144
|
case 271 /* ImportEqualsDeclaration */: {
|
|
111120
|
-
|
|
111145
|
+
const transformed = transformImportEqualsDeclaration(input);
|
|
111146
|
+
if (transformed) {
|
|
111147
|
+
trackReferencedAmbientModuleFromImport(input);
|
|
111148
|
+
}
|
|
111149
|
+
return transformed;
|
|
111121
111150
|
}
|
|
111122
111151
|
case 272 /* ImportDeclaration */: {
|
|
111123
|
-
|
|
111152
|
+
const transformed = transformImportDeclaration(input);
|
|
111153
|
+
if (transformed) {
|
|
111154
|
+
trackReferencedAmbientModuleFromImport(input);
|
|
111155
|
+
}
|
|
111156
|
+
return transformed;
|
|
111124
111157
|
}
|
|
111125
111158
|
}
|
|
111126
111159
|
if (isDeclaration(input) && isDeclarationAndNotVisible(input))
|
|
@@ -117607,7 +117640,8 @@ ${lanes.join("\n")}
|
|
|
117607
117640
|
getSymbolOfExternalModuleSpecifier: notImplemented,
|
|
117608
117641
|
isBindingCapturedByNode: notImplemented,
|
|
117609
117642
|
getDeclarationStatementsForSourceFile: notImplemented,
|
|
117610
|
-
isImportRequiredByAugmentation: notImplemented
|
|
117643
|
+
isImportRequiredByAugmentation: notImplemented,
|
|
117644
|
+
tryFindAmbientModule: notImplemented
|
|
117611
117645
|
};
|
|
117612
117646
|
createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({}));
|
|
117613
117647
|
createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true }));
|
|
@@ -118119,17 +118153,17 @@ ${lanes.join("\n")}
|
|
|
118119
118153
|
function closeFileWatcherOf(objWithWatcher) {
|
|
118120
118154
|
objWithWatcher.watcher.close();
|
|
118121
118155
|
}
|
|
118122
|
-
var
|
|
118156
|
+
var ProgramUpdateLevel, WatchLogLevel;
|
|
118123
118157
|
var init_watchUtilities = __esm({
|
|
118124
118158
|
"src/compiler/watchUtilities.ts"() {
|
|
118125
118159
|
"use strict";
|
|
118126
118160
|
init_ts2();
|
|
118127
|
-
|
|
118128
|
-
|
|
118129
|
-
|
|
118130
|
-
|
|
118131
|
-
return
|
|
118132
|
-
})(
|
|
118161
|
+
ProgramUpdateLevel = /* @__PURE__ */ ((ProgramUpdateLevel2) => {
|
|
118162
|
+
ProgramUpdateLevel2[ProgramUpdateLevel2["Update"] = 0] = "Update";
|
|
118163
|
+
ProgramUpdateLevel2[ProgramUpdateLevel2["RootNamesAndUpdate"] = 1] = "RootNamesAndUpdate";
|
|
118164
|
+
ProgramUpdateLevel2[ProgramUpdateLevel2["Full"] = 2] = "Full";
|
|
118165
|
+
return ProgramUpdateLevel2;
|
|
118166
|
+
})(ProgramUpdateLevel || {});
|
|
118133
118167
|
WatchLogLevel = /* @__PURE__ */ ((WatchLogLevel2) => {
|
|
118134
118168
|
WatchLogLevel2[WatchLogLevel2["None"] = 0] = "None";
|
|
118135
118169
|
WatchLogLevel2[WatchLogLevel2["TriggerOnly"] = 1] = "TriggerOnly";
|
|
@@ -125721,7 +125755,7 @@ ${lanes.join("\n")}
|
|
|
125721
125755
|
}
|
|
125722
125756
|
function createWatchProgram(host) {
|
|
125723
125757
|
let builderProgram;
|
|
125724
|
-
let
|
|
125758
|
+
let updateLevel;
|
|
125725
125759
|
let missingFilesMap;
|
|
125726
125760
|
let watchedWildcardDirectories;
|
|
125727
125761
|
let timerToUpdateProgram;
|
|
@@ -126080,7 +126114,7 @@ ${lanes.join("\n")}
|
|
|
126080
126114
|
}
|
|
126081
126115
|
function scheduleProgramReload() {
|
|
126082
126116
|
Debug.assert(!!configFileName);
|
|
126083
|
-
|
|
126117
|
+
updateLevel = 2 /* Full */;
|
|
126084
126118
|
scheduleProgramUpdate();
|
|
126085
126119
|
}
|
|
126086
126120
|
function updateProgramWithWatchStatus() {
|
|
@@ -126090,8 +126124,8 @@ ${lanes.join("\n")}
|
|
|
126090
126124
|
}
|
|
126091
126125
|
function updateProgram() {
|
|
126092
126126
|
var _a, _b, _c, _d;
|
|
126093
|
-
switch (
|
|
126094
|
-
case 1 /*
|
|
126127
|
+
switch (updateLevel) {
|
|
126128
|
+
case 1 /* RootNamesAndUpdate */:
|
|
126095
126129
|
(_a = perfLogger) == null ? void 0 : _a.logStartUpdateProgram("PartialConfigReload");
|
|
126096
126130
|
reloadFileNamesFromConfigFile();
|
|
126097
126131
|
break;
|
|
@@ -126111,7 +126145,7 @@ ${lanes.join("\n")}
|
|
|
126111
126145
|
writeLog("Reloading new file names and options");
|
|
126112
126146
|
Debug.assert(compilerOptions);
|
|
126113
126147
|
Debug.assert(configFileName);
|
|
126114
|
-
|
|
126148
|
+
updateLevel = 0 /* Update */;
|
|
126115
126149
|
rootFileNames = getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, getNormalizedAbsolutePath(getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
|
|
126116
126150
|
if (updateErrorForNoInputFiles(rootFileNames, getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) {
|
|
126117
126151
|
hasChangedConfigFileParsingErrors = true;
|
|
@@ -126121,7 +126155,7 @@ ${lanes.join("\n")}
|
|
|
126121
126155
|
function reloadConfigFile() {
|
|
126122
126156
|
Debug.assert(configFileName);
|
|
126123
126157
|
writeLog(`Reloading config file: ${configFileName}`);
|
|
126124
|
-
|
|
126158
|
+
updateLevel = 0 /* Update */;
|
|
126125
126159
|
if (cachedDirectoryStructureHost) {
|
|
126126
126160
|
cachedDirectoryStructureHost.clearCache();
|
|
126127
126161
|
}
|
|
@@ -126158,9 +126192,9 @@ ${lanes.join("\n")}
|
|
|
126158
126192
|
const configPath = toPath3(configFileName2);
|
|
126159
126193
|
let config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath);
|
|
126160
126194
|
if (config) {
|
|
126161
|
-
if (!config.
|
|
126195
|
+
if (!config.updateLevel)
|
|
126162
126196
|
return config.parsedCommandLine;
|
|
126163
|
-
if (config.parsedCommandLine && config.
|
|
126197
|
+
if (config.parsedCommandLine && config.updateLevel === 1 /* RootNamesAndUpdate */ && !host.getParsedCommandLine) {
|
|
126164
126198
|
writeLog("Reloading new file names and options");
|
|
126165
126199
|
Debug.assert(compilerOptions);
|
|
126166
126200
|
const fileNames = getFileNamesFromConfigSpecs(
|
|
@@ -126170,7 +126204,7 @@ ${lanes.join("\n")}
|
|
|
126170
126204
|
parseConfigFileHost
|
|
126171
126205
|
);
|
|
126172
126206
|
config.parsedCommandLine = { ...config.parsedCommandLine, fileNames };
|
|
126173
|
-
config.
|
|
126207
|
+
config.updateLevel = void 0;
|
|
126174
126208
|
return config.parsedCommandLine;
|
|
126175
126209
|
}
|
|
126176
126210
|
}
|
|
@@ -126178,7 +126212,7 @@ ${lanes.join("\n")}
|
|
|
126178
126212
|
const parsedCommandLine = host.getParsedCommandLine ? host.getParsedCommandLine(configFileName2) : getParsedCommandLineFromConfigFileHost(configFileName2);
|
|
126179
126213
|
if (config) {
|
|
126180
126214
|
config.parsedCommandLine = parsedCommandLine;
|
|
126181
|
-
config.
|
|
126215
|
+
config.updateLevel = void 0;
|
|
126182
126216
|
} else {
|
|
126183
126217
|
(parsedConfigs || (parsedConfigs = /* @__PURE__ */ new Map())).set(configPath, config = { parsedCommandLine });
|
|
126184
126218
|
}
|
|
@@ -126275,8 +126309,8 @@ ${lanes.join("\n")}
|
|
|
126275
126309
|
toPath: toPath3
|
|
126276
126310
|
}))
|
|
126277
126311
|
return;
|
|
126278
|
-
if (
|
|
126279
|
-
|
|
126312
|
+
if (updateLevel !== 2 /* Full */) {
|
|
126313
|
+
updateLevel = 1 /* RootNamesAndUpdate */;
|
|
126280
126314
|
scheduleProgramUpdate();
|
|
126281
126315
|
}
|
|
126282
126316
|
},
|
|
@@ -126302,11 +126336,11 @@ ${lanes.join("\n")}
|
|
|
126302
126336
|
return;
|
|
126303
126337
|
projects.forEach((projectPath) => {
|
|
126304
126338
|
if (configFileName && toPath3(configFileName) === projectPath) {
|
|
126305
|
-
|
|
126339
|
+
updateLevel = 2 /* Full */;
|
|
126306
126340
|
} else {
|
|
126307
126341
|
const config = parsedConfigs == null ? void 0 : parsedConfigs.get(projectPath);
|
|
126308
126342
|
if (config)
|
|
126309
|
-
config.
|
|
126343
|
+
config.updateLevel = 2 /* Full */;
|
|
126310
126344
|
resolutionCache.removeResolutionsFromProjectReferenceRedirects(projectPath);
|
|
126311
126345
|
}
|
|
126312
126346
|
scheduleProgramUpdate();
|
|
@@ -126327,7 +126361,7 @@ ${lanes.join("\n")}
|
|
|
126327
126361
|
updateCachedSystemWithFile(configFileName2, configPath, eventKind);
|
|
126328
126362
|
const config = parsedConfigs == null ? void 0 : parsedConfigs.get(configPath);
|
|
126329
126363
|
if (config)
|
|
126330
|
-
config.
|
|
126364
|
+
config.updateLevel = 2 /* Full */;
|
|
126331
126365
|
resolutionCache.removeResolutionsFromProjectReferenceRedirects(configPath);
|
|
126332
126366
|
scheduleProgramUpdate();
|
|
126333
126367
|
},
|
|
@@ -126365,8 +126399,8 @@ ${lanes.join("\n")}
|
|
|
126365
126399
|
toPath: toPath3
|
|
126366
126400
|
}))
|
|
126367
126401
|
return;
|
|
126368
|
-
if (config.
|
|
126369
|
-
config.
|
|
126402
|
+
if (config.updateLevel !== 2 /* Full */) {
|
|
126403
|
+
config.updateLevel = 1 /* RootNamesAndUpdate */;
|
|
126370
126404
|
scheduleProgramUpdate();
|
|
126371
126405
|
}
|
|
126372
126406
|
},
|
|
@@ -126840,12 +126874,12 @@ ${lanes.join("\n")}
|
|
|
126840
126874
|
state.projectStatus.delete(resolved);
|
|
126841
126875
|
state.diagnostics.delete(resolved);
|
|
126842
126876
|
}
|
|
126843
|
-
function addProjToQueue({ projectPendingBuild }, proj,
|
|
126877
|
+
function addProjToQueue({ projectPendingBuild }, proj, updateLevel) {
|
|
126844
126878
|
const value = projectPendingBuild.get(proj);
|
|
126845
126879
|
if (value === void 0) {
|
|
126846
|
-
projectPendingBuild.set(proj,
|
|
126847
|
-
} else if (value <
|
|
126848
|
-
projectPendingBuild.set(proj,
|
|
126880
|
+
projectPendingBuild.set(proj, updateLevel);
|
|
126881
|
+
} else if (value < updateLevel) {
|
|
126882
|
+
projectPendingBuild.set(proj, updateLevel);
|
|
126849
126883
|
}
|
|
126850
126884
|
}
|
|
126851
126885
|
function setupInitialBuild(state, cancellationToken) {
|
|
@@ -126859,7 +126893,7 @@ ${lanes.join("\n")}
|
|
|
126859
126893
|
buildOrder.forEach(
|
|
126860
126894
|
(configFileName) => state.projectPendingBuild.set(
|
|
126861
126895
|
toResolvedConfigFilePath(state, configFileName),
|
|
126862
|
-
0 /*
|
|
126896
|
+
0 /* Update */
|
|
126863
126897
|
)
|
|
126864
126898
|
);
|
|
126865
126899
|
if (cancellationToken) {
|
|
@@ -127295,8 +127329,8 @@ ${lanes.join("\n")}
|
|
|
127295
127329
|
for (let projectIndex = 0; projectIndex < buildOrder.length; projectIndex++) {
|
|
127296
127330
|
const project = buildOrder[projectIndex];
|
|
127297
127331
|
const projectPath = toResolvedConfigFilePath(state, project);
|
|
127298
|
-
const
|
|
127299
|
-
if (
|
|
127332
|
+
const updateLevel = state.projectPendingBuild.get(projectPath);
|
|
127333
|
+
if (updateLevel === void 0)
|
|
127300
127334
|
continue;
|
|
127301
127335
|
if (reportQueue) {
|
|
127302
127336
|
reportQueue = false;
|
|
@@ -127308,13 +127342,13 @@ ${lanes.join("\n")}
|
|
|
127308
127342
|
projectPendingBuild.delete(projectPath);
|
|
127309
127343
|
continue;
|
|
127310
127344
|
}
|
|
127311
|
-
if (
|
|
127345
|
+
if (updateLevel === 2 /* Full */) {
|
|
127312
127346
|
watchConfigFile(state, project, projectPath, config);
|
|
127313
127347
|
watchExtendedConfigFiles(state, projectPath, config);
|
|
127314
127348
|
watchWildCardDirectories(state, project, projectPath, config);
|
|
127315
127349
|
watchInputFiles(state, project, projectPath, config);
|
|
127316
127350
|
watchPackageJsonFiles(state, project, projectPath, config);
|
|
127317
|
-
} else if (
|
|
127351
|
+
} else if (updateLevel === 1 /* RootNamesAndUpdate */) {
|
|
127318
127352
|
config.fileNames = getFileNamesFromConfigSpecs(config.options.configFile.configFileSpecs, getDirectoryPath(project), config.options, state.parseConfigFileHost);
|
|
127319
127353
|
updateErrorForNoInputFiles(config.fileNames, project, config.options.configFile.configFileSpecs, config.errors, canJsonReportNoInputFiles(config.raw));
|
|
127320
127354
|
watchInputFiles(state, project, projectPath, config);
|
|
@@ -127901,7 +127935,7 @@ ${lanes.join("\n")}
|
|
|
127901
127935
|
break;
|
|
127902
127936
|
}
|
|
127903
127937
|
}
|
|
127904
|
-
addProjToQueue(state, nextProjectPath, 0 /*
|
|
127938
|
+
addProjToQueue(state, nextProjectPath, 0 /* Update */);
|
|
127905
127939
|
break;
|
|
127906
127940
|
}
|
|
127907
127941
|
}
|
|
@@ -127970,7 +128004,7 @@ ${lanes.join("\n")}
|
|
|
127970
128004
|
filesToDelete.push(output);
|
|
127971
128005
|
} else {
|
|
127972
128006
|
host.deleteFile(output);
|
|
127973
|
-
invalidateProject(state, resolvedPath, 0 /*
|
|
128007
|
+
invalidateProject(state, resolvedPath, 0 /* Update */);
|
|
127974
128008
|
}
|
|
127975
128009
|
}
|
|
127976
128010
|
}
|
|
@@ -127981,22 +128015,22 @@ ${lanes.join("\n")}
|
|
|
127981
128015
|
}
|
|
127982
128016
|
return 0 /* Success */;
|
|
127983
128017
|
}
|
|
127984
|
-
function invalidateProject(state, resolved,
|
|
127985
|
-
if (state.host.getParsedCommandLine &&
|
|
127986
|
-
|
|
128018
|
+
function invalidateProject(state, resolved, updateLevel) {
|
|
128019
|
+
if (state.host.getParsedCommandLine && updateLevel === 1 /* RootNamesAndUpdate */) {
|
|
128020
|
+
updateLevel = 2 /* Full */;
|
|
127987
128021
|
}
|
|
127988
|
-
if (
|
|
128022
|
+
if (updateLevel === 2 /* Full */) {
|
|
127989
128023
|
state.configFileCache.delete(resolved);
|
|
127990
128024
|
state.buildOrder = void 0;
|
|
127991
128025
|
}
|
|
127992
128026
|
state.needsSummary = true;
|
|
127993
128027
|
clearProjectStatus(state, resolved);
|
|
127994
|
-
addProjToQueue(state, resolved,
|
|
128028
|
+
addProjToQueue(state, resolved, updateLevel);
|
|
127995
128029
|
enableCache(state);
|
|
127996
128030
|
}
|
|
127997
|
-
function invalidateProjectAndScheduleBuilds(state, resolvedPath,
|
|
128031
|
+
function invalidateProjectAndScheduleBuilds(state, resolvedPath, updateLevel) {
|
|
127998
128032
|
state.reportFileChangeDetected = true;
|
|
127999
|
-
invalidateProject(state, resolvedPath,
|
|
128033
|
+
invalidateProject(state, resolvedPath, updateLevel);
|
|
128000
128034
|
scheduleBuildInvalidatedProject(
|
|
128001
128035
|
state,
|
|
128002
128036
|
250,
|
|
@@ -128127,7 +128161,7 @@ ${lanes.join("\n")}
|
|
|
128127
128161
|
toPath: (fileName) => toPath2(state, fileName)
|
|
128128
128162
|
}))
|
|
128129
128163
|
return;
|
|
128130
|
-
invalidateProjectAndScheduleBuilds(state, resolvedPath, 1 /*
|
|
128164
|
+
invalidateProjectAndScheduleBuilds(state, resolvedPath, 1 /* RootNamesAndUpdate */);
|
|
128131
128165
|
},
|
|
128132
128166
|
flags,
|
|
128133
128167
|
parsed == null ? void 0 : parsed.watchOptions,
|
|
@@ -128146,7 +128180,7 @@ ${lanes.join("\n")}
|
|
|
128146
128180
|
createNewValue: (_path, input) => watchFile(
|
|
128147
128181
|
state,
|
|
128148
128182
|
input,
|
|
128149
|
-
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /*
|
|
128183
|
+
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */),
|
|
128150
128184
|
250 /* Low */,
|
|
128151
128185
|
parsed == null ? void 0 : parsed.watchOptions,
|
|
128152
128186
|
WatchType.SourceFile,
|
|
@@ -128166,7 +128200,7 @@ ${lanes.join("\n")}
|
|
|
128166
128200
|
createNewValue: (path, _input) => watchFile(
|
|
128167
128201
|
state,
|
|
128168
128202
|
path,
|
|
128169
|
-
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /*
|
|
128203
|
+
() => invalidateProjectAndScheduleBuilds(state, resolvedPath, 0 /* Update */),
|
|
128170
128204
|
2e3 /* High */,
|
|
128171
128205
|
parsed == null ? void 0 : parsed.watchOptions,
|
|
128172
128206
|
WatchType.PackageJson,
|
|
@@ -128237,7 +128271,7 @@ ${lanes.join("\n")}
|
|
|
128237
128271
|
const configFilePath = toResolvedConfigFilePath(state, configFileName);
|
|
128238
128272
|
return getUpToDateStatus(state, parseConfigFile(state, configFileName, configFilePath), configFilePath);
|
|
128239
128273
|
},
|
|
128240
|
-
invalidateProject: (configFilePath,
|
|
128274
|
+
invalidateProject: (configFilePath, updateLevel) => invalidateProject(state, configFilePath, updateLevel || 0 /* Update */),
|
|
128241
128275
|
close: () => stopWatching(state)
|
|
128242
128276
|
};
|
|
128243
128277
|
}
|
|
@@ -173851,12 +173885,12 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
173851
173885
|
}
|
|
173852
173886
|
return { ...newTypeAcquisition, include: this.removeExistingTypings(newTypeAcquisition.include) };
|
|
173853
173887
|
}
|
|
173854
|
-
getExternalFiles() {
|
|
173888
|
+
getExternalFiles(updateLevel) {
|
|
173855
173889
|
return sort(flatMap(this.plugins, (plugin) => {
|
|
173856
173890
|
if (typeof plugin.module.getExternalFiles !== "function")
|
|
173857
173891
|
return;
|
|
173858
173892
|
try {
|
|
173859
|
-
return plugin.module.getExternalFiles(this);
|
|
173893
|
+
return plugin.module.getExternalFiles(this, updateLevel || 0 /* Update */);
|
|
173860
173894
|
} catch (e) {
|
|
173861
173895
|
this.projectService.logger.info(`A plugin threw an exception in getExternalFiles: ${e}`);
|
|
173862
173896
|
if (e.stack) {
|
|
@@ -174591,6 +174625,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
174591
174625
|
}
|
|
174592
174626
|
/** @internal */
|
|
174593
174627
|
getChangesSinceVersion(lastKnownVersion, includeProjectReferenceRedirectInfo) {
|
|
174628
|
+
var _a, _b;
|
|
174594
174629
|
const includeProjectReferenceRedirectInfoIfRequested = includeProjectReferenceRedirectInfo ? (files) => arrayFrom(files.entries(), ([fileName, isSourceOfProjectReferenceRedirect]) => ({
|
|
174595
174630
|
fileName,
|
|
174596
174631
|
isSourceOfProjectReferenceRedirect
|
|
@@ -174613,10 +174648,10 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
174613
174648
|
return { info, projectErrors: this.getGlobalProjectErrors() };
|
|
174614
174649
|
}
|
|
174615
174650
|
const lastReportedFileNames = this.lastReportedFileNames;
|
|
174616
|
-
const externalFiles = this.
|
|
174651
|
+
const externalFiles = ((_a = this.externalFiles) == null ? void 0 : _a.map((f) => ({
|
|
174617
174652
|
fileName: toNormalizedPath(f),
|
|
174618
174653
|
isSourceOfProjectReferenceRedirect: false
|
|
174619
|
-
}));
|
|
174654
|
+
}))) || emptyArray2;
|
|
174620
174655
|
const currentFiles = arrayToMap(
|
|
174621
174656
|
this.getFileNamesWithRedirectInfo(!!includeProjectReferenceRedirectInfo).concat(externalFiles),
|
|
174622
174657
|
(info2) => info2.fileName,
|
|
@@ -174658,10 +174693,10 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
174658
174693
|
};
|
|
174659
174694
|
} else {
|
|
174660
174695
|
const projectFileNames = this.getFileNamesWithRedirectInfo(!!includeProjectReferenceRedirectInfo);
|
|
174661
|
-
const externalFiles = this.
|
|
174696
|
+
const externalFiles = ((_b = this.externalFiles) == null ? void 0 : _b.map((f) => ({
|
|
174662
174697
|
fileName: toNormalizedPath(f),
|
|
174663
174698
|
isSourceOfProjectReferenceRedirect: false
|
|
174664
|
-
}));
|
|
174699
|
+
}))) || emptyArray2;
|
|
174665
174700
|
const allFiles = projectFileNames.concat(externalFiles);
|
|
174666
174701
|
this.lastReportedFileNames = arrayToMap(
|
|
174667
174702
|
allFiles,
|
|
@@ -175340,18 +175375,18 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
175340
175375
|
updateGraph() {
|
|
175341
175376
|
const isInitialLoad = this.isInitialLoadPending();
|
|
175342
175377
|
this.isInitialLoadPending = returnFalse;
|
|
175343
|
-
const
|
|
175344
|
-
this.
|
|
175378
|
+
const updateLevel = this.pendingUpdateLevel;
|
|
175379
|
+
this.pendingUpdateLevel = 0 /* Update */;
|
|
175345
175380
|
let result;
|
|
175346
|
-
switch (
|
|
175347
|
-
case 1 /*
|
|
175381
|
+
switch (updateLevel) {
|
|
175382
|
+
case 1 /* RootNamesAndUpdate */:
|
|
175348
175383
|
this.openFileWatchTriggered.clear();
|
|
175349
175384
|
result = this.projectService.reloadFileNamesOfConfiguredProject(this);
|
|
175350
175385
|
break;
|
|
175351
175386
|
case 2 /* Full */:
|
|
175352
175387
|
this.openFileWatchTriggered.clear();
|
|
175353
|
-
const reason = Debug.checkDefined(this.
|
|
175354
|
-
this.
|
|
175388
|
+
const reason = Debug.checkDefined(this.pendingUpdateReason);
|
|
175389
|
+
this.pendingUpdateReason = void 0;
|
|
175355
175390
|
this.projectService.reloadConfiguredProject(
|
|
175356
175391
|
this,
|
|
175357
175392
|
reason,
|
|
@@ -176474,28 +176509,28 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
176474
176509
|
getScriptKind: configuredProjectForConfig ? (fileName) => configuredProjectForConfig.getScriptKind(fileName) : void 0
|
|
176475
176510
|
}))
|
|
176476
176511
|
return;
|
|
176477
|
-
if (config.
|
|
176478
|
-
config.
|
|
176512
|
+
if (config.updateLevel !== 2 /* Full */)
|
|
176513
|
+
config.updateLevel = 1 /* RootNamesAndUpdate */;
|
|
176479
176514
|
config.projects.forEach((watchWildcardDirectories, projectCanonicalPath) => {
|
|
176480
176515
|
if (!watchWildcardDirectories)
|
|
176481
176516
|
return;
|
|
176482
176517
|
const project = this.getConfiguredProjectByCanonicalConfigFilePath(projectCanonicalPath);
|
|
176483
176518
|
if (!project)
|
|
176484
176519
|
return;
|
|
176485
|
-
const
|
|
176486
|
-
if (project.
|
|
176520
|
+
const updateLevel = configuredProjectForConfig === project ? 1 /* RootNamesAndUpdate */ : 0 /* Update */;
|
|
176521
|
+
if (project.pendingUpdateLevel !== void 0 && project.pendingUpdateLevel > updateLevel)
|
|
176487
176522
|
return;
|
|
176488
176523
|
if (this.openFiles.has(fileOrDirectoryPath)) {
|
|
176489
176524
|
const info = Debug.checkDefined(this.getScriptInfoForPath(fileOrDirectoryPath));
|
|
176490
176525
|
if (info.isAttached(project)) {
|
|
176491
|
-
const loadLevelToSet = Math.max(
|
|
176526
|
+
const loadLevelToSet = Math.max(updateLevel, project.openFileWatchTriggered.get(fileOrDirectoryPath) || 0 /* Update */);
|
|
176492
176527
|
project.openFileWatchTriggered.set(fileOrDirectoryPath, loadLevelToSet);
|
|
176493
176528
|
} else {
|
|
176494
|
-
project.
|
|
176529
|
+
project.pendingUpdateLevel = updateLevel;
|
|
176495
176530
|
this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project);
|
|
176496
176531
|
}
|
|
176497
176532
|
} else {
|
|
176498
|
-
project.
|
|
176533
|
+
project.pendingUpdateLevel = updateLevel;
|
|
176499
176534
|
this.delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project);
|
|
176500
176535
|
}
|
|
176501
176536
|
});
|
|
@@ -176507,12 +176542,12 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
176507
176542
|
);
|
|
176508
176543
|
}
|
|
176509
176544
|
/** @internal */
|
|
176510
|
-
delayUpdateProjectsFromParsedConfigOnConfigFileChange(canonicalConfigFilePath,
|
|
176545
|
+
delayUpdateProjectsFromParsedConfigOnConfigFileChange(canonicalConfigFilePath, loadReason) {
|
|
176511
176546
|
const configFileExistenceInfo = this.configFileExistenceInfoCache.get(canonicalConfigFilePath);
|
|
176512
176547
|
if (!(configFileExistenceInfo == null ? void 0 : configFileExistenceInfo.config))
|
|
176513
176548
|
return false;
|
|
176514
176549
|
let scheduledAnyProjectUpdate = false;
|
|
176515
|
-
configFileExistenceInfo.config.
|
|
176550
|
+
configFileExistenceInfo.config.updateLevel = 2 /* Full */;
|
|
176516
176551
|
configFileExistenceInfo.config.projects.forEach((_watchWildcardDirectories, projectCanonicalPath) => {
|
|
176517
176552
|
const project = this.getConfiguredProjectByCanonicalConfigFilePath(projectCanonicalPath);
|
|
176518
176553
|
if (!project)
|
|
@@ -176521,8 +176556,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
176521
176556
|
if (projectCanonicalPath === canonicalConfigFilePath) {
|
|
176522
176557
|
if (project.isInitialLoadPending())
|
|
176523
176558
|
return;
|
|
176524
|
-
project.
|
|
176525
|
-
project.
|
|
176559
|
+
project.pendingUpdateLevel = 2 /* Full */;
|
|
176560
|
+
project.pendingUpdateReason = loadReason;
|
|
176526
176561
|
this.delayUpdateProjectGraph(project);
|
|
176527
176562
|
} else {
|
|
176528
176563
|
project.resolutionCache.removeResolutionsFromProjectReferenceRedirects(this.toPath(canonicalConfigFilePath));
|
|
@@ -176671,11 +176706,11 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
176671
176706
|
if (info.hasMixedContent) {
|
|
176672
176707
|
info.registerFileUpdate();
|
|
176673
176708
|
}
|
|
176674
|
-
const
|
|
176675
|
-
if (
|
|
176709
|
+
const updateLevel = p.openFileWatchTriggered.get(info.path);
|
|
176710
|
+
if (updateLevel !== void 0) {
|
|
176676
176711
|
p.openFileWatchTriggered.delete(info.path);
|
|
176677
|
-
if (p.
|
|
176678
|
-
p.
|
|
176712
|
+
if (p.pendingUpdateLevel !== void 0 && p.pendingUpdateLevel < updateLevel) {
|
|
176713
|
+
p.pendingUpdateLevel = updateLevel;
|
|
176679
176714
|
p.markFileAsDirty(info.path);
|
|
176680
176715
|
}
|
|
176681
176716
|
}
|
|
@@ -177072,7 +177107,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
177072
177107
|
configFileExistenceInfo.config = {
|
|
177073
177108
|
cachedDirectoryStructureHost: createCachedDirectoryStructureHost(this.host, this.host.getCurrentDirectory(), this.host.useCaseSensitiveFileNames),
|
|
177074
177109
|
projects: /* @__PURE__ */ new Map(),
|
|
177075
|
-
|
|
177110
|
+
updateLevel: 2 /* Full */
|
|
177076
177111
|
};
|
|
177077
177112
|
}
|
|
177078
177113
|
const project = new ConfiguredProject2(
|
|
@@ -177089,8 +177124,8 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
177089
177124
|
/** @internal */
|
|
177090
177125
|
createConfiguredProjectWithDelayLoad(configFileName, reason) {
|
|
177091
177126
|
const project = this.createConfiguredProject(configFileName);
|
|
177092
|
-
project.
|
|
177093
|
-
project.
|
|
177127
|
+
project.pendingUpdateLevel = 2 /* Full */;
|
|
177128
|
+
project.pendingUpdateReason = reason;
|
|
177094
177129
|
return project;
|
|
177095
177130
|
}
|
|
177096
177131
|
/** @internal */
|
|
@@ -177146,7 +177181,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
177146
177181
|
this.watchWildcards(configFilename, configFileExistenceInfo, project);
|
|
177147
177182
|
}
|
|
177148
177183
|
project.enablePluginsWithOptions(compilerOptions);
|
|
177149
|
-
const filesToAdd = parsedCommandLine.fileNames.concat(project.getExternalFiles());
|
|
177184
|
+
const filesToAdd = parsedCommandLine.fileNames.concat(project.getExternalFiles(2 /* Full */));
|
|
177150
177185
|
this.updateRootAndOptionsOfNonInferredProject(project, filesToAdd, fileNamePropertyReader, compilerOptions, parsedCommandLine.typeAcquisition, parsedCommandLine.compileOnSave, parsedCommandLine.watchOptions);
|
|
177151
177186
|
(_b = tracing) == null ? void 0 : _b.pop();
|
|
177152
177187
|
}
|
|
@@ -177154,9 +177189,9 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
177154
177189
|
ensureParsedConfigUptoDate(configFilename, canonicalConfigFilePath, configFileExistenceInfo, forProject) {
|
|
177155
177190
|
var _a, _b, _c;
|
|
177156
177191
|
if (configFileExistenceInfo.config) {
|
|
177157
|
-
if (!configFileExistenceInfo.config.
|
|
177192
|
+
if (!configFileExistenceInfo.config.updateLevel)
|
|
177158
177193
|
return configFileExistenceInfo;
|
|
177159
|
-
if (configFileExistenceInfo.config.
|
|
177194
|
+
if (configFileExistenceInfo.config.updateLevel === 1 /* RootNamesAndUpdate */) {
|
|
177160
177195
|
this.reloadFileNamesOfParsedConfig(configFilename, configFileExistenceInfo.config);
|
|
177161
177196
|
return configFileExistenceInfo;
|
|
177162
177197
|
}
|
|
@@ -177199,7 +177234,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
177199
177234
|
} else {
|
|
177200
177235
|
configFileExistenceInfo.config.parsedCommandLine = parsedCommandLine;
|
|
177201
177236
|
configFileExistenceInfo.config.watchedDirectoriesStale = true;
|
|
177202
|
-
configFileExistenceInfo.config.
|
|
177237
|
+
configFileExistenceInfo.config.updateLevel = void 0;
|
|
177203
177238
|
}
|
|
177204
177239
|
if (!oldCommandLine && !isJsonEqual(
|
|
177205
177240
|
// Old options
|
|
@@ -177358,14 +177393,14 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
177358
177393
|
reloadFileNamesOfConfiguredProject(project) {
|
|
177359
177394
|
const fileNames = this.reloadFileNamesOfParsedConfig(project.getConfigFilePath(), this.configFileExistenceInfoCache.get(project.canonicalConfigFilePath).config);
|
|
177360
177395
|
project.updateErrorOnNoInputFiles(fileNames);
|
|
177361
|
-
this.updateNonInferredProjectFiles(project, fileNames.concat(project.getExternalFiles()), fileNamePropertyReader);
|
|
177396
|
+
this.updateNonInferredProjectFiles(project, fileNames.concat(project.getExternalFiles(1 /* RootNamesAndUpdate */)), fileNamePropertyReader);
|
|
177362
177397
|
return project.updateGraph();
|
|
177363
177398
|
}
|
|
177364
177399
|
/** @internal */
|
|
177365
177400
|
reloadFileNamesOfParsedConfig(configFileName, config) {
|
|
177366
|
-
if (config.
|
|
177401
|
+
if (config.updateLevel === void 0)
|
|
177367
177402
|
return config.parsedCommandLine.fileNames;
|
|
177368
|
-
Debug.assert(config.
|
|
177403
|
+
Debug.assert(config.updateLevel === 1 /* RootNamesAndUpdate */);
|
|
177369
177404
|
const configFileSpecs = config.parsedCommandLine.options.configFile.configFileSpecs;
|
|
177370
177405
|
const fileNames = getFileNamesFromConfigSpecs(
|
|
177371
177406
|
configFileSpecs,
|
|
@@ -177907,7 +177942,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
177907
177942
|
this.hostConfiguration.preferences = { ...this.hostConfiguration.preferences, ...args.preferences };
|
|
177908
177943
|
if (lazyConfiguredProjectsFromExternalProject && !this.hostConfiguration.preferences.lazyConfiguredProjectsFromExternalProject) {
|
|
177909
177944
|
this.configuredProjects.forEach((project) => {
|
|
177910
|
-
if (project.hasExternalProjectRef() && project.
|
|
177945
|
+
if (project.hasExternalProjectRef() && project.pendingUpdateLevel === 2 /* Full */ && !this.pendingProjectUpdates.has(project.getProjectName())) {
|
|
177911
177946
|
project.updateGraph();
|
|
177912
177947
|
}
|
|
177913
177948
|
});
|
|
@@ -177962,7 +177997,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
177962
177997
|
this.pendingEnsureProjectForOpenFiles = false;
|
|
177963
177998
|
this.configFileExistenceInfoCache.forEach((info) => {
|
|
177964
177999
|
if (info.config)
|
|
177965
|
-
info.config.
|
|
178000
|
+
info.config.updateLevel = 2 /* Full */;
|
|
177966
178001
|
});
|
|
177967
178002
|
this.reloadConfiguredProjectForFiles(
|
|
177968
178003
|
this.openFiles,
|
|
@@ -178014,8 +178049,8 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
178014
178049
|
if (!updatedProjects.has(project.canonicalConfigFilePath)) {
|
|
178015
178050
|
updatedProjects.set(project.canonicalConfigFilePath, true);
|
|
178016
178051
|
if (delayReload) {
|
|
178017
|
-
project.
|
|
178018
|
-
project.
|
|
178052
|
+
project.pendingUpdateLevel = 2 /* Full */;
|
|
178053
|
+
project.pendingUpdateReason = reason;
|
|
178019
178054
|
if (clearSemanticCache)
|
|
178020
178055
|
this.clearSemanticCache(project);
|
|
178021
178056
|
this.delayUpdateProjectGraph(project);
|
|
@@ -183313,7 +183348,6 @@ ${e.message}`;
|
|
|
183313
183348
|
CompletionInfoFlags: () => CompletionInfoFlags,
|
|
183314
183349
|
CompletionTriggerKind: () => CompletionTriggerKind,
|
|
183315
183350
|
Completions: () => ts_Completions_exports,
|
|
183316
|
-
ConfigFileProgramReloadLevel: () => ConfigFileProgramReloadLevel,
|
|
183317
183351
|
ContainerFlags: () => ContainerFlags,
|
|
183318
183352
|
ContextFlags: () => ContextFlags,
|
|
183319
183353
|
Debug: () => Debug,
|
|
@@ -183400,6 +183434,7 @@ ${e.message}`;
|
|
|
183400
183434
|
PragmaKindFlags: () => PragmaKindFlags,
|
|
183401
183435
|
PrivateIdentifierKind: () => PrivateIdentifierKind,
|
|
183402
183436
|
ProcessLevel: () => ProcessLevel,
|
|
183437
|
+
ProgramUpdateLevel: () => ProgramUpdateLevel,
|
|
183403
183438
|
QuotePreference: () => QuotePreference,
|
|
183404
183439
|
RelationComparisonResult: () => RelationComparisonResult,
|
|
183405
183440
|
Rename: () => ts_Rename_exports,
|
|
@@ -185720,7 +185755,6 @@ ${e.message}`;
|
|
|
185720
185755
|
CompletionInfoFlags: () => CompletionInfoFlags,
|
|
185721
185756
|
CompletionTriggerKind: () => CompletionTriggerKind,
|
|
185722
185757
|
Completions: () => ts_Completions_exports,
|
|
185723
|
-
ConfigFileProgramReloadLevel: () => ConfigFileProgramReloadLevel,
|
|
185724
185758
|
ContainerFlags: () => ContainerFlags,
|
|
185725
185759
|
ContextFlags: () => ContextFlags,
|
|
185726
185760
|
Debug: () => Debug,
|
|
@@ -185807,6 +185841,7 @@ ${e.message}`;
|
|
|
185807
185841
|
PragmaKindFlags: () => PragmaKindFlags,
|
|
185808
185842
|
PrivateIdentifierKind: () => PrivateIdentifierKind,
|
|
185809
185843
|
ProcessLevel: () => ProcessLevel,
|
|
185844
|
+
ProgramUpdateLevel: () => ProgramUpdateLevel,
|
|
185810
185845
|
QuotePreference: () => QuotePreference,
|
|
185811
185846
|
RelationComparisonResult: () => RelationComparisonResult,
|
|
185812
185847
|
Rename: () => ts_Rename_exports,
|