typescript 5.3.0-dev.20231101 → 5.4.0-dev.20231103
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 +170 -131
- package/lib/tsserver.js +328 -233
- package/lib/typescript.d.ts +1 -1
- package/lib/typescript.js +328 -233
- package/lib/typingsInstaller.js +2 -2
- package/package.json +2 -2
package/lib/typescript.js
CHANGED
|
@@ -34,8 +34,8 @@ var ts = (() => {
|
|
|
34
34
|
var init_corePublic = __esm({
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
|
-
versionMajorMinor = "5.
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
37
|
+
versionMajorMinor = "5.4";
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20231103`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -112726,27 +112726,6 @@ ${lanes.join("\n")}
|
|
|
112726
112726
|
(_e = tracing) == null ? void 0 : _e.push(tracing.Phase.Emit, "emitBuildInfo", { buildInfoPath });
|
|
112727
112727
|
emitBuildInfo(bundleBuildInfo, buildInfoPath);
|
|
112728
112728
|
(_f = tracing) == null ? void 0 : _f.pop();
|
|
112729
|
-
if (!emitSkipped && emittedFilesList) {
|
|
112730
|
-
if (!emitOnly) {
|
|
112731
|
-
if (jsFilePath) {
|
|
112732
|
-
emittedFilesList.push(jsFilePath);
|
|
112733
|
-
}
|
|
112734
|
-
if (sourceMapFilePath) {
|
|
112735
|
-
emittedFilesList.push(sourceMapFilePath);
|
|
112736
|
-
}
|
|
112737
|
-
if (buildInfoPath) {
|
|
112738
|
-
emittedFilesList.push(buildInfoPath);
|
|
112739
|
-
}
|
|
112740
|
-
}
|
|
112741
|
-
if (emitOnly !== 0 /* Js */) {
|
|
112742
|
-
if (declarationFilePath) {
|
|
112743
|
-
emittedFilesList.push(declarationFilePath);
|
|
112744
|
-
}
|
|
112745
|
-
if (declarationMapPath) {
|
|
112746
|
-
emittedFilesList.push(declarationMapPath);
|
|
112747
|
-
}
|
|
112748
|
-
}
|
|
112749
|
-
}
|
|
112750
112729
|
function relativeToBuildInfo(path) {
|
|
112751
112730
|
return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path, host.getCanonicalFileName));
|
|
112752
112731
|
}
|
|
@@ -112774,6 +112753,7 @@ ${lanes.join("\n")}
|
|
|
112774
112753
|
void 0,
|
|
112775
112754
|
{ buildInfo }
|
|
112776
112755
|
);
|
|
112756
|
+
emittedFilesList == null ? void 0 : emittedFilesList.push(buildInfoPath);
|
|
112777
112757
|
}
|
|
112778
112758
|
function emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo) {
|
|
112779
112759
|
if (!sourceFileOrBundle || emitOnly || !jsFilePath) {
|
|
@@ -112819,6 +112799,12 @@ ${lanes.join("\n")}
|
|
|
112819
112799
|
transform2.dispose();
|
|
112820
112800
|
if (bundleBuildInfo)
|
|
112821
112801
|
bundleBuildInfo.js = printer.bundleFileInfo;
|
|
112802
|
+
if (emittedFilesList) {
|
|
112803
|
+
emittedFilesList.push(jsFilePath);
|
|
112804
|
+
if (sourceMapFilePath) {
|
|
112805
|
+
emittedFilesList.push(sourceMapFilePath);
|
|
112806
|
+
}
|
|
112807
|
+
}
|
|
112822
112808
|
}
|
|
112823
112809
|
function emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath, relativeToBuildInfo) {
|
|
112824
112810
|
if (!sourceFileOrBundle || emitOnly === 0 /* Js */)
|
|
@@ -112849,33 +112835,33 @@ ${lanes.join("\n")}
|
|
|
112849
112835
|
emitterDiagnostics.add(diagnostic);
|
|
112850
112836
|
}
|
|
112851
112837
|
}
|
|
112852
|
-
const printerOptions = {
|
|
112853
|
-
removeComments: compilerOptions.removeComments,
|
|
112854
|
-
newLine: compilerOptions.newLine,
|
|
112855
|
-
noEmitHelpers: true,
|
|
112856
|
-
module: compilerOptions.module,
|
|
112857
|
-
target: compilerOptions.target,
|
|
112858
|
-
sourceMap: !forceDtsEmit && compilerOptions.declarationMap,
|
|
112859
|
-
inlineSourceMap: compilerOptions.inlineSourceMap,
|
|
112860
|
-
extendedDiagnostics: compilerOptions.extendedDiagnostics,
|
|
112861
|
-
onlyPrintJsDocStyle: true,
|
|
112862
|
-
omitBraceSourceMapPositions: true,
|
|
112863
|
-
writeBundleFileInfo: !!bundleBuildInfo,
|
|
112864
|
-
recordInternalSection: !!bundleBuildInfo,
|
|
112865
|
-
relativeToBuildInfo
|
|
112866
|
-
};
|
|
112867
|
-
const declarationPrinter = createPrinter(printerOptions, {
|
|
112868
|
-
// resolver hooks
|
|
112869
|
-
hasGlobalName: resolver.hasGlobalName,
|
|
112870
|
-
// transform hooks
|
|
112871
|
-
onEmitNode: declarationTransform.emitNodeWithNotification,
|
|
112872
|
-
isEmitNotificationEnabled: declarationTransform.isEmitNotificationEnabled,
|
|
112873
|
-
substituteNode: declarationTransform.substituteNode
|
|
112874
|
-
});
|
|
112875
112838
|
const declBlocked = !!declarationTransform.diagnostics && !!declarationTransform.diagnostics.length || !!host.isEmitBlocked(declarationFilePath) || !!compilerOptions.noEmit;
|
|
112876
112839
|
emitSkipped = emitSkipped || declBlocked;
|
|
112877
112840
|
if (!declBlocked || forceDtsEmit) {
|
|
112878
112841
|
Debug.assert(declarationTransform.transformed.length === 1, "Should only see one output from the decl transform");
|
|
112842
|
+
const printerOptions = {
|
|
112843
|
+
removeComments: compilerOptions.removeComments,
|
|
112844
|
+
newLine: compilerOptions.newLine,
|
|
112845
|
+
noEmitHelpers: true,
|
|
112846
|
+
module: compilerOptions.module,
|
|
112847
|
+
target: compilerOptions.target,
|
|
112848
|
+
sourceMap: !forceDtsEmit && compilerOptions.declarationMap,
|
|
112849
|
+
inlineSourceMap: compilerOptions.inlineSourceMap,
|
|
112850
|
+
extendedDiagnostics: compilerOptions.extendedDiagnostics,
|
|
112851
|
+
onlyPrintJsDocStyle: true,
|
|
112852
|
+
omitBraceSourceMapPositions: true,
|
|
112853
|
+
writeBundleFileInfo: !!bundleBuildInfo,
|
|
112854
|
+
recordInternalSection: !!bundleBuildInfo,
|
|
112855
|
+
relativeToBuildInfo
|
|
112856
|
+
};
|
|
112857
|
+
const declarationPrinter = createPrinter(printerOptions, {
|
|
112858
|
+
// resolver hooks
|
|
112859
|
+
hasGlobalName: resolver.hasGlobalName,
|
|
112860
|
+
// transform hooks
|
|
112861
|
+
onEmitNode: declarationTransform.emitNodeWithNotification,
|
|
112862
|
+
isEmitNotificationEnabled: declarationTransform.isEmitNotificationEnabled,
|
|
112863
|
+
substituteNode: declarationTransform.substituteNode
|
|
112864
|
+
});
|
|
112879
112865
|
printSourceFileOrBundle(
|
|
112880
112866
|
declarationFilePath,
|
|
112881
112867
|
declarationMapPath,
|
|
@@ -112889,10 +112875,16 @@ ${lanes.join("\n")}
|
|
|
112889
112875
|
// Explicitly do not passthru either `inline` option
|
|
112890
112876
|
}
|
|
112891
112877
|
);
|
|
112878
|
+
if (emittedFilesList) {
|
|
112879
|
+
emittedFilesList.push(declarationFilePath);
|
|
112880
|
+
if (declarationMapPath) {
|
|
112881
|
+
emittedFilesList.push(declarationMapPath);
|
|
112882
|
+
}
|
|
112883
|
+
}
|
|
112884
|
+
if (bundleBuildInfo)
|
|
112885
|
+
bundleBuildInfo.dts = declarationPrinter.bundleFileInfo;
|
|
112892
112886
|
}
|
|
112893
112887
|
declarationTransform.dispose();
|
|
112894
|
-
if (bundleBuildInfo)
|
|
112895
|
-
bundleBuildInfo.dts = declarationPrinter.bundleFileInfo;
|
|
112896
112888
|
}
|
|
112897
112889
|
function collectLinkedAliases(node) {
|
|
112898
112890
|
if (isExportAssignment(node)) {
|
|
@@ -123042,6 +123034,7 @@ ${lanes.join("\n")}
|
|
|
123042
123034
|
const copyDeclarationFileDiagnostics = canCopySemanticDiagnostics && !compilerOptions.skipLibCheck === !oldCompilerOptions.skipLibCheck;
|
|
123043
123035
|
const copyLibFileDiagnostics = copyDeclarationFileDiagnostics && !compilerOptions.skipDefaultLibCheck === !oldCompilerOptions.skipDefaultLibCheck;
|
|
123044
123036
|
state.fileInfos.forEach((info, sourceFilePath) => {
|
|
123037
|
+
var _a2;
|
|
123045
123038
|
let oldInfo;
|
|
123046
123039
|
let newReferences;
|
|
123047
123040
|
if (!useOldState || // File wasn't present in old state
|
|
@@ -123051,22 +123044,28 @@ ${lanes.join("\n")}
|
|
|
123051
123044
|
!hasSameKeys(newReferences = referencedMap && referencedMap.getValues(sourceFilePath), oldReferencedMap && oldReferencedMap.getValues(sourceFilePath)) || // Referenced file was deleted in the new program
|
|
123052
123045
|
newReferences && forEachKey(newReferences, (path) => !state.fileInfos.has(path) && oldState.fileInfos.has(path))) {
|
|
123053
123046
|
addFileToChangeSet(state, sourceFilePath);
|
|
123054
|
-
} else
|
|
123047
|
+
} else {
|
|
123055
123048
|
const sourceFile = newProgram.getSourceFileByPath(sourceFilePath);
|
|
123056
|
-
|
|
123057
|
-
|
|
123058
|
-
|
|
123059
|
-
return;
|
|
123060
|
-
const diagnostics = oldState.semanticDiagnosticsPerFile.get(sourceFilePath);
|
|
123061
|
-
if (diagnostics) {
|
|
123062
|
-
state.semanticDiagnosticsPerFile.set(
|
|
123049
|
+
const emitDiagnostics = (_a2 = oldState.emitDiagnosticsPerFile) == null ? void 0 : _a2.get(sourceFilePath);
|
|
123050
|
+
if (emitDiagnostics) {
|
|
123051
|
+
(state.emitDiagnosticsPerFile ?? (state.emitDiagnosticsPerFile = /* @__PURE__ */ new Map())).set(
|
|
123063
123052
|
sourceFilePath,
|
|
123064
|
-
oldState.hasReusableDiagnostic ? convertToDiagnostics(
|
|
123053
|
+
oldState.hasReusableDiagnostic ? convertToDiagnostics(emitDiagnostics, newProgram) : repopulateDiagnostics(emitDiagnostics, newProgram)
|
|
123065
123054
|
);
|
|
123066
|
-
|
|
123067
|
-
|
|
123055
|
+
}
|
|
123056
|
+
if (canCopySemanticDiagnostics) {
|
|
123057
|
+
if (sourceFile.isDeclarationFile && !copyDeclarationFileDiagnostics)
|
|
123058
|
+
return;
|
|
123059
|
+
if (sourceFile.hasNoDefaultLib && !copyLibFileDiagnostics)
|
|
123060
|
+
return;
|
|
123061
|
+
const diagnostics = oldState.semanticDiagnosticsPerFile.get(sourceFilePath);
|
|
123062
|
+
if (diagnostics) {
|
|
123063
|
+
state.semanticDiagnosticsPerFile.set(
|
|
123064
|
+
sourceFilePath,
|
|
123065
|
+
oldState.hasReusableDiagnostic ? convertToDiagnostics(diagnostics, newProgram) : repopulateDiagnostics(diagnostics, newProgram)
|
|
123066
|
+
);
|
|
123067
|
+
(state.semanticDiagnosticsFromOldState ?? (state.semanticDiagnosticsFromOldState = /* @__PURE__ */ new Set())).add(sourceFilePath);
|
|
123068
123068
|
}
|
|
123069
|
-
state.semanticDiagnosticsFromOldState.add(sourceFilePath);
|
|
123070
123069
|
}
|
|
123071
123070
|
}
|
|
123072
123071
|
if (canCopyEmitSignatures) {
|
|
@@ -123203,7 +123202,9 @@ ${lanes.join("\n")}
|
|
|
123203
123202
|
outSignature: state.outSignature,
|
|
123204
123203
|
latestChangedDtsFile: state.latestChangedDtsFile,
|
|
123205
123204
|
hasChangedEmitSignature: state.hasChangedEmitSignature,
|
|
123206
|
-
changedFilesSet: outFilePath ? new Set(state.changedFilesSet) : void 0
|
|
123205
|
+
changedFilesSet: outFilePath ? new Set(state.changedFilesSet) : void 0,
|
|
123206
|
+
buildInfoEmitPending: state.buildInfoEmitPending,
|
|
123207
|
+
emitDiagnosticsPerFile: state.emitDiagnosticsPerFile && new Map(state.emitDiagnosticsPerFile)
|
|
123207
123208
|
};
|
|
123208
123209
|
}
|
|
123209
123210
|
function restoreBuilderProgramEmitState(state, savedEmitState) {
|
|
@@ -123214,6 +123215,8 @@ ${lanes.join("\n")}
|
|
|
123214
123215
|
state.outSignature = savedEmitState.outSignature;
|
|
123215
123216
|
state.latestChangedDtsFile = savedEmitState.latestChangedDtsFile;
|
|
123216
123217
|
state.hasChangedEmitSignature = savedEmitState.hasChangedEmitSignature;
|
|
123218
|
+
state.buildInfoEmitPending = savedEmitState.buildInfoEmitPending;
|
|
123219
|
+
state.emitDiagnosticsPerFile = savedEmitState.emitDiagnosticsPerFile;
|
|
123217
123220
|
if (savedEmitState.changedFilesSet)
|
|
123218
123221
|
state.changedFilesSet = savedEmitState.changedFilesSet;
|
|
123219
123222
|
}
|
|
@@ -123304,6 +123307,22 @@ ${lanes.join("\n")}
|
|
|
123304
123307
|
return { affectedFile, emitKind: pendingKind };
|
|
123305
123308
|
});
|
|
123306
123309
|
}
|
|
123310
|
+
function getNextPendingEmitDiagnosticsFile(state) {
|
|
123311
|
+
var _a;
|
|
123312
|
+
if (!((_a = state.emitDiagnosticsPerFile) == null ? void 0 : _a.size))
|
|
123313
|
+
return void 0;
|
|
123314
|
+
return forEachEntry(state.emitDiagnosticsPerFile, (diagnostics, path) => {
|
|
123315
|
+
var _a2;
|
|
123316
|
+
const affectedFile = state.program.getSourceFileByPath(path);
|
|
123317
|
+
if (!affectedFile || !sourceFileMayBeEmitted(affectedFile, state.program)) {
|
|
123318
|
+
state.emitDiagnosticsPerFile.delete(path);
|
|
123319
|
+
return void 0;
|
|
123320
|
+
}
|
|
123321
|
+
const seenKind = ((_a2 = state.seenEmittedFiles) == null ? void 0 : _a2.get(affectedFile.resolvedPath)) || 0 /* None */;
|
|
123322
|
+
if (!(seenKind & 24 /* AllDts */))
|
|
123323
|
+
return { affectedFile, diagnostics, seenKind };
|
|
123324
|
+
});
|
|
123325
|
+
}
|
|
123307
123326
|
function removeDiagnosticsOfLibraryFiles(state) {
|
|
123308
123327
|
if (!state.cleanedDiagnosticsOfLibFiles) {
|
|
123309
123328
|
state.cleanedDiagnosticsOfLibFiles = true;
|
|
@@ -123580,18 +123599,7 @@ ${lanes.join("\n")}
|
|
|
123580
123599
|
return void 0;
|
|
123581
123600
|
});
|
|
123582
123601
|
}
|
|
123583
|
-
|
|
123584
|
-
if (state.semanticDiagnosticsPerFile) {
|
|
123585
|
-
for (const key of arrayFrom(state.semanticDiagnosticsPerFile.keys()).sort(compareStringsCaseSensitive)) {
|
|
123586
|
-
const value = state.semanticDiagnosticsPerFile.get(key);
|
|
123587
|
-
(semanticDiagnosticsPerFile || (semanticDiagnosticsPerFile = [])).push(
|
|
123588
|
-
value.length ? [
|
|
123589
|
-
toFileId(key),
|
|
123590
|
-
convertToReusableDiagnostics(value, relativeToBuildInfo)
|
|
123591
|
-
] : toFileId(key)
|
|
123592
|
-
);
|
|
123593
|
-
}
|
|
123594
|
-
}
|
|
123602
|
+
const semanticDiagnosticsPerFile = convertToProgramBuildInfoDiagnostics(state.semanticDiagnosticsPerFile);
|
|
123595
123603
|
let affectedFilesPendingEmit;
|
|
123596
123604
|
if ((_c = state.affectedFilesPendingEmit) == null ? void 0 : _c.size) {
|
|
123597
123605
|
const fullEmitForOptions = getBuilderFileEmit(state.compilerOptions);
|
|
@@ -123621,6 +123629,7 @@ ${lanes.join("\n")}
|
|
|
123621
123629
|
(changeFileSet || (changeFileSet = [])).push(toFileId(path));
|
|
123622
123630
|
}
|
|
123623
123631
|
}
|
|
123632
|
+
const emitDiagnosticsPerFile = convertToProgramBuildInfoDiagnostics(state.emitDiagnosticsPerFile);
|
|
123624
123633
|
const program = {
|
|
123625
123634
|
fileNames,
|
|
123626
123635
|
fileInfos,
|
|
@@ -123630,6 +123639,7 @@ ${lanes.join("\n")}
|
|
|
123630
123639
|
referencedMap,
|
|
123631
123640
|
exportedModulesMap,
|
|
123632
123641
|
semanticDiagnosticsPerFile,
|
|
123642
|
+
emitDiagnosticsPerFile,
|
|
123633
123643
|
affectedFilesPendingEmit,
|
|
123634
123644
|
changeFileSet,
|
|
123635
123645
|
emitSignatures,
|
|
@@ -123686,73 +123696,87 @@ ${lanes.join("\n")}
|
|
|
123686
123696
|
if (optionInfo == null ? void 0 : optionInfo.affectsBuildInfo) {
|
|
123687
123697
|
(result || (result = {}))[name] = convertToReusableCompilerOptionValue(
|
|
123688
123698
|
optionInfo,
|
|
123689
|
-
options[name]
|
|
123690
|
-
relativeToBuildInfoEnsuringAbsolutePath
|
|
123699
|
+
options[name]
|
|
123691
123700
|
);
|
|
123692
123701
|
}
|
|
123693
123702
|
}
|
|
123694
123703
|
return result;
|
|
123695
123704
|
}
|
|
123696
|
-
|
|
123697
|
-
|
|
123698
|
-
|
|
123699
|
-
|
|
123700
|
-
|
|
123701
|
-
|
|
123702
|
-
|
|
123703
|
-
|
|
123705
|
+
function convertToReusableCompilerOptionValue(option, value) {
|
|
123706
|
+
if (option) {
|
|
123707
|
+
Debug.assert(option.type !== "listOrElement");
|
|
123708
|
+
if (option.type === "list") {
|
|
123709
|
+
const values = value;
|
|
123710
|
+
if (option.element.isFilePath && values.length) {
|
|
123711
|
+
return values.map(relativeToBuildInfoEnsuringAbsolutePath);
|
|
123712
|
+
}
|
|
123713
|
+
} else if (option.isFilePath) {
|
|
123714
|
+
return relativeToBuildInfoEnsuringAbsolutePath(value);
|
|
123704
123715
|
}
|
|
123705
|
-
} else if (option.isFilePath) {
|
|
123706
|
-
return relativeToBuildInfo(value);
|
|
123707
123716
|
}
|
|
123717
|
+
return value;
|
|
123708
123718
|
}
|
|
123709
|
-
|
|
123710
|
-
|
|
123711
|
-
|
|
123712
|
-
|
|
123713
|
-
|
|
123714
|
-
|
|
123715
|
-
|
|
123716
|
-
|
|
123717
|
-
|
|
123718
|
-
|
|
123719
|
-
|
|
123720
|
-
|
|
123719
|
+
function convertToProgramBuildInfoDiagnostics(diagnostics) {
|
|
123720
|
+
let result;
|
|
123721
|
+
if (diagnostics) {
|
|
123722
|
+
for (const key of arrayFrom(diagnostics.keys()).sort(compareStringsCaseSensitive)) {
|
|
123723
|
+
const value = diagnostics.get(key);
|
|
123724
|
+
(result || (result = [])).push(
|
|
123725
|
+
value.length ? [
|
|
123726
|
+
toFileId(key),
|
|
123727
|
+
convertToReusableDiagnostics(value)
|
|
123728
|
+
] : toFileId(key)
|
|
123729
|
+
);
|
|
123730
|
+
}
|
|
123731
|
+
}
|
|
123721
123732
|
return result;
|
|
123722
|
-
}
|
|
123723
|
-
|
|
123724
|
-
|
|
123725
|
-
|
|
123726
|
-
|
|
123727
|
-
|
|
123728
|
-
|
|
123729
|
-
|
|
123730
|
-
|
|
123731
|
-
|
|
123732
|
-
|
|
123733
|
-
|
|
123733
|
+
}
|
|
123734
|
+
function convertToReusableDiagnostics(diagnostics) {
|
|
123735
|
+
Debug.assert(!!diagnostics.length);
|
|
123736
|
+
return diagnostics.map((diagnostic) => {
|
|
123737
|
+
const result = convertToReusableDiagnosticRelatedInformation(diagnostic);
|
|
123738
|
+
result.reportsUnnecessary = diagnostic.reportsUnnecessary;
|
|
123739
|
+
result.reportDeprecated = diagnostic.reportsDeprecated;
|
|
123740
|
+
result.source = diagnostic.source;
|
|
123741
|
+
result.skippedOn = diagnostic.skippedOn;
|
|
123742
|
+
const { relatedInformation } = diagnostic;
|
|
123743
|
+
result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r) => convertToReusableDiagnosticRelatedInformation(r)) : [] : void 0;
|
|
123744
|
+
return result;
|
|
123745
|
+
});
|
|
123746
|
+
}
|
|
123747
|
+
function convertToReusableDiagnosticRelatedInformation(diagnostic) {
|
|
123748
|
+
const { file } = diagnostic;
|
|
123734
123749
|
return {
|
|
123735
|
-
|
|
123736
|
-
|
|
123750
|
+
...diagnostic,
|
|
123751
|
+
file: file ? relativeToBuildInfo(file.resolvedPath) : void 0,
|
|
123752
|
+
messageText: isString(diagnostic.messageText) ? diagnostic.messageText : convertToReusableDiagnosticMessageChain(diagnostic.messageText)
|
|
123737
123753
|
};
|
|
123738
123754
|
}
|
|
123739
|
-
|
|
123740
|
-
|
|
123741
|
-
|
|
123742
|
-
|
|
123743
|
-
|
|
123744
|
-
|
|
123745
|
-
return forEach(array, (chain, index) => {
|
|
123746
|
-
const reusable = convertToReusableDiagnosticMessageChain(chain);
|
|
123747
|
-
if (chain === reusable)
|
|
123748
|
-
return void 0;
|
|
123749
|
-
const result = index > 0 ? array.slice(0, index - 1) : [];
|
|
123750
|
-
result.push(reusable);
|
|
123751
|
-
for (let i = index + 1; i < array.length; i++) {
|
|
123752
|
-
result.push(convertToReusableDiagnosticMessageChain(array[i]));
|
|
123755
|
+
function convertToReusableDiagnosticMessageChain(chain) {
|
|
123756
|
+
if (chain.repopulateInfo) {
|
|
123757
|
+
return {
|
|
123758
|
+
info: chain.repopulateInfo(),
|
|
123759
|
+
next: convertToReusableDiagnosticMessageChainArray(chain.next)
|
|
123760
|
+
};
|
|
123753
123761
|
}
|
|
123754
|
-
|
|
123755
|
-
|
|
123762
|
+
const next = convertToReusableDiagnosticMessageChainArray(chain.next);
|
|
123763
|
+
return next === chain.next ? chain : { ...chain, next };
|
|
123764
|
+
}
|
|
123765
|
+
function convertToReusableDiagnosticMessageChainArray(array) {
|
|
123766
|
+
if (!array)
|
|
123767
|
+
return array;
|
|
123768
|
+
return forEach(array, (chain, index) => {
|
|
123769
|
+
const reusable = convertToReusableDiagnosticMessageChain(chain);
|
|
123770
|
+
if (chain === reusable)
|
|
123771
|
+
return void 0;
|
|
123772
|
+
const result = index > 0 ? array.slice(0, index - 1) : [];
|
|
123773
|
+
result.push(reusable);
|
|
123774
|
+
for (let i = index + 1; i < array.length; i++) {
|
|
123775
|
+
result.push(convertToReusableDiagnosticMessageChain(array[i]));
|
|
123776
|
+
}
|
|
123777
|
+
return result;
|
|
123778
|
+
}) || array;
|
|
123779
|
+
}
|
|
123756
123780
|
}
|
|
123757
123781
|
function getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {
|
|
123758
123782
|
let host;
|
|
@@ -123861,6 +123885,14 @@ ${lanes.join("\n")}
|
|
|
123861
123885
|
if (!outFile(state.compilerOptions)) {
|
|
123862
123886
|
const pendingAffectedFile = getNextAffectedFilePendingEmit(state, emitOnlyDtsFiles);
|
|
123863
123887
|
if (!pendingAffectedFile) {
|
|
123888
|
+
const pendingForDiagnostics = getNextPendingEmitDiagnosticsFile(state);
|
|
123889
|
+
if (pendingForDiagnostics) {
|
|
123890
|
+
(state.seenEmittedFiles ?? (state.seenEmittedFiles = /* @__PURE__ */ new Map())).set(pendingForDiagnostics.affectedFile.resolvedPath, pendingForDiagnostics.seenKind | 24 /* AllDts */);
|
|
123891
|
+
return {
|
|
123892
|
+
result: { emitSkipped: true, diagnostics: pendingForDiagnostics.diagnostics },
|
|
123893
|
+
affected: pendingForDiagnostics.affectedFile
|
|
123894
|
+
};
|
|
123895
|
+
}
|
|
123864
123896
|
if (!state.buildInfoEmitPending)
|
|
123865
123897
|
return void 0;
|
|
123866
123898
|
const affected2 = state.program;
|
|
@@ -123909,6 +123941,8 @@ ${lanes.join("\n")}
|
|
|
123909
123941
|
(state.affectedFilesPendingEmit ?? (state.affectedFilesPendingEmit = /* @__PURE__ */ new Map())).set(affectedSourceFile.resolvedPath, pendingKind);
|
|
123910
123942
|
else
|
|
123911
123943
|
(_c = state.affectedFilesPendingEmit) == null ? void 0 : _c.delete(affectedSourceFile.resolvedPath);
|
|
123944
|
+
if (result.diagnostics.length)
|
|
123945
|
+
(state.emitDiagnosticsPerFile ?? (state.emitDiagnosticsPerFile = /* @__PURE__ */ new Map())).set(affectedSourceFile.resolvedPath, result.diagnostics);
|
|
123912
123946
|
} else {
|
|
123913
123947
|
state.changedFilesSet.clear();
|
|
123914
123948
|
}
|
|
@@ -124081,9 +124115,10 @@ ${lanes.join("\n")}
|
|
|
124081
124115
|
}
|
|
124082
124116
|
}
|
|
124083
124117
|
function addToAffectedFilesPendingEmit(state, affectedFilePendingEmit, kind) {
|
|
124084
|
-
var _a;
|
|
124118
|
+
var _a, _b;
|
|
124085
124119
|
const existingKind = ((_a = state.affectedFilesPendingEmit) == null ? void 0 : _a.get(affectedFilePendingEmit)) || 0 /* None */;
|
|
124086
124120
|
(state.affectedFilesPendingEmit ?? (state.affectedFilesPendingEmit = /* @__PURE__ */ new Map())).set(affectedFilePendingEmit, existingKind | kind);
|
|
124121
|
+
(_b = state.emitDiagnosticsPerFile) == null ? void 0 : _b.delete(affectedFilePendingEmit);
|
|
124087
124122
|
}
|
|
124088
124123
|
function toBuilderStateFileInfoForMultiEmit(fileInfo) {
|
|
124089
124124
|
return isString(fileInfo) ? { version: fileInfo, signature: fileInfo, affectsGlobalScope: void 0, impliedFormat: void 0 } : isString(fileInfo.signature) ? fileInfo : { version: fileInfo.version, signature: fileInfo.signature === false ? void 0 : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
|
|
@@ -124148,7 +124183,8 @@ ${lanes.join("\n")}
|
|
|
124148
124183
|
compilerOptions: program.options ? convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
|
|
124149
124184
|
referencedMap: toManyToManyPathMap(program.referencedMap),
|
|
124150
124185
|
exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
|
|
124151
|
-
semanticDiagnosticsPerFile:
|
|
124186
|
+
semanticDiagnosticsPerFile: toPerFileDiagnostics(program.semanticDiagnosticsPerFile),
|
|
124187
|
+
emitDiagnosticsPerFile: toPerFileDiagnostics(program.emitDiagnosticsPerFile),
|
|
124152
124188
|
hasReusableDiagnostic: true,
|
|
124153
124189
|
affectedFilesPendingEmit: program.affectedFilesPendingEmit && arrayToMap(program.affectedFilesPendingEmit, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => toBuilderFileEmit(value, fullEmitForOptions)),
|
|
124154
124190
|
changedFilesSet: new Set(map(program.changeFileSet, toFilePath)),
|
|
@@ -124201,6 +124237,9 @@ ${lanes.join("\n")}
|
|
|
124201
124237
|
referenceMap.forEach(([fileId, fileIdListId]) => map2.set(toFilePath(fileId), toFilePathsSet(fileIdListId)));
|
|
124202
124238
|
return map2;
|
|
124203
124239
|
}
|
|
124240
|
+
function toPerFileDiagnostics(diagnostics) {
|
|
124241
|
+
return diagnostics && arrayToMap(diagnostics, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => isNumber(value) ? emptyArray : value[1]);
|
|
124242
|
+
}
|
|
124204
124243
|
}
|
|
124205
124244
|
function getBuildInfoFileVersionMap(program, buildInfoPath, host) {
|
|
124206
124245
|
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
|
|
@@ -127895,7 +127934,7 @@ ${lanes.join("\n")}
|
|
|
127895
127934
|
}
|
|
127896
127935
|
}
|
|
127897
127936
|
function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
127898
|
-
var _a, _b;
|
|
127937
|
+
var _a, _b, _c;
|
|
127899
127938
|
if (!project.fileNames.length && !canJsonReportNoInputFiles(project.raw)) {
|
|
127900
127939
|
return {
|
|
127901
127940
|
type: 16 /* ContainerOnly */
|
|
@@ -127969,7 +128008,7 @@ ${lanes.join("\n")}
|
|
|
127969
128008
|
};
|
|
127970
128009
|
}
|
|
127971
128010
|
if (buildInfo.program) {
|
|
127972
|
-
if (((_a = buildInfo.program.changeFileSet) == null ? void 0 : _a.length) || (!project.options.noEmit ? (_b = buildInfo.program.affectedFilesPendingEmit) == null ? void 0 : _b.length : some(buildInfo.program.semanticDiagnosticsPerFile, isArray))) {
|
|
128011
|
+
if (((_a = buildInfo.program.changeFileSet) == null ? void 0 : _a.length) || (!project.options.noEmit ? ((_b = buildInfo.program.affectedFilesPendingEmit) == null ? void 0 : _b.length) || ((_c = buildInfo.program.emitDiagnosticsPerFile) == null ? void 0 : _c.length) : some(buildInfo.program.semanticDiagnosticsPerFile, isArray))) {
|
|
127973
128012
|
return {
|
|
127974
128013
|
type: 8 /* OutOfDateBuildInfo */,
|
|
127975
128014
|
buildInfoFile: buildInfoPath
|
|
@@ -164466,6 +164505,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
164466
164505
|
visitForDisplayParts(typeNode);
|
|
164467
164506
|
return parts;
|
|
164468
164507
|
function visitForDisplayParts(node) {
|
|
164508
|
+
var _a, _b;
|
|
164469
164509
|
if (!node) {
|
|
164470
164510
|
return;
|
|
164471
164511
|
}
|
|
@@ -164480,9 +164520,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
164480
164520
|
}
|
|
164481
164521
|
switch (node.kind) {
|
|
164482
164522
|
case 80 /* Identifier */:
|
|
164483
|
-
|
|
164484
|
-
const identifierText = idText(
|
|
164485
|
-
const name =
|
|
164523
|
+
Debug.assertNode(node, isIdentifier);
|
|
164524
|
+
const identifierText = idText(node);
|
|
164525
|
+
const name = node.symbol && node.symbol.declarations && node.symbol.declarations.length && getNameOfDeclaration(node.symbol.declarations[0]);
|
|
164486
164526
|
if (name) {
|
|
164487
164527
|
parts.push(getNodeDisplayPart(identifierText, name));
|
|
164488
164528
|
} else {
|
|
@@ -164490,252 +164530,307 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
164490
164530
|
}
|
|
164491
164531
|
break;
|
|
164492
164532
|
case 166 /* QualifiedName */:
|
|
164493
|
-
|
|
164494
|
-
visitForDisplayParts(
|
|
164533
|
+
Debug.assertNode(node, isQualifiedName);
|
|
164534
|
+
visitForDisplayParts(node.left);
|
|
164495
164535
|
parts.push({ text: "." });
|
|
164496
|
-
visitForDisplayParts(
|
|
164536
|
+
visitForDisplayParts(node.right);
|
|
164497
164537
|
break;
|
|
164498
164538
|
case 182 /* TypePredicate */:
|
|
164499
|
-
|
|
164500
|
-
if (
|
|
164539
|
+
Debug.assertNode(node, isTypePredicateNode);
|
|
164540
|
+
if (node.assertsModifier) {
|
|
164501
164541
|
parts.push({ text: "asserts " });
|
|
164502
164542
|
}
|
|
164503
|
-
visitForDisplayParts(
|
|
164504
|
-
if (
|
|
164543
|
+
visitForDisplayParts(node.parameterName);
|
|
164544
|
+
if (node.type) {
|
|
164505
164545
|
parts.push({ text: " is " });
|
|
164506
|
-
visitForDisplayParts(
|
|
164546
|
+
visitForDisplayParts(node.type);
|
|
164507
164547
|
}
|
|
164508
164548
|
break;
|
|
164509
164549
|
case 183 /* TypeReference */:
|
|
164510
|
-
|
|
164511
|
-
visitForDisplayParts(
|
|
164512
|
-
if (
|
|
164550
|
+
Debug.assertNode(node, isTypeReferenceNode);
|
|
164551
|
+
visitForDisplayParts(node.typeName);
|
|
164552
|
+
if (node.typeArguments) {
|
|
164513
164553
|
parts.push({ text: "<" });
|
|
164514
|
-
visitDisplayPartList(
|
|
164554
|
+
visitDisplayPartList(node.typeArguments, ", ");
|
|
164515
164555
|
parts.push({ text: ">" });
|
|
164516
164556
|
}
|
|
164517
164557
|
break;
|
|
164518
164558
|
case 168 /* TypeParameter */:
|
|
164519
|
-
|
|
164520
|
-
if (
|
|
164521
|
-
visitDisplayPartList(
|
|
164559
|
+
Debug.assertNode(node, isTypeParameterDeclaration);
|
|
164560
|
+
if (node.modifiers) {
|
|
164561
|
+
visitDisplayPartList(node.modifiers, " ");
|
|
164522
164562
|
}
|
|
164523
|
-
visitForDisplayParts(
|
|
164524
|
-
if (
|
|
164563
|
+
visitForDisplayParts(node.name);
|
|
164564
|
+
if (node.constraint) {
|
|
164525
164565
|
parts.push({ text: " extends " });
|
|
164526
|
-
visitForDisplayParts(
|
|
164566
|
+
visitForDisplayParts(node.constraint);
|
|
164527
164567
|
}
|
|
164528
|
-
if (
|
|
164568
|
+
if (node.default) {
|
|
164529
164569
|
parts.push({ text: " = " });
|
|
164530
|
-
visitForDisplayParts(
|
|
164570
|
+
visitForDisplayParts(node.default);
|
|
164531
164571
|
}
|
|
164532
164572
|
break;
|
|
164533
164573
|
case 169 /* Parameter */:
|
|
164534
|
-
|
|
164535
|
-
if (
|
|
164536
|
-
visitDisplayPartList(
|
|
164574
|
+
Debug.assertNode(node, isParameter);
|
|
164575
|
+
if (node.modifiers) {
|
|
164576
|
+
visitDisplayPartList(node.modifiers, " ");
|
|
164537
164577
|
}
|
|
164538
|
-
if (
|
|
164578
|
+
if (node.dotDotDotToken) {
|
|
164539
164579
|
parts.push({ text: "..." });
|
|
164540
164580
|
}
|
|
164541
|
-
visitForDisplayParts(
|
|
164542
|
-
if (
|
|
164581
|
+
visitForDisplayParts(node.name);
|
|
164582
|
+
if (node.questionToken) {
|
|
164543
164583
|
parts.push({ text: "?" });
|
|
164544
164584
|
}
|
|
164545
|
-
if (
|
|
164585
|
+
if (node.type) {
|
|
164546
164586
|
parts.push({ text: ": " });
|
|
164547
|
-
visitForDisplayParts(
|
|
164587
|
+
visitForDisplayParts(node.type);
|
|
164548
164588
|
}
|
|
164549
164589
|
break;
|
|
164550
164590
|
case 185 /* ConstructorType */:
|
|
164551
|
-
|
|
164591
|
+
Debug.assertNode(node, isConstructorTypeNode);
|
|
164552
164592
|
parts.push({ text: "new " });
|
|
164553
|
-
|
|
164554
|
-
parts.push({ text: "<" });
|
|
164555
|
-
visitDisplayPartList(constructorType.typeParameters, ", ");
|
|
164556
|
-
parts.push({ text: ">" });
|
|
164557
|
-
}
|
|
164558
|
-
parts.push({ text: "(" });
|
|
164559
|
-
visitDisplayPartList(constructorType.parameters, ", ");
|
|
164560
|
-
parts.push({ text: ")" });
|
|
164593
|
+
visitParametersAndTypeParameters(node);
|
|
164561
164594
|
parts.push({ text: " => " });
|
|
164562
|
-
visitForDisplayParts(
|
|
164595
|
+
visitForDisplayParts(node.type);
|
|
164563
164596
|
break;
|
|
164564
164597
|
case 186 /* TypeQuery */:
|
|
164565
|
-
|
|
164598
|
+
Debug.assertNode(node, isTypeQueryNode);
|
|
164566
164599
|
parts.push({ text: "typeof " });
|
|
164567
|
-
visitForDisplayParts(
|
|
164568
|
-
if (
|
|
164600
|
+
visitForDisplayParts(node.exprName);
|
|
164601
|
+
if (node.typeArguments) {
|
|
164569
164602
|
parts.push({ text: "<" });
|
|
164570
|
-
visitDisplayPartList(
|
|
164603
|
+
visitDisplayPartList(node.typeArguments, ", ");
|
|
164571
164604
|
parts.push({ text: ">" });
|
|
164572
164605
|
}
|
|
164573
164606
|
break;
|
|
164574
164607
|
case 187 /* TypeLiteral */:
|
|
164575
|
-
|
|
164608
|
+
Debug.assertNode(node, isTypeLiteralNode);
|
|
164576
164609
|
parts.push({ text: "{" });
|
|
164577
|
-
if (
|
|
164610
|
+
if (node.members.length) {
|
|
164578
164611
|
parts.push({ text: " " });
|
|
164579
|
-
visitDisplayPartList(
|
|
164612
|
+
visitDisplayPartList(node.members, "; ");
|
|
164580
164613
|
parts.push({ text: " " });
|
|
164581
164614
|
}
|
|
164582
164615
|
parts.push({ text: "}" });
|
|
164583
164616
|
break;
|
|
164584
164617
|
case 188 /* ArrayType */:
|
|
164618
|
+
Debug.assertNode(node, isArrayTypeNode);
|
|
164585
164619
|
visitForDisplayParts(node.elementType);
|
|
164586
164620
|
parts.push({ text: "[]" });
|
|
164587
164621
|
break;
|
|
164588
164622
|
case 189 /* TupleType */:
|
|
164623
|
+
Debug.assertNode(node, isTupleTypeNode);
|
|
164589
164624
|
parts.push({ text: "[" });
|
|
164590
164625
|
visitDisplayPartList(node.elements, ", ");
|
|
164591
164626
|
parts.push({ text: "]" });
|
|
164592
164627
|
break;
|
|
164593
164628
|
case 202 /* NamedTupleMember */:
|
|
164594
|
-
|
|
164595
|
-
if (
|
|
164629
|
+
Debug.assertNode(node, isNamedTupleMember);
|
|
164630
|
+
if (node.dotDotDotToken) {
|
|
164596
164631
|
parts.push({ text: "..." });
|
|
164597
164632
|
}
|
|
164598
|
-
visitForDisplayParts(
|
|
164599
|
-
if (
|
|
164633
|
+
visitForDisplayParts(node.name);
|
|
164634
|
+
if (node.questionToken) {
|
|
164600
164635
|
parts.push({ text: "?" });
|
|
164601
164636
|
}
|
|
164602
164637
|
parts.push({ text: ": " });
|
|
164603
|
-
visitForDisplayParts(
|
|
164638
|
+
visitForDisplayParts(node.type);
|
|
164604
164639
|
break;
|
|
164605
164640
|
case 190 /* OptionalType */:
|
|
164641
|
+
Debug.assertNode(node, isOptionalTypeNode);
|
|
164606
164642
|
visitForDisplayParts(node.type);
|
|
164607
164643
|
parts.push({ text: "?" });
|
|
164608
164644
|
break;
|
|
164609
164645
|
case 191 /* RestType */:
|
|
164646
|
+
Debug.assertNode(node, isRestTypeNode);
|
|
164610
164647
|
parts.push({ text: "..." });
|
|
164611
164648
|
visitForDisplayParts(node.type);
|
|
164612
164649
|
break;
|
|
164613
164650
|
case 192 /* UnionType */:
|
|
164651
|
+
Debug.assertNode(node, isUnionTypeNode);
|
|
164614
164652
|
visitDisplayPartList(node.types, " | ");
|
|
164615
164653
|
break;
|
|
164616
164654
|
case 193 /* IntersectionType */:
|
|
164655
|
+
Debug.assertNode(node, isIntersectionTypeNode);
|
|
164617
164656
|
visitDisplayPartList(node.types, " & ");
|
|
164618
164657
|
break;
|
|
164619
164658
|
case 194 /* ConditionalType */:
|
|
164620
|
-
|
|
164621
|
-
visitForDisplayParts(
|
|
164659
|
+
Debug.assertNode(node, isConditionalTypeNode);
|
|
164660
|
+
visitForDisplayParts(node.checkType);
|
|
164622
164661
|
parts.push({ text: " extends " });
|
|
164623
|
-
visitForDisplayParts(
|
|
164662
|
+
visitForDisplayParts(node.extendsType);
|
|
164624
164663
|
parts.push({ text: " ? " });
|
|
164625
|
-
visitForDisplayParts(
|
|
164664
|
+
visitForDisplayParts(node.trueType);
|
|
164626
164665
|
parts.push({ text: " : " });
|
|
164627
|
-
visitForDisplayParts(
|
|
164666
|
+
visitForDisplayParts(node.falseType);
|
|
164628
164667
|
break;
|
|
164629
164668
|
case 195 /* InferType */:
|
|
164669
|
+
Debug.assertNode(node, isInferTypeNode);
|
|
164630
164670
|
parts.push({ text: "infer " });
|
|
164631
164671
|
visitForDisplayParts(node.typeParameter);
|
|
164632
164672
|
break;
|
|
164633
164673
|
case 196 /* ParenthesizedType */:
|
|
164674
|
+
Debug.assertNode(node, isParenthesizedTypeNode);
|
|
164634
164675
|
parts.push({ text: "(" });
|
|
164635
164676
|
visitForDisplayParts(node.type);
|
|
164636
164677
|
parts.push({ text: ")" });
|
|
164637
164678
|
break;
|
|
164638
164679
|
case 198 /* TypeOperator */:
|
|
164639
|
-
|
|
164640
|
-
parts.push({ text: `${tokenToString(
|
|
164641
|
-
visitForDisplayParts(
|
|
164680
|
+
Debug.assertNode(node, isTypeOperatorNode);
|
|
164681
|
+
parts.push({ text: `${tokenToString(node.operator)} ` });
|
|
164682
|
+
visitForDisplayParts(node.type);
|
|
164642
164683
|
break;
|
|
164643
164684
|
case 199 /* IndexedAccessType */:
|
|
164644
|
-
|
|
164645
|
-
visitForDisplayParts(
|
|
164685
|
+
Debug.assertNode(node, isIndexedAccessTypeNode);
|
|
164686
|
+
visitForDisplayParts(node.objectType);
|
|
164646
164687
|
parts.push({ text: "[" });
|
|
164647
|
-
visitForDisplayParts(
|
|
164688
|
+
visitForDisplayParts(node.indexType);
|
|
164648
164689
|
parts.push({ text: "]" });
|
|
164649
164690
|
break;
|
|
164650
164691
|
case 200 /* MappedType */:
|
|
164651
|
-
|
|
164692
|
+
Debug.assertNode(node, isMappedTypeNode);
|
|
164652
164693
|
parts.push({ text: "{ " });
|
|
164653
|
-
if (
|
|
164654
|
-
if (
|
|
164694
|
+
if (node.readonlyToken) {
|
|
164695
|
+
if (node.readonlyToken.kind === 40 /* PlusToken */) {
|
|
164655
164696
|
parts.push({ text: "+" });
|
|
164656
|
-
} else if (
|
|
164697
|
+
} else if (node.readonlyToken.kind === 41 /* MinusToken */) {
|
|
164657
164698
|
parts.push({ text: "-" });
|
|
164658
164699
|
}
|
|
164659
164700
|
parts.push({ text: "readonly " });
|
|
164660
164701
|
}
|
|
164661
164702
|
parts.push({ text: "[" });
|
|
164662
|
-
visitForDisplayParts(
|
|
164663
|
-
if (
|
|
164703
|
+
visitForDisplayParts(node.typeParameter);
|
|
164704
|
+
if (node.nameType) {
|
|
164664
164705
|
parts.push({ text: " as " });
|
|
164665
|
-
visitForDisplayParts(
|
|
164706
|
+
visitForDisplayParts(node.nameType);
|
|
164666
164707
|
}
|
|
164667
164708
|
parts.push({ text: "]" });
|
|
164668
|
-
if (
|
|
164669
|
-
if (
|
|
164709
|
+
if (node.questionToken) {
|
|
164710
|
+
if (node.questionToken.kind === 40 /* PlusToken */) {
|
|
164670
164711
|
parts.push({ text: "+" });
|
|
164671
|
-
} else if (
|
|
164712
|
+
} else if (node.questionToken.kind === 41 /* MinusToken */) {
|
|
164672
164713
|
parts.push({ text: "-" });
|
|
164673
164714
|
}
|
|
164674
164715
|
parts.push({ text: "?" });
|
|
164675
164716
|
}
|
|
164676
164717
|
parts.push({ text: ": " });
|
|
164677
|
-
if (
|
|
164678
|
-
visitForDisplayParts(
|
|
164718
|
+
if (node.type) {
|
|
164719
|
+
visitForDisplayParts(node.type);
|
|
164679
164720
|
}
|
|
164680
164721
|
parts.push({ text: "; }" });
|
|
164681
164722
|
break;
|
|
164682
164723
|
case 201 /* LiteralType */:
|
|
164724
|
+
Debug.assertNode(node, isLiteralTypeNode);
|
|
164683
164725
|
visitForDisplayParts(node.literal);
|
|
164684
164726
|
break;
|
|
164685
164727
|
case 184 /* FunctionType */:
|
|
164686
|
-
|
|
164687
|
-
|
|
164688
|
-
parts.push({ text: "<" });
|
|
164689
|
-
visitDisplayPartList(functionType.typeParameters, ", ");
|
|
164690
|
-
parts.push({ text: ">" });
|
|
164691
|
-
}
|
|
164692
|
-
parts.push({ text: "(" });
|
|
164693
|
-
visitDisplayPartList(functionType.parameters, ", ");
|
|
164694
|
-
parts.push({ text: ")" });
|
|
164728
|
+
Debug.assertNode(node, isFunctionTypeNode);
|
|
164729
|
+
visitParametersAndTypeParameters(node);
|
|
164695
164730
|
parts.push({ text: " => " });
|
|
164696
|
-
visitForDisplayParts(
|
|
164731
|
+
visitForDisplayParts(node.type);
|
|
164697
164732
|
break;
|
|
164698
164733
|
case 205 /* ImportType */:
|
|
164699
|
-
|
|
164700
|
-
if (
|
|
164734
|
+
Debug.assertNode(node, isImportTypeNode);
|
|
164735
|
+
if (node.isTypeOf) {
|
|
164701
164736
|
parts.push({ text: "typeof " });
|
|
164702
164737
|
}
|
|
164703
164738
|
parts.push({ text: "import(" });
|
|
164704
|
-
visitForDisplayParts(
|
|
164705
|
-
if (
|
|
164739
|
+
visitForDisplayParts(node.argument);
|
|
164740
|
+
if (node.assertions) {
|
|
164706
164741
|
parts.push({ text: ", { assert: " });
|
|
164707
|
-
visitDisplayPartList(
|
|
164742
|
+
visitDisplayPartList(node.assertions.assertClause.elements, ", ");
|
|
164708
164743
|
parts.push({ text: " }" });
|
|
164709
164744
|
}
|
|
164710
164745
|
parts.push({ text: ")" });
|
|
164711
|
-
if (
|
|
164746
|
+
if (node.qualifier) {
|
|
164712
164747
|
parts.push({ text: "." });
|
|
164713
|
-
visitForDisplayParts(
|
|
164748
|
+
visitForDisplayParts(node.qualifier);
|
|
164714
164749
|
}
|
|
164715
|
-
if (
|
|
164750
|
+
if (node.typeArguments) {
|
|
164716
164751
|
parts.push({ text: "<" });
|
|
164717
|
-
visitDisplayPartList(
|
|
164752
|
+
visitDisplayPartList(node.typeArguments, ", ");
|
|
164718
164753
|
parts.push({ text: ">" });
|
|
164719
164754
|
}
|
|
164720
164755
|
break;
|
|
164721
164756
|
case 171 /* PropertySignature */:
|
|
164722
|
-
|
|
164723
|
-
if (
|
|
164724
|
-
visitDisplayPartList(
|
|
164757
|
+
Debug.assertNode(node, isPropertySignature);
|
|
164758
|
+
if ((_a = node.modifiers) == null ? void 0 : _a.length) {
|
|
164759
|
+
visitDisplayPartList(node.modifiers, " ");
|
|
164760
|
+
parts.push({ text: " " });
|
|
164725
164761
|
}
|
|
164726
|
-
visitForDisplayParts(
|
|
164727
|
-
if (
|
|
164762
|
+
visitForDisplayParts(node.name);
|
|
164763
|
+
if (node.questionToken) {
|
|
164728
164764
|
parts.push({ text: "?" });
|
|
164729
164765
|
}
|
|
164730
|
-
if (
|
|
164766
|
+
if (node.type) {
|
|
164767
|
+
parts.push({ text: ": " });
|
|
164768
|
+
visitForDisplayParts(node.type);
|
|
164769
|
+
}
|
|
164770
|
+
break;
|
|
164771
|
+
case 173 /* MethodSignature */:
|
|
164772
|
+
Debug.assertNode(node, isMethodSignature);
|
|
164773
|
+
if ((_b = node.modifiers) == null ? void 0 : _b.length) {
|
|
164774
|
+
visitDisplayPartList(node.modifiers, " ");
|
|
164775
|
+
parts.push({ text: " " });
|
|
164776
|
+
}
|
|
164777
|
+
visitForDisplayParts(node.name);
|
|
164778
|
+
if (node.questionToken) {
|
|
164779
|
+
parts.push({ text: "?" });
|
|
164780
|
+
}
|
|
164781
|
+
visitParametersAndTypeParameters(node);
|
|
164782
|
+
if (node.type) {
|
|
164783
|
+
parts.push({ text: ": " });
|
|
164784
|
+
visitForDisplayParts(node.type);
|
|
164785
|
+
}
|
|
164786
|
+
break;
|
|
164787
|
+
case 179 /* CallSignature */:
|
|
164788
|
+
Debug.assertNode(node, isCallSignatureDeclaration);
|
|
164789
|
+
visitParametersAndTypeParameters(node);
|
|
164790
|
+
if (node.type) {
|
|
164731
164791
|
parts.push({ text: ": " });
|
|
164732
|
-
visitForDisplayParts(
|
|
164792
|
+
visitForDisplayParts(node.type);
|
|
164733
164793
|
}
|
|
164734
164794
|
break;
|
|
164795
|
+
case 207 /* ArrayBindingPattern */:
|
|
164796
|
+
Debug.assertNode(node, isArrayBindingPattern);
|
|
164797
|
+
parts.push({ text: "[" });
|
|
164798
|
+
visitDisplayPartList(node.elements, ", ");
|
|
164799
|
+
parts.push({ text: "]" });
|
|
164800
|
+
break;
|
|
164801
|
+
case 206 /* ObjectBindingPattern */:
|
|
164802
|
+
Debug.assertNode(node, isObjectBindingPattern);
|
|
164803
|
+
parts.push({ text: "{" });
|
|
164804
|
+
if (node.elements.length) {
|
|
164805
|
+
parts.push({ text: " " });
|
|
164806
|
+
visitDisplayPartList(node.elements, ", ");
|
|
164807
|
+
parts.push({ text: " " });
|
|
164808
|
+
}
|
|
164809
|
+
parts.push({ text: "}" });
|
|
164810
|
+
break;
|
|
164811
|
+
case 208 /* BindingElement */:
|
|
164812
|
+
Debug.assertNode(node, isBindingElement);
|
|
164813
|
+
visitForDisplayParts(node.name);
|
|
164814
|
+
break;
|
|
164815
|
+
case 224 /* PrefixUnaryExpression */:
|
|
164816
|
+
Debug.assertNode(node, isPrefixUnaryExpression);
|
|
164817
|
+
parts.push({ text: tokenToString(node.operator) });
|
|
164818
|
+
visitForDisplayParts(node.operand);
|
|
164819
|
+
break;
|
|
164735
164820
|
default:
|
|
164736
164821
|
Debug.failBadSyntaxKind(node);
|
|
164737
164822
|
}
|
|
164738
164823
|
}
|
|
164824
|
+
function visitParametersAndTypeParameters(signatureDeclaration) {
|
|
164825
|
+
if (signatureDeclaration.typeParameters) {
|
|
164826
|
+
parts.push({ text: "<" });
|
|
164827
|
+
visitDisplayPartList(signatureDeclaration.typeParameters, ", ");
|
|
164828
|
+
parts.push({ text: ">" });
|
|
164829
|
+
}
|
|
164830
|
+
parts.push({ text: "(" });
|
|
164831
|
+
visitDisplayPartList(signatureDeclaration.parameters, ", ");
|
|
164832
|
+
parts.push({ text: ")" });
|
|
164833
|
+
}
|
|
164739
164834
|
function visitDisplayPartList(nodes, separator) {
|
|
164740
164835
|
nodes.forEach((node, index) => {
|
|
164741
164836
|
if (index > 0) {
|