typescript 5.6.0-dev.20240612 → 5.6.0-dev.20240614
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 +482 -615
- package/lib/tsserver.js +0 -12
- package/lib/typescript.d.ts +55 -112
- package/lib/typescript.js +899 -790
- package/package.json +2 -4
package/lib/typescript.js
CHANGED
|
@@ -248,6 +248,7 @@ __export(typescript_exports, {
|
|
|
248
248
|
buildOverload: () => buildOverload,
|
|
249
249
|
bundlerModuleNameResolver: () => bundlerModuleNameResolver,
|
|
250
250
|
canBeConvertedToAsync: () => canBeConvertedToAsync,
|
|
251
|
+
canEmitTsBuildInfo: () => canEmitTsBuildInfo,
|
|
251
252
|
canHaveDecorators: () => canHaveDecorators,
|
|
252
253
|
canHaveExportModifier: () => canHaveExportModifier,
|
|
253
254
|
canHaveFlowNode: () => canHaveFlowNode,
|
|
@@ -258,9 +259,8 @@ __export(typescript_exports, {
|
|
|
258
259
|
canHaveJSDoc: () => canHaveJSDoc,
|
|
259
260
|
canHaveLocals: () => canHaveLocals,
|
|
260
261
|
canHaveModifiers: () => canHaveModifiers,
|
|
261
|
-
canHaveModuleSpecifier: () => canHaveModuleSpecifier,
|
|
262
262
|
canHaveSymbol: () => canHaveSymbol,
|
|
263
|
-
|
|
263
|
+
canIncludeBindAndCheckDiagnostics: () => canIncludeBindAndCheckDiagnostics,
|
|
264
264
|
canJsonReportNoInputFiles: () => canJsonReportNoInputFiles,
|
|
265
265
|
canProduceDiagnostics: () => canProduceDiagnostics,
|
|
266
266
|
canUsePropertyAccess: () => canUsePropertyAccess,
|
|
@@ -735,7 +735,6 @@ __export(typescript_exports, {
|
|
|
735
735
|
getDefaultLibFilePath: () => getDefaultLibFilePath,
|
|
736
736
|
getDefaultLikeExportInfo: () => getDefaultLikeExportInfo,
|
|
737
737
|
getDefaultLikeExportNameFromDeclaration: () => getDefaultLikeExportNameFromDeclaration,
|
|
738
|
-
getDefaultResolutionModeForFileWorker: () => getDefaultResolutionModeForFileWorker,
|
|
739
738
|
getDiagnosticText: () => getDiagnosticText,
|
|
740
739
|
getDiagnosticsWithinSpan: () => getDiagnosticsWithinSpan,
|
|
741
740
|
getDirectoryPath: () => getDirectoryPath,
|
|
@@ -766,7 +765,6 @@ __export(typescript_exports, {
|
|
|
766
765
|
getEmitFlags: () => getEmitFlags,
|
|
767
766
|
getEmitHelpers: () => getEmitHelpers,
|
|
768
767
|
getEmitModuleDetectionKind: () => getEmitModuleDetectionKind,
|
|
769
|
-
getEmitModuleFormatOfFileWorker: () => getEmitModuleFormatOfFileWorker,
|
|
770
768
|
getEmitModuleKind: () => getEmitModuleKind,
|
|
771
769
|
getEmitModuleResolutionKind: () => getEmitModuleResolutionKind,
|
|
772
770
|
getEmitScriptTarget: () => getEmitScriptTarget,
|
|
@@ -817,7 +815,6 @@ __export(typescript_exports, {
|
|
|
817
815
|
getIdentifierGeneratedImportReference: () => getIdentifierGeneratedImportReference,
|
|
818
816
|
getIdentifierTypeArguments: () => getIdentifierTypeArguments,
|
|
819
817
|
getImmediatelyInvokedFunctionExpression: () => getImmediatelyInvokedFunctionExpression,
|
|
820
|
-
getImpliedNodeFormatForEmitWorker: () => getImpliedNodeFormatForEmitWorker,
|
|
821
818
|
getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile,
|
|
822
819
|
getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker,
|
|
823
820
|
getImportNeedsImportDefaultHelper: () => getImportNeedsImportDefaultHelper,
|
|
@@ -942,6 +939,7 @@ __export(typescript_exports, {
|
|
|
942
939
|
getNonAssignmentOperatorForCompoundAssignment: () => getNonAssignmentOperatorForCompoundAssignment,
|
|
943
940
|
getNonAugmentationDeclaration: () => getNonAugmentationDeclaration,
|
|
944
941
|
getNonDecoratorTokenPosOfNode: () => getNonDecoratorTokenPosOfNode,
|
|
942
|
+
getNonIncrementalBuildInfoRoots: () => getNonIncrementalBuildInfoRoots,
|
|
945
943
|
getNormalizedAbsolutePath: () => getNormalizedAbsolutePath,
|
|
946
944
|
getNormalizedAbsolutePathWithoutRoot: () => getNormalizedAbsolutePathWithoutRoot,
|
|
947
945
|
getNormalizedPathComponents: () => getNormalizedPathComponents,
|
|
@@ -1177,7 +1175,6 @@ __export(typescript_exports, {
|
|
|
1177
1175
|
importDefaultHelper: () => importDefaultHelper,
|
|
1178
1176
|
importFromModuleSpecifier: () => importFromModuleSpecifier,
|
|
1179
1177
|
importStarHelper: () => importStarHelper,
|
|
1180
|
-
importSyntaxAffectsModuleResolution: () => importSyntaxAffectsModuleResolution,
|
|
1181
1178
|
indexOfAnyCharCode: () => indexOfAnyCharCode,
|
|
1182
1179
|
indexOfNode: () => indexOfNode,
|
|
1183
1180
|
indicesOf: () => indicesOf,
|
|
@@ -1653,6 +1650,7 @@ __export(typescript_exports, {
|
|
|
1653
1650
|
isNonExportDefaultModifier: () => isNonExportDefaultModifier,
|
|
1654
1651
|
isNonGlobalAmbientModule: () => isNonGlobalAmbientModule,
|
|
1655
1652
|
isNonGlobalDeclaration: () => isNonGlobalDeclaration,
|
|
1653
|
+
isNonIncrementalBuildInfo: () => isNonIncrementalBuildInfo,
|
|
1656
1654
|
isNonNullAccess: () => isNonNullAccess,
|
|
1657
1655
|
isNonNullChain: () => isNonNullChain,
|
|
1658
1656
|
isNonNullExpression: () => isNonNullExpression,
|
|
@@ -1765,6 +1763,7 @@ __export(typescript_exports, {
|
|
|
1765
1763
|
isSimpleParameter: () => isSimpleParameter,
|
|
1766
1764
|
isSimpleParameterList: () => isSimpleParameterList,
|
|
1767
1765
|
isSingleOrDoubleQuote: () => isSingleOrDoubleQuote,
|
|
1766
|
+
isSourceElement: () => isSourceElement,
|
|
1768
1767
|
isSourceFile: () => isSourceFile,
|
|
1769
1768
|
isSourceFileFromLibrary: () => isSourceFileFromLibrary,
|
|
1770
1769
|
isSourceFileJS: () => isSourceFileJS,
|
|
@@ -1898,7 +1897,6 @@ __export(typescript_exports, {
|
|
|
1898
1897
|
linkNamePart: () => linkNamePart,
|
|
1899
1898
|
linkPart: () => linkPart,
|
|
1900
1899
|
linkTextPart: () => linkTextPart,
|
|
1901
|
-
listFiles: () => listFiles,
|
|
1902
1900
|
loadModuleFromGlobalCache: () => loadModuleFromGlobalCache,
|
|
1903
1901
|
loadWithModeAwareCache: () => loadWithModeAwareCache,
|
|
1904
1902
|
makeIdentifierFromModuleName: () => makeIdentifierFromModuleName,
|
|
@@ -1977,6 +1975,7 @@ __export(typescript_exports, {
|
|
|
1977
1975
|
noopFileWatcher: () => noopFileWatcher,
|
|
1978
1976
|
normalizePath: () => normalizePath,
|
|
1979
1977
|
normalizeSlashes: () => normalizeSlashes,
|
|
1978
|
+
normalizeSpans: () => normalizeSpans,
|
|
1980
1979
|
not: () => not,
|
|
1981
1980
|
notImplemented: () => notImplemented,
|
|
1982
1981
|
notImplementedResolver: () => notImplementedResolver,
|
|
@@ -2028,7 +2027,6 @@ __export(typescript_exports, {
|
|
|
2028
2027
|
pathIsBareSpecifier: () => pathIsBareSpecifier,
|
|
2029
2028
|
pathIsRelative: () => pathIsRelative,
|
|
2030
2029
|
patternText: () => patternText,
|
|
2031
|
-
perfLogger: () => perfLogger,
|
|
2032
2030
|
performIncrementalCompilation: () => performIncrementalCompilation,
|
|
2033
2031
|
performance: () => ts_performance_exports,
|
|
2034
2032
|
plainJSErrors: () => plainJSErrors,
|
|
@@ -2236,7 +2234,10 @@ __export(typescript_exports, {
|
|
|
2236
2234
|
textOrKeywordPart: () => textOrKeywordPart,
|
|
2237
2235
|
textPart: () => textPart,
|
|
2238
2236
|
textRangeContainsPositionInclusive: () => textRangeContainsPositionInclusive,
|
|
2237
|
+
textRangeContainsTextSpan: () => textRangeContainsTextSpan,
|
|
2238
|
+
textRangeIntersectsWithTextSpan: () => textRangeIntersectsWithTextSpan,
|
|
2239
2239
|
textSpanContainsPosition: () => textSpanContainsPosition,
|
|
2240
|
+
textSpanContainsTextRange: () => textSpanContainsTextRange,
|
|
2240
2241
|
textSpanContainsTextSpan: () => textSpanContainsTextSpan,
|
|
2241
2242
|
textSpanEnd: () => textSpanEnd,
|
|
2242
2243
|
textSpanIntersection: () => textSpanIntersection,
|
|
@@ -2277,11 +2278,11 @@ __export(typescript_exports, {
|
|
|
2277
2278
|
transformESDecorators: () => transformESDecorators,
|
|
2278
2279
|
transformESNext: () => transformESNext,
|
|
2279
2280
|
transformGenerators: () => transformGenerators,
|
|
2280
|
-
transformImpliedNodeFormatDependentModule: () => transformImpliedNodeFormatDependentModule,
|
|
2281
2281
|
transformJsx: () => transformJsx,
|
|
2282
2282
|
transformLegacyDecorators: () => transformLegacyDecorators,
|
|
2283
2283
|
transformModule: () => transformModule,
|
|
2284
2284
|
transformNamedEvaluation: () => transformNamedEvaluation,
|
|
2285
|
+
transformNodeModule: () => transformNodeModule,
|
|
2285
2286
|
transformNodes: () => transformNodes,
|
|
2286
2287
|
transformSystemModule: () => transformSystemModule,
|
|
2287
2288
|
transformTypeScript: () => transformTypeScript,
|
|
@@ -2375,7 +2376,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2375
2376
|
|
|
2376
2377
|
// src/compiler/corePublic.ts
|
|
2377
2378
|
var versionMajorMinor = "5.6";
|
|
2378
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2379
|
+
var version = `${versionMajorMinor}.0-dev.20240614`;
|
|
2379
2380
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2380
2381
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2381
2382
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -5287,16 +5288,6 @@ function tryGetNativePerformanceHooks() {
|
|
|
5287
5288
|
}
|
|
5288
5289
|
var timestamp = nativePerformanceTime ? () => nativePerformanceTime.now() : Date.now;
|
|
5289
5290
|
|
|
5290
|
-
// src/compiler/perfLogger.ts
|
|
5291
|
-
var etwModule;
|
|
5292
|
-
try {
|
|
5293
|
-
const etwModulePath = process.env.TS_ETW_MODULE_PATH ?? "./node_modules/@microsoft/typescript-etw";
|
|
5294
|
-
etwModule = require(etwModulePath);
|
|
5295
|
-
} catch (e) {
|
|
5296
|
-
etwModule = void 0;
|
|
5297
|
-
}
|
|
5298
|
-
var perfLogger = (etwModule == null ? void 0 : etwModule.logEvent) ? etwModule : void 0;
|
|
5299
|
-
|
|
5300
5291
|
// src/compiler/_namespaces/ts.performance.ts
|
|
5301
5292
|
var ts_performance_exports = {};
|
|
5302
5293
|
__export(ts_performance_exports, {
|
|
@@ -6583,6 +6574,7 @@ var NodeCheckFlags = /* @__PURE__ */ ((NodeCheckFlags3) => {
|
|
|
6583
6574
|
NodeCheckFlags3[NodeCheckFlags3["ContainsClassWithPrivateIdentifiers"] = 1048576] = "ContainsClassWithPrivateIdentifiers";
|
|
6584
6575
|
NodeCheckFlags3[NodeCheckFlags3["ContainsSuperPropertyInStaticInitializer"] = 2097152] = "ContainsSuperPropertyInStaticInitializer";
|
|
6585
6576
|
NodeCheckFlags3[NodeCheckFlags3["InCheckIdentifier"] = 4194304] = "InCheckIdentifier";
|
|
6577
|
+
NodeCheckFlags3[NodeCheckFlags3["PartiallyTypeChecked"] = 8388608] = "PartiallyTypeChecked";
|
|
6586
6578
|
NodeCheckFlags3[NodeCheckFlags3["LazyFlags"] = 539358128] = "LazyFlags";
|
|
6587
6579
|
return NodeCheckFlags3;
|
|
6588
6580
|
})(NodeCheckFlags || {});
|
|
@@ -8676,7 +8668,7 @@ var sys = (() => {
|
|
|
8676
8668
|
callback
|
|
8677
8669
|
);
|
|
8678
8670
|
}
|
|
8679
|
-
function
|
|
8671
|
+
function readFile(fileName, _encoding) {
|
|
8680
8672
|
let buffer;
|
|
8681
8673
|
try {
|
|
8682
8674
|
buffer = _fs.readFileSync(fileName);
|
|
@@ -8701,16 +8693,7 @@ var sys = (() => {
|
|
|
8701
8693
|
}
|
|
8702
8694
|
return buffer.toString("utf8");
|
|
8703
8695
|
}
|
|
8704
|
-
function readFile(fileName, _encoding) {
|
|
8705
|
-
var _a, _b;
|
|
8706
|
-
(_a = perfLogger) == null ? void 0 : _a.logStartReadFile(fileName);
|
|
8707
|
-
const file = readFileWorker(fileName, _encoding);
|
|
8708
|
-
(_b = perfLogger) == null ? void 0 : _b.logStopReadFile();
|
|
8709
|
-
return file;
|
|
8710
|
-
}
|
|
8711
8696
|
function writeFile2(fileName, data, writeByteOrderMark) {
|
|
8712
|
-
var _a;
|
|
8713
|
-
(_a = perfLogger) == null ? void 0 : _a.logEvent("WriteFile: " + fileName);
|
|
8714
8697
|
if (writeByteOrderMark) {
|
|
8715
8698
|
data = byteOrderMarkIndicator + data;
|
|
8716
8699
|
}
|
|
@@ -8731,8 +8714,6 @@ var sys = (() => {
|
|
|
8731
8714
|
}
|
|
8732
8715
|
}
|
|
8733
8716
|
function getAccessibleFileSystemEntries(path) {
|
|
8734
|
-
var _a;
|
|
8735
|
-
(_a = perfLogger) == null ? void 0 : _a.logEvent("ReadDir: " + (path || "."));
|
|
8736
8717
|
try {
|
|
8737
8718
|
const entries = _fs.readdirSync(path || ".", { withFileTypes: true });
|
|
8738
8719
|
const files = [];
|
|
@@ -9510,7 +9491,6 @@ var Diagnostics = {
|
|
|
9510
9491
|
_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1290, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_marked_type_only_in_this_file_before_re_exporting_1290", "'{0}' resolves to a type-only declaration and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
|
|
9511
9492
|
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_import_type_where_0_is_imported: diag(1291, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1291", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'import type' where '{0}' is imported."),
|
|
9512
9493
|
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1292, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
|
|
9513
|
-
ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve: diag(1293, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293", "ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'."),
|
|
9514
9494
|
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
|
|
9515
9495
|
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
|
|
9516
9496
|
The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, 1 /* Error */, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
|
|
@@ -10399,7 +10379,6 @@ var Diagnostics = {
|
|
|
10399
10379
|
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
|
|
10400
10380
|
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
|
|
10401
10381
|
Cannot_read_file_0_Colon_1: diag(5012, 1 /* Error */, "Cannot_read_file_0_Colon_1_5012", "Cannot read file '{0}': {1}."),
|
|
10402
|
-
Failed_to_parse_file_0_Colon_1: diag(5014, 1 /* Error */, "Failed_to_parse_file_0_Colon_1_5014", "Failed to parse file '{0}': {1}."),
|
|
10403
10382
|
Unknown_compiler_option_0: diag(5023, 1 /* Error */, "Unknown_compiler_option_0_5023", "Unknown compiler option '{0}'."),
|
|
10404
10383
|
Compiler_option_0_requires_a_value_of_type_1: diag(5024, 1 /* Error */, "Compiler_option_0_requires_a_value_of_type_1_5024", "Compiler option '{0}' requires a value of type {1}."),
|
|
10405
10384
|
Unknown_compiler_option_0_Did_you_mean_1: diag(5025, 1 /* Error */, "Unknown_compiler_option_0_Did_you_mean_1_5025", "Unknown compiler option '{0}'. Did you mean '{1}'?"),
|
|
@@ -10462,6 +10441,7 @@ var Diagnostics = {
|
|
|
10462
10441
|
Option_0_1_has_been_removed_Please_remove_it_from_your_configuration: diag(5108, 1 /* Error */, "Option_0_1_has_been_removed_Please_remove_it_from_your_configuration_5108", "Option '{0}={1}' has been removed. Please remove it from your configuration."),
|
|
10463
10442
|
Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1: diag(5109, 1 /* Error */, "Option_moduleResolution_must_be_set_to_0_or_left_unspecified_when_option_module_is_set_to_1_5109", "Option 'moduleResolution' must be set to '{0}' (or left unspecified) when option 'module' is set to '{1}'."),
|
|
10464
10443
|
Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1: diag(5110, 1 /* Error */, "Option_module_must_be_set_to_0_when_option_moduleResolution_is_set_to_1_5110", "Option 'module' must be set to '{0}' when option 'moduleResolution' is set to '{1}'."),
|
|
10444
|
+
Option_tsBuildInfoFile_cannot_be_specified_without_specifying_option_incremental_or_composite_or_if_not_running_tsc_b: diag(5111, 1 /* Error */, "Option_tsBuildInfoFile_cannot_be_specified_without_specifying_option_incremental_or_composite_or_if__5111", "Option 'tsBuildInfoFile' cannot be specified without specifying option 'incremental' or 'composite' or if not running 'tsc -b'."),
|
|
10465
10445
|
Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."),
|
|
10466
10446
|
Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."),
|
|
10467
10447
|
Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."),
|
|
@@ -10842,6 +10822,8 @@ var Diagnostics = {
|
|
|
10842
10822
|
Exiting_conditional_exports: diag(6416, 3 /* Message */, "Exiting_conditional_exports_6416", "Exiting conditional exports."),
|
|
10843
10823
|
Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0: diag(6417, 3 /* Message */, "Searching_all_ancestor_node_modules_directories_for_preferred_extensions_Colon_0_6417", "Searching all ancestor node_modules directories for preferred extensions: {0}."),
|
|
10844
10824
|
Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0: diag(6418, 3 /* Message */, "Searching_all_ancestor_node_modules_directories_for_fallback_extensions_Colon_0_6418", "Searching all ancestor node_modules directories for fallback extensions: {0}."),
|
|
10825
|
+
Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors: diag(6419, 3 /* Message */, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors_6419", "Project '{0}' is out of date because buildinfo file '{1}' indicates that program needs to report errors."),
|
|
10826
|
+
Project_0_is_out_of_date_because_1: diag(6420, 3 /* Message */, "Project_0_is_out_of_date_because_1_6420", "Project '{0}' is out of date because {1}."),
|
|
10845
10827
|
The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, 3 /* Message */, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"),
|
|
10846
10828
|
The_expected_type_comes_from_this_index_signature: diag(6501, 3 /* Message */, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."),
|
|
10847
10829
|
The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, 3 /* Message */, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."),
|
|
@@ -14713,12 +14695,18 @@ function textSpanIsEmpty(span) {
|
|
|
14713
14695
|
function textSpanContainsPosition(span, position) {
|
|
14714
14696
|
return position >= span.start && position < textSpanEnd(span);
|
|
14715
14697
|
}
|
|
14716
|
-
function textRangeContainsPositionInclusive(
|
|
14717
|
-
return position >=
|
|
14698
|
+
function textRangeContainsPositionInclusive(range, position) {
|
|
14699
|
+
return position >= range.pos && position <= range.end;
|
|
14718
14700
|
}
|
|
14719
14701
|
function textSpanContainsTextSpan(span, other) {
|
|
14720
14702
|
return other.start >= span.start && textSpanEnd(other) <= textSpanEnd(span);
|
|
14721
14703
|
}
|
|
14704
|
+
function textSpanContainsTextRange(span, range) {
|
|
14705
|
+
return range.pos >= span.start && range.end <= textSpanEnd(span);
|
|
14706
|
+
}
|
|
14707
|
+
function textRangeContainsTextSpan(range, span) {
|
|
14708
|
+
return span.start >= range.pos && textSpanEnd(span) <= range.end;
|
|
14709
|
+
}
|
|
14722
14710
|
function textSpanOverlapsWith(span, other) {
|
|
14723
14711
|
return textSpanOverlap(span, other) !== void 0;
|
|
14724
14712
|
}
|
|
@@ -14740,11 +14728,34 @@ function decodedTextSpanIntersectsWith(start1, length1, start2, length2) {
|
|
|
14740
14728
|
function textSpanIntersectsWithPosition(span, position) {
|
|
14741
14729
|
return position <= textSpanEnd(span) && position >= span.start;
|
|
14742
14730
|
}
|
|
14731
|
+
function textRangeIntersectsWithTextSpan(range, span) {
|
|
14732
|
+
return textSpanIntersectsWith(span, range.pos, range.end - range.pos);
|
|
14733
|
+
}
|
|
14743
14734
|
function textSpanIntersection(span1, span2) {
|
|
14744
14735
|
const start = Math.max(span1.start, span2.start);
|
|
14745
14736
|
const end = Math.min(textSpanEnd(span1), textSpanEnd(span2));
|
|
14746
14737
|
return start <= end ? createTextSpanFromBounds(start, end) : void 0;
|
|
14747
14738
|
}
|
|
14739
|
+
function normalizeSpans(spans) {
|
|
14740
|
+
spans = spans.filter((span) => span.length > 0).sort((a, b) => {
|
|
14741
|
+
return a.start !== b.start ? a.start - b.start : a.length - b.length;
|
|
14742
|
+
});
|
|
14743
|
+
const result = [];
|
|
14744
|
+
let i = 0;
|
|
14745
|
+
while (i < spans.length) {
|
|
14746
|
+
let span = spans[i];
|
|
14747
|
+
let j = i + 1;
|
|
14748
|
+
while (j < spans.length && textSpanIntersectsWithTextSpan(span, spans[j])) {
|
|
14749
|
+
const start = Math.min(span.start, spans[j].start);
|
|
14750
|
+
const end = Math.max(textSpanEnd(span), textSpanEnd(spans[j]));
|
|
14751
|
+
span = createTextSpanFromBounds(start, end);
|
|
14752
|
+
j++;
|
|
14753
|
+
}
|
|
14754
|
+
i = j;
|
|
14755
|
+
result.push(span);
|
|
14756
|
+
}
|
|
14757
|
+
return result;
|
|
14758
|
+
}
|
|
14748
14759
|
function createTextSpan(start, length2) {
|
|
14749
14760
|
if (start < 0) {
|
|
14750
14761
|
throw new Error("start < 0");
|
|
@@ -18652,23 +18663,6 @@ function isFunctionSymbol(symbol) {
|
|
|
18652
18663
|
const decl = symbol.valueDeclaration;
|
|
18653
18664
|
return decl.kind === 262 /* FunctionDeclaration */ || isVariableDeclaration(decl) && decl.initializer && isFunctionLike(decl.initializer);
|
|
18654
18665
|
}
|
|
18655
|
-
function canHaveModuleSpecifier(node) {
|
|
18656
|
-
switch (node == null ? void 0 : node.kind) {
|
|
18657
|
-
case 260 /* VariableDeclaration */:
|
|
18658
|
-
case 208 /* BindingElement */:
|
|
18659
|
-
case 272 /* ImportDeclaration */:
|
|
18660
|
-
case 278 /* ExportDeclaration */:
|
|
18661
|
-
case 271 /* ImportEqualsDeclaration */:
|
|
18662
|
-
case 273 /* ImportClause */:
|
|
18663
|
-
case 280 /* NamespaceExport */:
|
|
18664
|
-
case 274 /* NamespaceImport */:
|
|
18665
|
-
case 281 /* ExportSpecifier */:
|
|
18666
|
-
case 276 /* ImportSpecifier */:
|
|
18667
|
-
case 205 /* ImportType */:
|
|
18668
|
-
return true;
|
|
18669
|
-
}
|
|
18670
|
-
return false;
|
|
18671
|
-
}
|
|
18672
18666
|
function tryGetModuleSpecifierFromDeclaration(node) {
|
|
18673
18667
|
var _a, _b;
|
|
18674
18668
|
switch (node.kind) {
|
|
@@ -21683,8 +21677,8 @@ function walkTreeForJSXTags(node) {
|
|
|
21683
21677
|
function isFileModuleFromUsingJSXTag(file) {
|
|
21684
21678
|
return !file.isDeclarationFile ? walkTreeForJSXTags(file) : void 0;
|
|
21685
21679
|
}
|
|
21686
|
-
function isFileForcedToBeModuleByFormat(file
|
|
21687
|
-
return (
|
|
21680
|
+
function isFileForcedToBeModuleByFormat(file) {
|
|
21681
|
+
return (file.impliedNodeFormat === 99 /* ESNext */ || fileExtensionIsOneOf(file.fileName, [".cjs" /* Cjs */, ".cts" /* Cts */, ".mjs" /* Mjs */, ".mts" /* Mts */])) && !file.isDeclarationFile ? true : void 0;
|
|
21688
21682
|
}
|
|
21689
21683
|
function getSetExternalModuleIndicator(options) {
|
|
21690
21684
|
switch (getEmitModuleDetectionKind(options)) {
|
|
@@ -21703,14 +21697,10 @@ function getSetExternalModuleIndicator(options) {
|
|
|
21703
21697
|
}
|
|
21704
21698
|
checks.push(isFileForcedToBeModuleByFormat);
|
|
21705
21699
|
const combined = or(...checks);
|
|
21706
|
-
const callback = (file) => void (file.externalModuleIndicator = combined(file
|
|
21700
|
+
const callback = (file) => void (file.externalModuleIndicator = combined(file));
|
|
21707
21701
|
return callback;
|
|
21708
21702
|
}
|
|
21709
21703
|
}
|
|
21710
|
-
function importSyntaxAffectsModuleResolution(options) {
|
|
21711
|
-
const moduleResolution = getEmitModuleResolutionKind(options);
|
|
21712
|
-
return 3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */ || getResolvePackageJsonExports(options) || getResolvePackageJsonImports(options);
|
|
21713
|
-
}
|
|
21714
21704
|
function createComputedCompilerOptions(options) {
|
|
21715
21705
|
return options;
|
|
21716
21706
|
}
|
|
@@ -22554,9 +22544,9 @@ function rangeOfTypeParameters(sourceFile, typeParameters) {
|
|
|
22554
22544
|
return { pos, end };
|
|
22555
22545
|
}
|
|
22556
22546
|
function skipTypeChecking(sourceFile, options, host) {
|
|
22557
|
-
return options.skipLibCheck && sourceFile.isDeclarationFile || options.skipDefaultLibCheck && sourceFile.hasNoDefaultLib || options.noCheck || host.isSourceOfProjectReferenceRedirect(sourceFile.fileName) || !
|
|
22547
|
+
return options.skipLibCheck && sourceFile.isDeclarationFile || options.skipDefaultLibCheck && sourceFile.hasNoDefaultLib || options.noCheck || host.isSourceOfProjectReferenceRedirect(sourceFile.fileName) || !canIncludeBindAndCheckDiagnostics(sourceFile, options);
|
|
22558
22548
|
}
|
|
22559
|
-
function
|
|
22549
|
+
function canIncludeBindAndCheckDiagnostics(sourceFile, options) {
|
|
22560
22550
|
if (!!sourceFile.checkJsDirective && sourceFile.checkJsDirective.enabled === false) return false;
|
|
22561
22551
|
if (sourceFile.scriptKind === 3 /* TS */ || sourceFile.scriptKind === 4 /* TSX */ || sourceFile.scriptKind === 5 /* External */) return true;
|
|
22562
22552
|
const isJs = sourceFile.scriptKind === 1 /* JS */ || sourceFile.scriptKind === 2 /* JSX */;
|
|
@@ -23064,6 +23054,105 @@ function replaceFirstStar(s, replacement) {
|
|
|
23064
23054
|
function getNameFromImportAttribute(node) {
|
|
23065
23055
|
return isIdentifier(node.name) ? node.name.escapedText : escapeLeadingUnderscores(node.name.text);
|
|
23066
23056
|
}
|
|
23057
|
+
function isSourceElement(node) {
|
|
23058
|
+
switch (node.kind) {
|
|
23059
|
+
case 168 /* TypeParameter */:
|
|
23060
|
+
case 169 /* Parameter */:
|
|
23061
|
+
case 172 /* PropertyDeclaration */:
|
|
23062
|
+
case 171 /* PropertySignature */:
|
|
23063
|
+
case 185 /* ConstructorType */:
|
|
23064
|
+
case 184 /* FunctionType */:
|
|
23065
|
+
case 179 /* CallSignature */:
|
|
23066
|
+
case 180 /* ConstructSignature */:
|
|
23067
|
+
case 181 /* IndexSignature */:
|
|
23068
|
+
case 174 /* MethodDeclaration */:
|
|
23069
|
+
case 173 /* MethodSignature */:
|
|
23070
|
+
case 175 /* ClassStaticBlockDeclaration */:
|
|
23071
|
+
case 176 /* Constructor */:
|
|
23072
|
+
case 177 /* GetAccessor */:
|
|
23073
|
+
case 178 /* SetAccessor */:
|
|
23074
|
+
case 183 /* TypeReference */:
|
|
23075
|
+
case 182 /* TypePredicate */:
|
|
23076
|
+
case 186 /* TypeQuery */:
|
|
23077
|
+
case 187 /* TypeLiteral */:
|
|
23078
|
+
case 188 /* ArrayType */:
|
|
23079
|
+
case 189 /* TupleType */:
|
|
23080
|
+
case 192 /* UnionType */:
|
|
23081
|
+
case 193 /* IntersectionType */:
|
|
23082
|
+
case 196 /* ParenthesizedType */:
|
|
23083
|
+
case 190 /* OptionalType */:
|
|
23084
|
+
case 191 /* RestType */:
|
|
23085
|
+
case 197 /* ThisType */:
|
|
23086
|
+
case 198 /* TypeOperator */:
|
|
23087
|
+
case 194 /* ConditionalType */:
|
|
23088
|
+
case 195 /* InferType */:
|
|
23089
|
+
case 203 /* TemplateLiteralType */:
|
|
23090
|
+
case 205 /* ImportType */:
|
|
23091
|
+
case 202 /* NamedTupleMember */:
|
|
23092
|
+
case 328 /* JSDocAugmentsTag */:
|
|
23093
|
+
case 329 /* JSDocImplementsTag */:
|
|
23094
|
+
case 346 /* JSDocTypedefTag */:
|
|
23095
|
+
case 338 /* JSDocCallbackTag */:
|
|
23096
|
+
case 340 /* JSDocEnumTag */:
|
|
23097
|
+
case 345 /* JSDocTemplateTag */:
|
|
23098
|
+
case 344 /* JSDocTypeTag */:
|
|
23099
|
+
case 324 /* JSDocLink */:
|
|
23100
|
+
case 325 /* JSDocLinkCode */:
|
|
23101
|
+
case 326 /* JSDocLinkPlain */:
|
|
23102
|
+
case 341 /* JSDocParameterTag */:
|
|
23103
|
+
case 348 /* JSDocPropertyTag */:
|
|
23104
|
+
case 317 /* JSDocFunctionType */:
|
|
23105
|
+
case 315 /* JSDocNonNullableType */:
|
|
23106
|
+
case 314 /* JSDocNullableType */:
|
|
23107
|
+
case 312 /* JSDocAllType */:
|
|
23108
|
+
case 313 /* JSDocUnknownType */:
|
|
23109
|
+
case 322 /* JSDocTypeLiteral */:
|
|
23110
|
+
case 318 /* JSDocVariadicType */:
|
|
23111
|
+
case 309 /* JSDocTypeExpression */:
|
|
23112
|
+
case 333 /* JSDocPublicTag */:
|
|
23113
|
+
case 335 /* JSDocProtectedTag */:
|
|
23114
|
+
case 334 /* JSDocPrivateTag */:
|
|
23115
|
+
case 350 /* JSDocSatisfiesTag */:
|
|
23116
|
+
case 343 /* JSDocThisTag */:
|
|
23117
|
+
case 199 /* IndexedAccessType */:
|
|
23118
|
+
case 200 /* MappedType */:
|
|
23119
|
+
case 262 /* FunctionDeclaration */:
|
|
23120
|
+
case 241 /* Block */:
|
|
23121
|
+
case 268 /* ModuleBlock */:
|
|
23122
|
+
case 243 /* VariableStatement */:
|
|
23123
|
+
case 244 /* ExpressionStatement */:
|
|
23124
|
+
case 245 /* IfStatement */:
|
|
23125
|
+
case 246 /* DoStatement */:
|
|
23126
|
+
case 247 /* WhileStatement */:
|
|
23127
|
+
case 248 /* ForStatement */:
|
|
23128
|
+
case 249 /* ForInStatement */:
|
|
23129
|
+
case 250 /* ForOfStatement */:
|
|
23130
|
+
case 251 /* ContinueStatement */:
|
|
23131
|
+
case 252 /* BreakStatement */:
|
|
23132
|
+
case 253 /* ReturnStatement */:
|
|
23133
|
+
case 254 /* WithStatement */:
|
|
23134
|
+
case 255 /* SwitchStatement */:
|
|
23135
|
+
case 256 /* LabeledStatement */:
|
|
23136
|
+
case 257 /* ThrowStatement */:
|
|
23137
|
+
case 258 /* TryStatement */:
|
|
23138
|
+
case 260 /* VariableDeclaration */:
|
|
23139
|
+
case 208 /* BindingElement */:
|
|
23140
|
+
case 263 /* ClassDeclaration */:
|
|
23141
|
+
case 264 /* InterfaceDeclaration */:
|
|
23142
|
+
case 265 /* TypeAliasDeclaration */:
|
|
23143
|
+
case 266 /* EnumDeclaration */:
|
|
23144
|
+
case 267 /* ModuleDeclaration */:
|
|
23145
|
+
case 272 /* ImportDeclaration */:
|
|
23146
|
+
case 271 /* ImportEqualsDeclaration */:
|
|
23147
|
+
case 278 /* ExportDeclaration */:
|
|
23148
|
+
case 277 /* ExportAssignment */:
|
|
23149
|
+
case 242 /* EmptyStatement */:
|
|
23150
|
+
case 259 /* DebuggerStatement */:
|
|
23151
|
+
case 282 /* MissingDeclaration */:
|
|
23152
|
+
return true;
|
|
23153
|
+
}
|
|
23154
|
+
return false;
|
|
23155
|
+
}
|
|
23067
23156
|
function evaluatorResult(value, isSyntacticallyString = false, resolvedOtherFiles = false, hasExternalReferences = false) {
|
|
23068
23157
|
return { value, isSyntacticallyString, resolvedOtherFiles, hasExternalReferences };
|
|
23069
23158
|
}
|
|
@@ -23436,7 +23525,7 @@ function createNameResolver({
|
|
|
23436
23525
|
}
|
|
23437
23526
|
break;
|
|
23438
23527
|
}
|
|
23439
|
-
if (isSelfReferenceLocation(location)) {
|
|
23528
|
+
if (isSelfReferenceLocation(location, lastLocation)) {
|
|
23440
23529
|
lastSelfReferenceLocation = location;
|
|
23441
23530
|
}
|
|
23442
23531
|
lastLocation = location;
|
|
@@ -23537,8 +23626,10 @@ function createNameResolver({
|
|
|
23537
23626
|
}
|
|
23538
23627
|
return !getImmediatelyInvokedFunctionExpression(location);
|
|
23539
23628
|
}
|
|
23540
|
-
function isSelfReferenceLocation(node) {
|
|
23629
|
+
function isSelfReferenceLocation(node, lastLocation) {
|
|
23541
23630
|
switch (node.kind) {
|
|
23631
|
+
case 169 /* Parameter */:
|
|
23632
|
+
return !!lastLocation && lastLocation === node.name;
|
|
23542
23633
|
case 262 /* FunctionDeclaration */:
|
|
23543
23634
|
case 263 /* ClassDeclaration */:
|
|
23544
23635
|
case 264 /* InterfaceDeclaration */:
|
|
@@ -31073,7 +31164,7 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto
|
|
|
31073
31164
|
if (compilerOptions.importHelpers && isEffectiveExternalModule(sourceFile, compilerOptions)) {
|
|
31074
31165
|
let namedBindings;
|
|
31075
31166
|
const moduleKind = getEmitModuleKind(compilerOptions);
|
|
31076
|
-
if (moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */ ||
|
|
31167
|
+
if (moduleKind >= 5 /* ES2015 */ && moduleKind <= 99 /* ESNext */ || sourceFile.impliedNodeFormat === 99 /* ESNext */) {
|
|
31077
31168
|
const helpers = getEmitHelpers(sourceFile);
|
|
31078
31169
|
if (helpers) {
|
|
31079
31170
|
const helperNames = [];
|
|
@@ -31138,7 +31229,8 @@ function getOrCreateExternalHelpersModuleNameIfNeeded(factory2, node, compilerOp
|
|
|
31138
31229
|
if (externalHelpersModuleName) {
|
|
31139
31230
|
return externalHelpersModuleName;
|
|
31140
31231
|
}
|
|
31141
|
-
|
|
31232
|
+
const moduleKind = getEmitModuleKind(compilerOptions);
|
|
31233
|
+
let create = (hasExportStarsToExportValues || getESModuleInterop(compilerOptions) && hasImportStarOrImportDefault) && moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || node.impliedNodeFormat === 1 /* CommonJS */);
|
|
31142
31234
|
if (!create) {
|
|
31143
31235
|
const helpers = getEmitHelpers(node);
|
|
31144
31236
|
if (helpers) {
|
|
@@ -32324,7 +32416,7 @@ function setExternalModuleIndicator(sourceFile) {
|
|
|
32324
32416
|
sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
|
|
32325
32417
|
}
|
|
32326
32418
|
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind) {
|
|
32327
|
-
var _a, _b
|
|
32419
|
+
var _a, _b;
|
|
32328
32420
|
(_a = tracing) == null ? void 0 : _a.push(
|
|
32329
32421
|
tracing.Phase.Parse,
|
|
32330
32422
|
"createSourceFile",
|
|
@@ -32334,7 +32426,6 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
32334
32426
|
);
|
|
32335
32427
|
mark("beforeParse");
|
|
32336
32428
|
let result;
|
|
32337
|
-
(_b = perfLogger) == null ? void 0 : _b.logStartParseSourceFile(fileName);
|
|
32338
32429
|
const {
|
|
32339
32430
|
languageVersion,
|
|
32340
32431
|
setExternalModuleIndicator: overrideSetExternalModuleIndicator,
|
|
@@ -32370,10 +32461,9 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
32370
32461
|
jsDocParsingMode
|
|
32371
32462
|
);
|
|
32372
32463
|
}
|
|
32373
|
-
(_c = perfLogger) == null ? void 0 : _c.logStopParseSourceFile();
|
|
32374
32464
|
mark("afterParse");
|
|
32375
32465
|
measure("Parse", "beforeParse", "afterParse");
|
|
32376
|
-
(
|
|
32466
|
+
(_b = tracing) == null ? void 0 : _b.pop();
|
|
32377
32467
|
return result;
|
|
32378
32468
|
}
|
|
32379
32469
|
function parseIsolatedEntityName(text, languageVersion) {
|
|
@@ -43977,7 +44067,6 @@ function resolveModuleNameFromCache(moduleName, containingFile, cache, mode) {
|
|
|
43977
44067
|
);
|
|
43978
44068
|
}
|
|
43979
44069
|
function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
43980
|
-
var _a, _b, _c;
|
|
43981
44070
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
43982
44071
|
if (redirectedReference) {
|
|
43983
44072
|
compilerOptions = redirectedReference.commandLine.options;
|
|
@@ -44006,7 +44095,6 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
44006
44095
|
trace(host, Diagnostics.Explicitly_specified_module_resolution_kind_Colon_0, ModuleResolutionKind[moduleResolution]);
|
|
44007
44096
|
}
|
|
44008
44097
|
}
|
|
44009
|
-
(_a = perfLogger) == null ? void 0 : _a.logStartResolveModule(moduleName);
|
|
44010
44098
|
switch (moduleResolution) {
|
|
44011
44099
|
case 3 /* Node16 */:
|
|
44012
44100
|
result = node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
@@ -44026,8 +44114,6 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
44026
44114
|
default:
|
|
44027
44115
|
return Debug.fail(`Unexpected moduleResolution: ${moduleResolution}`);
|
|
44028
44116
|
}
|
|
44029
|
-
if (result && result.resolvedModule) (_b = perfLogger) == null ? void 0 : _b.logInfoEvent(`Module "${moduleName}" resolved to "${result.resolvedModule.resolvedFileName}"`);
|
|
44030
|
-
(_c = perfLogger) == null ? void 0 : _c.logStopResolveModule(result && result.resolvedModule ? "" + result.resolvedModule.resolvedFileName : "null");
|
|
44031
44117
|
if (cache && !cache.isReadonly) {
|
|
44032
44118
|
cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference).set(moduleName, resolutionMode, result);
|
|
44033
44119
|
if (!isExternalModuleNameRelative(moduleName)) {
|
|
@@ -45875,11 +45961,8 @@ function createFlowNode(flags, node, antecedent) {
|
|
|
45875
45961
|
}
|
|
45876
45962
|
var binder = /* @__PURE__ */ createBinder();
|
|
45877
45963
|
function bindSourceFile(file, options) {
|
|
45878
|
-
var _a, _b;
|
|
45879
45964
|
mark("beforeBind");
|
|
45880
|
-
(_a = perfLogger) == null ? void 0 : _a.logStartBindFile("" + file.fileName);
|
|
45881
45965
|
binder(file, options);
|
|
45882
|
-
(_b = perfLogger) == null ? void 0 : _b.logStopBindFile();
|
|
45883
45966
|
mark("afterBind");
|
|
45884
45967
|
measure("Bind", "beforeBind", "afterBind");
|
|
45885
45968
|
}
|
|
@@ -48872,15 +48955,13 @@ var RelativePreference = /* @__PURE__ */ ((RelativePreference2) => {
|
|
|
48872
48955
|
RelativePreference2[RelativePreference2["ExternalNonRelative"] = 3] = "ExternalNonRelative";
|
|
48873
48956
|
return RelativePreference2;
|
|
48874
48957
|
})(RelativePreference || {});
|
|
48875
|
-
function getModuleSpecifierPreferences({ importModuleSpecifierPreference, importModuleSpecifierEnding },
|
|
48958
|
+
function getModuleSpecifierPreferences({ importModuleSpecifierPreference, importModuleSpecifierEnding }, compilerOptions, importingSourceFile, oldImportSpecifier) {
|
|
48876
48959
|
const filePreferredEnding = getPreferredEnding();
|
|
48877
48960
|
return {
|
|
48878
48961
|
relativePreference: oldImportSpecifier !== void 0 ? isExternalModuleNameRelative(oldImportSpecifier) ? 0 /* Relative */ : 1 /* NonRelative */ : importModuleSpecifierPreference === "relative" ? 0 /* Relative */ : importModuleSpecifierPreference === "non-relative" ? 1 /* NonRelative */ : importModuleSpecifierPreference === "project-relative" ? 3 /* ExternalNonRelative */ : 2 /* Shortest */,
|
|
48879
48962
|
getAllowedEndingsInPreferredOrder: (syntaxImpliedNodeFormat) => {
|
|
48880
|
-
const
|
|
48881
|
-
|
|
48882
|
-
const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
|
|
48883
|
-
if ((syntaxImpliedNodeFormat ?? impliedNodeFormat) === 99 /* ESNext */ && 3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */) {
|
|
48963
|
+
const preferredEnding = syntaxImpliedNodeFormat !== importingSourceFile.impliedNodeFormat ? getPreferredEnding(syntaxImpliedNodeFormat) : filePreferredEnding;
|
|
48964
|
+
if ((syntaxImpliedNodeFormat ?? importingSourceFile.impliedNodeFormat) === 99 /* ESNext */) {
|
|
48884
48965
|
if (shouldAllowImportingTsExtension(compilerOptions, importingSourceFile.fileName)) {
|
|
48885
48966
|
return [3 /* TsExtension */, 2 /* JsExtension */];
|
|
48886
48967
|
}
|
|
@@ -48911,19 +48992,19 @@ function getModuleSpecifierPreferences({ importModuleSpecifierPreference, import
|
|
|
48911
48992
|
}
|
|
48912
48993
|
return getModuleSpecifierEndingPreference(
|
|
48913
48994
|
importModuleSpecifierEnding,
|
|
48914
|
-
resolutionMode ??
|
|
48995
|
+
resolutionMode ?? importingSourceFile.impliedNodeFormat,
|
|
48915
48996
|
compilerOptions,
|
|
48916
48997
|
isFullSourceFile(importingSourceFile) ? importingSourceFile : void 0
|
|
48917
48998
|
);
|
|
48918
48999
|
}
|
|
48919
49000
|
}
|
|
48920
49001
|
function updateModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, oldImportSpecifier, options = {}) {
|
|
48921
|
-
const res = getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, getModuleSpecifierPreferences({},
|
|
49002
|
+
const res = getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, getModuleSpecifierPreferences({}, compilerOptions, importingSourceFile, oldImportSpecifier), {}, options);
|
|
48922
49003
|
if (res === oldImportSpecifier) return void 0;
|
|
48923
49004
|
return res;
|
|
48924
49005
|
}
|
|
48925
49006
|
function getModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, options = {}) {
|
|
48926
|
-
return getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, getModuleSpecifierPreferences({},
|
|
49007
|
+
return getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName2, host, getModuleSpecifierPreferences({}, compilerOptions, importingSourceFile), {}, options);
|
|
48927
49008
|
}
|
|
48928
49009
|
function getNodeModulesPackageName(compilerOptions, importingSourceFile, nodeModulesFileName, host, preferences, options = {}) {
|
|
48929
49010
|
const info = getInfo(importingSourceFile.fileName, host);
|
|
@@ -48953,7 +49034,7 @@ function getModuleSpecifierWorker(compilerOptions, importingSourceFile, importin
|
|
|
48953
49034
|
/*packageNameOnly*/
|
|
48954
49035
|
void 0,
|
|
48955
49036
|
options.overrideImportMode
|
|
48956
|
-
)) || getLocalModuleSpecifier(toFileName2, info, compilerOptions, host, options.overrideImportMode ||
|
|
49037
|
+
)) || getLocalModuleSpecifier(toFileName2, info, compilerOptions, host, options.overrideImportMode || importingSourceFile.impliedNodeFormat, preferences);
|
|
48957
49038
|
}
|
|
48958
49039
|
function tryGetModuleSpecifiersFromCache(moduleSymbol, importingSourceFile, host, userPreferences, options = {}) {
|
|
48959
49040
|
const result = tryGetModuleSpecifiersFromCacheWorker(
|
|
@@ -49024,21 +49105,17 @@ function getLocalModuleSpecifierBetweenFileNames(importingFile, targetFileName,
|
|
|
49024
49105
|
compilerOptions,
|
|
49025
49106
|
host,
|
|
49026
49107
|
importMode,
|
|
49027
|
-
getModuleSpecifierPreferences({},
|
|
49108
|
+
getModuleSpecifierPreferences({}, compilerOptions, importingFile)
|
|
49028
49109
|
);
|
|
49029
49110
|
}
|
|
49030
49111
|
function computeModuleSpecifiers(modulePaths, compilerOptions, importingSourceFile, host, userPreferences, options = {}, forAutoImport) {
|
|
49031
49112
|
const info = getInfo(importingSourceFile.fileName, host);
|
|
49032
|
-
const preferences = getModuleSpecifierPreferences(userPreferences,
|
|
49113
|
+
const preferences = getModuleSpecifierPreferences(userPreferences, compilerOptions, importingSourceFile);
|
|
49033
49114
|
const existingSpecifier = isFullSourceFile(importingSourceFile) && forEach(modulePaths, (modulePath) => forEach(
|
|
49034
49115
|
host.getFileIncludeReasons().get(toPath(modulePath.path, host.getCurrentDirectory(), info.getCanonicalFileName)),
|
|
49035
49116
|
(reason) => {
|
|
49036
49117
|
if (reason.kind !== 3 /* Import */ || reason.file !== importingSourceFile.path) return void 0;
|
|
49037
|
-
|
|
49038
|
-
const targetMode = options.overrideImportMode ?? host.getDefaultResolutionModeForFile(importingSourceFile);
|
|
49039
|
-
if (existingMode !== targetMode && existingMode !== void 0 && targetMode !== void 0) {
|
|
49040
|
-
return void 0;
|
|
49041
|
-
}
|
|
49118
|
+
if (importingSourceFile.impliedNodeFormat && importingSourceFile.impliedNodeFormat !== getModeForResolutionAtIndex(importingSourceFile, reason.index, compilerOptions)) return void 0;
|
|
49042
49119
|
const specifier = getModuleNameStringLiteralAt(importingSourceFile, reason.index).text;
|
|
49043
49120
|
return preferences.relativePreference !== 1 /* NonRelative */ || !pathIsRelative(specifier) ? specifier : void 0;
|
|
49044
49121
|
}
|
|
@@ -49568,7 +49645,7 @@ function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileNa
|
|
|
49568
49645
|
if (!parts) {
|
|
49569
49646
|
return void 0;
|
|
49570
49647
|
}
|
|
49571
|
-
const preferences = getModuleSpecifierPreferences(userPreferences,
|
|
49648
|
+
const preferences = getModuleSpecifierPreferences(userPreferences, options, importingSourceFile);
|
|
49572
49649
|
const allowedEndings = preferences.getAllowedEndingsInPreferredOrder();
|
|
49573
49650
|
let moduleSpecifier = path;
|
|
49574
49651
|
let isPackageRootPath = false;
|
|
@@ -49618,7 +49695,7 @@ function tryGetModuleNameAsNodeModule({ path, isRedirect }, { getCanonicalFileNa
|
|
|
49618
49695
|
const cachedPackageJson = (_b = (_a = host.getPackageJsonInfoCache) == null ? void 0 : _a.call(host)) == null ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
|
|
49619
49696
|
if (isPackageJsonInfo(cachedPackageJson) || cachedPackageJson === void 0 && host.fileExists(packageJsonPath)) {
|
|
49620
49697
|
const packageJsonContent = (cachedPackageJson == null ? void 0 : cachedPackageJson.contents.packageJsonContent) || tryParseJson(host.readFile(packageJsonPath));
|
|
49621
|
-
const importMode = overrideMode ||
|
|
49698
|
+
const importMode = overrideMode || importingSourceFile.impliedNodeFormat;
|
|
49622
49699
|
if (getResolvePackageJsonExports(options)) {
|
|
49623
49700
|
const nodeModulesDirectoryName2 = packageRootPath.substring(parts.topLevelPackageNameIndex + 1);
|
|
49624
49701
|
const packageName2 = getPackageNameFromTypesPackageName(nodeModulesDirectoryName2);
|
|
@@ -49768,9 +49845,6 @@ function getRelativePathIfInSameVolume(path, directoryPath, getCanonicalFileName
|
|
|
49768
49845
|
function isPathRelativeToParent(path) {
|
|
49769
49846
|
return startsWith(path, "..");
|
|
49770
49847
|
}
|
|
49771
|
-
function getDefaultResolutionModeForFile(file, host, compilerOptions) {
|
|
49772
|
-
return isFullSourceFile(file) ? host.getDefaultResolutionModeForFile(file) : getDefaultResolutionModeForFileWorker(file, compilerOptions);
|
|
49773
|
-
}
|
|
49774
49848
|
|
|
49775
49849
|
// src/compiler/checker.ts
|
|
49776
49850
|
var ambientModuleSymbolRegex = /^".+"$/;
|
|
@@ -51993,28 +52067,22 @@ function createTypeChecker(host) {
|
|
|
51993
52067
|
function isSyntacticDefault(node) {
|
|
51994
52068
|
return isExportAssignment(node) && !node.isExportEquals || hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) || isNamespaceExport(node);
|
|
51995
52069
|
}
|
|
51996
|
-
function
|
|
51997
|
-
return isStringLiteralLike(usage) ? host.
|
|
52070
|
+
function getUsageModeForExpression(usage) {
|
|
52071
|
+
return isStringLiteralLike(usage) ? host.getModeForUsageLocation(getSourceFileOfNode(usage), usage) : void 0;
|
|
51998
52072
|
}
|
|
51999
52073
|
function isESMFormatImportImportingCommonjsFormatFile(usageMode, targetMode) {
|
|
52000
52074
|
return usageMode === 99 /* ESNext */ && targetMode === 1 /* CommonJS */;
|
|
52001
52075
|
}
|
|
52002
|
-
function
|
|
52003
|
-
|
|
52004
|
-
|
|
52005
|
-
return usageMode === 99 /* ESNext */ && endsWith(usage.text, ".json" /* Json */);
|
|
52006
|
-
}
|
|
52007
|
-
return false;
|
|
52076
|
+
function isOnlyImportedAsDefault(usage) {
|
|
52077
|
+
const usageMode = getUsageModeForExpression(usage);
|
|
52078
|
+
return usageMode === 99 /* ESNext */ && endsWith(usage.text, ".json" /* Json */);
|
|
52008
52079
|
}
|
|
52009
52080
|
function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, usage) {
|
|
52010
|
-
const usageMode = file &&
|
|
52011
|
-
if (file && usageMode !== void 0) {
|
|
52012
|
-
const
|
|
52013
|
-
if (usageMode === 99 /* ESNext */
|
|
52014
|
-
return
|
|
52015
|
-
}
|
|
52016
|
-
if (usageMode === 99 /* ESNext */ && targetMode === 99 /* ESNext */) {
|
|
52017
|
-
return false;
|
|
52081
|
+
const usageMode = file && getUsageModeForExpression(usage);
|
|
52082
|
+
if (file && usageMode !== void 0 && 100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */) {
|
|
52083
|
+
const result = isESMFormatImportImportingCommonjsFormatFile(usageMode, file.impliedNodeFormat);
|
|
52084
|
+
if (usageMode === 99 /* ESNext */ || result) {
|
|
52085
|
+
return result;
|
|
52018
52086
|
}
|
|
52019
52087
|
}
|
|
52020
52088
|
if (!allowSyntheticDefaultImports) {
|
|
@@ -52073,7 +52141,7 @@ function createTypeChecker(host) {
|
|
|
52073
52141
|
if (!specifier) {
|
|
52074
52142
|
return exportDefaultSymbol;
|
|
52075
52143
|
}
|
|
52076
|
-
const hasDefaultOnly =
|
|
52144
|
+
const hasDefaultOnly = isOnlyImportedAsDefault(specifier);
|
|
52077
52145
|
const hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, specifier);
|
|
52078
52146
|
if (!exportDefaultSymbol && !hasSyntheticDefault && !hasDefaultOnly) {
|
|
52079
52147
|
if (hasExportAssignmentSymbol(moduleSymbol) && !allowSyntheticDefaultImports) {
|
|
@@ -52275,7 +52343,7 @@ function createTypeChecker(host) {
|
|
|
52275
52343
|
let symbolFromModule = getExportOfModule(targetSymbol, nameText, specifier, dontResolveAlias);
|
|
52276
52344
|
if (symbolFromModule === void 0 && nameText === "default" /* Default */) {
|
|
52277
52345
|
const file = (_a = moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile);
|
|
52278
|
-
if (
|
|
52346
|
+
if (isOnlyImportedAsDefault(moduleSpecifier) || canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, moduleSpecifier)) {
|
|
52279
52347
|
symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
|
|
52280
52348
|
}
|
|
52281
52349
|
}
|
|
@@ -52879,7 +52947,7 @@ function createTypeChecker(host) {
|
|
|
52879
52947
|
/*requireStringLiteralLikeArgument*/
|
|
52880
52948
|
true
|
|
52881
52949
|
) ? location.initializer.arguments[0] : void 0) || ((_c = findAncestor(location, isImportCall)) == null ? void 0 : _c.arguments[0]) || ((_d = findAncestor(location, isImportDeclaration)) == null ? void 0 : _d.moduleSpecifier) || ((_e = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _e.moduleReference.expression) || ((_f = findAncestor(location, isExportDeclaration)) == null ? void 0 : _f.moduleSpecifier);
|
|
52882
|
-
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? host.getModeForUsageLocation(currentSourceFile, contextSpecifier) :
|
|
52950
|
+
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? host.getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
|
|
52883
52951
|
const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
|
|
52884
52952
|
const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
|
|
52885
52953
|
const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
|
|
@@ -53123,7 +53191,7 @@ function createTypeChecker(host) {
|
|
|
53123
53191
|
return cloneTypeAsModuleType(symbol, defaultOnlyType, referenceParent);
|
|
53124
53192
|
}
|
|
53125
53193
|
const targetFile = (_a = moduleSymbol == null ? void 0 : moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile);
|
|
53126
|
-
const isEsmCjsRef = targetFile && isESMFormatImportImportingCommonjsFormatFile(
|
|
53194
|
+
const isEsmCjsRef = targetFile && isESMFormatImportImportingCommonjsFormatFile(getUsageModeForExpression(reference), targetFile.impliedNodeFormat);
|
|
53127
53195
|
if (getESModuleInterop(compilerOptions) || isEsmCjsRef) {
|
|
53128
53196
|
let sigs = getSignaturesOfStructuredType(type, 0 /* Call */);
|
|
53129
53197
|
if (!sigs || !sigs.length) {
|
|
@@ -55729,10 +55797,8 @@ function createTypeChecker(host) {
|
|
|
55729
55797
|
}
|
|
55730
55798
|
return getSourceFileOfNode(getNonAugmentationDeclaration(symbol)).fileName;
|
|
55731
55799
|
}
|
|
55732
|
-
const enclosingDeclaration = getOriginalNode(context.enclosingDeclaration);
|
|
55733
|
-
const originalModuleSpecifier = canHaveModuleSpecifier(enclosingDeclaration) ? tryGetModuleSpecifierFromDeclaration(enclosingDeclaration) : void 0;
|
|
55734
55800
|
const contextFile = context.enclosingFile;
|
|
55735
|
-
const resolutionMode = overrideImportMode ||
|
|
55801
|
+
const resolutionMode = overrideImportMode || (contextFile == null ? void 0 : contextFile.impliedNodeFormat);
|
|
55736
55802
|
const cacheKey = createModeAwareCacheKey(contextFile.path, resolutionMode);
|
|
55737
55803
|
const links = getSymbolLinks(symbol);
|
|
55738
55804
|
let specifier = links.specifierCache && links.specifierCache.get(cacheKey);
|
|
@@ -56701,8 +56767,28 @@ function createTypeChecker(host) {
|
|
|
56701
56767
|
} else {
|
|
56702
56768
|
const type = getWidenedType(getRegularTypeOfExpression(node.expression));
|
|
56703
56769
|
const computedPropertyNameType = typeToTypeNodeHelper(type, context);
|
|
56704
|
-
|
|
56705
|
-
|
|
56770
|
+
let literal;
|
|
56771
|
+
if (isLiteralTypeNode(computedPropertyNameType)) {
|
|
56772
|
+
literal = computedPropertyNameType.literal;
|
|
56773
|
+
} else {
|
|
56774
|
+
const evaluated = evaluateEntityNameExpression(node.expression);
|
|
56775
|
+
const literalNode = typeof evaluated.value === "string" ? factory.createStringLiteral(
|
|
56776
|
+
evaluated.value,
|
|
56777
|
+
/*isSingleQuote*/
|
|
56778
|
+
void 0
|
|
56779
|
+
) : typeof evaluated.value === "number" ? factory.createNumericLiteral(
|
|
56780
|
+
evaluated.value,
|
|
56781
|
+
/*numericLiteralFlags*/
|
|
56782
|
+
0
|
|
56783
|
+
) : void 0;
|
|
56784
|
+
if (!literalNode) {
|
|
56785
|
+
if (isImportTypeNode(computedPropertyNameType)) {
|
|
56786
|
+
trackComputedName(node.expression, context.enclosingDeclaration, context);
|
|
56787
|
+
}
|
|
56788
|
+
return node;
|
|
56789
|
+
}
|
|
56790
|
+
literal = literalNode;
|
|
56791
|
+
}
|
|
56706
56792
|
if (literal.kind === 11 /* StringLiteral */ && isIdentifierText(literal.text, getEmitScriptTarget(compilerOptions))) {
|
|
56707
56793
|
return factory.createIdentifier(literal.text);
|
|
56708
56794
|
}
|
|
@@ -80204,7 +80290,7 @@ function createTypeChecker(host) {
|
|
|
80204
80290
|
return createAnonymousType(anonymousSymbol, memberTable, emptyArray, emptyArray, emptyArray);
|
|
80205
80291
|
}
|
|
80206
80292
|
function getTypeWithSyntheticDefaultOnly(type, symbol, originalSymbol, moduleSpecifier) {
|
|
80207
|
-
const hasDefaultOnly =
|
|
80293
|
+
const hasDefaultOnly = isOnlyImportedAsDefault(moduleSpecifier);
|
|
80208
80294
|
if (hasDefaultOnly && type && !isErrorType(type)) {
|
|
80209
80295
|
const synthType = type;
|
|
80210
80296
|
if (!synthType.defaultOnlyType) {
|
|
@@ -85431,7 +85517,7 @@ function createTypeChecker(host) {
|
|
|
85431
85517
|
});
|
|
85432
85518
|
}
|
|
85433
85519
|
function checkCollisionWithRequireExportsInGeneratedCode(node, name) {
|
|
85434
|
-
if (
|
|
85520
|
+
if (moduleKind >= 5 /* ES2015 */ && !(moduleKind >= 100 /* Node16 */ && getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) {
|
|
85435
85521
|
return;
|
|
85436
85522
|
}
|
|
85437
85523
|
if (!name || !needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) {
|
|
@@ -86852,7 +86938,7 @@ function createTypeChecker(host) {
|
|
|
86852
86938
|
}
|
|
86853
86939
|
}
|
|
86854
86940
|
function checkClassNameCollisionWithObject(name) {
|
|
86855
|
-
if (languageVersion >= 1 /* ES5 */ && name.escapedText === "Object" &&
|
|
86941
|
+
if (languageVersion >= 1 /* ES5 */ && name.escapedText === "Object" && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(name).impliedNodeFormat === 1 /* CommonJS */)) {
|
|
86856
86942
|
error2(name, Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ModuleKind[moduleKind]);
|
|
86857
86943
|
}
|
|
86858
86944
|
}
|
|
@@ -87231,23 +87317,22 @@ function createTypeChecker(host) {
|
|
|
87231
87317
|
hasAbstractModifier(member),
|
|
87232
87318
|
isStatic(member),
|
|
87233
87319
|
memberIsParameterProperty,
|
|
87234
|
-
|
|
87320
|
+
declaredProp,
|
|
87235
87321
|
reportErrors2 ? member : void 0
|
|
87236
87322
|
);
|
|
87237
87323
|
}
|
|
87238
|
-
function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty,
|
|
87324
|
+
function checkMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, memberHasOverrideModifier, memberHasAbstractModifier, memberIsStatic, memberIsParameterProperty, member, errorNode) {
|
|
87239
87325
|
const isJs = isInJSFile(node);
|
|
87240
87326
|
const nodeInAmbientContext = !!(node.flags & 33554432 /* Ambient */);
|
|
87241
87327
|
if (baseWithThis && (memberHasOverrideModifier || compilerOptions.noImplicitOverride)) {
|
|
87242
|
-
const memberEscapedName = escapeLeadingUnderscores(memberName);
|
|
87243
87328
|
const thisType = memberIsStatic ? staticType : typeWithThis;
|
|
87244
87329
|
const baseType = memberIsStatic ? baseStaticType : baseWithThis;
|
|
87245
|
-
const prop = getPropertyOfType(thisType,
|
|
87246
|
-
const baseProp = getPropertyOfType(baseType,
|
|
87330
|
+
const prop = getPropertyOfType(thisType, member.escapedName);
|
|
87331
|
+
const baseProp = getPropertyOfType(baseType, member.escapedName);
|
|
87247
87332
|
const baseClassName = typeToString(baseWithThis);
|
|
87248
87333
|
if (prop && !baseProp && memberHasOverrideModifier) {
|
|
87249
87334
|
if (errorNode) {
|
|
87250
|
-
const suggestion = getSuggestedSymbolForNonexistentClassMember(
|
|
87335
|
+
const suggestion = getSuggestedSymbolForNonexistentClassMember(symbolName(member), baseType);
|
|
87251
87336
|
suggestion ? error2(
|
|
87252
87337
|
errorNode,
|
|
87253
87338
|
isJs ? Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1 : Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1,
|
|
@@ -87364,7 +87449,7 @@ function createTypeChecker(host) {
|
|
|
87364
87449
|
isStatic(member),
|
|
87365
87450
|
/*memberIsParameterProperty*/
|
|
87366
87451
|
false,
|
|
87367
|
-
|
|
87452
|
+
memberSymbol
|
|
87368
87453
|
);
|
|
87369
87454
|
}
|
|
87370
87455
|
function getTargetSymbol(s) {
|
|
@@ -87933,7 +88018,7 @@ function createTypeChecker(host) {
|
|
|
87933
88018
|
getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */;
|
|
87934
88019
|
}
|
|
87935
88020
|
}
|
|
87936
|
-
if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 307 /* SourceFile */ &&
|
|
88021
|
+
if (compilerOptions.verbatimModuleSyntax && node.parent.kind === 307 /* SourceFile */ && (moduleKind === 1 /* CommonJS */ || node.parent.impliedNodeFormat === 1 /* CommonJS */)) {
|
|
87937
88022
|
const exportModifier = (_b = node.modifiers) == null ? void 0 : _b.find((m) => m.kind === 95 /* ExportKeyword */);
|
|
87938
88023
|
if (exportModifier) {
|
|
87939
88024
|
error2(exportModifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
|
|
@@ -88153,10 +88238,8 @@ function createTypeChecker(host) {
|
|
|
88153
88238
|
}
|
|
88154
88239
|
}
|
|
88155
88240
|
}
|
|
88156
|
-
if (compilerOptions.verbatimModuleSyntax && node.kind !== 271 /* ImportEqualsDeclaration */ && !isInJSFile(node) &&
|
|
88241
|
+
if (compilerOptions.verbatimModuleSyntax && node.kind !== 271 /* ImportEqualsDeclaration */ && !isInJSFile(node) && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) {
|
|
88157
88242
|
error2(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
|
|
88158
|
-
} else if (moduleKind === 200 /* Preserve */ && node.kind !== 271 /* ImportEqualsDeclaration */ && node.kind !== 260 /* VariableDeclaration */ && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) === 1 /* CommonJS */) {
|
|
88159
|
-
error2(node, Diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve);
|
|
88160
88243
|
}
|
|
88161
88244
|
}
|
|
88162
88245
|
if (isImportSpecifier(node)) {
|
|
@@ -88197,7 +88280,7 @@ function createTypeChecker(host) {
|
|
|
88197
88280
|
checkAliasSymbol(node);
|
|
88198
88281
|
if (node.kind === 276 /* ImportSpecifier */) {
|
|
88199
88282
|
checkModuleExportName(node.propertyName);
|
|
88200
|
-
if (moduleExportNameIsDefault(node.propertyName || node.name) && getESModuleInterop(compilerOptions) &&
|
|
88283
|
+
if (moduleExportNameIsDefault(node.propertyName || node.name) && getESModuleInterop(compilerOptions) && moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) {
|
|
88201
88284
|
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
|
|
88202
88285
|
}
|
|
88203
88286
|
}
|
|
@@ -88219,7 +88302,7 @@ function createTypeChecker(host) {
|
|
|
88219
88302
|
if (validForTypeAttributes && override) {
|
|
88220
88303
|
return;
|
|
88221
88304
|
}
|
|
88222
|
-
const mode = moduleKind === 199 /* NodeNext */ && declaration.moduleSpecifier &&
|
|
88305
|
+
const mode = moduleKind === 199 /* NodeNext */ && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier);
|
|
88223
88306
|
if (mode !== 99 /* ESNext */ && moduleKind !== 99 /* ESNext */ && moduleKind !== 200 /* Preserve */) {
|
|
88224
88307
|
const message = isImportAttributes2 ? moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve : moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve;
|
|
88225
88308
|
return grammarErrorOnNode(node, message);
|
|
@@ -88252,7 +88335,7 @@ function createTypeChecker(host) {
|
|
|
88252
88335
|
if (importClause.namedBindings) {
|
|
88253
88336
|
if (importClause.namedBindings.kind === 274 /* NamespaceImport */) {
|
|
88254
88337
|
checkImportBinding(importClause.namedBindings);
|
|
88255
|
-
if (
|
|
88338
|
+
if (moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */) && getESModuleInterop(compilerOptions)) {
|
|
88256
88339
|
checkExternalEmitHelpers(node, 65536 /* ImportStar */);
|
|
88257
88340
|
}
|
|
88258
88341
|
} else {
|
|
@@ -88292,7 +88375,7 @@ function createTypeChecker(host) {
|
|
|
88292
88375
|
grammarErrorOnNode(node, Diagnostics.An_import_alias_cannot_use_import_type);
|
|
88293
88376
|
}
|
|
88294
88377
|
} else {
|
|
88295
|
-
if (5 /* ES2015 */
|
|
88378
|
+
if (moduleKind >= 5 /* ES2015 */ && moduleKind !== 200 /* Preserve */ && getSourceFileOfNode(node).impliedNodeFormat === void 0 && !node.isTypeOnly && !(node.flags & 33554432 /* Ambient */)) {
|
|
88296
88379
|
grammarErrorOnNode(node, Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
|
|
88297
88380
|
}
|
|
88298
88381
|
}
|
|
@@ -88322,7 +88405,7 @@ function createTypeChecker(host) {
|
|
|
88322
88405
|
checkAliasSymbol(node.exportClause);
|
|
88323
88406
|
checkModuleExportName(node.exportClause.name);
|
|
88324
88407
|
}
|
|
88325
|
-
if (
|
|
88408
|
+
if (moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) {
|
|
88326
88409
|
if (node.exportClause) {
|
|
88327
88410
|
if (getESModuleInterop(compilerOptions)) {
|
|
88328
88411
|
checkExternalEmitHelpers(node, 65536 /* ImportStar */);
|
|
@@ -88381,7 +88464,7 @@ function createTypeChecker(host) {
|
|
|
88381
88464
|
markLinkedReferences(node, 7 /* ExportSpecifier */);
|
|
88382
88465
|
}
|
|
88383
88466
|
} else {
|
|
88384
|
-
if (getESModuleInterop(compilerOptions) &&
|
|
88467
|
+
if (getESModuleInterop(compilerOptions) && moduleKind !== 4 /* System */ && (moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */) && moduleExportNameIsDefault(node.propertyName || node.name)) {
|
|
88385
88468
|
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
|
|
88386
88469
|
}
|
|
88387
88470
|
}
|
|
@@ -88407,7 +88490,7 @@ function createTypeChecker(host) {
|
|
|
88407
88490
|
if (typeAnnotationNode) {
|
|
88408
88491
|
checkTypeAssignableTo(checkExpressionCached(node.expression), getTypeFromTypeNode(typeAnnotationNode), node.expression);
|
|
88409
88492
|
}
|
|
88410
|
-
const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 33554432 /* Ambient */) && compilerOptions.verbatimModuleSyntax &&
|
|
88493
|
+
const isIllegalExportDefaultInCJS = !node.isExportEquals && !(node.flags & 33554432 /* Ambient */) && compilerOptions.verbatimModuleSyntax && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */);
|
|
88411
88494
|
if (node.expression.kind === 80 /* Identifier */) {
|
|
88412
88495
|
const id = node.expression;
|
|
88413
88496
|
const sym = getExportSymbolOfValueSymbolIfExported(resolveEntityName(
|
|
@@ -88487,7 +88570,7 @@ function createTypeChecker(host) {
|
|
|
88487
88570
|
grammarErrorOnNode(node.expression, Diagnostics.The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context);
|
|
88488
88571
|
}
|
|
88489
88572
|
if (node.isExportEquals) {
|
|
88490
|
-
if (moduleKind >= 5 /* ES2015 */ && moduleKind !== 200 /* Preserve */ && (node.flags & 33554432 /* Ambient */ &&
|
|
88573
|
+
if (moduleKind >= 5 /* ES2015 */ && moduleKind !== 200 /* Preserve */ && (node.flags & 33554432 /* Ambient */ && getSourceFileOfNode(node).impliedNodeFormat === 99 /* ESNext */ || !(node.flags & 33554432 /* Ambient */) && getSourceFileOfNode(node).impliedNodeFormat !== 1 /* CommonJS */)) {
|
|
88491
88574
|
grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead);
|
|
88492
88575
|
} else if (moduleKind === 4 /* System */ && !(node.flags & 33554432 /* Ambient */)) {
|
|
88493
88576
|
grammarErrorOnNode(node, Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system);
|
|
@@ -88548,6 +88631,9 @@ function createTypeChecker(host) {
|
|
|
88548
88631
|
}
|
|
88549
88632
|
}
|
|
88550
88633
|
function checkSourceElementWorker(node) {
|
|
88634
|
+
if (getNodeCheckFlags(node) & 8388608 /* PartiallyTypeChecked */) {
|
|
88635
|
+
return;
|
|
88636
|
+
}
|
|
88551
88637
|
if (canHaveJSDoc(node)) {
|
|
88552
88638
|
forEach(node.jsDoc, ({ comment, tags }) => {
|
|
88553
88639
|
checkJSDocCommentWorker(comment);
|
|
@@ -88891,19 +88977,21 @@ function createTypeChecker(host) {
|
|
|
88891
88977
|
currentNode = saveCurrentNode;
|
|
88892
88978
|
(_b = tracing) == null ? void 0 : _b.pop();
|
|
88893
88979
|
}
|
|
88894
|
-
function checkSourceFile(node) {
|
|
88980
|
+
function checkSourceFile(node, nodesToCheck) {
|
|
88895
88981
|
var _a, _b;
|
|
88896
88982
|
(_a = tracing) == null ? void 0 : _a.push(
|
|
88897
88983
|
tracing.Phase.Check,
|
|
88898
|
-
"checkSourceFile",
|
|
88984
|
+
nodesToCheck ? "checkSourceFileNodes" : "checkSourceFile",
|
|
88899
88985
|
{ path: node.path },
|
|
88900
88986
|
/*separateBeginAndEnd*/
|
|
88901
88987
|
true
|
|
88902
88988
|
);
|
|
88903
|
-
|
|
88904
|
-
|
|
88905
|
-
mark(
|
|
88906
|
-
|
|
88989
|
+
const beforeMark = nodesToCheck ? "beforeCheckNodes" : "beforeCheck";
|
|
88990
|
+
const afterMark = nodesToCheck ? "afterCheckNodes" : "afterCheck";
|
|
88991
|
+
mark(beforeMark);
|
|
88992
|
+
nodesToCheck ? checkSourceFileNodesWorker(node, nodesToCheck) : checkSourceFileWorker(node);
|
|
88993
|
+
mark(afterMark);
|
|
88994
|
+
measure("Check", beforeMark, afterMark);
|
|
88907
88995
|
(_b = tracing) == null ? void 0 : _b.pop();
|
|
88908
88996
|
}
|
|
88909
88997
|
function unusedIsError(kind, isAmbient) {
|
|
@@ -88934,6 +89022,13 @@ function createTypeChecker(host) {
|
|
|
88934
89022
|
clear(potentialWeakMapSetCollisions);
|
|
88935
89023
|
clear(potentialReflectCollisions);
|
|
88936
89024
|
clear(potentialUnusedRenamedBindingElementsInTypes);
|
|
89025
|
+
if (links.flags & 8388608 /* PartiallyTypeChecked */) {
|
|
89026
|
+
potentialThisCollisions = links.potentialThisCollisions;
|
|
89027
|
+
potentialNewTargetCollisions = links.potentialNewTargetCollisions;
|
|
89028
|
+
potentialWeakMapSetCollisions = links.potentialWeakMapSetCollisions;
|
|
89029
|
+
potentialReflectCollisions = links.potentialReflectCollisions;
|
|
89030
|
+
potentialUnusedRenamedBindingElementsInTypes = links.potentialUnusedRenamedBindingElementsInTypes;
|
|
89031
|
+
}
|
|
88937
89032
|
forEach(node.statements, checkSourceElement);
|
|
88938
89033
|
checkSourceElement(node.endOfFileToken);
|
|
88939
89034
|
checkDeferredNodes(node);
|
|
@@ -88974,10 +89069,38 @@ function createTypeChecker(host) {
|
|
|
88974
89069
|
links.flags |= 1 /* TypeChecked */;
|
|
88975
89070
|
}
|
|
88976
89071
|
}
|
|
88977
|
-
function
|
|
89072
|
+
function checkSourceFileNodesWorker(file, nodes) {
|
|
89073
|
+
const links = getNodeLinks(file);
|
|
89074
|
+
if (!(links.flags & 1 /* TypeChecked */)) {
|
|
89075
|
+
if (skipTypeChecking(file, compilerOptions, host)) {
|
|
89076
|
+
return;
|
|
89077
|
+
}
|
|
89078
|
+
checkGrammarSourceFile(file);
|
|
89079
|
+
clear(potentialThisCollisions);
|
|
89080
|
+
clear(potentialNewTargetCollisions);
|
|
89081
|
+
clear(potentialWeakMapSetCollisions);
|
|
89082
|
+
clear(potentialReflectCollisions);
|
|
89083
|
+
clear(potentialUnusedRenamedBindingElementsInTypes);
|
|
89084
|
+
forEach(nodes, checkSourceElement);
|
|
89085
|
+
checkDeferredNodes(file);
|
|
89086
|
+
(links.potentialThisCollisions || (links.potentialThisCollisions = [])).push(...potentialThisCollisions);
|
|
89087
|
+
(links.potentialNewTargetCollisions || (links.potentialNewTargetCollisions = [])).push(...potentialNewTargetCollisions);
|
|
89088
|
+
(links.potentialWeakMapSetCollisions || (links.potentialWeakMapSetCollisions = [])).push(...potentialWeakMapSetCollisions);
|
|
89089
|
+
(links.potentialReflectCollisions || (links.potentialReflectCollisions = [])).push(...potentialReflectCollisions);
|
|
89090
|
+
(links.potentialUnusedRenamedBindingElementsInTypes || (links.potentialUnusedRenamedBindingElementsInTypes = [])).push(
|
|
89091
|
+
...potentialUnusedRenamedBindingElementsInTypes
|
|
89092
|
+
);
|
|
89093
|
+
links.flags |= 8388608 /* PartiallyTypeChecked */;
|
|
89094
|
+
for (const node of nodes) {
|
|
89095
|
+
const nodeLinks2 = getNodeLinks(node);
|
|
89096
|
+
nodeLinks2.flags |= 8388608 /* PartiallyTypeChecked */;
|
|
89097
|
+
}
|
|
89098
|
+
}
|
|
89099
|
+
}
|
|
89100
|
+
function getDiagnostics2(sourceFile, ct, nodesToCheck) {
|
|
88978
89101
|
try {
|
|
88979
89102
|
cancellationToken = ct;
|
|
88980
|
-
return getDiagnosticsWorker(sourceFile);
|
|
89103
|
+
return getDiagnosticsWorker(sourceFile, nodesToCheck);
|
|
88981
89104
|
} finally {
|
|
88982
89105
|
cancellationToken = void 0;
|
|
88983
89106
|
}
|
|
@@ -88988,20 +89111,23 @@ function createTypeChecker(host) {
|
|
|
88988
89111
|
}
|
|
88989
89112
|
deferredDiagnosticsCallbacks = [];
|
|
88990
89113
|
}
|
|
88991
|
-
function checkSourceFileWithEagerDiagnostics(sourceFile) {
|
|
89114
|
+
function checkSourceFileWithEagerDiagnostics(sourceFile, nodesToCheck) {
|
|
88992
89115
|
ensurePendingDiagnosticWorkComplete();
|
|
88993
89116
|
const oldAddLazyDiagnostics = addLazyDiagnostic;
|
|
88994
89117
|
addLazyDiagnostic = (cb) => cb();
|
|
88995
|
-
checkSourceFile(sourceFile);
|
|
89118
|
+
checkSourceFile(sourceFile, nodesToCheck);
|
|
88996
89119
|
addLazyDiagnostic = oldAddLazyDiagnostics;
|
|
88997
89120
|
}
|
|
88998
|
-
function getDiagnosticsWorker(sourceFile) {
|
|
89121
|
+
function getDiagnosticsWorker(sourceFile, nodesToCheck) {
|
|
88999
89122
|
if (sourceFile) {
|
|
89000
89123
|
ensurePendingDiagnosticWorkComplete();
|
|
89001
89124
|
const previousGlobalDiagnostics = diagnostics.getGlobalDiagnostics();
|
|
89002
89125
|
const previousGlobalDiagnosticsSize = previousGlobalDiagnostics.length;
|
|
89003
|
-
checkSourceFileWithEagerDiagnostics(sourceFile);
|
|
89126
|
+
checkSourceFileWithEagerDiagnostics(sourceFile, nodesToCheck);
|
|
89004
89127
|
const semanticDiagnostics = diagnostics.getDiagnostics(sourceFile.fileName);
|
|
89128
|
+
if (nodesToCheck) {
|
|
89129
|
+
return semanticDiagnostics;
|
|
89130
|
+
}
|
|
89005
89131
|
const currentGlobalDiagnostics = diagnostics.getGlobalDiagnostics();
|
|
89006
89132
|
if (currentGlobalDiagnostics !== previousGlobalDiagnostics) {
|
|
89007
89133
|
const deferredGlobalDiagnostics = relativeComplement(previousGlobalDiagnostics, currentGlobalDiagnostics, compareDiagnostics);
|
|
@@ -89011,7 +89137,7 @@ function createTypeChecker(host) {
|
|
|
89011
89137
|
}
|
|
89012
89138
|
return semanticDiagnostics;
|
|
89013
89139
|
}
|
|
89014
|
-
forEach(host.getSourceFiles(), checkSourceFileWithEagerDiagnostics);
|
|
89140
|
+
forEach(host.getSourceFiles(), (file) => checkSourceFileWithEagerDiagnostics(file));
|
|
89015
89141
|
return diagnostics.getDiagnostics();
|
|
89016
89142
|
}
|
|
89017
89143
|
function getGlobalDiagnostics() {
|
|
@@ -89973,7 +90099,7 @@ function createTypeChecker(host) {
|
|
|
89973
90099
|
return !!(getNodeCheckFlags(node) & flag);
|
|
89974
90100
|
}
|
|
89975
90101
|
function calculateNodeCheckFlagWorker(node, flag) {
|
|
89976
|
-
if (!compilerOptions.noCheck &&
|
|
90102
|
+
if (!compilerOptions.noCheck && canIncludeBindAndCheckDiagnostics(getSourceFileOfNode(node), compilerOptions)) {
|
|
89977
90103
|
return;
|
|
89978
90104
|
}
|
|
89979
90105
|
const links = getNodeLinks(node);
|
|
@@ -90990,7 +91116,7 @@ function createTypeChecker(host) {
|
|
|
90990
91116
|
break;
|
|
90991
91117
|
case 95 /* ExportKeyword */:
|
|
90992
91118
|
if (compilerOptions.verbatimModuleSyntax && !(node.flags & 33554432 /* Ambient */) && node.kind !== 265 /* TypeAliasDeclaration */ && node.kind !== 264 /* InterfaceDeclaration */ && // ModuleDeclaration needs to be checked that it is uninstantiated later
|
|
90993
|
-
node.kind !== 267 /* ModuleDeclaration */ && node.parent.kind === 307 /* SourceFile */ &&
|
|
91119
|
+
node.kind !== 267 /* ModuleDeclaration */ && node.parent.kind === 307 /* SourceFile */ && (moduleKind === 1 /* CommonJS */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */)) {
|
|
90994
91120
|
return grammarErrorOnNode(modifier, Diagnostics.A_top_level_export_modifier_cannot_be_used_on_value_declarations_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled);
|
|
90995
91121
|
}
|
|
90996
91122
|
if (flags & 32 /* Export */) {
|
|
@@ -91899,7 +92025,7 @@ function createTypeChecker(host) {
|
|
|
91899
92025
|
const message = node.initializer ? Diagnostics.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions : !node.type ? Diagnostics.Declarations_with_definite_assignment_assertions_must_also_have_type_annotations : Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context;
|
|
91900
92026
|
return grammarErrorOnNode(node.exclamationToken, message);
|
|
91901
92027
|
}
|
|
91902
|
-
if (
|
|
92028
|
+
if ((moduleKind < 5 /* ES2015 */ || getSourceFileOfNode(node).impliedNodeFormat === 1 /* CommonJS */) && moduleKind !== 4 /* System */ && !(node.parent.parent.flags & 33554432 /* Ambient */) && hasSyntacticModifier(node.parent.parent, 32 /* Export */)) {
|
|
91903
92029
|
checkESModuleMarker(node.name);
|
|
91904
92030
|
}
|
|
91905
92031
|
return !!blockScopeKind && checkGrammarNameInLetOrConstDeclarations(node.name);
|
|
@@ -92400,9 +92526,7 @@ function createBasicNodeBuilderModuleSpecifierResolutionHost(host) {
|
|
|
92400
92526
|
isSourceOfProjectReferenceRedirect: (fileName) => host.isSourceOfProjectReferenceRedirect(fileName),
|
|
92401
92527
|
fileExists: (fileName) => host.fileExists(fileName),
|
|
92402
92528
|
getFileIncludeReasons: () => host.getFileIncludeReasons(),
|
|
92403
|
-
readFile: host.readFile ? (fileName) => host.readFile(fileName) : void 0
|
|
92404
|
-
getDefaultResolutionModeForFile: (file) => host.getDefaultResolutionModeForFile(file),
|
|
92405
|
-
getModeForResolutionAtIndex: (file, index) => host.getModeForResolutionAtIndex(file, index)
|
|
92529
|
+
readFile: host.readFile ? (fileName) => host.readFile(fileName) : void 0
|
|
92406
92530
|
};
|
|
92407
92531
|
}
|
|
92408
92532
|
var SymbolTrackerImpl = class _SymbolTrackerImpl {
|
|
@@ -112257,7 +112381,7 @@ function transformModule(context) {
|
|
|
112257
112381
|
case 354 /* PartiallyEmittedExpression */:
|
|
112258
112382
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
112259
112383
|
case 213 /* CallExpression */:
|
|
112260
|
-
if (isImportCall(node) &&
|
|
112384
|
+
if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
|
|
112261
112385
|
return visitImportCallExpression(node);
|
|
112262
112386
|
}
|
|
112263
112387
|
break;
|
|
@@ -115253,8 +115377,8 @@ function transformECMAScriptModule(context) {
|
|
|
115253
115377
|
}
|
|
115254
115378
|
}
|
|
115255
115379
|
|
|
115256
|
-
// src/compiler/transformers/module/
|
|
115257
|
-
function
|
|
115380
|
+
// src/compiler/transformers/module/node.ts
|
|
115381
|
+
function transformNodeModule(context) {
|
|
115258
115382
|
const previousOnSubstituteNode = context.onSubstituteNode;
|
|
115259
115383
|
const previousOnEmitNode = context.onEmitNode;
|
|
115260
115384
|
const esmTransform = transformECMAScriptModule(context);
|
|
@@ -115265,7 +115389,6 @@ function transformImpliedNodeFormatDependentModule(context) {
|
|
|
115265
115389
|
const cjsTransform = transformModule(context);
|
|
115266
115390
|
const cjsOnSubstituteNode = context.onSubstituteNode;
|
|
115267
115391
|
const cjsOnEmitNode = context.onEmitNode;
|
|
115268
|
-
const getEmitModuleFormatOfFile2 = (file) => context.getEmitHost().getEmitModuleFormatOfFile(file);
|
|
115269
115392
|
context.onSubstituteNode = onSubstituteNode;
|
|
115270
115393
|
context.onEmitNode = onEmitNode;
|
|
115271
115394
|
context.enableSubstitution(307 /* SourceFile */);
|
|
@@ -115280,7 +115403,7 @@ function transformImpliedNodeFormatDependentModule(context) {
|
|
|
115280
115403
|
if (!currentSourceFile) {
|
|
115281
115404
|
return previousOnSubstituteNode(hint, node);
|
|
115282
115405
|
}
|
|
115283
|
-
if (
|
|
115406
|
+
if (currentSourceFile.impliedNodeFormat === 99 /* ESNext */) {
|
|
115284
115407
|
return esmOnSubstituteNode(hint, node);
|
|
115285
115408
|
}
|
|
115286
115409
|
return cjsOnSubstituteNode(hint, node);
|
|
@@ -115293,13 +115416,13 @@ function transformImpliedNodeFormatDependentModule(context) {
|
|
|
115293
115416
|
if (!currentSourceFile) {
|
|
115294
115417
|
return previousOnEmitNode(hint, node, emitCallback);
|
|
115295
115418
|
}
|
|
115296
|
-
if (
|
|
115419
|
+
if (currentSourceFile.impliedNodeFormat === 99 /* ESNext */) {
|
|
115297
115420
|
return esmOnEmitNode(hint, node, emitCallback);
|
|
115298
115421
|
}
|
|
115299
115422
|
return cjsOnEmitNode(hint, node, emitCallback);
|
|
115300
115423
|
}
|
|
115301
115424
|
function getModuleTransformForFile(file) {
|
|
115302
|
-
return
|
|
115425
|
+
return file.impliedNodeFormat === 99 /* ESNext */ ? esmTransform : cjsTransform;
|
|
115303
115426
|
}
|
|
115304
115427
|
function transformSourceFile(node) {
|
|
115305
115428
|
if (node.isDeclarationFile) {
|
|
@@ -117421,18 +117544,17 @@ function isProcessedComponent(node) {
|
|
|
117421
117544
|
// src/compiler/transformer.ts
|
|
117422
117545
|
function getModuleTransformer(moduleKind) {
|
|
117423
117546
|
switch (moduleKind) {
|
|
117424
|
-
case 200 /* Preserve */:
|
|
117425
|
-
return transformECMAScriptModule;
|
|
117426
117547
|
case 99 /* ESNext */:
|
|
117427
117548
|
case 7 /* ES2022 */:
|
|
117428
117549
|
case 6 /* ES2020 */:
|
|
117429
117550
|
case 5 /* ES2015 */:
|
|
117430
|
-
case
|
|
117431
|
-
|
|
117432
|
-
case 1 /* CommonJS */:
|
|
117433
|
-
return transformImpliedNodeFormatDependentModule;
|
|
117551
|
+
case 200 /* Preserve */:
|
|
117552
|
+
return transformECMAScriptModule;
|
|
117434
117553
|
case 4 /* System */:
|
|
117435
117554
|
return transformSystemModule;
|
|
117555
|
+
case 100 /* Node16 */:
|
|
117556
|
+
case 199 /* NodeNext */:
|
|
117557
|
+
return transformNodeModule;
|
|
117436
117558
|
default:
|
|
117437
117559
|
return transformModule;
|
|
117438
117560
|
}
|
|
@@ -117885,7 +118007,7 @@ function forEachEmittedFile(host, action, sourceFilesOrTargetSourceFile, forceDt
|
|
|
117885
118007
|
}
|
|
117886
118008
|
function getTsBuildInfoEmitOutputFilePath(options) {
|
|
117887
118009
|
const configFile = options.configFilePath;
|
|
117888
|
-
if (!
|
|
118010
|
+
if (!canEmitTsBuildInfo(options)) return void 0;
|
|
117889
118011
|
if (options.tsBuildInfoFile) return options.tsBuildInfoFile;
|
|
117890
118012
|
const outPath = options.outFile;
|
|
117891
118013
|
let buildInfoExtensionLess;
|
|
@@ -117903,6 +118025,9 @@ function getTsBuildInfoEmitOutputFilePath(options) {
|
|
|
117903
118025
|
}
|
|
117904
118026
|
return buildInfoExtensionLess + ".tsbuildinfo" /* TsBuildInfo */;
|
|
117905
118027
|
}
|
|
118028
|
+
function canEmitTsBuildInfo(options) {
|
|
118029
|
+
return isIncrementalCompilation(options) || !!options.tscBuild;
|
|
118030
|
+
}
|
|
117906
118031
|
function getOutputPathsForBundle(options, forceDtsPaths) {
|
|
117907
118032
|
const outPath = options.outFile;
|
|
117908
118033
|
const jsFilePath = options.emitDeclarationOnly ? void 0 : outPath;
|
|
@@ -118139,7 +118264,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
118139
118264
|
}
|
|
118140
118265
|
(isSourceFile(sourceFileOrBundle) ? [sourceFileOrBundle] : filter(sourceFileOrBundle.sourceFiles, isSourceFileNotJson)).forEach(
|
|
118141
118266
|
(sourceFile) => {
|
|
118142
|
-
if (compilerOptions.noCheck || !
|
|
118267
|
+
if (compilerOptions.noCheck || !canIncludeBindAndCheckDiagnostics(sourceFile, compilerOptions)) markLinkedReferences(sourceFile);
|
|
118143
118268
|
}
|
|
118144
118269
|
);
|
|
118145
118270
|
const transform2 = transformNodes(
|
|
@@ -118157,7 +118282,6 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
118157
118282
|
newLine: compilerOptions.newLine,
|
|
118158
118283
|
noEmitHelpers: compilerOptions.noEmitHelpers,
|
|
118159
118284
|
module: getEmitModuleKind(compilerOptions),
|
|
118160
|
-
moduleResolution: getEmitModuleResolutionKind(compilerOptions),
|
|
118161
118285
|
target: getEmitScriptTarget(compilerOptions),
|
|
118162
118286
|
sourceMap: compilerOptions.sourceMap,
|
|
118163
118287
|
inlineSourceMap: compilerOptions.inlineSourceMap,
|
|
@@ -118192,7 +118316,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
118192
118316
|
const filesForEmit = forceDtsEmit ? sourceFiles : filter(sourceFiles, isSourceFileNotJson);
|
|
118193
118317
|
const inputListOrBundle = compilerOptions.outFile ? [factory.createBundle(filesForEmit)] : filesForEmit;
|
|
118194
118318
|
filesForEmit.forEach((sourceFile) => {
|
|
118195
|
-
if (emitOnly && !getEmitDeclarations(compilerOptions) || compilerOptions.noCheck || emitResolverSkipsTypeChecking(emitOnly, forceDtsEmit) || !
|
|
118319
|
+
if (emitOnly && !getEmitDeclarations(compilerOptions) || compilerOptions.noCheck || emitResolverSkipsTypeChecking(emitOnly, forceDtsEmit) || !canIncludeBindAndCheckDiagnostics(sourceFile, compilerOptions)) {
|
|
118196
118320
|
collectLinkedAliases(sourceFile);
|
|
118197
118321
|
}
|
|
118198
118322
|
});
|
|
@@ -118220,7 +118344,6 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
118220
118344
|
newLine: compilerOptions.newLine,
|
|
118221
118345
|
noEmitHelpers: true,
|
|
118222
118346
|
module: compilerOptions.module,
|
|
118223
|
-
moduleResolution: compilerOptions.moduleResolution,
|
|
118224
118347
|
target: compilerOptions.target,
|
|
118225
118348
|
sourceMap: !forceDtsEmit && compilerOptions.declarationMap,
|
|
118226
118349
|
inlineSourceMap: compilerOptions.inlineSourceMap,
|
|
@@ -118236,7 +118359,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
118236
118359
|
isEmitNotificationEnabled: declarationTransform.isEmitNotificationEnabled,
|
|
118237
118360
|
substituteNode: declarationTransform.substituteNode
|
|
118238
118361
|
});
|
|
118239
|
-
printSourceFileOrBundle(
|
|
118362
|
+
const dtsWritten = printSourceFileOrBundle(
|
|
118240
118363
|
declarationFilePath,
|
|
118241
118364
|
declarationMapPath,
|
|
118242
118365
|
declarationTransform,
|
|
@@ -118250,7 +118373,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
118250
118373
|
}
|
|
118251
118374
|
);
|
|
118252
118375
|
if (emittedFilesList) {
|
|
118253
|
-
emittedFilesList.push(declarationFilePath);
|
|
118376
|
+
if (dtsWritten) emittedFilesList.push(declarationFilePath);
|
|
118254
118377
|
if (declarationMapPath) {
|
|
118255
118378
|
emittedFilesList.push(declarationMapPath);
|
|
118256
118379
|
}
|
|
@@ -118341,8 +118464,10 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
118341
118464
|
writer.writeLine();
|
|
118342
118465
|
}
|
|
118343
118466
|
const text = writer.getText();
|
|
118344
|
-
|
|
118467
|
+
const data = { sourceMapUrlPos, diagnostics: transform2.diagnostics };
|
|
118468
|
+
writeFile(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, data);
|
|
118345
118469
|
writer.clear();
|
|
118470
|
+
return !data.skippedDtsWrite;
|
|
118346
118471
|
}
|
|
118347
118472
|
function shouldEmitSourceMaps(mapOptions, sourceFileOrBundle) {
|
|
118348
118473
|
return (mapOptions.sourceMap || mapOptions.inlineSourceMap) && (sourceFileOrBundle.kind !== 307 /* SourceFile */ || !fileExtensionIs(sourceFileOrBundle.fileName, ".json" /* Json */));
|
|
@@ -123729,6 +123854,7 @@ function getModeForUsageLocation(file, usage, compilerOptions) {
|
|
|
123729
123854
|
return getModeForUsageLocationWorker(file, usage, compilerOptions);
|
|
123730
123855
|
}
|
|
123731
123856
|
function getModeForUsageLocationWorker(file, usage, compilerOptions) {
|
|
123857
|
+
var _a;
|
|
123732
123858
|
if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent)) {
|
|
123733
123859
|
const isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent);
|
|
123734
123860
|
if (isTypeOnly) {
|
|
@@ -123744,28 +123870,19 @@ function getModeForUsageLocationWorker(file, usage, compilerOptions) {
|
|
|
123744
123870
|
return override;
|
|
123745
123871
|
}
|
|
123746
123872
|
}
|
|
123747
|
-
if (compilerOptions &&
|
|
123748
|
-
return
|
|
123873
|
+
if (compilerOptions && getEmitModuleKind(compilerOptions) === 200 /* Preserve */) {
|
|
123874
|
+
return usage.parent.parent && isImportEqualsDeclaration(usage.parent.parent) || isRequireCall(
|
|
123875
|
+
usage.parent,
|
|
123876
|
+
/*requireStringLiteralLikeArgument*/
|
|
123877
|
+
false
|
|
123878
|
+
) ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
123749
123879
|
}
|
|
123750
|
-
|
|
123751
|
-
|
|
123752
|
-
|
|
123753
|
-
if (!compilerOptions) {
|
|
123754
|
-
return void 0;
|
|
123880
|
+
if (file.impliedNodeFormat === void 0) return void 0;
|
|
123881
|
+
if (file.impliedNodeFormat !== 99 /* ESNext */) {
|
|
123882
|
+
return isImportCall(walkUpParenthesizedExpressions(usage.parent)) ? 99 /* ESNext */ : 1 /* CommonJS */;
|
|
123755
123883
|
}
|
|
123756
123884
|
const exprParentParent = (_a = walkUpParenthesizedExpressions(usage.parent)) == null ? void 0 : _a.parent;
|
|
123757
|
-
|
|
123758
|
-
usage.parent,
|
|
123759
|
-
/*requireStringLiteralLikeArgument*/
|
|
123760
|
-
false
|
|
123761
|
-
)) {
|
|
123762
|
-
return 1 /* CommonJS */;
|
|
123763
|
-
}
|
|
123764
|
-
if (isImportCall(walkUpParenthesizedExpressions(usage.parent))) {
|
|
123765
|
-
return shouldTransformImportCallWorker(file, compilerOptions) ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
123766
|
-
}
|
|
123767
|
-
const fileEmitMode = getEmitModuleFormatOfFileWorker(file, compilerOptions);
|
|
123768
|
-
return fileEmitMode === 1 /* CommonJS */ ? 1 /* CommonJS */ : emitModuleKindIsNonNodeESM(fileEmitMode) || fileEmitMode === 200 /* Preserve */ ? 99 /* ESNext */ : void 0;
|
|
123885
|
+
return exprParentParent && isImportEqualsDeclaration(exprParentParent) ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
123769
123886
|
}
|
|
123770
123887
|
function getResolutionModeOverride(node, grammarErrorOnNode) {
|
|
123771
123888
|
if (!node) return void 0;
|
|
@@ -123822,7 +123939,7 @@ function getTypeReferenceResolutionName(entry) {
|
|
|
123822
123939
|
}
|
|
123823
123940
|
var typeReferenceResolutionNameAndModeGetter = {
|
|
123824
123941
|
getName: getTypeReferenceResolutionName,
|
|
123825
|
-
getMode: (entry, file
|
|
123942
|
+
getMode: (entry, file) => getModeForFileReference(entry, file == null ? void 0 : file.impliedNodeFormat)
|
|
123826
123943
|
};
|
|
123827
123944
|
function createTypeReferenceResolutionLoader(containingFile, redirectedReference, options, host, cache) {
|
|
123828
123945
|
return {
|
|
@@ -123996,7 +124113,13 @@ function getImpliedNodeFormatForFile(fileName, packageJsonInfoCache, host, optio
|
|
|
123996
124113
|
return typeof result === "object" ? result.impliedNodeFormat : result;
|
|
123997
124114
|
}
|
|
123998
124115
|
function getImpliedNodeFormatForFileWorker(fileName, packageJsonInfoCache, host, options) {
|
|
123999
|
-
|
|
124116
|
+
switch (getEmitModuleResolutionKind(options)) {
|
|
124117
|
+
case 3 /* Node16 */:
|
|
124118
|
+
case 99 /* NodeNext */:
|
|
124119
|
+
return fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".mjs" /* Mjs */]) ? 99 /* ESNext */ : fileExtensionIsOneOf(fileName, [".d.cts" /* Dcts */, ".cts" /* Cts */, ".cjs" /* Cjs */]) ? 1 /* CommonJS */ : fileExtensionIsOneOf(fileName, [".d.ts" /* Dts */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".js" /* Js */, ".jsx" /* Jsx */]) ? lookupFromPackageJson() : void 0;
|
|
124120
|
+
default:
|
|
124121
|
+
return void 0;
|
|
124122
|
+
}
|
|
124000
124123
|
function lookupFromPackageJson() {
|
|
124001
124124
|
const state = getTemporaryModuleResolutionState(packageJsonInfoCache, host, options);
|
|
124002
124125
|
const packageJsonLocations = [];
|
|
@@ -124455,7 +124578,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
124455
124578
|
isSourceFileFromExternalLibrary,
|
|
124456
124579
|
isSourceFileDefaultLibrary,
|
|
124457
124580
|
getModeForUsageLocation: getModeForUsageLocation2,
|
|
124458
|
-
getEmitSyntaxForUsageLocation,
|
|
124459
124581
|
getModeForResolutionAtIndex: getModeForResolutionAtIndex2,
|
|
124460
124582
|
getSourceFileFromReference,
|
|
124461
124583
|
getLibFileFromReference,
|
|
@@ -124484,11 +124606,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
124484
124606
|
forEachResolvedProjectReference: forEachResolvedProjectReference2,
|
|
124485
124607
|
isSourceOfProjectReferenceRedirect,
|
|
124486
124608
|
getRedirectReferenceForResolutionFromSourceOfProject,
|
|
124487
|
-
getCompilerOptionsForFile,
|
|
124488
|
-
getDefaultResolutionModeForFile: getDefaultResolutionModeForFile2,
|
|
124489
|
-
getEmitModuleFormatOfFile: getEmitModuleFormatOfFile2,
|
|
124490
|
-
getImpliedNodeFormatForEmit: getImpliedNodeFormatForEmit2,
|
|
124491
|
-
shouldTransformImportCall,
|
|
124492
124609
|
emitBuildInfo,
|
|
124493
124610
|
fileExists,
|
|
124494
124611
|
readFile,
|
|
@@ -125071,10 +125188,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
125071
125188
|
getSymlinkCache,
|
|
125072
125189
|
writeFile: writeFileCallback || writeFile2,
|
|
125073
125190
|
isEmitBlocked,
|
|
125074
|
-
shouldTransformImportCall,
|
|
125075
|
-
getEmitModuleFormatOfFile: getEmitModuleFormatOfFile2,
|
|
125076
|
-
getDefaultResolutionModeForFile: getDefaultResolutionModeForFile2,
|
|
125077
|
-
getModeForResolutionAtIndex: getModeForResolutionAtIndex2,
|
|
125078
125191
|
readFile: (f) => host.readFile(f),
|
|
125079
125192
|
fileExists: (f) => {
|
|
125080
125193
|
const path = toPath3(f);
|
|
@@ -125232,15 +125345,24 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
125232
125345
|
function getSyntacticDiagnostics(sourceFile, cancellationToken) {
|
|
125233
125346
|
return getDiagnosticsHelper(sourceFile, getSyntacticDiagnosticsForFile, cancellationToken);
|
|
125234
125347
|
}
|
|
125235
|
-
function getSemanticDiagnostics(sourceFile, cancellationToken) {
|
|
125236
|
-
return getDiagnosticsHelper(
|
|
125348
|
+
function getSemanticDiagnostics(sourceFile, cancellationToken, nodesToCheck) {
|
|
125349
|
+
return getDiagnosticsHelper(
|
|
125350
|
+
sourceFile,
|
|
125351
|
+
(sourceFile2, cancellationToken2) => getSemanticDiagnosticsForFile(sourceFile2, cancellationToken2, nodesToCheck),
|
|
125352
|
+
cancellationToken
|
|
125353
|
+
);
|
|
125237
125354
|
}
|
|
125238
125355
|
function getCachedSemanticDiagnostics(sourceFile) {
|
|
125239
125356
|
var _a2;
|
|
125240
125357
|
return sourceFile ? (_a2 = cachedBindAndCheckDiagnosticsForFile.perFile) == null ? void 0 : _a2.get(sourceFile.path) : cachedBindAndCheckDiagnosticsForFile.allDiagnostics;
|
|
125241
125358
|
}
|
|
125242
125359
|
function getBindAndCheckDiagnostics(sourceFile, cancellationToken) {
|
|
125243
|
-
return getBindAndCheckDiagnosticsForFile(
|
|
125360
|
+
return getBindAndCheckDiagnosticsForFile(
|
|
125361
|
+
sourceFile,
|
|
125362
|
+
cancellationToken,
|
|
125363
|
+
/*nodesToCheck*/
|
|
125364
|
+
void 0
|
|
125365
|
+
);
|
|
125244
125366
|
}
|
|
125245
125367
|
function getProgramDiagnostics(sourceFile) {
|
|
125246
125368
|
var _a2;
|
|
@@ -125280,16 +125402,19 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
125280
125402
|
throw e;
|
|
125281
125403
|
}
|
|
125282
125404
|
}
|
|
125283
|
-
function getSemanticDiagnosticsForFile(sourceFile, cancellationToken) {
|
|
125405
|
+
function getSemanticDiagnosticsForFile(sourceFile, cancellationToken, nodesToCheck) {
|
|
125284
125406
|
return concatenate(
|
|
125285
|
-
filterSemanticDiagnostics(getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken), options),
|
|
125407
|
+
filterSemanticDiagnostics(getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken, nodesToCheck), options),
|
|
125286
125408
|
getProgramDiagnostics(sourceFile)
|
|
125287
125409
|
);
|
|
125288
125410
|
}
|
|
125289
|
-
function getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken) {
|
|
125411
|
+
function getBindAndCheckDiagnosticsForFile(sourceFile, cancellationToken, nodesToCheck) {
|
|
125412
|
+
if (nodesToCheck) {
|
|
125413
|
+
return getBindAndCheckDiagnosticsForFileNoCache(sourceFile, cancellationToken, nodesToCheck);
|
|
125414
|
+
}
|
|
125290
125415
|
return getAndCacheDiagnostics(sourceFile, cancellationToken, cachedBindAndCheckDiagnosticsForFile, getBindAndCheckDiagnosticsForFileNoCache);
|
|
125291
125416
|
}
|
|
125292
|
-
function getBindAndCheckDiagnosticsForFileNoCache(sourceFile, cancellationToken) {
|
|
125417
|
+
function getBindAndCheckDiagnosticsForFileNoCache(sourceFile, cancellationToken, nodesToCheck) {
|
|
125293
125418
|
return runWithCancellationToken(() => {
|
|
125294
125419
|
if (skipTypeChecking(sourceFile, options, program)) {
|
|
125295
125420
|
return emptyArray;
|
|
@@ -125297,24 +125422,34 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
125297
125422
|
const typeChecker2 = getTypeChecker();
|
|
125298
125423
|
Debug.assert(!!sourceFile.bindDiagnostics);
|
|
125299
125424
|
const isJs = sourceFile.scriptKind === 1 /* JS */ || sourceFile.scriptKind === 2 /* JSX */;
|
|
125300
|
-
const isCheckJs = isJs && isCheckJsEnabledForFile(sourceFile, options);
|
|
125301
125425
|
const isPlainJs = isPlainJsFile(sourceFile, options.checkJs);
|
|
125426
|
+
const isCheckJs = isJs && isCheckJsEnabledForFile(sourceFile, options);
|
|
125302
125427
|
let bindDiagnostics = sourceFile.bindDiagnostics;
|
|
125303
|
-
let checkDiagnostics = typeChecker2.getDiagnostics(sourceFile, cancellationToken);
|
|
125428
|
+
let checkDiagnostics = typeChecker2.getDiagnostics(sourceFile, cancellationToken, nodesToCheck);
|
|
125304
125429
|
if (isPlainJs) {
|
|
125305
125430
|
bindDiagnostics = filter(bindDiagnostics, (d) => plainJSErrors.has(d.code));
|
|
125306
125431
|
checkDiagnostics = filter(checkDiagnostics, (d) => plainJSErrors.has(d.code));
|
|
125307
125432
|
}
|
|
125308
|
-
return getMergedBindAndCheckDiagnostics(
|
|
125433
|
+
return getMergedBindAndCheckDiagnostics(
|
|
125434
|
+
sourceFile,
|
|
125435
|
+
!isPlainJs,
|
|
125436
|
+
!!nodesToCheck,
|
|
125437
|
+
bindDiagnostics,
|
|
125438
|
+
checkDiagnostics,
|
|
125439
|
+
isCheckJs ? sourceFile.jsDocDiagnostics : void 0
|
|
125440
|
+
);
|
|
125309
125441
|
});
|
|
125310
125442
|
}
|
|
125311
|
-
function getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics, ...allDiagnostics) {
|
|
125443
|
+
function getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics, partialCheck, ...allDiagnostics) {
|
|
125312
125444
|
var _a2;
|
|
125313
125445
|
const flatDiagnostics = flatten(allDiagnostics);
|
|
125314
125446
|
if (!includeBindAndCheckDiagnostics || !((_a2 = sourceFile.commentDirectives) == null ? void 0 : _a2.length)) {
|
|
125315
125447
|
return flatDiagnostics;
|
|
125316
125448
|
}
|
|
125317
125449
|
const { diagnostics, directives } = getDiagnosticsWithPrecedingDirectives(sourceFile, sourceFile.commentDirectives, flatDiagnostics);
|
|
125450
|
+
if (partialCheck) {
|
|
125451
|
+
return diagnostics;
|
|
125452
|
+
}
|
|
125318
125453
|
for (const errorExpectation of directives.getUnusedExpectations()) {
|
|
125319
125454
|
diagnostics.push(createDiagnosticForRange(sourceFile, errorExpectation.range, Diagnostics.Unused_ts_expect_error_directive));
|
|
125320
125455
|
}
|
|
@@ -126135,14 +126270,10 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
126135
126270
|
const resolvedTypeReferenceDirective = resolutions[index];
|
|
126136
126271
|
const fileName = ref.fileName;
|
|
126137
126272
|
resolutionsInFile.set(fileName, getModeForFileReference(ref, file.impliedNodeFormat), resolvedTypeReferenceDirective);
|
|
126138
|
-
const mode = ref.resolutionMode ||
|
|
126273
|
+
const mode = ref.resolutionMode || file.impliedNodeFormat;
|
|
126139
126274
|
processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: 5 /* TypeReferenceDirective */, file: file.path, index });
|
|
126140
126275
|
}
|
|
126141
126276
|
}
|
|
126142
|
-
function getCompilerOptionsForFile(file) {
|
|
126143
|
-
var _a2;
|
|
126144
|
-
return ((_a2 = getRedirectReferenceForResolution(file)) == null ? void 0 : _a2.commandLine.options) || options;
|
|
126145
|
-
}
|
|
126146
126277
|
function processTypeReferenceDirective(typeReferenceDirective, mode, resolution, reason) {
|
|
126147
126278
|
var _a2, _b2;
|
|
126148
126279
|
(_a2 = tracing) == null ? void 0 : _a2.push(tracing.Phase.Program, "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!resolution.resolvedTypeReferenceDirective, refKind: reason.kind, refPath: isReferencedFile(reason) ? reason.file : void 0 });
|
|
@@ -126243,12 +126374,13 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
126243
126374
|
return host.getCanonicalFileName(fileName);
|
|
126244
126375
|
}
|
|
126245
126376
|
function processImportedModules(file) {
|
|
126377
|
+
var _a2;
|
|
126246
126378
|
collectExternalModuleReferences(file);
|
|
126247
126379
|
if (file.imports.length || file.moduleAugmentations.length) {
|
|
126248
126380
|
const moduleNames = getModuleNames(file);
|
|
126249
126381
|
const resolutions = (resolvedModulesProcessing == null ? void 0 : resolvedModulesProcessing.get(file.path)) || resolveModuleNamesReusingOldState(moduleNames, file);
|
|
126250
126382
|
Debug.assert(resolutions.length === moduleNames.length);
|
|
126251
|
-
const optionsForFile =
|
|
126383
|
+
const optionsForFile = ((_a2 = getRedirectReferenceForResolution(file)) == null ? void 0 : _a2.commandLine.options) || options;
|
|
126252
126384
|
const resolutionsInFile = createModeAwareCache();
|
|
126253
126385
|
(resolvedModules ?? (resolvedModules = /* @__PURE__ */ new Map())).set(file.path, resolutionsInFile);
|
|
126254
126386
|
for (let index = 0; index < moduleNames.length; index++) {
|
|
@@ -126413,8 +126545,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
126413
126545
|
}
|
|
126414
126546
|
const outputFile = options.outFile;
|
|
126415
126547
|
if (options.tsBuildInfoFile) {
|
|
126416
|
-
if (!
|
|
126417
|
-
createDiagnosticForOptionName(Diagnostics.
|
|
126548
|
+
if (!canEmitTsBuildInfo(options)) {
|
|
126549
|
+
createDiagnosticForOptionName(Diagnostics.Option_tsBuildInfoFile_cannot_be_specified_without_specifying_option_incremental_or_composite_or_if_not_running_tsc_b, "tsBuildInfoFile");
|
|
126418
126550
|
}
|
|
126419
126551
|
} else if (options.incremental && !outputFile && !options.configFilePath) {
|
|
126420
126552
|
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified));
|
|
@@ -126804,7 +126936,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
126804
126936
|
redirectInfo = cachedChain.redirectInfo;
|
|
126805
126937
|
} else {
|
|
126806
126938
|
reasons == null ? void 0 : reasons.forEach(processReason);
|
|
126807
|
-
redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file
|
|
126939
|
+
redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file);
|
|
126808
126940
|
}
|
|
126809
126941
|
if (fileProcessingReason) processReason(fileProcessingReason);
|
|
126810
126942
|
const processedExtraReason = (seenReasons == null ? void 0 : seenReasons.size) !== (reasons == null ? void 0 : reasons.length);
|
|
@@ -127162,53 +127294,13 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
127162
127294
|
return symlinks;
|
|
127163
127295
|
}
|
|
127164
127296
|
function getModeForUsageLocation2(file, usage) {
|
|
127165
|
-
|
|
127166
|
-
|
|
127167
|
-
|
|
127168
|
-
return getEmitSyntaxForUsageLocationWorker(file, usage, getCompilerOptionsForFile(file));
|
|
127297
|
+
var _a2;
|
|
127298
|
+
const optionsForFile = ((_a2 = getRedirectReferenceForResolution(file)) == null ? void 0 : _a2.commandLine.options) || options;
|
|
127299
|
+
return getModeForUsageLocationWorker(file, usage, optionsForFile);
|
|
127169
127300
|
}
|
|
127170
127301
|
function getModeForResolutionAtIndex2(file, index) {
|
|
127171
127302
|
return getModeForUsageLocation2(file, getModuleNameStringLiteralAt(file, index));
|
|
127172
127303
|
}
|
|
127173
|
-
function getDefaultResolutionModeForFile2(sourceFile) {
|
|
127174
|
-
return getDefaultResolutionModeForFileWorker(sourceFile, getCompilerOptionsForFile(sourceFile));
|
|
127175
|
-
}
|
|
127176
|
-
function getImpliedNodeFormatForEmit2(sourceFile) {
|
|
127177
|
-
return getImpliedNodeFormatForEmitWorker(sourceFile, getCompilerOptionsForFile(sourceFile));
|
|
127178
|
-
}
|
|
127179
|
-
function getEmitModuleFormatOfFile2(sourceFile) {
|
|
127180
|
-
return getEmitModuleFormatOfFileWorker(sourceFile, getCompilerOptionsForFile(sourceFile));
|
|
127181
|
-
}
|
|
127182
|
-
function shouldTransformImportCall(sourceFile) {
|
|
127183
|
-
return shouldTransformImportCallWorker(sourceFile, getCompilerOptionsForFile(sourceFile));
|
|
127184
|
-
}
|
|
127185
|
-
}
|
|
127186
|
-
function shouldTransformImportCallWorker(sourceFile, options) {
|
|
127187
|
-
const moduleKind = getEmitModuleKind(options);
|
|
127188
|
-
if (100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */ || moduleKind === 200 /* Preserve */) {
|
|
127189
|
-
return false;
|
|
127190
|
-
}
|
|
127191
|
-
return getEmitModuleFormatOfFileWorker(sourceFile, options) < 5 /* ES2015 */;
|
|
127192
|
-
}
|
|
127193
|
-
function getEmitModuleFormatOfFileWorker(sourceFile, options) {
|
|
127194
|
-
return getImpliedNodeFormatForEmitWorker(sourceFile, options) ?? getEmitModuleKind(options);
|
|
127195
|
-
}
|
|
127196
|
-
function getImpliedNodeFormatForEmitWorker(sourceFile, options) {
|
|
127197
|
-
var _a, _b;
|
|
127198
|
-
const moduleKind = getEmitModuleKind(options);
|
|
127199
|
-
if (100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */) {
|
|
127200
|
-
return sourceFile.impliedNodeFormat;
|
|
127201
|
-
}
|
|
127202
|
-
if (sourceFile.impliedNodeFormat === 1 /* CommonJS */ && (((_a = sourceFile.packageJsonScope) == null ? void 0 : _a.contents.packageJsonContent.type) === "commonjs" || fileExtensionIsOneOf(sourceFile.fileName, [".cjs" /* Cjs */, ".cts" /* Cts */]))) {
|
|
127203
|
-
return 1 /* CommonJS */;
|
|
127204
|
-
}
|
|
127205
|
-
if (sourceFile.impliedNodeFormat === 99 /* ESNext */ && (((_b = sourceFile.packageJsonScope) == null ? void 0 : _b.contents.packageJsonContent.type) === "module" || fileExtensionIsOneOf(sourceFile.fileName, [".mjs" /* Mjs */, ".mts" /* Mts */]))) {
|
|
127206
|
-
return 99 /* ESNext */;
|
|
127207
|
-
}
|
|
127208
|
-
return void 0;
|
|
127209
|
-
}
|
|
127210
|
-
function getDefaultResolutionModeForFileWorker(sourceFile, options) {
|
|
127211
|
-
return importSyntaxAffectsModuleResolution(options) ? getImpliedNodeFormatForEmitWorker(sourceFile, options) : void 0;
|
|
127212
127304
|
}
|
|
127213
127305
|
function updateHostForUseSourceOfProjectReferenceRedirect(host) {
|
|
127214
127306
|
let setOfDeclarationDirectories;
|
|
@@ -127892,8 +127984,9 @@ function createBuilderProgramState(newProgram, oldState) {
|
|
|
127892
127984
|
canCopySemanticDiagnostics = false;
|
|
127893
127985
|
canCopyEmitDiagnostics = false;
|
|
127894
127986
|
}
|
|
127987
|
+
state.hasErrorsFromOldState = oldState.hasErrors;
|
|
127895
127988
|
} else {
|
|
127896
|
-
state.buildInfoEmitPending =
|
|
127989
|
+
state.buildInfoEmitPending = isIncrementalCompilation(compilerOptions);
|
|
127897
127990
|
}
|
|
127898
127991
|
const referencedMap = state.referencedMap;
|
|
127899
127992
|
const oldReferencedMap = useOldState ? oldState.referencedMap : void 0;
|
|
@@ -128051,40 +128144,6 @@ function releaseCache(state) {
|
|
|
128051
128144
|
BuilderState.releaseCache(state);
|
|
128052
128145
|
state.program = void 0;
|
|
128053
128146
|
}
|
|
128054
|
-
function backupBuilderProgramEmitState(state) {
|
|
128055
|
-
const outFilePath = state.compilerOptions.outFile;
|
|
128056
|
-
Debug.assert(!state.changedFilesSet.size || outFilePath);
|
|
128057
|
-
return {
|
|
128058
|
-
affectedFilesPendingEmit: state.affectedFilesPendingEmit && new Map(state.affectedFilesPendingEmit),
|
|
128059
|
-
seenEmittedFiles: state.seenEmittedFiles && new Map(state.seenEmittedFiles),
|
|
128060
|
-
seenProgramEmit: state.seenProgramEmit,
|
|
128061
|
-
programEmitPending: state.programEmitPending,
|
|
128062
|
-
emitSignatures: state.emitSignatures && new Map(state.emitSignatures),
|
|
128063
|
-
outSignature: state.outSignature,
|
|
128064
|
-
latestChangedDtsFile: state.latestChangedDtsFile,
|
|
128065
|
-
hasChangedEmitSignature: state.hasChangedEmitSignature,
|
|
128066
|
-
changedFilesSet: outFilePath ? new Set(state.changedFilesSet) : void 0,
|
|
128067
|
-
buildInfoEmitPending: state.buildInfoEmitPending,
|
|
128068
|
-
emitDiagnosticsPerFile: state.emitDiagnosticsPerFile && new Map(state.emitDiagnosticsPerFile)
|
|
128069
|
-
};
|
|
128070
|
-
}
|
|
128071
|
-
function restoreBuilderProgramEmitState(state, savedEmitState) {
|
|
128072
|
-
state.affectedFilesPendingEmit = savedEmitState.affectedFilesPendingEmit;
|
|
128073
|
-
state.seenEmittedFiles = savedEmitState.seenEmittedFiles;
|
|
128074
|
-
state.seenProgramEmit = savedEmitState.seenProgramEmit;
|
|
128075
|
-
state.programEmitPending = savedEmitState.programEmitPending;
|
|
128076
|
-
state.emitSignatures = savedEmitState.emitSignatures;
|
|
128077
|
-
state.outSignature = savedEmitState.outSignature;
|
|
128078
|
-
state.latestChangedDtsFile = savedEmitState.latestChangedDtsFile;
|
|
128079
|
-
state.hasChangedEmitSignature = savedEmitState.hasChangedEmitSignature;
|
|
128080
|
-
state.buildInfoEmitPending = savedEmitState.buildInfoEmitPending;
|
|
128081
|
-
state.emitDiagnosticsPerFile = savedEmitState.emitDiagnosticsPerFile;
|
|
128082
|
-
if (savedEmitState.changedFilesSet) state.changedFilesSet = savedEmitState.changedFilesSet;
|
|
128083
|
-
if (state.compilerOptions.outFile && state.changedFilesSet.size) {
|
|
128084
|
-
state.semanticDiagnosticsPerFile.clear();
|
|
128085
|
-
state.emitDiagnosticsPerFile = void 0;
|
|
128086
|
-
}
|
|
128087
|
-
}
|
|
128088
128147
|
function assertSourceFileOkWithoutNextAffectedCall(state, sourceFile) {
|
|
128089
128148
|
Debug.assert(!sourceFile || !state.affectedFiles || state.affectedFiles[state.affectedFilesIndex - 1] !== sourceFile || !state.semanticDiagnosticsPerFile.has(sourceFile.resolvedPath));
|
|
128090
128149
|
}
|
|
@@ -128366,6 +128425,7 @@ function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationTok
|
|
|
128366
128425
|
}
|
|
128367
128426
|
const diagnostics = state.program.getBindAndCheckDiagnostics(sourceFile, cancellationToken);
|
|
128368
128427
|
semanticDiagnosticsPerFile.set(path, diagnostics);
|
|
128428
|
+
state.buildInfoEmitPending = true;
|
|
128369
128429
|
return filterSemanticDiagnostics(diagnostics, state.compilerOptions);
|
|
128370
128430
|
}
|
|
128371
128431
|
function isIncrementalBundleEmitBuildInfo(info) {
|
|
@@ -128375,6 +128435,35 @@ function isIncrementalBundleEmitBuildInfo(info) {
|
|
|
128375
128435
|
function isIncrementalBuildInfo(info) {
|
|
128376
128436
|
return !!info.fileNames;
|
|
128377
128437
|
}
|
|
128438
|
+
function isNonIncrementalBuildInfo(info) {
|
|
128439
|
+
return !isIncrementalBuildInfo(info) && !!info.root;
|
|
128440
|
+
}
|
|
128441
|
+
function ensureHasErrorsForState(state) {
|
|
128442
|
+
if (state.hasErrors !== void 0) return;
|
|
128443
|
+
if (isIncrementalCompilation(state.compilerOptions)) {
|
|
128444
|
+
state.hasErrors = !some(state.program.getSourceFiles(), (f) => {
|
|
128445
|
+
var _a, _b;
|
|
128446
|
+
const bindAndCheckDiagnostics = state.semanticDiagnosticsPerFile.get(f.resolvedPath);
|
|
128447
|
+
return bindAndCheckDiagnostics === void 0 || // Missing semantic diagnostics in cache will be encoded in buildInfo
|
|
128448
|
+
!!bindAndCheckDiagnostics.length || // cached semantic diagnostics will be encoded in buildInfo
|
|
128449
|
+
!!((_b = (_a = state.emitDiagnosticsPerFile) == null ? void 0 : _a.get(f.resolvedPath)) == null ? void 0 : _b.length);
|
|
128450
|
+
}) && (hasSyntaxOrGlobalErrors(state) || some(state.program.getSourceFiles(), (f) => !!state.program.getProgramDiagnostics(f).length));
|
|
128451
|
+
} else {
|
|
128452
|
+
state.hasErrors = some(state.program.getSourceFiles(), (f) => {
|
|
128453
|
+
var _a, _b;
|
|
128454
|
+
const bindAndCheckDiagnostics = state.semanticDiagnosticsPerFile.get(f.resolvedPath);
|
|
128455
|
+
return !!(bindAndCheckDiagnostics == null ? void 0 : bindAndCheckDiagnostics.length) || // If has semantic diagnostics
|
|
128456
|
+
!!((_b = (_a = state.emitDiagnosticsPerFile) == null ? void 0 : _a.get(f.resolvedPath)) == null ? void 0 : _b.length);
|
|
128457
|
+
}) || hasSyntaxOrGlobalErrors(state);
|
|
128458
|
+
}
|
|
128459
|
+
}
|
|
128460
|
+
function hasSyntaxOrGlobalErrors(state) {
|
|
128461
|
+
return !!state.program.getConfigFileParsingDiagnostics().length || !!state.program.getSyntacticDiagnostics().length || !!state.program.getOptionsDiagnostics().length || !!state.program.getGlobalDiagnostics().length;
|
|
128462
|
+
}
|
|
128463
|
+
function getBuildInfoEmitPending(state) {
|
|
128464
|
+
ensureHasErrorsForState(state);
|
|
128465
|
+
return state.buildInfoEmitPending ?? (state.buildInfoEmitPending = !!state.hasErrorsFromOldState !== !!state.hasErrors);
|
|
128466
|
+
}
|
|
128378
128467
|
function getBuildInfo2(state) {
|
|
128379
128468
|
var _a, _b;
|
|
128380
128469
|
const currentDirectory = state.program.getCurrentDirectory();
|
|
@@ -128383,6 +128472,15 @@ function getBuildInfo2(state) {
|
|
|
128383
128472
|
const fileNames = [];
|
|
128384
128473
|
const fileNameToFileId = /* @__PURE__ */ new Map();
|
|
128385
128474
|
const rootFileNames = new Set(state.program.getRootFileNames().map((f) => toPath(f, currentDirectory, state.program.getCanonicalFileName)));
|
|
128475
|
+
ensureHasErrorsForState(state);
|
|
128476
|
+
if (!isIncrementalCompilation(state.compilerOptions)) {
|
|
128477
|
+
const buildInfo2 = {
|
|
128478
|
+
root: arrayFrom(rootFileNames, (r) => relativeToBuildInfo(r)),
|
|
128479
|
+
errors: state.hasErrors ? true : void 0,
|
|
128480
|
+
version
|
|
128481
|
+
};
|
|
128482
|
+
return buildInfo2;
|
|
128483
|
+
}
|
|
128386
128484
|
const root = [];
|
|
128387
128485
|
if (state.compilerOptions.outFile) {
|
|
128388
128486
|
const fileInfos2 = arrayFrom(state.fileInfos.entries(), ([key, value]) => {
|
|
@@ -128390,7 +128488,7 @@ function getBuildInfo2(state) {
|
|
|
128390
128488
|
tryAddRoot(key, fileId);
|
|
128391
128489
|
return value.impliedFormat ? { version: value.version, impliedFormat: value.impliedFormat, signature: void 0, affectsGlobalScope: void 0 } : value.version;
|
|
128392
128490
|
});
|
|
128393
|
-
|
|
128491
|
+
const buildInfo2 = {
|
|
128394
128492
|
fileNames,
|
|
128395
128493
|
fileInfos: fileInfos2,
|
|
128396
128494
|
root,
|
|
@@ -128398,7 +128496,6 @@ function getBuildInfo2(state) {
|
|
|
128398
128496
|
options: toIncrementalBuildInfoCompilerOptions(state.compilerOptions),
|
|
128399
128497
|
semanticDiagnosticsPerFile: toIncrementalBuildInfoDiagnostics(),
|
|
128400
128498
|
emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(),
|
|
128401
|
-
changeFileSet: toChangeFileSet(),
|
|
128402
128499
|
outSignature: state.outSignature,
|
|
128403
128500
|
latestChangedDtsFile,
|
|
128404
128501
|
pendingEmit: !state.programEmitPending ? void 0 : (
|
|
@@ -128409,8 +128506,10 @@ function getBuildInfo2(state) {
|
|
|
128409
128506
|
)
|
|
128410
128507
|
),
|
|
128411
128508
|
// Actual value
|
|
128509
|
+
errors: state.hasErrors ? true : void 0,
|
|
128412
128510
|
version
|
|
128413
128511
|
};
|
|
128512
|
+
return buildInfo2;
|
|
128414
128513
|
}
|
|
128415
128514
|
let fileIdsList;
|
|
128416
128515
|
let fileNamesToFileIdListId;
|
|
@@ -128489,7 +128588,7 @@ function getBuildInfo2(state) {
|
|
|
128489
128588
|
}
|
|
128490
128589
|
}
|
|
128491
128590
|
}
|
|
128492
|
-
|
|
128591
|
+
const buildInfo = {
|
|
128493
128592
|
fileNames,
|
|
128494
128593
|
fileIdsList,
|
|
128495
128594
|
fileInfos,
|
|
@@ -128500,11 +128599,12 @@ function getBuildInfo2(state) {
|
|
|
128500
128599
|
semanticDiagnosticsPerFile,
|
|
128501
128600
|
emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(),
|
|
128502
128601
|
affectedFilesPendingEmit,
|
|
128503
|
-
changeFileSet: toChangeFileSet(),
|
|
128504
128602
|
emitSignatures,
|
|
128505
128603
|
latestChangedDtsFile,
|
|
128604
|
+
errors: state.hasErrors ? true : void 0,
|
|
128506
128605
|
version
|
|
128507
128606
|
};
|
|
128607
|
+
return buildInfo;
|
|
128508
128608
|
function relativeToBuildInfoEnsuringAbsolutePath(path) {
|
|
128509
128609
|
return relativeToBuildInfo(getNormalizedAbsolutePath(path, currentDirectory));
|
|
128510
128610
|
}
|
|
@@ -128585,7 +128685,7 @@ function getBuildInfo2(state) {
|
|
|
128585
128685
|
state.fileInfos.forEach((_value, key) => {
|
|
128586
128686
|
const value = state.semanticDiagnosticsPerFile.get(key);
|
|
128587
128687
|
if (!value) {
|
|
128588
|
-
|
|
128688
|
+
result = append(result, toFileId(key));
|
|
128589
128689
|
} else if (value.length) {
|
|
128590
128690
|
result = append(result, [
|
|
128591
128691
|
toFileId(key),
|
|
@@ -128652,15 +128752,6 @@ function getBuildInfo2(state) {
|
|
|
128652
128752
|
return result;
|
|
128653
128753
|
}) || array;
|
|
128654
128754
|
}
|
|
128655
|
-
function toChangeFileSet() {
|
|
128656
|
-
let changeFileSet;
|
|
128657
|
-
if (state.changedFilesSet.size) {
|
|
128658
|
-
for (const path of arrayFrom(state.changedFilesSet.keys()).sort(compareStringsCaseSensitive)) {
|
|
128659
|
-
changeFileSet = append(changeFileSet, toFileId(path));
|
|
128660
|
-
}
|
|
128661
|
-
}
|
|
128662
|
-
return changeFileSet;
|
|
128663
|
-
}
|
|
128664
128755
|
}
|
|
128665
128756
|
var BuilderProgramKind = /* @__PURE__ */ ((BuilderProgramKind2) => {
|
|
128666
128757
|
BuilderProgramKind2[BuilderProgramKind2["SemanticDiagnosticsBuilderProgram"] = 0] = "SemanticDiagnosticsBuilderProgram";
|
|
@@ -128737,8 +128828,6 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128737
128828
|
oldState = void 0;
|
|
128738
128829
|
const builderProgram = createRedirectedBuilderProgram(state, configFileParsingDiagnostics);
|
|
128739
128830
|
builderProgram.state = state;
|
|
128740
|
-
builderProgram.saveEmitState = () => backupBuilderProgramEmitState(state);
|
|
128741
|
-
builderProgram.restoreEmitState = (saved) => restoreBuilderProgramEmitState(state, saved);
|
|
128742
128831
|
builderProgram.hasChangedEmitSignature = () => !!state.hasChangedEmitSignature;
|
|
128743
128832
|
builderProgram.getAllDependencies = (sourceFile) => BuilderState.getAllDependencies(
|
|
128744
128833
|
state,
|
|
@@ -128760,7 +128849,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128760
128849
|
return builderProgram;
|
|
128761
128850
|
function emitBuildInfo(writeFile2, cancellationToken) {
|
|
128762
128851
|
Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
|
|
128763
|
-
if (state
|
|
128852
|
+
if (getBuildInfoEmitPending(state)) {
|
|
128764
128853
|
const result = state.program.emitBuildInfo(
|
|
128765
128854
|
writeFile2 || maybeBind(host, host.writeFile),
|
|
128766
128855
|
cancellationToken
|
|
@@ -128811,7 +128900,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128811
128900
|
}
|
|
128812
128901
|
}
|
|
128813
128902
|
if (!affected) {
|
|
128814
|
-
if (!state
|
|
128903
|
+
if (!getBuildInfoEmitPending(state)) return void 0;
|
|
128815
128904
|
const affected2 = state.program;
|
|
128816
128905
|
const result2 = affected2.emitBuildInfo(
|
|
128817
128906
|
writeFile2 || maybeBind(host, host.writeFile),
|
|
@@ -128899,7 +128988,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128899
128988
|
if (state.compilerOptions.composite) {
|
|
128900
128989
|
const filePath = sourceFiles[0].resolvedPath;
|
|
128901
128990
|
emitSignature = handleNewSignature((_c = state.emitSignatures) == null ? void 0 : _c.get(filePath), emitSignature);
|
|
128902
|
-
if (!emitSignature) return;
|
|
128991
|
+
if (!emitSignature) return data.skippedDtsWrite = true;
|
|
128903
128992
|
(state.emitSignatures ?? (state.emitSignatures = /* @__PURE__ */ new Map())).set(filePath, emitSignature);
|
|
128904
128993
|
}
|
|
128905
128994
|
} else if (state.compilerOptions.composite) {
|
|
@@ -128908,7 +128997,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
|
|
|
128908
128997
|
/*newSignature*/
|
|
128909
128998
|
void 0
|
|
128910
128999
|
);
|
|
128911
|
-
if (!newSignature) return;
|
|
129000
|
+
if (!newSignature) return data.skippedDtsWrite = true;
|
|
128912
129001
|
state.outSignature = newSignature;
|
|
128913
129002
|
}
|
|
128914
129003
|
}
|
|
@@ -129053,7 +129142,6 @@ function createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath,
|
|
|
129053
129142
|
let filePathsSetList;
|
|
129054
129143
|
const latestChangedDtsFile = buildInfo.latestChangedDtsFile ? toAbsolutePath(buildInfo.latestChangedDtsFile) : void 0;
|
|
129055
129144
|
const fileInfos = /* @__PURE__ */ new Map();
|
|
129056
|
-
const changedFilesSet = new Set(map(buildInfo.changeFileSet, toFilePath));
|
|
129057
129145
|
if (isIncrementalBundleEmitBuildInfo(buildInfo)) {
|
|
129058
129146
|
buildInfo.fileInfos.forEach((fileInfo, index) => {
|
|
129059
129147
|
const path = toFilePath(index + 1);
|
|
@@ -129065,10 +129153,10 @@ function createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath,
|
|
|
129065
129153
|
semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(buildInfo.semanticDiagnosticsPerFile),
|
|
129066
129154
|
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile),
|
|
129067
129155
|
hasReusableDiagnostic: true,
|
|
129068
|
-
changedFilesSet,
|
|
129069
129156
|
latestChangedDtsFile,
|
|
129070
129157
|
outSignature: buildInfo.outSignature,
|
|
129071
|
-
programEmitPending: buildInfo.pendingEmit === void 0 ? void 0 : toProgramEmitPending(buildInfo.pendingEmit, buildInfo.options)
|
|
129158
|
+
programEmitPending: buildInfo.pendingEmit === void 0 ? void 0 : toProgramEmitPending(buildInfo.pendingEmit, buildInfo.options),
|
|
129159
|
+
hasErrors: buildInfo.errors
|
|
129072
129160
|
};
|
|
129073
129161
|
} else {
|
|
129074
129162
|
filePathsSetList = (_b = buildInfo.fileIdsList) == null ? void 0 : _b.map((fileIds) => new Set(fileIds.map(toFilePath)));
|
|
@@ -129101,15 +129189,13 @@ function createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath,
|
|
|
129101
129189
|
emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile),
|
|
129102
129190
|
hasReusableDiagnostic: true,
|
|
129103
129191
|
affectedFilesPendingEmit: buildInfo.affectedFilesPendingEmit && arrayToMap(buildInfo.affectedFilesPendingEmit, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => toBuilderFileEmit(value, fullEmitForOptions)),
|
|
129104
|
-
changedFilesSet,
|
|
129105
129192
|
latestChangedDtsFile,
|
|
129106
|
-
emitSignatures: (emitSignatures == null ? void 0 : emitSignatures.size) ? emitSignatures : void 0
|
|
129193
|
+
emitSignatures: (emitSignatures == null ? void 0 : emitSignatures.size) ? emitSignatures : void 0,
|
|
129194
|
+
hasErrors: buildInfo.errors
|
|
129107
129195
|
};
|
|
129108
129196
|
}
|
|
129109
129197
|
return {
|
|
129110
129198
|
state,
|
|
129111
|
-
saveEmitState: noop,
|
|
129112
|
-
restoreEmitState: noop,
|
|
129113
129199
|
getProgram: notImplemented,
|
|
129114
129200
|
getProgramOrUndefined: returnUndefined,
|
|
129115
129201
|
releaseProgram: noop,
|
|
@@ -129153,7 +129239,7 @@ function createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath,
|
|
|
129153
129239
|
const semanticDiagnostics = new Map(
|
|
129154
129240
|
mapDefinedIterator(
|
|
129155
129241
|
fileInfos.keys(),
|
|
129156
|
-
(key) =>
|
|
129242
|
+
(key) => [key, emptyArray]
|
|
129157
129243
|
)
|
|
129158
129244
|
);
|
|
129159
129245
|
diagnostics == null ? void 0 : diagnostics.forEach((value) => {
|
|
@@ -129201,11 +129287,15 @@ function getBuildInfoFileVersionMap(program, buildInfoPath, host) {
|
|
|
129201
129287
|
}
|
|
129202
129288
|
}
|
|
129203
129289
|
}
|
|
129290
|
+
function getNonIncrementalBuildInfoRoots(buildInfo, buildInfoPath, host) {
|
|
129291
|
+
if (!isNonIncrementalBuildInfo(buildInfo)) return void 0;
|
|
129292
|
+
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
|
|
129293
|
+
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
129294
|
+
return buildInfo.root.map((r) => toPath(r, buildInfoDirectory, getCanonicalFileName));
|
|
129295
|
+
}
|
|
129204
129296
|
function createRedirectedBuilderProgram(state, configFileParsingDiagnostics) {
|
|
129205
129297
|
return {
|
|
129206
129298
|
state: void 0,
|
|
129207
|
-
saveEmitState: noop,
|
|
129208
|
-
restoreEmitState: noop,
|
|
129209
129299
|
getProgram,
|
|
129210
129300
|
getProgramOrUndefined: () => state.program,
|
|
129211
129301
|
releaseProgram: () => state.program = void 0,
|
|
@@ -130563,10 +130653,10 @@ function explainFiles(program, write) {
|
|
|
130563
130653
|
for (const file of program.getSourceFiles()) {
|
|
130564
130654
|
write(`${toFileName(file, relativeFileName)}`);
|
|
130565
130655
|
(_a = reasons.get(file.path)) == null ? void 0 : _a.forEach((reason) => write(` ${fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText}`));
|
|
130566
|
-
(_b = explainIfFileIsRedirectAndImpliedFormat(file,
|
|
130656
|
+
(_b = explainIfFileIsRedirectAndImpliedFormat(file, relativeFileName)) == null ? void 0 : _b.forEach((d) => write(` ${d.messageText}`));
|
|
130567
130657
|
}
|
|
130568
130658
|
}
|
|
130569
|
-
function explainIfFileIsRedirectAndImpliedFormat(file,
|
|
130659
|
+
function explainIfFileIsRedirectAndImpliedFormat(file, fileNameConvertor) {
|
|
130570
130660
|
var _a;
|
|
130571
130661
|
let result;
|
|
130572
130662
|
if (file.path !== file.resolvedPath) {
|
|
@@ -130586,7 +130676,7 @@ function explainIfFileIsRedirectAndImpliedFormat(file, options, fileNameConverto
|
|
|
130586
130676
|
));
|
|
130587
130677
|
}
|
|
130588
130678
|
if (isExternalOrCommonJsModule(file)) {
|
|
130589
|
-
switch (
|
|
130679
|
+
switch (file.impliedNodeFormat) {
|
|
130590
130680
|
case 99 /* ESNext */:
|
|
130591
130681
|
if (file.packageJsonScope) {
|
|
130592
130682
|
(result ?? (result = [])).push(chainDiagnosticMessages(
|
|
@@ -130783,13 +130873,12 @@ function emitFilesAndReportErrors(program, reportDiagnostic, write, reportSummar
|
|
|
130783
130873
|
emitOnlyDtsFiles,
|
|
130784
130874
|
customTransformers
|
|
130785
130875
|
);
|
|
130786
|
-
|
|
130787
|
-
addRange(allDiagnostics, emitDiagnostics);
|
|
130876
|
+
addRange(allDiagnostics, emitResult.diagnostics);
|
|
130788
130877
|
const diagnostics = sortAndDeduplicateDiagnostics(allDiagnostics);
|
|
130789
130878
|
diagnostics.forEach(reportDiagnostic);
|
|
130790
130879
|
if (write) {
|
|
130791
130880
|
const currentDir = program.getCurrentDirectory();
|
|
130792
|
-
forEach(emittedFiles, (file) => {
|
|
130881
|
+
forEach(emitResult.emittedFiles, (file) => {
|
|
130793
130882
|
const filepath = getNormalizedAbsolutePath(file, currentDir);
|
|
130794
130883
|
write(`TSFILE: ${filepath}`);
|
|
130795
130884
|
});
|
|
@@ -131472,22 +131561,17 @@ function createWatchProgram(host) {
|
|
|
131472
131561
|
updateProgram();
|
|
131473
131562
|
}
|
|
131474
131563
|
function updateProgram() {
|
|
131475
|
-
var _a, _b, _c, _d;
|
|
131476
131564
|
switch (updateLevel) {
|
|
131477
131565
|
case 1 /* RootNamesAndUpdate */:
|
|
131478
|
-
(_a = perfLogger) == null ? void 0 : _a.logStartUpdateProgram("PartialConfigReload");
|
|
131479
131566
|
reloadFileNamesFromConfigFile();
|
|
131480
131567
|
break;
|
|
131481
131568
|
case 2 /* Full */:
|
|
131482
|
-
(_b = perfLogger) == null ? void 0 : _b.logStartUpdateProgram("FullConfigReload");
|
|
131483
131569
|
reloadConfigFile();
|
|
131484
131570
|
break;
|
|
131485
131571
|
default:
|
|
131486
|
-
(_c = perfLogger) == null ? void 0 : _c.logStartUpdateProgram("SynchronizeProgram");
|
|
131487
131572
|
synchronizeProgram();
|
|
131488
131573
|
break;
|
|
131489
131574
|
}
|
|
131490
|
-
(_d = perfLogger) == null ? void 0 : _d.logStopUpdateProgram("Done");
|
|
131491
131575
|
return getCurrentBuilderProgram();
|
|
131492
131576
|
}
|
|
131493
131577
|
function reloadFileNamesFromConfigFile() {
|
|
@@ -131769,16 +131853,17 @@ var UpToDateStatusType = /* @__PURE__ */ ((UpToDateStatusType2) => {
|
|
|
131769
131853
|
UpToDateStatusType2[UpToDateStatusType2["ErrorReadingFile"] = 4] = "ErrorReadingFile";
|
|
131770
131854
|
UpToDateStatusType2[UpToDateStatusType2["OutOfDateWithSelf"] = 5] = "OutOfDateWithSelf";
|
|
131771
131855
|
UpToDateStatusType2[UpToDateStatusType2["OutOfDateWithUpstream"] = 6] = "OutOfDateWithUpstream";
|
|
131772
|
-
UpToDateStatusType2[UpToDateStatusType2["
|
|
131773
|
-
UpToDateStatusType2[UpToDateStatusType2["
|
|
131774
|
-
UpToDateStatusType2[UpToDateStatusType2["
|
|
131775
|
-
UpToDateStatusType2[UpToDateStatusType2["
|
|
131776
|
-
UpToDateStatusType2[UpToDateStatusType2["
|
|
131777
|
-
UpToDateStatusType2[UpToDateStatusType2["
|
|
131778
|
-
UpToDateStatusType2[UpToDateStatusType2["
|
|
131779
|
-
UpToDateStatusType2[UpToDateStatusType2["
|
|
131780
|
-
UpToDateStatusType2[UpToDateStatusType2["
|
|
131781
|
-
UpToDateStatusType2[UpToDateStatusType2["
|
|
131856
|
+
UpToDateStatusType2[UpToDateStatusType2["OutOfDateBuildInfoWithPendingEmit"] = 7] = "OutOfDateBuildInfoWithPendingEmit";
|
|
131857
|
+
UpToDateStatusType2[UpToDateStatusType2["OutOfDateBuildInfoWithErrors"] = 8] = "OutOfDateBuildInfoWithErrors";
|
|
131858
|
+
UpToDateStatusType2[UpToDateStatusType2["OutOfDateOptions"] = 9] = "OutOfDateOptions";
|
|
131859
|
+
UpToDateStatusType2[UpToDateStatusType2["OutOfDateRoots"] = 10] = "OutOfDateRoots";
|
|
131860
|
+
UpToDateStatusType2[UpToDateStatusType2["UpstreamOutOfDate"] = 11] = "UpstreamOutOfDate";
|
|
131861
|
+
UpToDateStatusType2[UpToDateStatusType2["UpstreamBlocked"] = 12] = "UpstreamBlocked";
|
|
131862
|
+
UpToDateStatusType2[UpToDateStatusType2["ComputingUpstream"] = 13] = "ComputingUpstream";
|
|
131863
|
+
UpToDateStatusType2[UpToDateStatusType2["TsVersionOutputOfDate"] = 14] = "TsVersionOutputOfDate";
|
|
131864
|
+
UpToDateStatusType2[UpToDateStatusType2["UpToDateWithInputFileText"] = 15] = "UpToDateWithInputFileText";
|
|
131865
|
+
UpToDateStatusType2[UpToDateStatusType2["ContainerOnly"] = 16] = "ContainerOnly";
|
|
131866
|
+
UpToDateStatusType2[UpToDateStatusType2["ForceBuild"] = 17] = "ForceBuild";
|
|
131782
131867
|
return UpToDateStatusType2;
|
|
131783
131868
|
})(UpToDateStatusType || {});
|
|
131784
131869
|
function resolveConfigFileProjectName(project) {
|
|
@@ -131790,7 +131875,6 @@ function resolveConfigFileProjectName(project) {
|
|
|
131790
131875
|
|
|
131791
131876
|
// src/compiler/tsbuildPublic.ts
|
|
131792
131877
|
var minimumDate = /* @__PURE__ */ new Date(-864e13);
|
|
131793
|
-
var maximumDate = /* @__PURE__ */ new Date(864e13);
|
|
131794
131878
|
function getOrCreateValueFromConfigFileMap(configFileMap, resolved, createT) {
|
|
131795
131879
|
const existingValue = configFileMap.get(resolved);
|
|
131796
131880
|
let newValue;
|
|
@@ -131845,6 +131929,7 @@ function getCompilerOptionsOfBuildOptions(buildOptions) {
|
|
|
131845
131929
|
commonOptionsWithBuild.forEach((option) => {
|
|
131846
131930
|
if (hasProperty(buildOptions, option.name)) result[option.name] = buildOptions[option.name];
|
|
131847
131931
|
});
|
|
131932
|
+
result.tscBuild = true;
|
|
131848
131933
|
return result;
|
|
131849
131934
|
}
|
|
131850
131935
|
function createSolutionBuilder(host, rootNames, defaultOptions) {
|
|
@@ -132248,7 +132333,7 @@ function createUpdateOutputFileStampsProject(state, project, projectPath, config
|
|
|
132248
132333
|
}
|
|
132249
132334
|
};
|
|
132250
132335
|
}
|
|
132251
|
-
function createBuildOrUpdateInvalidedProject(state, project, projectPath, projectIndex, config, buildOrder) {
|
|
132336
|
+
function createBuildOrUpdateInvalidedProject(state, project, projectPath, projectIndex, config, status, buildOrder) {
|
|
132252
132337
|
let step = 0 /* CreateProgram */;
|
|
132253
132338
|
let program;
|
|
132254
132339
|
let buildResult;
|
|
@@ -132299,17 +132384,13 @@ function createBuildOrUpdateInvalidedProject(state, project, projectPath, projec
|
|
|
132299
132384
|
}
|
|
132300
132385
|
);
|
|
132301
132386
|
}
|
|
132302
|
-
executeSteps(
|
|
132303
|
-
if (step === 4 /* EmitBuildInfo */) {
|
|
132304
|
-
return emitBuildInfo(writeFile2, cancellationToken);
|
|
132305
|
-
}
|
|
132306
|
-
if (step !== 3 /* Emit */) return void 0;
|
|
132387
|
+
executeSteps(0 /* CreateProgram */, cancellationToken);
|
|
132307
132388
|
return emit(writeFile2, cancellationToken, customTransformers);
|
|
132308
132389
|
},
|
|
132309
132390
|
done
|
|
132310
132391
|
};
|
|
132311
132392
|
function done(cancellationToken, writeFile2, customTransformers) {
|
|
132312
|
-
executeSteps(
|
|
132393
|
+
executeSteps(3 /* Done */, cancellationToken, writeFile2, customTransformers);
|
|
132313
132394
|
mark("SolutionBuilder::Projects built");
|
|
132314
132395
|
return doneInvalidatedProject(state, projectPath);
|
|
132315
132396
|
}
|
|
@@ -132326,14 +132407,14 @@ function createBuildOrUpdateInvalidedProject(state, project, projectPath, projec
|
|
|
132326
132407
|
if (state.options.dry) {
|
|
132327
132408
|
reportStatus(state, Diagnostics.A_non_dry_build_would_build_project_0, project);
|
|
132328
132409
|
buildResult = 1 /* Success */;
|
|
132329
|
-
step =
|
|
132410
|
+
step = 2 /* QueueReferencingProjects */;
|
|
132330
132411
|
return;
|
|
132331
132412
|
}
|
|
132332
132413
|
if (state.options.verbose) reportStatus(state, Diagnostics.Building_project_0, project);
|
|
132333
132414
|
if (config.fileNames.length === 0) {
|
|
132334
132415
|
reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
|
|
132335
132416
|
buildResult = 0 /* None */;
|
|
132336
|
-
step =
|
|
132417
|
+
step = 2 /* QueueReferencingProjects */;
|
|
132337
132418
|
return;
|
|
132338
132419
|
}
|
|
132339
132420
|
const { host, compilerHost } = state;
|
|
@@ -132361,179 +132442,97 @@ function createBuildOrUpdateInvalidedProject(state, project, projectPath, projec
|
|
|
132361
132442
|
}
|
|
132362
132443
|
step++;
|
|
132363
132444
|
}
|
|
132364
|
-
function handleDiagnostics(diagnostics, errorFlags, errorType) {
|
|
132365
|
-
if (diagnostics.length) {
|
|
132366
|
-
({ buildResult, step } = buildErrors(
|
|
132367
|
-
state,
|
|
132368
|
-
projectPath,
|
|
132369
|
-
diagnostics,
|
|
132370
|
-
errorFlags,
|
|
132371
|
-
errorType
|
|
132372
|
-
));
|
|
132373
|
-
} else {
|
|
132374
|
-
step++;
|
|
132375
|
-
}
|
|
132376
|
-
}
|
|
132377
|
-
function getSyntaxDiagnostics(cancellationToken) {
|
|
132378
|
-
Debug.assertIsDefined(program);
|
|
132379
|
-
handleDiagnostics(
|
|
132380
|
-
[
|
|
132381
|
-
...program.getConfigFileParsingDiagnostics(),
|
|
132382
|
-
...program.getOptionsDiagnostics(cancellationToken),
|
|
132383
|
-
...program.getGlobalDiagnostics(cancellationToken),
|
|
132384
|
-
...program.getSyntacticDiagnostics(
|
|
132385
|
-
/*sourceFile*/
|
|
132386
|
-
void 0,
|
|
132387
|
-
cancellationToken
|
|
132388
|
-
)
|
|
132389
|
-
],
|
|
132390
|
-
8 /* SyntaxErrors */,
|
|
132391
|
-
"Syntactic"
|
|
132392
|
-
);
|
|
132393
|
-
}
|
|
132394
|
-
function getSemanticDiagnostics(cancellationToken) {
|
|
132395
|
-
handleDiagnostics(
|
|
132396
|
-
Debug.checkDefined(program).getSemanticDiagnostics(
|
|
132397
|
-
/*sourceFile*/
|
|
132398
|
-
void 0,
|
|
132399
|
-
cancellationToken
|
|
132400
|
-
),
|
|
132401
|
-
16 /* TypeErrors */,
|
|
132402
|
-
"Semantic"
|
|
132403
|
-
);
|
|
132404
|
-
}
|
|
132405
132445
|
function emit(writeFileCallback, cancellationToken, customTransformers) {
|
|
132406
132446
|
var _a, _b, _c;
|
|
132407
132447
|
Debug.assertIsDefined(program);
|
|
132408
|
-
Debug.assert(step ===
|
|
132409
|
-
const
|
|
132410
|
-
|
|
132411
|
-
const
|
|
132412
|
-
const
|
|
132413
|
-
|
|
132448
|
+
Debug.assert(step === 1 /* Emit */);
|
|
132449
|
+
const { host, compilerHost } = state;
|
|
132450
|
+
const emittedOutputs = /* @__PURE__ */ new Map();
|
|
132451
|
+
const options = program.getCompilerOptions();
|
|
132452
|
+
const isIncremental = isIncrementalCompilation(options);
|
|
132453
|
+
let outputTimeStampMap;
|
|
132454
|
+
let now;
|
|
132455
|
+
const { emitResult, diagnostics } = emitFilesAndReportErrors(
|
|
132414
132456
|
program,
|
|
132415
|
-
|
|
132416
|
-
|
|
132417
|
-
void 0,
|
|
132457
|
+
(d) => host.reportDiagnostic(d),
|
|
132458
|
+
state.write,
|
|
132418
132459
|
/*reportSummary*/
|
|
132419
132460
|
void 0,
|
|
132420
|
-
(name, text, writeByteOrderMark,
|
|
132461
|
+
(name, text, writeByteOrderMark, onError, sourceFiles, data) => {
|
|
132462
|
+
var _a2;
|
|
132463
|
+
const path = toPath2(state, name);
|
|
132464
|
+
emittedOutputs.set(toPath2(state, name), name);
|
|
132465
|
+
if (data == null ? void 0 : data.buildInfo) {
|
|
132466
|
+
now || (now = getCurrentTime(state.host));
|
|
132467
|
+
const isChangedSignature2 = (_a2 = program.hasChangedEmitSignature) == null ? void 0 : _a2.call(program);
|
|
132468
|
+
const existing = getBuildInfoCacheEntry(state, name, projectPath);
|
|
132469
|
+
if (existing) {
|
|
132470
|
+
existing.buildInfo = data.buildInfo;
|
|
132471
|
+
existing.modifiedTime = now;
|
|
132472
|
+
if (isChangedSignature2) existing.latestChangedDtsTime = now;
|
|
132473
|
+
} else {
|
|
132474
|
+
state.buildInfoCache.set(projectPath, {
|
|
132475
|
+
path: toPath2(state, name),
|
|
132476
|
+
buildInfo: data.buildInfo,
|
|
132477
|
+
modifiedTime: now,
|
|
132478
|
+
latestChangedDtsTime: isChangedSignature2 ? now : void 0
|
|
132479
|
+
});
|
|
132480
|
+
}
|
|
132481
|
+
}
|
|
132482
|
+
const modifiedTime = (data == null ? void 0 : data.differsOnlyInMap) ? getModifiedTime(state.host, name) : void 0;
|
|
132483
|
+
(writeFileCallback || compilerHost.writeFile)(
|
|
132484
|
+
name,
|
|
132485
|
+
text,
|
|
132486
|
+
writeByteOrderMark,
|
|
132487
|
+
onError,
|
|
132488
|
+
sourceFiles,
|
|
132489
|
+
data
|
|
132490
|
+
);
|
|
132491
|
+
if (data == null ? void 0 : data.differsOnlyInMap) state.host.setModifiedTime(name, modifiedTime);
|
|
132492
|
+
else if (!isIncremental && state.watch) {
|
|
132493
|
+
(outputTimeStampMap || (outputTimeStampMap = getOutputTimeStampMap(state, projectPath))).set(path, now || (now = getCurrentTime(state.host)));
|
|
132494
|
+
}
|
|
132495
|
+
},
|
|
132421
132496
|
cancellationToken,
|
|
132422
132497
|
/*emitOnlyDtsFiles*/
|
|
132423
|
-
|
|
132498
|
+
void 0,
|
|
132424
132499
|
customTransformers || ((_b = (_a = state.host).getCustomTransformers) == null ? void 0 : _b.call(_a, project))
|
|
132425
132500
|
);
|
|
132426
|
-
if (
|
|
132427
|
-
|
|
132428
|
-
({ buildResult, step } = buildErrors(
|
|
132429
|
-
state,
|
|
132430
|
-
projectPath,
|
|
132431
|
-
declDiagnostics,
|
|
132432
|
-
32 /* DeclarationEmitErrors */,
|
|
132433
|
-
"Declaration file"
|
|
132434
|
-
));
|
|
132435
|
-
return {
|
|
132436
|
-
emitSkipped: true,
|
|
132437
|
-
diagnostics: emitResult.diagnostics
|
|
132438
|
-
};
|
|
132501
|
+
if ((!options.noEmitOnError || !diagnostics.length) && (emittedOutputs.size || status.type !== 8 /* OutOfDateBuildInfoWithErrors */)) {
|
|
132502
|
+
updateOutputTimestampsWorker(state, config, projectPath, Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
|
|
132439
132503
|
}
|
|
132440
|
-
|
|
132441
|
-
|
|
132442
|
-
|
|
132443
|
-
|
|
132444
|
-
|
|
132445
|
-
|
|
132446
|
-
|
|
132447
|
-
|
|
132448
|
-
|
|
132449
|
-
|
|
132450
|
-
|
|
132451
|
-
|
|
132452
|
-
const modifiedTime = (data == null ? void 0 : data.differsOnlyInMap) ? getModifiedTime(state.host, name) : void 0;
|
|
132453
|
-
writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
|
|
132454
|
-
if (data == null ? void 0 : data.differsOnlyInMap) state.host.setModifiedTime(name, modifiedTime);
|
|
132455
|
-
else if (!isIncremental && state.watch) {
|
|
132456
|
-
(outputTimeStampMap || (outputTimeStampMap = getOutputTimeStampMap(state, projectPath))).set(path, now || (now = getCurrentTime(state.host)));
|
|
132457
|
-
}
|
|
132458
|
-
});
|
|
132459
|
-
finishEmit(
|
|
132460
|
-
emitterDiagnostics,
|
|
132461
|
-
emittedOutputs,
|
|
132462
|
-
outputFiles.length ? outputFiles[0].name : getFirstProjectOutput(config, !host.useCaseSensitiveFileNames()),
|
|
132463
|
-
resultFlags
|
|
132464
|
-
);
|
|
132465
|
-
return emitResult;
|
|
132466
|
-
}
|
|
132467
|
-
function emitBuildInfo(writeFileCallback, cancellationToken) {
|
|
132468
|
-
Debug.assertIsDefined(program);
|
|
132469
|
-
Debug.assert(step === 4 /* EmitBuildInfo */);
|
|
132470
|
-
const emitResult = program.emitBuildInfo((name, text, writeByteOrderMark, onError, sourceFiles, data) => {
|
|
132471
|
-
if (data == null ? void 0 : data.buildInfo) setBuildInfo(state, data.buildInfo, projectPath, program.getCompilerOptions(), 2 /* DeclarationOutputUnchanged */);
|
|
132472
|
-
if (writeFileCallback) writeFileCallback(name, text, writeByteOrderMark, onError, sourceFiles, data);
|
|
132473
|
-
else state.compilerHost.writeFile(name, text, writeByteOrderMark, onError, sourceFiles, data);
|
|
132474
|
-
}, cancellationToken);
|
|
132475
|
-
if (emitResult.diagnostics.length) {
|
|
132476
|
-
reportErrors(state, emitResult.diagnostics);
|
|
132477
|
-
state.diagnostics.set(projectPath, [...state.diagnostics.get(projectPath), ...emitResult.diagnostics]);
|
|
132478
|
-
buildResult = 64 /* EmitErrors */ & buildResult;
|
|
132479
|
-
}
|
|
132480
|
-
if (emitResult.emittedFiles && state.write) {
|
|
132481
|
-
emitResult.emittedFiles.forEach((name) => listEmittedFile(state, config, name));
|
|
132504
|
+
state.projectErrorsReported.set(projectPath, true);
|
|
132505
|
+
if (!diagnostics.length) {
|
|
132506
|
+
state.diagnostics.delete(projectPath);
|
|
132507
|
+
state.projectStatus.set(projectPath, {
|
|
132508
|
+
type: 1 /* UpToDate */,
|
|
132509
|
+
oldestOutputFileName: firstOrUndefinedIterator(emittedOutputs.values()) ?? getFirstProjectOutput(config, !host.useCaseSensitiveFileNames())
|
|
132510
|
+
});
|
|
132511
|
+
buildResult = ((_c = program.hasChangedEmitSignature) == null ? void 0 : _c.call(program)) ? 0 /* None */ : 2 /* DeclarationOutputUnchanged */;
|
|
132512
|
+
} else {
|
|
132513
|
+
state.diagnostics.set(projectPath, diagnostics);
|
|
132514
|
+
state.projectStatus.set(projectPath, { type: 0 /* Unbuildable */, reason: `it had errors` });
|
|
132515
|
+
buildResult = 4 /* AnyErrors */;
|
|
132482
132516
|
}
|
|
132483
132517
|
afterProgramDone(state, program);
|
|
132484
|
-
step =
|
|
132518
|
+
step = 2 /* QueueReferencingProjects */;
|
|
132485
132519
|
return emitResult;
|
|
132486
132520
|
}
|
|
132487
|
-
function finishEmit(emitterDiagnostics, emittedOutputs, oldestOutputFileName, resultFlags) {
|
|
132488
|
-
const emitDiagnostics = emitterDiagnostics.getDiagnostics();
|
|
132489
|
-
if (emitDiagnostics.length) {
|
|
132490
|
-
({ buildResult, step } = buildErrors(
|
|
132491
|
-
state,
|
|
132492
|
-
projectPath,
|
|
132493
|
-
emitDiagnostics,
|
|
132494
|
-
64 /* EmitErrors */,
|
|
132495
|
-
"Emit"
|
|
132496
|
-
));
|
|
132497
|
-
return emitDiagnostics;
|
|
132498
|
-
}
|
|
132499
|
-
if (state.write) {
|
|
132500
|
-
emittedOutputs.forEach((name) => listEmittedFile(state, config, name));
|
|
132501
|
-
}
|
|
132502
|
-
updateOutputTimestampsWorker(state, config, projectPath, Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
|
|
132503
|
-
state.diagnostics.delete(projectPath);
|
|
132504
|
-
state.projectStatus.set(projectPath, {
|
|
132505
|
-
type: 1 /* UpToDate */,
|
|
132506
|
-
oldestOutputFileName
|
|
132507
|
-
});
|
|
132508
|
-
afterProgramDone(state, program);
|
|
132509
|
-
step = 5 /* QueueReferencingProjects */;
|
|
132510
|
-
buildResult = resultFlags;
|
|
132511
|
-
return emitDiagnostics;
|
|
132512
|
-
}
|
|
132513
132521
|
function executeSteps(till, cancellationToken, writeFile2, customTransformers) {
|
|
132514
|
-
while (step <= till && step <
|
|
132522
|
+
while (step <= till && step < 3 /* Done */) {
|
|
132515
132523
|
const currentStep = step;
|
|
132516
132524
|
switch (step) {
|
|
132517
132525
|
case 0 /* CreateProgram */:
|
|
132518
132526
|
createProgram2();
|
|
132519
132527
|
break;
|
|
132520
|
-
case 1 /*
|
|
132521
|
-
getSyntaxDiagnostics(cancellationToken);
|
|
132522
|
-
break;
|
|
132523
|
-
case 2 /* SemanticDiagnostics */:
|
|
132524
|
-
getSemanticDiagnostics(cancellationToken);
|
|
132525
|
-
break;
|
|
132526
|
-
case 3 /* Emit */:
|
|
132528
|
+
case 1 /* Emit */:
|
|
132527
132529
|
emit(writeFile2, cancellationToken, customTransformers);
|
|
132528
132530
|
break;
|
|
132529
|
-
case
|
|
132530
|
-
emitBuildInfo(writeFile2, cancellationToken);
|
|
132531
|
-
break;
|
|
132532
|
-
case 5 /* QueueReferencingProjects */:
|
|
132531
|
+
case 2 /* QueueReferencingProjects */:
|
|
132533
132532
|
queueReferencingProjects(state, project, projectPath, projectIndex, config, buildOrder, Debug.checkDefined(buildResult));
|
|
132534
132533
|
step++;
|
|
132535
132534
|
break;
|
|
132536
|
-
case
|
|
132535
|
+
case 3 /* Done */:
|
|
132537
132536
|
default:
|
|
132538
132537
|
assertType(step);
|
|
132539
132538
|
}
|
|
@@ -132583,7 +132582,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
|
|
|
132583
132582
|
}
|
|
132584
132583
|
continue;
|
|
132585
132584
|
}
|
|
132586
|
-
if (status.type === 2 /* UpToDateWithUpstreamTypes */ || status.type ===
|
|
132585
|
+
if (status.type === 2 /* UpToDateWithUpstreamTypes */ || status.type === 15 /* UpToDateWithInputFileText */) {
|
|
132587
132586
|
reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
|
|
132588
132587
|
return {
|
|
132589
132588
|
kind: 1 /* UpdateOutputFileStamps */,
|
|
@@ -132595,7 +132594,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
|
|
|
132595
132594
|
};
|
|
132596
132595
|
}
|
|
132597
132596
|
}
|
|
132598
|
-
if (status.type ===
|
|
132597
|
+
if (status.type === 12 /* UpstreamBlocked */) {
|
|
132599
132598
|
verboseReportProjectStatus(state, project, status);
|
|
132600
132599
|
reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
|
|
132601
132600
|
projectPendingBuild.delete(projectPath);
|
|
@@ -132609,7 +132608,7 @@ function getNextInvalidatedProjectCreateInfo(state, buildOrder, reportQueue) {
|
|
|
132609
132608
|
}
|
|
132610
132609
|
continue;
|
|
132611
132610
|
}
|
|
132612
|
-
if (status.type ===
|
|
132611
|
+
if (status.type === 16 /* ContainerOnly */) {
|
|
132613
132612
|
verboseReportProjectStatus(state, project, status);
|
|
132614
132613
|
reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config));
|
|
132615
132614
|
projectPendingBuild.delete(projectPath);
|
|
@@ -132634,6 +132633,7 @@ function createInvalidatedProjectWithInfo(state, info, buildOrder) {
|
|
|
132634
132633
|
info.projectPath,
|
|
132635
132634
|
info.projectIndex,
|
|
132636
132635
|
info.config,
|
|
132636
|
+
info.status,
|
|
132637
132637
|
buildOrder
|
|
132638
132638
|
) : createUpdateOutputFileStampsProject(
|
|
132639
132639
|
state,
|
|
@@ -132648,11 +132648,6 @@ function getNextInvalidatedProject(state, buildOrder, reportQueue) {
|
|
|
132648
132648
|
if (!info) return info;
|
|
132649
132649
|
return createInvalidatedProjectWithInfo(state, info, buildOrder);
|
|
132650
132650
|
}
|
|
132651
|
-
function listEmittedFile({ write }, proj, file) {
|
|
132652
|
-
if (write && proj.options.listEmittedFiles) {
|
|
132653
|
-
write(`TSFILE: ${file}`);
|
|
132654
|
-
}
|
|
132655
|
-
}
|
|
132656
132651
|
function getOldProgram({ options, builderPrograms, compilerHost }, proj, parsed) {
|
|
132657
132652
|
if (options.force) return void 0;
|
|
132658
132653
|
const value = builderPrograms.get(proj);
|
|
@@ -132661,7 +132656,6 @@ function getOldProgram({ options, builderPrograms, compilerHost }, proj, parsed)
|
|
|
132661
132656
|
}
|
|
132662
132657
|
function afterProgramDone(state, program) {
|
|
132663
132658
|
if (program) {
|
|
132664
|
-
if (state.write) listFiles(program, state.write);
|
|
132665
132659
|
if (state.host.afterProgramEmitAndDiagnostics) {
|
|
132666
132660
|
state.host.afterProgramEmitAndDiagnostics(program);
|
|
132667
132661
|
}
|
|
@@ -132669,11 +132663,6 @@ function afterProgramDone(state, program) {
|
|
|
132669
132663
|
}
|
|
132670
132664
|
state.projectCompilerOptions = state.baseCompilerOptions;
|
|
132671
132665
|
}
|
|
132672
|
-
function buildErrors(state, resolvedPath, diagnostics, buildResult, errorType) {
|
|
132673
|
-
reportAndStoreErrors(state, resolvedPath, diagnostics);
|
|
132674
|
-
state.projectStatus.set(resolvedPath, { type: 0 /* Unbuildable */, reason: `${errorType} errors` });
|
|
132675
|
-
return { buildResult, step: 4 /* EmitBuildInfo */ };
|
|
132676
|
-
}
|
|
132677
132666
|
function isFileWatcherWithModifiedTime(value) {
|
|
132678
132667
|
return !!value.watcher;
|
|
132679
132668
|
}
|
|
@@ -132731,23 +132720,6 @@ function getOutputTimeStampMap(state, resolvedConfigFilePath) {
|
|
|
132731
132720
|
if (!result) state.outputTimeStamps.set(resolvedConfigFilePath, result = /* @__PURE__ */ new Map());
|
|
132732
132721
|
return result;
|
|
132733
132722
|
}
|
|
132734
|
-
function setBuildInfo(state, buildInfo, resolvedConfigPath, options, resultFlags) {
|
|
132735
|
-
const buildInfoPath = getTsBuildInfoEmitOutputFilePath(options);
|
|
132736
|
-
const existing = getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath);
|
|
132737
|
-
const modifiedTime = getCurrentTime(state.host);
|
|
132738
|
-
if (existing) {
|
|
132739
|
-
existing.buildInfo = buildInfo;
|
|
132740
|
-
existing.modifiedTime = modifiedTime;
|
|
132741
|
-
if (!(resultFlags & 2 /* DeclarationOutputUnchanged */)) existing.latestChangedDtsTime = modifiedTime;
|
|
132742
|
-
} else {
|
|
132743
|
-
state.buildInfoCache.set(resolvedConfigPath, {
|
|
132744
|
-
path: toPath2(state, buildInfoPath),
|
|
132745
|
-
buildInfo,
|
|
132746
|
-
modifiedTime,
|
|
132747
|
-
latestChangedDtsTime: resultFlags & 2 /* DeclarationOutputUnchanged */ ? void 0 : modifiedTime
|
|
132748
|
-
});
|
|
132749
|
-
}
|
|
132750
|
-
}
|
|
132751
132723
|
function getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath) {
|
|
132752
132724
|
const path = toPath2(state, buildInfoPath);
|
|
132753
132725
|
const existing = state.buildInfoCache.get(resolvedConfigPath);
|
|
@@ -132775,99 +132747,106 @@ function checkConfigFileUpToDateStatus(state, configFile, oldestOutputFileTime,
|
|
|
132775
132747
|
}
|
|
132776
132748
|
}
|
|
132777
132749
|
function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
132778
|
-
var _a, _b, _c
|
|
132750
|
+
var _a, _b, _c;
|
|
132779
132751
|
if (!project.fileNames.length && !canJsonReportNoInputFiles(project.raw)) {
|
|
132780
132752
|
return {
|
|
132781
|
-
type:
|
|
132753
|
+
type: 16 /* ContainerOnly */
|
|
132782
132754
|
};
|
|
132783
132755
|
}
|
|
132784
132756
|
let referenceStatuses;
|
|
132785
132757
|
const force = !!state.options.force;
|
|
132786
132758
|
if (project.projectReferences) {
|
|
132787
|
-
state.projectStatus.set(resolvedPath, { type:
|
|
132759
|
+
state.projectStatus.set(resolvedPath, { type: 13 /* ComputingUpstream */ });
|
|
132788
132760
|
for (const ref of project.projectReferences) {
|
|
132789
132761
|
const resolvedRef = resolveProjectReferencePath(ref);
|
|
132790
132762
|
const resolvedRefPath = toResolvedConfigFilePath(state, resolvedRef);
|
|
132791
132763
|
const resolvedConfig = parseConfigFile(state, resolvedRef, resolvedRefPath);
|
|
132792
132764
|
const refStatus = getUpToDateStatus(state, resolvedConfig, resolvedRefPath);
|
|
132793
|
-
if (refStatus.type ===
|
|
132765
|
+
if (refStatus.type === 13 /* ComputingUpstream */ || refStatus.type === 16 /* ContainerOnly */) {
|
|
132794
132766
|
continue;
|
|
132795
132767
|
}
|
|
132796
|
-
if (refStatus.type === 0 /* Unbuildable */ || refStatus.type ===
|
|
132768
|
+
if (refStatus.type === 0 /* Unbuildable */ || refStatus.type === 12 /* UpstreamBlocked */) {
|
|
132797
132769
|
return {
|
|
132798
|
-
type:
|
|
132770
|
+
type: 12 /* UpstreamBlocked */,
|
|
132799
132771
|
upstreamProjectName: ref.path,
|
|
132800
|
-
upstreamProjectBlocked: refStatus.type ===
|
|
132772
|
+
upstreamProjectBlocked: refStatus.type === 12 /* UpstreamBlocked */
|
|
132801
132773
|
};
|
|
132802
132774
|
}
|
|
132803
132775
|
if (refStatus.type !== 1 /* UpToDate */) {
|
|
132804
132776
|
return {
|
|
132805
|
-
type:
|
|
132777
|
+
type: 11 /* UpstreamOutOfDate */,
|
|
132806
132778
|
upstreamProjectName: ref.path
|
|
132807
132779
|
};
|
|
132808
132780
|
}
|
|
132809
132781
|
if (!force) (referenceStatuses || (referenceStatuses = [])).push({ ref, refStatus, resolvedRefPath, resolvedConfig });
|
|
132810
132782
|
}
|
|
132811
132783
|
}
|
|
132812
|
-
if (force) return { type:
|
|
132784
|
+
if (force) return { type: 17 /* ForceBuild */ };
|
|
132813
132785
|
const { host } = state;
|
|
132814
132786
|
const buildInfoPath = getTsBuildInfoEmitOutputFilePath(project.options);
|
|
132815
|
-
|
|
132816
|
-
let
|
|
132817
|
-
|
|
132818
|
-
|
|
132819
|
-
|
|
132820
|
-
|
|
132821
|
-
|
|
132822
|
-
|
|
132823
|
-
|
|
132824
|
-
|
|
132825
|
-
|
|
132826
|
-
|
|
132827
|
-
|
|
132828
|
-
|
|
132829
|
-
|
|
132830
|
-
|
|
132787
|
+
const isIncremental = isIncrementalCompilation(project.options);
|
|
132788
|
+
let buildInfoCacheEntry = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath);
|
|
132789
|
+
const buildInfoTime = (buildInfoCacheEntry == null ? void 0 : buildInfoCacheEntry.modifiedTime) || getModifiedTime(host, buildInfoPath);
|
|
132790
|
+
if (buildInfoTime === missingFileModifiedTime) {
|
|
132791
|
+
if (!buildInfoCacheEntry) {
|
|
132792
|
+
state.buildInfoCache.set(resolvedPath, {
|
|
132793
|
+
path: toPath2(state, buildInfoPath),
|
|
132794
|
+
buildInfo: false,
|
|
132795
|
+
modifiedTime: buildInfoTime
|
|
132796
|
+
});
|
|
132797
|
+
}
|
|
132798
|
+
return {
|
|
132799
|
+
type: 3 /* OutputMissing */,
|
|
132800
|
+
missingOutputFileName: buildInfoPath
|
|
132801
|
+
};
|
|
132802
|
+
}
|
|
132803
|
+
const buildInfo = getBuildInfo3(state, buildInfoPath, resolvedPath, buildInfoTime);
|
|
132804
|
+
if (!buildInfo) {
|
|
132805
|
+
return {
|
|
132806
|
+
type: 4 /* ErrorReadingFile */,
|
|
132807
|
+
fileName: buildInfoPath
|
|
132808
|
+
};
|
|
132809
|
+
}
|
|
132810
|
+
const incrementalBuildInfo = isIncremental && isIncrementalBuildInfo(buildInfo) ? buildInfo : void 0;
|
|
132811
|
+
if ((incrementalBuildInfo || !isIncremental) && buildInfo.version !== version) {
|
|
132812
|
+
return {
|
|
132813
|
+
type: 14 /* TsVersionOutputOfDate */,
|
|
132814
|
+
version: buildInfo.version
|
|
132815
|
+
};
|
|
132816
|
+
}
|
|
132817
|
+
if (buildInfo.errors) {
|
|
132818
|
+
return {
|
|
132819
|
+
type: 8 /* OutOfDateBuildInfoWithErrors */,
|
|
132820
|
+
buildInfoFile: buildInfoPath
|
|
132821
|
+
};
|
|
132822
|
+
}
|
|
132823
|
+
if (incrementalBuildInfo) {
|
|
132824
|
+
if (((_a = incrementalBuildInfo.semanticDiagnosticsPerFile) == null ? void 0 : _a.length) || !project.options.noEmit && getEmitDeclarations(project.options) && ((_b = incrementalBuildInfo.emitDiagnosticsPerFile) == null ? void 0 : _b.length)) {
|
|
132831
132825
|
return {
|
|
132832
|
-
type:
|
|
132833
|
-
|
|
132826
|
+
type: 8 /* OutOfDateBuildInfoWithErrors */,
|
|
132827
|
+
buildInfoFile: buildInfoPath
|
|
132834
132828
|
};
|
|
132835
132829
|
}
|
|
132836
|
-
|
|
132837
|
-
if (!buildInfo) {
|
|
132830
|
+
if (!project.options.noEmit && (((_c = incrementalBuildInfo.affectedFilesPendingEmit) == null ? void 0 : _c.length) || incrementalBuildInfo.pendingEmit !== void 0)) {
|
|
132838
132831
|
return {
|
|
132839
|
-
type:
|
|
132840
|
-
|
|
132832
|
+
type: 7 /* OutOfDateBuildInfoWithPendingEmit */,
|
|
132833
|
+
buildInfoFile: buildInfoPath
|
|
132841
132834
|
};
|
|
132842
132835
|
}
|
|
132843
|
-
if (
|
|
132836
|
+
if (!project.options.noEmit && getPendingEmitKind(project.options, incrementalBuildInfo.options || {})) {
|
|
132844
132837
|
return {
|
|
132845
|
-
type:
|
|
132846
|
-
|
|
132838
|
+
type: 9 /* OutOfDateOptions */,
|
|
132839
|
+
buildInfoFile: buildInfoPath
|
|
132847
132840
|
};
|
|
132848
132841
|
}
|
|
132849
|
-
if (isIncrementalBuildInfo(buildInfo)) {
|
|
132850
|
-
if (((_a = buildInfo.changeFileSet) == null ? void 0 : _a.length) || (!project.options.noEmit ? ((_b = buildInfo.affectedFilesPendingEmit) == null ? void 0 : _b.length) || ((_c = buildInfo.emitDiagnosticsPerFile) == null ? void 0 : _c.length) || buildInfo.pendingEmit !== void 0 : (_d = buildInfo.semanticDiagnosticsPerFile) == null ? void 0 : _d.length)) {
|
|
132851
|
-
return {
|
|
132852
|
-
type: 7 /* OutOfDateBuildInfo */,
|
|
132853
|
-
buildInfoFile: buildInfoPath
|
|
132854
|
-
};
|
|
132855
|
-
}
|
|
132856
|
-
if (!project.options.noEmit && getPendingEmitKind(project.options, buildInfo.options || {})) {
|
|
132857
|
-
return {
|
|
132858
|
-
type: 8 /* OutOfDateOptions */,
|
|
132859
|
-
buildInfoFile: buildInfoPath
|
|
132860
|
-
};
|
|
132861
|
-
}
|
|
132862
|
-
incrementalBuildInfo = buildInfo;
|
|
132863
|
-
}
|
|
132864
|
-
oldestOutputFileTime = buildInfoTime;
|
|
132865
|
-
oldestOutputFileName = buildInfoPath;
|
|
132866
132842
|
}
|
|
132843
|
+
let oldestOutputFileTime = buildInfoTime;
|
|
132844
|
+
let oldestOutputFileName = buildInfoPath;
|
|
132867
132845
|
let newestInputFileName = void 0;
|
|
132868
132846
|
let newestInputFileTime = minimumDate;
|
|
132869
132847
|
let pseudoInputUpToDate = false;
|
|
132870
132848
|
const seenRoots = /* @__PURE__ */ new Set();
|
|
132849
|
+
let buildInfoVersionMap;
|
|
132871
132850
|
for (const inputFile of project.fileNames) {
|
|
132872
132851
|
const inputTime = getModifiedTime2(state, inputFile);
|
|
132873
132852
|
if (inputTime === missingFileModifiedTime) {
|
|
@@ -132876,8 +132855,8 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
132876
132855
|
reason: `${inputFile} does not exist`
|
|
132877
132856
|
};
|
|
132878
132857
|
}
|
|
132879
|
-
const inputPath =
|
|
132880
|
-
if (buildInfoTime
|
|
132858
|
+
const inputPath = toPath2(state, inputFile);
|
|
132859
|
+
if (buildInfoTime < inputTime) {
|
|
132881
132860
|
let version2;
|
|
132882
132861
|
let currentVersion;
|
|
132883
132862
|
if (incrementalBuildInfo) {
|
|
@@ -132900,27 +132879,34 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
132900
132879
|
newestInputFileName = inputFile;
|
|
132901
132880
|
newestInputFileTime = inputTime;
|
|
132902
132881
|
}
|
|
132903
|
-
|
|
132882
|
+
seenRoots.add(inputPath);
|
|
132904
132883
|
}
|
|
132884
|
+
let existingRoot;
|
|
132905
132885
|
if (incrementalBuildInfo) {
|
|
132906
132886
|
if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(incrementalBuildInfo, buildInfoPath, host);
|
|
132907
|
-
|
|
132887
|
+
existingRoot = forEachEntry(
|
|
132908
132888
|
buildInfoVersionMap.roots,
|
|
132909
132889
|
// File was root file when project was built but its not any more
|
|
132910
132890
|
(_resolved, existingRoot2) => !seenRoots.has(existingRoot2) ? existingRoot2 : void 0
|
|
132911
132891
|
);
|
|
132912
|
-
|
|
132913
|
-
|
|
132914
|
-
|
|
132915
|
-
|
|
132916
|
-
|
|
132917
|
-
|
|
132918
|
-
|
|
132892
|
+
} else {
|
|
132893
|
+
existingRoot = forEach(
|
|
132894
|
+
getNonIncrementalBuildInfoRoots(buildInfo, buildInfoPath, host),
|
|
132895
|
+
(root) => !seenRoots.has(root) ? root : void 0
|
|
132896
|
+
);
|
|
132897
|
+
}
|
|
132898
|
+
if (existingRoot) {
|
|
132899
|
+
return {
|
|
132900
|
+
type: 10 /* OutOfDateRoots */,
|
|
132901
|
+
buildInfoFile: buildInfoPath,
|
|
132902
|
+
inputFile: existingRoot
|
|
132903
|
+
};
|
|
132919
132904
|
}
|
|
132920
|
-
if (!
|
|
132905
|
+
if (!isIncremental) {
|
|
132921
132906
|
const outputs = getAllProjectOutputs(project, !host.useCaseSensitiveFileNames());
|
|
132922
132907
|
const outputTimeStampMap = getOutputTimeStampMap(state, resolvedPath);
|
|
132923
132908
|
for (const output of outputs) {
|
|
132909
|
+
if (output === buildInfoPath) continue;
|
|
132924
132910
|
const path = toPath2(state, output);
|
|
132925
132911
|
let outputTime = outputTimeStampMap == null ? void 0 : outputTimeStampMap.get(path);
|
|
132926
132912
|
if (!outputTime) {
|
|
@@ -132946,14 +132932,13 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
132946
132932
|
}
|
|
132947
132933
|
}
|
|
132948
132934
|
}
|
|
132949
|
-
const buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath);
|
|
132950
132935
|
let pseudoUpToDate = false;
|
|
132951
132936
|
if (referenceStatuses) {
|
|
132952
132937
|
for (const { ref, refStatus, resolvedConfig, resolvedRefPath } of referenceStatuses) {
|
|
132953
132938
|
if (refStatus.newestInputFileTime && refStatus.newestInputFileTime <= oldestOutputFileTime) {
|
|
132954
132939
|
continue;
|
|
132955
132940
|
}
|
|
132956
|
-
if (
|
|
132941
|
+
if (hasSameBuildInfo(state, buildInfoCacheEntry ?? (buildInfoCacheEntry = state.buildInfoCache.get(resolvedPath)), resolvedRefPath)) {
|
|
132957
132942
|
return {
|
|
132958
132943
|
type: 6 /* OutOfDateWithUpstream */,
|
|
132959
132944
|
outOfDateOutputFileName: buildInfoPath,
|
|
@@ -132984,7 +132969,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
|
|
|
132984
132969
|
);
|
|
132985
132970
|
if (dependentPackageFileStatus) return dependentPackageFileStatus;
|
|
132986
132971
|
return {
|
|
132987
|
-
type: pseudoUpToDate ? 2 /* UpToDateWithUpstreamTypes */ : pseudoInputUpToDate ?
|
|
132972
|
+
type: pseudoUpToDate ? 2 /* UpToDateWithUpstreamTypes */ : pseudoInputUpToDate ? 15 /* UpToDateWithInputFileText */ : 1 /* UpToDate */,
|
|
132988
132973
|
newestInputFileTime,
|
|
132989
132974
|
newestInputFileName,
|
|
132990
132975
|
oldestOutputFileName
|
|
@@ -132996,7 +132981,7 @@ function hasSameBuildInfo(state, buildInfoCacheEntry, resolvedRefPath) {
|
|
|
132996
132981
|
}
|
|
132997
132982
|
function getUpToDateStatus(state, project, resolvedPath) {
|
|
132998
132983
|
if (project === void 0) {
|
|
132999
|
-
return { type: 0 /* Unbuildable */, reason: "
|
|
132984
|
+
return { type: 0 /* Unbuildable */, reason: "config file deleted mid-build" };
|
|
133000
132985
|
}
|
|
133001
132986
|
const prior = state.projectStatus.get(resolvedPath);
|
|
133002
132987
|
if (prior !== void 0) {
|
|
@@ -133013,7 +132998,8 @@ function updateOutputTimestampsWorker(state, proj, projectPath, verboseMessage,
|
|
|
133013
132998
|
if (proj.options.noEmit) return;
|
|
133014
132999
|
let now;
|
|
133015
133000
|
const buildInfoPath = getTsBuildInfoEmitOutputFilePath(proj.options);
|
|
133016
|
-
|
|
133001
|
+
const isIncremental = isIncrementalCompilation(proj.options);
|
|
133002
|
+
if (buildInfoPath && isIncremental) {
|
|
133017
133003
|
if (!(skipOutputs == null ? void 0 : skipOutputs.has(toPath2(state, buildInfoPath)))) {
|
|
133018
133004
|
if (!!state.options.verbose) reportStatus(state, verboseMessage, proj.options.configFilePath);
|
|
133019
133005
|
state.host.setModifiedTime(buildInfoPath, now = getCurrentTime(state.host));
|
|
@@ -133036,7 +133022,8 @@ function updateOutputTimestampsWorker(state, proj, projectPath, verboseMessage,
|
|
|
133036
133022
|
reportStatus(state, verboseMessage, proj.options.configFilePath);
|
|
133037
133023
|
}
|
|
133038
133024
|
host.setModifiedTime(file, now || (now = getCurrentTime(state.host)));
|
|
133039
|
-
if (
|
|
133025
|
+
if (file === buildInfoPath) getBuildInfoCacheEntry(state, buildInfoPath, projectPath).modifiedTime = now;
|
|
133026
|
+
else if (outputTimeStampMap) {
|
|
133040
133027
|
outputTimeStampMap.set(path, now);
|
|
133041
133028
|
modifiedOutputs.add(path);
|
|
133042
133029
|
}
|
|
@@ -133065,7 +133052,7 @@ function updateOutputTimestamps(state, proj, resolvedPath) {
|
|
|
133065
133052
|
});
|
|
133066
133053
|
}
|
|
133067
133054
|
function queueReferencingProjects(state, project, projectPath, projectIndex, config, buildOrder, buildResult) {
|
|
133068
|
-
if (buildResult &
|
|
133055
|
+
if (buildResult & 4 /* AnyErrors */) return;
|
|
133069
133056
|
if (!config.options.composite) return;
|
|
133070
133057
|
for (let index = projectIndex + 1; index < buildOrder.length; index++) {
|
|
133071
133058
|
const nextProject = buildOrder[index];
|
|
@@ -133084,7 +133071,7 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con
|
|
|
133084
133071
|
status.type = 2 /* UpToDateWithUpstreamTypes */;
|
|
133085
133072
|
break;
|
|
133086
133073
|
}
|
|
133087
|
-
case
|
|
133074
|
+
case 15 /* UpToDateWithInputFileText */:
|
|
133088
133075
|
case 2 /* UpToDateWithUpstreamTypes */:
|
|
133089
133076
|
if (!(buildResult & 2 /* DeclarationOutputUnchanged */)) {
|
|
133090
133077
|
state.projectStatus.set(nextProjectPath, {
|
|
@@ -133094,7 +133081,7 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con
|
|
|
133094
133081
|
});
|
|
133095
133082
|
}
|
|
133096
133083
|
break;
|
|
133097
|
-
case
|
|
133084
|
+
case 12 /* UpstreamBlocked */:
|
|
133098
133085
|
if (toResolvedConfigFilePath(state, resolveProjectName(state, status.upstreamProjectName)) === projectPath) {
|
|
133099
133086
|
clearProjectStatus(state, nextProjectPath);
|
|
133100
133087
|
}
|
|
@@ -133513,21 +133500,28 @@ function reportUpToDateStatus(state, configFileName, status) {
|
|
|
133513
133500
|
relName(state, configFileName),
|
|
133514
133501
|
relName(state, status.fileName)
|
|
133515
133502
|
);
|
|
133516
|
-
case 7 /*
|
|
133503
|
+
case 7 /* OutOfDateBuildInfoWithPendingEmit */:
|
|
133517
133504
|
return reportStatus(
|
|
133518
133505
|
state,
|
|
133519
133506
|
Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted,
|
|
133520
133507
|
relName(state, configFileName),
|
|
133521
133508
|
relName(state, status.buildInfoFile)
|
|
133522
133509
|
);
|
|
133523
|
-
case 8 /*
|
|
133510
|
+
case 8 /* OutOfDateBuildInfoWithErrors */:
|
|
133511
|
+
return reportStatus(
|
|
133512
|
+
state,
|
|
133513
|
+
Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors,
|
|
133514
|
+
relName(state, configFileName),
|
|
133515
|
+
relName(state, status.buildInfoFile)
|
|
133516
|
+
);
|
|
133517
|
+
case 9 /* OutOfDateOptions */:
|
|
133524
133518
|
return reportStatus(
|
|
133525
133519
|
state,
|
|
133526
133520
|
Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions,
|
|
133527
133521
|
relName(state, configFileName),
|
|
133528
133522
|
relName(state, status.buildInfoFile)
|
|
133529
133523
|
);
|
|
133530
|
-
case
|
|
133524
|
+
case 10 /* OutOfDateRoots */:
|
|
133531
133525
|
return reportStatus(
|
|
133532
133526
|
state,
|
|
133533
133527
|
Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more,
|
|
@@ -133552,20 +133546,20 @@ function reportUpToDateStatus(state, configFileName, status) {
|
|
|
133552
133546
|
Diagnostics.Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies,
|
|
133553
133547
|
relName(state, configFileName)
|
|
133554
133548
|
);
|
|
133555
|
-
case
|
|
133549
|
+
case 15 /* UpToDateWithInputFileText */:
|
|
133556
133550
|
return reportStatus(
|
|
133557
133551
|
state,
|
|
133558
133552
|
Diagnostics.Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files,
|
|
133559
133553
|
relName(state, configFileName)
|
|
133560
133554
|
);
|
|
133561
|
-
case
|
|
133555
|
+
case 11 /* UpstreamOutOfDate */:
|
|
133562
133556
|
return reportStatus(
|
|
133563
133557
|
state,
|
|
133564
133558
|
Diagnostics.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date,
|
|
133565
133559
|
relName(state, configFileName),
|
|
133566
133560
|
relName(state, status.upstreamProjectName)
|
|
133567
133561
|
);
|
|
133568
|
-
case
|
|
133562
|
+
case 12 /* UpstreamBlocked */:
|
|
133569
133563
|
return reportStatus(
|
|
133570
133564
|
state,
|
|
133571
133565
|
status.upstreamProjectBlocked ? Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built : Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors,
|
|
@@ -133575,11 +133569,11 @@ function reportUpToDateStatus(state, configFileName, status) {
|
|
|
133575
133569
|
case 0 /* Unbuildable */:
|
|
133576
133570
|
return reportStatus(
|
|
133577
133571
|
state,
|
|
133578
|
-
Diagnostics.
|
|
133572
|
+
Diagnostics.Project_0_is_out_of_date_because_1,
|
|
133579
133573
|
relName(state, configFileName),
|
|
133580
133574
|
status.reason
|
|
133581
133575
|
);
|
|
133582
|
-
case
|
|
133576
|
+
case 14 /* TsVersionOutputOfDate */:
|
|
133583
133577
|
return reportStatus(
|
|
133584
133578
|
state,
|
|
133585
133579
|
Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2,
|
|
@@ -133587,14 +133581,14 @@ function reportUpToDateStatus(state, configFileName, status) {
|
|
|
133587
133581
|
status.version,
|
|
133588
133582
|
version
|
|
133589
133583
|
);
|
|
133590
|
-
case
|
|
133584
|
+
case 17 /* ForceBuild */:
|
|
133591
133585
|
return reportStatus(
|
|
133592
133586
|
state,
|
|
133593
133587
|
Diagnostics.Project_0_is_being_forcibly_rebuilt,
|
|
133594
133588
|
relName(state, configFileName)
|
|
133595
133589
|
);
|
|
133596
|
-
case
|
|
133597
|
-
case
|
|
133590
|
+
case 16 /* ContainerOnly */:
|
|
133591
|
+
case 13 /* ComputingUpstream */:
|
|
133598
133592
|
break;
|
|
133599
133593
|
default:
|
|
133600
133594
|
assertType(status);
|
|
@@ -137248,9 +137242,7 @@ function createModuleSpecifierResolutionHost(program, host) {
|
|
|
137248
137242
|
isSourceOfProjectReferenceRedirect: (fileName) => program.isSourceOfProjectReferenceRedirect(fileName),
|
|
137249
137243
|
getNearestAncestorDirectoryWithPackageJson: maybeBind(host, host.getNearestAncestorDirectoryWithPackageJson),
|
|
137250
137244
|
getFileIncludeReasons: () => program.getFileIncludeReasons(),
|
|
137251
|
-
getCommonSourceDirectory: () => program.getCommonSourceDirectory()
|
|
137252
|
-
getDefaultResolutionModeForFile: (file) => program.getDefaultResolutionModeForFile(file),
|
|
137253
|
-
getModeForResolutionAtIndex: (file, index) => program.getModeForResolutionAtIndex(file, index)
|
|
137245
|
+
getCommonSourceDirectory: () => program.getCommonSourceDirectory()
|
|
137254
137246
|
};
|
|
137255
137247
|
}
|
|
137256
137248
|
function getModuleSpecifierResolverHost(program, host) {
|
|
@@ -138556,13 +138548,9 @@ function fileShouldUseJavaScriptRequire(file, program, host, preferRequire) {
|
|
|
138556
138548
|
if (!hasJSFileExtension(fileName)) {
|
|
138557
138549
|
return false;
|
|
138558
138550
|
}
|
|
138559
|
-
const compilerOptions =
|
|
138551
|
+
const compilerOptions = program.getCompilerOptions();
|
|
138560
138552
|
const moduleKind = getEmitModuleKind(compilerOptions);
|
|
138561
|
-
const
|
|
138562
|
-
fileName: file,
|
|
138563
|
-
impliedNodeFormat: getImpliedNodeFormatForFile(toPath(file, host.getCurrentDirectory(), hostGetCanonicalFileName(host)), (_a = program.getPackageJsonInfoCache) == null ? void 0 : _a.call(program), host, compilerOptions)
|
|
138564
|
-
} : file;
|
|
138565
|
-
const impliedNodeFormat = getImpliedNodeFormatForEmitWorker(sourceFileLike, compilerOptions);
|
|
138553
|
+
const impliedNodeFormat = typeof file === "string" ? getImpliedNodeFormatForFile(toPath(file, host.getCurrentDirectory(), hostGetCanonicalFileName(host)), (_a = program.getPackageJsonInfoCache) == null ? void 0 : _a.call(program), host, compilerOptions) : file.impliedNodeFormat;
|
|
138566
138554
|
if (impliedNodeFormat === 99 /* ESNext */) {
|
|
138567
138555
|
return false;
|
|
138568
138556
|
}
|
|
@@ -141542,7 +141530,7 @@ function computeSuggestionDiagnostics(sourceFile, program, cancellationToken) {
|
|
|
141542
141530
|
program.getSemanticDiagnostics(sourceFile, cancellationToken);
|
|
141543
141531
|
const diags = [];
|
|
141544
141532
|
const checker = program.getTypeChecker();
|
|
141545
|
-
const isCommonJSFile =
|
|
141533
|
+
const isCommonJSFile = sourceFile.impliedNodeFormat === 1 /* CommonJS */ || fileExtensionIsOneOf(sourceFile.fileName, [".cts" /* Cts */, ".cjs" /* Cjs */]);
|
|
141546
141534
|
if (!isCommonJSFile && sourceFile.commonJsModuleIndicator && (programContainsEsModules(program) || compilerOptionsIndicateEsModules(program.getCompilerOptions())) && containsTopLevelCommonjs(sourceFile)) {
|
|
141547
141535
|
diags.push(createDiagnosticForNode(getErrorNodeFromCommonJsIndicator(sourceFile.commonJsModuleIndicator), Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module));
|
|
141548
141536
|
}
|
|
@@ -149397,6 +149385,108 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
149397
149385
|
const declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile, cancellationToken);
|
|
149398
149386
|
return [...semanticDiagnostics, ...declarationDiagnostics];
|
|
149399
149387
|
}
|
|
149388
|
+
function getRegionSemanticDiagnostics(fileName, ranges) {
|
|
149389
|
+
synchronizeHostData();
|
|
149390
|
+
const sourceFile = getValidSourceFile(fileName);
|
|
149391
|
+
const options = program.getCompilerOptions();
|
|
149392
|
+
if (skipTypeChecking(sourceFile, options, program) || !canIncludeBindAndCheckDiagnostics(sourceFile, options) || program.getCachedSemanticDiagnostics(sourceFile)) {
|
|
149393
|
+
return void 0;
|
|
149394
|
+
}
|
|
149395
|
+
const nodes = getNodesForRanges(sourceFile, ranges);
|
|
149396
|
+
if (!nodes) {
|
|
149397
|
+
return void 0;
|
|
149398
|
+
}
|
|
149399
|
+
const checkedSpans = normalizeSpans(nodes.map((node) => createTextSpanFromBounds(node.getFullStart(), node.getEnd())));
|
|
149400
|
+
const semanticDiagnostics = program.getSemanticDiagnostics(sourceFile, cancellationToken, nodes);
|
|
149401
|
+
return {
|
|
149402
|
+
diagnostics: semanticDiagnostics.slice(),
|
|
149403
|
+
spans: checkedSpans
|
|
149404
|
+
};
|
|
149405
|
+
}
|
|
149406
|
+
function getNodesForRanges(file, ranges) {
|
|
149407
|
+
const nodes = [];
|
|
149408
|
+
const spans = normalizeSpans(ranges.map((range) => createTextSpanFromRange(range)));
|
|
149409
|
+
for (const span of spans) {
|
|
149410
|
+
const nodesForSpan = getNodesForSpan(file, span);
|
|
149411
|
+
if (!nodesForSpan) {
|
|
149412
|
+
return void 0;
|
|
149413
|
+
}
|
|
149414
|
+
nodes.push(...nodesForSpan);
|
|
149415
|
+
}
|
|
149416
|
+
if (!nodes.length) {
|
|
149417
|
+
return void 0;
|
|
149418
|
+
}
|
|
149419
|
+
return nodes;
|
|
149420
|
+
}
|
|
149421
|
+
function getNodesForSpan(file, span) {
|
|
149422
|
+
if (textSpanContainsTextRange(span, file)) {
|
|
149423
|
+
return void 0;
|
|
149424
|
+
}
|
|
149425
|
+
const endToken = findTokenOnLeftOfPosition(file, textSpanEnd(span)) || file;
|
|
149426
|
+
const enclosingNode = findAncestor(endToken, (node) => textRangeContainsTextSpan(node, span));
|
|
149427
|
+
const nodes = [];
|
|
149428
|
+
chooseOverlappingNodes(span, enclosingNode, nodes);
|
|
149429
|
+
if (file.end === span.start + span.length) {
|
|
149430
|
+
nodes.push(file.endOfFileToken);
|
|
149431
|
+
}
|
|
149432
|
+
if (some(nodes, isSourceFile)) {
|
|
149433
|
+
return void 0;
|
|
149434
|
+
}
|
|
149435
|
+
return nodes;
|
|
149436
|
+
}
|
|
149437
|
+
function chooseOverlappingNodes(span, node, result) {
|
|
149438
|
+
if (!nodeOverlapsWithSpan(node, span)) {
|
|
149439
|
+
return false;
|
|
149440
|
+
}
|
|
149441
|
+
if (textSpanContainsTextRange(span, node)) {
|
|
149442
|
+
addSourceElement(node, result);
|
|
149443
|
+
return true;
|
|
149444
|
+
}
|
|
149445
|
+
if (isBlockLike(node)) {
|
|
149446
|
+
return chooseOverlappingBlockLike(span, node, result);
|
|
149447
|
+
}
|
|
149448
|
+
if (isClassLike(node)) {
|
|
149449
|
+
return chooseOverlappingClassLike(span, node, result);
|
|
149450
|
+
}
|
|
149451
|
+
addSourceElement(node, result);
|
|
149452
|
+
return true;
|
|
149453
|
+
}
|
|
149454
|
+
function nodeOverlapsWithSpan(node, span) {
|
|
149455
|
+
const spanEnd = span.start + span.length;
|
|
149456
|
+
return node.pos < spanEnd && node.end > span.start;
|
|
149457
|
+
}
|
|
149458
|
+
function addSourceElement(node, result) {
|
|
149459
|
+
while (node.parent && !isSourceElement(node)) {
|
|
149460
|
+
node = node.parent;
|
|
149461
|
+
}
|
|
149462
|
+
result.push(node);
|
|
149463
|
+
}
|
|
149464
|
+
function chooseOverlappingBlockLike(span, node, result) {
|
|
149465
|
+
const childResult = [];
|
|
149466
|
+
const stmts = node.statements.filter((stmt) => chooseOverlappingNodes(span, stmt, childResult));
|
|
149467
|
+
if (stmts.length === node.statements.length) {
|
|
149468
|
+
addSourceElement(node, result);
|
|
149469
|
+
return true;
|
|
149470
|
+
}
|
|
149471
|
+
result.push(...childResult);
|
|
149472
|
+
return false;
|
|
149473
|
+
}
|
|
149474
|
+
function chooseOverlappingClassLike(span, node, result) {
|
|
149475
|
+
var _a2, _b, _c;
|
|
149476
|
+
const overlaps = (n) => textRangeIntersectsWithTextSpan(n, span);
|
|
149477
|
+
if (((_a2 = node.modifiers) == null ? void 0 : _a2.some(overlaps)) || node.name && overlaps(node.name) || ((_b = node.typeParameters) == null ? void 0 : _b.some(overlaps)) || ((_c = node.heritageClauses) == null ? void 0 : _c.some(overlaps))) {
|
|
149478
|
+
addSourceElement(node, result);
|
|
149479
|
+
return true;
|
|
149480
|
+
}
|
|
149481
|
+
const childResult = [];
|
|
149482
|
+
const members = node.members.filter((member) => chooseOverlappingNodes(span, member, childResult));
|
|
149483
|
+
if (members.length === node.members.length) {
|
|
149484
|
+
addSourceElement(node, result);
|
|
149485
|
+
return true;
|
|
149486
|
+
}
|
|
149487
|
+
result.push(...childResult);
|
|
149488
|
+
return false;
|
|
149489
|
+
}
|
|
149400
149490
|
function getSuggestionDiagnostics(fileName) {
|
|
149401
149491
|
synchronizeHostData();
|
|
149402
149492
|
return computeSuggestionDiagnostics(getValidSourceFile(fileName), program, cancellationToken);
|
|
@@ -150211,6 +150301,7 @@ function createLanguageService(host, documentRegistry = createDocumentRegistry(h
|
|
|
150211
150301
|
cleanupSemanticCache,
|
|
150212
150302
|
getSyntacticDiagnostics,
|
|
150213
150303
|
getSemanticDiagnostics,
|
|
150304
|
+
getRegionSemanticDiagnostics,
|
|
150214
150305
|
getSuggestionDiagnostics,
|
|
150215
150306
|
getCompilerOptionsDiagnostics,
|
|
150216
150307
|
getSyntacticClassifications: getSyntacticClassifications2,
|
|
@@ -154538,7 +154629,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre
|
|
|
154538
154629
|
compilerOptions,
|
|
154539
154630
|
createModuleSpecifierResolutionHost(program, host)
|
|
154540
154631
|
);
|
|
154541
|
-
const importKind = getImportKind(futureExportingSourceFile, exportKind,
|
|
154632
|
+
const importKind = getImportKind(futureExportingSourceFile, exportKind, compilerOptions);
|
|
154542
154633
|
const addAsTypeOnly = getAddAsTypeOnly(
|
|
154543
154634
|
isImportUsageValidAsTypeOnly,
|
|
154544
154635
|
/*isForNewImportDeclaration*/
|
|
@@ -154878,7 +154969,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre
|
|
|
154878
154969
|
}
|
|
154879
154970
|
function createImportSpecifierResolver(importingFile, program, host, preferences) {
|
|
154880
154971
|
const packageJsonImportFilter = createPackageJsonImportFilter(importingFile, preferences, host);
|
|
154881
|
-
const importMap = createExistingImportMap(importingFile, program);
|
|
154972
|
+
const importMap = createExistingImportMap(program.getTypeChecker(), importingFile, program.getCompilerOptions());
|
|
154882
154973
|
return { getModuleSpecifierForBestExportInfo };
|
|
154883
154974
|
function getModuleSpecifierForBestExportInfo(exportInfo, position, isValidTypeOnlyUseSite, fromCacheOnly) {
|
|
154884
154975
|
const { fixes, computedWithoutCacheCount } = getImportFixes(
|
|
@@ -154981,7 +155072,7 @@ function getSingleExportInfoForSymbol(symbol, symbolName2, moduleSymbol, program
|
|
|
154981
155072
|
}
|
|
154982
155073
|
}
|
|
154983
155074
|
}
|
|
154984
|
-
function getImportFixes(exportInfos, usagePosition, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences, importMap = isFullSourceFile(sourceFile) ? createExistingImportMap(sourceFile, program) : void 0, fromCacheOnly) {
|
|
155075
|
+
function getImportFixes(exportInfos, usagePosition, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences, importMap = isFullSourceFile(sourceFile) ? createExistingImportMap(program.getTypeChecker(), sourceFile, program.getCompilerOptions()) : void 0, fromCacheOnly) {
|
|
154985
155076
|
const checker = program.getTypeChecker();
|
|
154986
155077
|
const existingImports = importMap ? flatMap(exportInfos, importMap.getImportsForExportInfo) : emptyArray;
|
|
154987
155078
|
const useNamespace = usagePosition !== void 0 && tryUseExistingNamespaceImport(existingImports, usagePosition);
|
|
@@ -155096,8 +155187,7 @@ function tryAddToExistingImport(existingImports, isValidTypeOnlyUseSite, checker
|
|
|
155096
155187
|
};
|
|
155097
155188
|
}
|
|
155098
155189
|
}
|
|
155099
|
-
function createExistingImportMap(importingFile,
|
|
155100
|
-
const checker = program.getTypeChecker();
|
|
155190
|
+
function createExistingImportMap(checker, importingFile, compilerOptions) {
|
|
155101
155191
|
let importMap;
|
|
155102
155192
|
for (const moduleSpecifier of importingFile.imports) {
|
|
155103
155193
|
const i = importFromModuleSpecifier(moduleSpecifier);
|
|
@@ -155118,7 +155208,7 @@ function createExistingImportMap(importingFile, program) {
|
|
|
155118
155208
|
const matchingDeclarations = importMap == null ? void 0 : importMap.get(getSymbolId(moduleSymbol));
|
|
155119
155209
|
if (!matchingDeclarations) return emptyArray;
|
|
155120
155210
|
if (isSourceFileJS(importingFile) && !(targetFlags & 111551 /* Value */) && !every(matchingDeclarations, isJSDocImportTag)) return emptyArray;
|
|
155121
|
-
const importKind = getImportKind(importingFile, exportKind,
|
|
155211
|
+
const importKind = getImportKind(importingFile, exportKind, compilerOptions);
|
|
155122
155212
|
return matchingDeclarations.map((declaration) => ({ declaration, importKind, symbol, targetFlags }));
|
|
155123
155213
|
}
|
|
155124
155214
|
};
|
|
@@ -155133,8 +155223,8 @@ function shouldUseRequire(sourceFile, program) {
|
|
|
155133
155223
|
if (compilerOptions.configFile) {
|
|
155134
155224
|
return getEmitModuleKind(compilerOptions) < 5 /* ES2015 */;
|
|
155135
155225
|
}
|
|
155136
|
-
if (
|
|
155137
|
-
if (
|
|
155226
|
+
if (sourceFile.impliedNodeFormat === 1 /* CommonJS */) return true;
|
|
155227
|
+
if (sourceFile.impliedNodeFormat === 99 /* ESNext */) return false;
|
|
155138
155228
|
for (const otherFile of program.getSourceFiles()) {
|
|
155139
155229
|
if (otherFile === sourceFile || !isSourceFileJS(otherFile) || program.isSourceFileFromExternalLibrary(otherFile)) continue;
|
|
155140
155230
|
if (otherFile.commonJsModuleIndicator && !otherFile.externalModuleIndicator) return true;
|
|
@@ -155186,7 +155276,7 @@ function getNewImportFixes(program, sourceFile, usagePosition, isValidTypeOnlyUs
|
|
|
155186
155276
|
if (!importedSymbolHasValueMeaning && isJs && usagePosition !== void 0) {
|
|
155187
155277
|
return { kind: 1 /* JsdocTypeImport */, moduleSpecifierKind, moduleSpecifier, usagePosition, exportInfo: exportInfo2, isReExport: i > 0 };
|
|
155188
155278
|
}
|
|
155189
|
-
const importKind = getImportKind(sourceFile, exportInfo2.exportKind,
|
|
155279
|
+
const importKind = getImportKind(sourceFile, exportInfo2.exportKind, compilerOptions);
|
|
155190
155280
|
let qualification;
|
|
155191
155281
|
if (usagePosition !== void 0 && importKind === 3 /* CommonJS */ && exportInfo2.exportKind === 0 /* Named */) {
|
|
155192
155282
|
const exportEquals = checker.resolveExternalModuleSymbol(exportInfo2.moduleSymbol);
|
|
@@ -155372,8 +155462,8 @@ function getUmdSymbol(token, checker) {
|
|
|
155372
155462
|
}
|
|
155373
155463
|
return void 0;
|
|
155374
155464
|
}
|
|
155375
|
-
function getImportKind(importingFile, exportKind,
|
|
155376
|
-
if (
|
|
155465
|
+
function getImportKind(importingFile, exportKind, compilerOptions, forceImportKeyword) {
|
|
155466
|
+
if (compilerOptions.verbatimModuleSyntax && (getEmitModuleKind(compilerOptions) === 1 /* CommonJS */ || importingFile.impliedNodeFormat === 1 /* CommonJS */)) {
|
|
155377
155467
|
return 3 /* CommonJS */;
|
|
155378
155468
|
}
|
|
155379
155469
|
switch (exportKind) {
|
|
@@ -155382,18 +155472,18 @@ function getImportKind(importingFile, exportKind, program, forceImportKeyword) {
|
|
|
155382
155472
|
case 1 /* Default */:
|
|
155383
155473
|
return 1 /* Default */;
|
|
155384
155474
|
case 2 /* ExportEquals */:
|
|
155385
|
-
return getExportEqualsImportKind(importingFile,
|
|
155475
|
+
return getExportEqualsImportKind(importingFile, compilerOptions, !!forceImportKeyword);
|
|
155386
155476
|
case 3 /* UMD */:
|
|
155387
|
-
return getUmdImportKind(importingFile,
|
|
155477
|
+
return getUmdImportKind(importingFile, compilerOptions, !!forceImportKeyword);
|
|
155388
155478
|
default:
|
|
155389
155479
|
return Debug.assertNever(exportKind);
|
|
155390
155480
|
}
|
|
155391
155481
|
}
|
|
155392
|
-
function getUmdImportKind(importingFile,
|
|
155393
|
-
if (getAllowSyntheticDefaultImports(
|
|
155482
|
+
function getUmdImportKind(importingFile, compilerOptions, forceImportKeyword) {
|
|
155483
|
+
if (getAllowSyntheticDefaultImports(compilerOptions)) {
|
|
155394
155484
|
return 1 /* Default */;
|
|
155395
155485
|
}
|
|
155396
|
-
const moduleKind = getEmitModuleKind(
|
|
155486
|
+
const moduleKind = getEmitModuleKind(compilerOptions);
|
|
155397
155487
|
switch (moduleKind) {
|
|
155398
155488
|
case 2 /* AMD */:
|
|
155399
155489
|
case 1 /* CommonJS */:
|
|
@@ -155412,7 +155502,7 @@ function getUmdImportKind(importingFile, program, forceImportKeyword) {
|
|
|
155412
155502
|
return 2 /* Namespace */;
|
|
155413
155503
|
case 100 /* Node16 */:
|
|
155414
155504
|
case 199 /* NodeNext */:
|
|
155415
|
-
return
|
|
155505
|
+
return importingFile.impliedNodeFormat === 99 /* ESNext */ ? 2 /* Namespace */ : 3 /* CommonJS */;
|
|
155416
155506
|
default:
|
|
155417
155507
|
return Debug.assertNever(moduleKind, `Unexpected moduleKind ${moduleKind}`);
|
|
155418
155508
|
}
|
|
@@ -155896,12 +155986,6 @@ function createConstEqualsRequireDeclaration(name, quotedModuleSpecifier) {
|
|
|
155896
155986
|
function symbolFlagsHaveMeaning(flags, meaning) {
|
|
155897
155987
|
return meaning === 7 /* All */ ? true : meaning & 1 /* Value */ ? !!(flags & 111551 /* Value */) : meaning & 2 /* Type */ ? !!(flags & 788968 /* Type */) : meaning & 4 /* Namespace */ ? !!(flags & 1920 /* Namespace */) : false;
|
|
155898
155988
|
}
|
|
155899
|
-
function getImpliedNodeFormatForEmit(file, program) {
|
|
155900
|
-
return isFullSourceFile(file) ? program.getImpliedNodeFormatForEmit(file) : getImpliedNodeFormatForEmitWorker(file, program.getCompilerOptions());
|
|
155901
|
-
}
|
|
155902
|
-
function getEmitModuleFormatOfFile(file, program) {
|
|
155903
|
-
return isFullSourceFile(file) ? program.getEmitModuleFormatOfFile(file) : getEmitModuleFormatOfFileWorker(file, program.getCompilerOptions());
|
|
155904
|
-
}
|
|
155905
155989
|
|
|
155906
155990
|
// src/services/codefixes/fixAddMissingConstraint.ts
|
|
155907
155991
|
var fixId17 = "addMissingConstraint";
|
|
@@ -163174,12 +163258,10 @@ function getJSDocParamAnnotation(paramName, initializer, dotDotDotToken, isJs, i
|
|
|
163174
163258
|
const printer = isSnippet ? createSnippetPrinter({
|
|
163175
163259
|
removeComments: true,
|
|
163176
163260
|
module: options.module,
|
|
163177
|
-
moduleResolution: options.moduleResolution,
|
|
163178
163261
|
target: options.target
|
|
163179
163262
|
}) : createPrinter({
|
|
163180
163263
|
removeComments: true,
|
|
163181
163264
|
module: options.module,
|
|
163182
|
-
moduleResolution: options.moduleResolution,
|
|
163183
163265
|
target: options.target
|
|
163184
163266
|
});
|
|
163185
163267
|
setEmitFlags(typeNode, 1 /* SingleLine */);
|
|
@@ -163435,7 +163517,6 @@ function getExhaustiveCaseSnippets(caseBlock, sourceFile, preferences, options,
|
|
|
163435
163517
|
const printer = createSnippetPrinter({
|
|
163436
163518
|
removeComments: true,
|
|
163437
163519
|
module: options.module,
|
|
163438
|
-
moduleResolution: options.moduleResolution,
|
|
163439
163520
|
target: options.target,
|
|
163440
163521
|
newLine: getNewLineKind(newLineChar)
|
|
163441
163522
|
});
|
|
@@ -163622,7 +163703,7 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
|
|
|
163622
163703
|
if (originIsResolvedExport(origin)) {
|
|
163623
163704
|
sourceDisplay = [textPart(origin.moduleSpecifier)];
|
|
163624
163705
|
if (importStatementCompletion) {
|
|
163625
|
-
({ insertText, replacementSpan } = getInsertTextAndReplacementSpanForImportCompletion(name, importStatementCompletion, origin, useSemicolons, sourceFile,
|
|
163706
|
+
({ insertText, replacementSpan } = getInsertTextAndReplacementSpanForImportCompletion(name, importStatementCompletion, origin, useSemicolons, sourceFile, options, preferences));
|
|
163626
163707
|
isSnippet = preferences.includeCompletionsWithSnippetText ? true : void 0;
|
|
163627
163708
|
}
|
|
163628
163709
|
}
|
|
@@ -163763,7 +163844,6 @@ function getEntryForMemberCompletion(host, program, options, preferences, name,
|
|
|
163763
163844
|
const printer = createSnippetPrinter({
|
|
163764
163845
|
removeComments: true,
|
|
163765
163846
|
module: options.module,
|
|
163766
|
-
moduleResolution: options.moduleResolution,
|
|
163767
163847
|
target: options.target,
|
|
163768
163848
|
omitTrailingSemicolon: false,
|
|
163769
163849
|
newLine: getNewLineKind(getNewLineOrDefaultFromHost(host, formatContext == null ? void 0 : formatContext.options))
|
|
@@ -163914,7 +163994,6 @@ function getEntryForObjectLiteralMethodCompletion(symbol, name, enclosingDeclara
|
|
|
163914
163994
|
const printer = createSnippetPrinter({
|
|
163915
163995
|
removeComments: true,
|
|
163916
163996
|
module: options.module,
|
|
163917
|
-
moduleResolution: options.moduleResolution,
|
|
163918
163997
|
target: options.target,
|
|
163919
163998
|
omitTrailingSemicolon: false,
|
|
163920
163999
|
newLine: getNewLineKind(getNewLineOrDefaultFromHost(host, formatContext == null ? void 0 : formatContext.options))
|
|
@@ -163935,7 +164014,6 @@ function getEntryForObjectLiteralMethodCompletion(symbol, name, enclosingDeclara
|
|
|
163935
164014
|
const signaturePrinter = createPrinter({
|
|
163936
164015
|
removeComments: true,
|
|
163937
164016
|
module: options.module,
|
|
163938
|
-
moduleResolution: options.moduleResolution,
|
|
163939
164017
|
target: options.target,
|
|
163940
164018
|
omitTrailingSemicolon: true
|
|
163941
164019
|
});
|
|
@@ -164197,7 +164275,7 @@ function completionEntryDataToSymbolOriginInfo(data, completionName, moduleSymbo
|
|
|
164197
164275
|
};
|
|
164198
164276
|
return unresolvedOrigin;
|
|
164199
164277
|
}
|
|
164200
|
-
function getInsertTextAndReplacementSpanForImportCompletion(name, importStatementCompletion, origin, useSemicolons, sourceFile,
|
|
164278
|
+
function getInsertTextAndReplacementSpanForImportCompletion(name, importStatementCompletion, origin, useSemicolons, sourceFile, options, preferences) {
|
|
164201
164279
|
const replacementSpan = importStatementCompletion.replacementSpan;
|
|
164202
164280
|
const quotedModuleSpecifier = escapeSnippetText(quote(sourceFile, preferences, origin.moduleSpecifier));
|
|
164203
164281
|
const exportKind = origin.isDefaultExport ? 1 /* Default */ : origin.exportName === "export=" /* ExportEquals */ ? 2 /* ExportEquals */ : 0 /* Named */;
|
|
@@ -164205,7 +164283,7 @@ function getInsertTextAndReplacementSpanForImportCompletion(name, importStatemen
|
|
|
164205
164283
|
const importKind = ts_codefix_exports.getImportKind(
|
|
164206
164284
|
sourceFile,
|
|
164207
164285
|
exportKind,
|
|
164208
|
-
|
|
164286
|
+
options,
|
|
164209
164287
|
/*forceImportKeyword*/
|
|
164210
164288
|
true
|
|
164211
164289
|
);
|
|
@@ -166584,7 +166662,7 @@ function createNameAndKindSet() {
|
|
|
166584
166662
|
}
|
|
166585
166663
|
function getStringLiteralCompletions(sourceFile, position, contextToken, options, host, program, log, preferences, includeSymbol) {
|
|
166586
166664
|
if (isInReferenceComment(sourceFile, position)) {
|
|
166587
|
-
const entries = getTripleSlashReferenceCompletion(sourceFile, position,
|
|
166665
|
+
const entries = getTripleSlashReferenceCompletion(sourceFile, position, options, host);
|
|
166588
166666
|
return entries && convertPathCompletions(entries);
|
|
166589
166667
|
}
|
|
166590
166668
|
if (isInString(sourceFile, position, contextToken)) {
|
|
@@ -166907,7 +166985,7 @@ function getStringLiteralCompletionsFromModuleNamesWorker(sourceFile, node, prog
|
|
|
166907
166985
|
const compilerOptions = program.getCompilerOptions();
|
|
166908
166986
|
const typeChecker = program.getTypeChecker();
|
|
166909
166987
|
const extensionOptions = getExtensionOptions(compilerOptions, 1 /* ModuleSpecifier */, sourceFile, typeChecker, preferences, mode);
|
|
166910
|
-
return isPathRelativeToScript(literalValue) || !compilerOptions.baseUrl && !compilerOptions.paths && (isRootedDiskPath(literalValue) || isUrl(literalValue)) ? getCompletionEntriesForRelativeModules(literalValue, scriptDirectory,
|
|
166988
|
+
return isPathRelativeToScript(literalValue) || !compilerOptions.baseUrl && !compilerOptions.paths && (isRootedDiskPath(literalValue) || isUrl(literalValue)) ? getCompletionEntriesForRelativeModules(literalValue, scriptDirectory, compilerOptions, host, scriptPath, extensionOptions) : getCompletionEntriesForNonRelativeModules(literalValue, scriptDirectory, mode, compilerOptions, host, extensionOptions, typeChecker);
|
|
166911
166989
|
}
|
|
166912
166990
|
function getExtensionOptions(compilerOptions, referenceKind, importingSourceFile, typeChecker, preferences, resolutionMode) {
|
|
166913
166991
|
return {
|
|
@@ -166918,15 +166996,14 @@ function getExtensionOptions(compilerOptions, referenceKind, importingSourceFile
|
|
|
166918
166996
|
resolutionMode
|
|
166919
166997
|
};
|
|
166920
166998
|
}
|
|
166921
|
-
function getCompletionEntriesForRelativeModules(literalValue, scriptDirectory,
|
|
166922
|
-
const compilerOptions = program.getCompilerOptions();
|
|
166999
|
+
function getCompletionEntriesForRelativeModules(literalValue, scriptDirectory, compilerOptions, host, scriptPath, extensionOptions) {
|
|
166923
167000
|
if (compilerOptions.rootDirs) {
|
|
166924
167001
|
return getCompletionEntriesForDirectoryFragmentWithRootDirs(
|
|
166925
167002
|
compilerOptions.rootDirs,
|
|
166926
167003
|
literalValue,
|
|
166927
167004
|
scriptDirectory,
|
|
166928
167005
|
extensionOptions,
|
|
166929
|
-
|
|
167006
|
+
compilerOptions,
|
|
166930
167007
|
host,
|
|
166931
167008
|
scriptPath
|
|
166932
167009
|
);
|
|
@@ -166935,7 +167012,6 @@ function getCompletionEntriesForRelativeModules(literalValue, scriptDirectory, p
|
|
|
166935
167012
|
literalValue,
|
|
166936
167013
|
scriptDirectory,
|
|
166937
167014
|
extensionOptions,
|
|
166938
|
-
program,
|
|
166939
167015
|
host,
|
|
166940
167016
|
/*moduleSpecifierIsRelative*/
|
|
166941
167017
|
true,
|
|
@@ -166962,8 +167038,7 @@ function getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ign
|
|
|
166962
167038
|
compareStringsCaseSensitive
|
|
166963
167039
|
);
|
|
166964
167040
|
}
|
|
166965
|
-
function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptDirectory, extensionOptions,
|
|
166966
|
-
const compilerOptions = program.getCompilerOptions();
|
|
167041
|
+
function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment, scriptDirectory, extensionOptions, compilerOptions, host, exclude) {
|
|
166967
167042
|
const basePath = compilerOptions.project || host.getCurrentDirectory();
|
|
166968
167043
|
const ignoreCase = !(host.useCaseSensitiveFileNames && host.useCaseSensitiveFileNames());
|
|
166969
167044
|
const baseDirectories = getBaseDirectoriesFromRootDirs(rootDirs, basePath, scriptDirectory, ignoreCase);
|
|
@@ -166972,7 +167047,6 @@ function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment
|
|
|
166972
167047
|
fragment,
|
|
166973
167048
|
baseDirectory,
|
|
166974
167049
|
extensionOptions,
|
|
166975
|
-
program,
|
|
166976
167050
|
host,
|
|
166977
167051
|
/*moduleSpecifierIsRelative*/
|
|
166978
167052
|
true,
|
|
@@ -166981,7 +167055,7 @@ function getCompletionEntriesForDirectoryFragmentWithRootDirs(rootDirs, fragment
|
|
|
166981
167055
|
(itemA, itemB) => itemA.name === itemB.name && itemA.kind === itemB.kind && itemA.extension === itemB.extension
|
|
166982
167056
|
);
|
|
166983
167057
|
}
|
|
166984
|
-
function getCompletionEntriesForDirectoryFragment(fragment, scriptDirectory, extensionOptions,
|
|
167058
|
+
function getCompletionEntriesForDirectoryFragment(fragment, scriptDirectory, extensionOptions, host, moduleSpecifierIsRelative, exclude, result = createNameAndKindSet()) {
|
|
166985
167059
|
var _a;
|
|
166986
167060
|
if (fragment === void 0) {
|
|
166987
167061
|
fragment = "";
|
|
@@ -167006,7 +167080,7 @@ function getCompletionEntriesForDirectoryFragment(fragment, scriptDirectory, ext
|
|
|
167006
167080
|
if (versionPaths) {
|
|
167007
167081
|
const packageDirectory = getDirectoryPath(packageJsonPath);
|
|
167008
167082
|
const pathInPackage = absolutePath.slice(ensureTrailingDirectorySeparator(packageDirectory).length);
|
|
167009
|
-
if (addCompletionEntriesFromPaths(result, pathInPackage, packageDirectory, extensionOptions,
|
|
167083
|
+
if (addCompletionEntriesFromPaths(result, pathInPackage, packageDirectory, extensionOptions, host, versionPaths)) {
|
|
167010
167084
|
return result;
|
|
167011
167085
|
}
|
|
167012
167086
|
}
|
|
@@ -167032,7 +167106,7 @@ function getCompletionEntriesForDirectoryFragment(fragment, scriptDirectory, ext
|
|
|
167032
167106
|
}
|
|
167033
167107
|
const { name, extension } = getFilenameWithExtensionOption(
|
|
167034
167108
|
getBaseFileName(filePath),
|
|
167035
|
-
|
|
167109
|
+
host.getCompilationSettings(),
|
|
167036
167110
|
extensionOptions,
|
|
167037
167111
|
/*isExportsWildcard*/
|
|
167038
167112
|
false
|
|
@@ -167051,7 +167125,7 @@ function getCompletionEntriesForDirectoryFragment(fragment, scriptDirectory, ext
|
|
|
167051
167125
|
}
|
|
167052
167126
|
return result;
|
|
167053
167127
|
}
|
|
167054
|
-
function getFilenameWithExtensionOption(name,
|
|
167128
|
+
function getFilenameWithExtensionOption(name, compilerOptions, extensionOptions, isExportsWildcard) {
|
|
167055
167129
|
const nonJsResult = ts_moduleSpecifiers_exports.tryGetRealFileNameForNonJsDeclarationFileName(name);
|
|
167056
167130
|
if (nonJsResult) {
|
|
167057
167131
|
return { name: nonJsResult, extension: tryGetExtensionFromPath2(nonJsResult) };
|
|
@@ -167061,8 +167135,7 @@ function getFilenameWithExtensionOption(name, program, extensionOptions, isExpor
|
|
|
167061
167135
|
}
|
|
167062
167136
|
let allowedEndings = getModuleSpecifierPreferences(
|
|
167063
167137
|
{ importModuleSpecifierEnding: extensionOptions.endingPreference },
|
|
167064
|
-
|
|
167065
|
-
program.getCompilerOptions(),
|
|
167138
|
+
compilerOptions,
|
|
167066
167139
|
extensionOptions.importingSourceFile
|
|
167067
167140
|
).getAllowedEndingsInPreferredOrder(extensionOptions.resolutionMode);
|
|
167068
167141
|
if (isExportsWildcard) {
|
|
@@ -167072,16 +167145,16 @@ function getFilenameWithExtensionOption(name, program, extensionOptions, isExpor
|
|
|
167072
167145
|
if (fileExtensionIsOneOf(name, supportedTSImplementationExtensions)) {
|
|
167073
167146
|
return { name, extension: tryGetExtensionFromPath2(name) };
|
|
167074
167147
|
}
|
|
167075
|
-
const outputExtension2 = ts_moduleSpecifiers_exports.tryGetJSExtensionForFile(name,
|
|
167148
|
+
const outputExtension2 = ts_moduleSpecifiers_exports.tryGetJSExtensionForFile(name, compilerOptions);
|
|
167076
167149
|
return outputExtension2 ? { name: changeExtension(name, outputExtension2), extension: outputExtension2 } : { name, extension: tryGetExtensionFromPath2(name) };
|
|
167077
167150
|
}
|
|
167078
167151
|
if (!isExportsWildcard && (allowedEndings[0] === 0 /* Minimal */ || allowedEndings[0] === 1 /* Index */) && fileExtensionIsOneOf(name, [".js" /* Js */, ".jsx" /* Jsx */, ".ts" /* Ts */, ".tsx" /* Tsx */, ".d.ts" /* Dts */])) {
|
|
167079
167152
|
return { name: removeFileExtension(name), extension: tryGetExtensionFromPath2(name) };
|
|
167080
167153
|
}
|
|
167081
|
-
const outputExtension = ts_moduleSpecifiers_exports.tryGetJSExtensionForFile(name,
|
|
167154
|
+
const outputExtension = ts_moduleSpecifiers_exports.tryGetJSExtensionForFile(name, compilerOptions);
|
|
167082
167155
|
return outputExtension ? { name: changeExtension(name, outputExtension), extension: outputExtension } : { name, extension: tryGetExtensionFromPath2(name) };
|
|
167083
167156
|
}
|
|
167084
|
-
function addCompletionEntriesFromPaths(result, fragment, baseDirectory, extensionOptions,
|
|
167157
|
+
function addCompletionEntriesFromPaths(result, fragment, baseDirectory, extensionOptions, host, paths) {
|
|
167085
167158
|
const getPatternsForKey = (key) => paths[key];
|
|
167086
167159
|
const comparePaths2 = (a, b) => {
|
|
167087
167160
|
const patternA = tryParsePattern(a);
|
|
@@ -167097,14 +167170,13 @@ function addCompletionEntriesFromPaths(result, fragment, baseDirectory, extensio
|
|
|
167097
167170
|
fragment,
|
|
167098
167171
|
baseDirectory,
|
|
167099
167172
|
extensionOptions,
|
|
167100
|
-
program,
|
|
167101
167173
|
host,
|
|
167102
167174
|
getOwnKeys(paths),
|
|
167103
167175
|
getPatternsForKey,
|
|
167104
167176
|
comparePaths2
|
|
167105
167177
|
);
|
|
167106
167178
|
}
|
|
167107
|
-
function addCompletionEntriesFromPathsOrExports(result, isExports, fragment, baseDirectory, extensionOptions,
|
|
167179
|
+
function addCompletionEntriesFromPathsOrExports(result, isExports, fragment, baseDirectory, extensionOptions, host, keys, getPatternsForKey, comparePaths2) {
|
|
167108
167180
|
let pathResults = [];
|
|
167109
167181
|
let matchedPath;
|
|
167110
167182
|
for (const key of keys) {
|
|
@@ -167123,7 +167195,7 @@ function addCompletionEntriesFromPathsOrExports(result, isExports, fragment, bas
|
|
|
167123
167195
|
if (typeof pathPattern === "string" || matchedPath === void 0 || comparePaths2(key, matchedPath) !== 1 /* GreaterThan */) {
|
|
167124
167196
|
pathResults.push({
|
|
167125
167197
|
matchedPattern: isMatch,
|
|
167126
|
-
results: getCompletionsForPathMapping(keyWithoutLeadingDotSlash, patterns, fragment, baseDirectory, extensionOptions, isExports && isMatch,
|
|
167198
|
+
results: getCompletionsForPathMapping(keyWithoutLeadingDotSlash, patterns, fragment, baseDirectory, extensionOptions, isExports && isMatch, host).map(({ name, kind, extension }) => nameAndKind(name, kind, extension))
|
|
167127
167199
|
});
|
|
167128
167200
|
}
|
|
167129
167201
|
}
|
|
@@ -167131,9 +167203,7 @@ function addCompletionEntriesFromPathsOrExports(result, isExports, fragment, bas
|
|
|
167131
167203
|
pathResults.forEach((pathResult) => pathResult.results.forEach((r) => result.add(r)));
|
|
167132
167204
|
return matchedPath !== void 0;
|
|
167133
167205
|
}
|
|
167134
|
-
function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode,
|
|
167135
|
-
const typeChecker = program.getTypeChecker();
|
|
167136
|
-
const compilerOptions = program.getCompilerOptions();
|
|
167206
|
+
function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, compilerOptions, host, extensionOptions, typeChecker) {
|
|
167137
167207
|
const { baseUrl, paths } = compilerOptions;
|
|
167138
167208
|
const result = createNameAndKindSet();
|
|
167139
167209
|
const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
|
|
@@ -167143,7 +167213,6 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, p
|
|
|
167143
167213
|
fragment,
|
|
167144
167214
|
absolute,
|
|
167145
167215
|
extensionOptions,
|
|
167146
|
-
program,
|
|
167147
167216
|
host,
|
|
167148
167217
|
/*moduleSpecifierIsRelative*/
|
|
167149
167218
|
false,
|
|
@@ -167154,7 +167223,7 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, p
|
|
|
167154
167223
|
}
|
|
167155
167224
|
if (paths) {
|
|
167156
167225
|
const absolute = getPathsBasePath(compilerOptions, host);
|
|
167157
|
-
addCompletionEntriesFromPaths(result, fragment, absolute, extensionOptions,
|
|
167226
|
+
addCompletionEntriesFromPaths(result, fragment, absolute, extensionOptions, host, paths);
|
|
167158
167227
|
}
|
|
167159
167228
|
const fragmentDirectory = getFragmentDirectory(fragment);
|
|
167160
167229
|
for (const ambientName of getAmbientModuleCompletions(fragment, fragmentDirectory, typeChecker)) {
|
|
@@ -167165,7 +167234,7 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, p
|
|
|
167165
167234
|
void 0
|
|
167166
167235
|
));
|
|
167167
167236
|
}
|
|
167168
|
-
getCompletionEntriesFromTypings(host,
|
|
167237
|
+
getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, fragmentDirectory, extensionOptions, result);
|
|
167169
167238
|
if (moduleResolutionUsesNodeModules(moduleResolution)) {
|
|
167170
167239
|
let foundGlobal = false;
|
|
167171
167240
|
if (fragmentDirectory === void 0) {
|
|
@@ -167190,7 +167259,6 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, p
|
|
|
167190
167259
|
fragment,
|
|
167191
167260
|
nodeModules,
|
|
167192
167261
|
extensionOptions,
|
|
167193
|
-
program,
|
|
167194
167262
|
host,
|
|
167195
167263
|
/*moduleSpecifierIsRelative*/
|
|
167196
167264
|
false,
|
|
@@ -167235,7 +167303,6 @@ function getCompletionEntriesForNonRelativeModules(fragment, scriptPath, mode, p
|
|
|
167235
167303
|
fragmentSubpath,
|
|
167236
167304
|
packageDirectory,
|
|
167237
167305
|
extensionOptions,
|
|
167238
|
-
program,
|
|
167239
167306
|
host,
|
|
167240
167307
|
keys,
|
|
167241
167308
|
(key) => singleElementArray(getPatternFromFirstMatchingCondition(exports2[key], conditions)),
|
|
@@ -167268,7 +167335,7 @@ function getPatternFromFirstMatchingCondition(target, conditions) {
|
|
|
167268
167335
|
function getFragmentDirectory(fragment) {
|
|
167269
167336
|
return containsSlash(fragment) ? hasTrailingDirectorySeparator(fragment) ? fragment : getDirectoryPath(fragment) : void 0;
|
|
167270
167337
|
}
|
|
167271
|
-
function getCompletionsForPathMapping(path, patterns, fragment, packageDirectory, extensionOptions, isExportsWildcard,
|
|
167338
|
+
function getCompletionsForPathMapping(path, patterns, fragment, packageDirectory, extensionOptions, isExportsWildcard, host) {
|
|
167272
167339
|
if (!endsWith(path, "*")) {
|
|
167273
167340
|
return !path.includes("*") ? justPathMappingName(path, "script" /* scriptElement */) : emptyArray;
|
|
167274
167341
|
}
|
|
@@ -167278,15 +167345,15 @@ function getCompletionsForPathMapping(path, patterns, fragment, packageDirectory
|
|
|
167278
167345
|
const starIsFullPathComponent = path[path.length - 2] === "/";
|
|
167279
167346
|
return starIsFullPathComponent ? justPathMappingName(pathPrefix, "directory" /* directory */) : flatMap(patterns, (pattern) => {
|
|
167280
167347
|
var _a;
|
|
167281
|
-
return (_a = getModulesForPathsPattern("", packageDirectory, pattern, extensionOptions, isExportsWildcard,
|
|
167348
|
+
return (_a = getModulesForPathsPattern("", packageDirectory, pattern, extensionOptions, isExportsWildcard, host)) == null ? void 0 : _a.map(({ name, ...rest }) => ({ name: pathPrefix + name, ...rest }));
|
|
167282
167349
|
});
|
|
167283
167350
|
}
|
|
167284
|
-
return flatMap(patterns, (pattern) => getModulesForPathsPattern(remainingFragment, packageDirectory, pattern, extensionOptions, isExportsWildcard,
|
|
167351
|
+
return flatMap(patterns, (pattern) => getModulesForPathsPattern(remainingFragment, packageDirectory, pattern, extensionOptions, isExportsWildcard, host));
|
|
167285
167352
|
function justPathMappingName(name, kind) {
|
|
167286
167353
|
return startsWith(name, fragment) ? [{ name: removeTrailingDirectorySeparator(name), kind, extension: void 0 }] : emptyArray;
|
|
167287
167354
|
}
|
|
167288
167355
|
}
|
|
167289
|
-
function getModulesForPathsPattern(fragment, packageDirectory, pattern, extensionOptions, isExportsWildcard,
|
|
167356
|
+
function getModulesForPathsPattern(fragment, packageDirectory, pattern, extensionOptions, isExportsWildcard, host) {
|
|
167290
167357
|
if (!host.readDirectory) {
|
|
167291
167358
|
return void 0;
|
|
167292
167359
|
}
|
|
@@ -167319,7 +167386,7 @@ function getModulesForPathsPattern(fragment, packageDirectory, pattern, extensio
|
|
|
167319
167386
|
if (containsSlash(trimmedWithPattern)) {
|
|
167320
167387
|
return directoryResult(getPathComponents(removeLeadingDirectorySeparator(trimmedWithPattern))[1]);
|
|
167321
167388
|
}
|
|
167322
|
-
const { name, extension } = getFilenameWithExtensionOption(trimmedWithPattern,
|
|
167389
|
+
const { name, extension } = getFilenameWithExtensionOption(trimmedWithPattern, host.getCompilationSettings(), extensionOptions, isExportsWildcard);
|
|
167323
167390
|
return nameAndKind(name, "script" /* scriptElement */, extension);
|
|
167324
167391
|
}
|
|
167325
167392
|
});
|
|
@@ -167347,8 +167414,7 @@ function getAmbientModuleCompletions(fragment, fragmentDirectory, checker) {
|
|
|
167347
167414
|
}
|
|
167348
167415
|
return nonRelativeModuleNames;
|
|
167349
167416
|
}
|
|
167350
|
-
function getTripleSlashReferenceCompletion(sourceFile, position,
|
|
167351
|
-
const compilerOptions = program.getCompilerOptions();
|
|
167417
|
+
function getTripleSlashReferenceCompletion(sourceFile, position, compilerOptions, host) {
|
|
167352
167418
|
const token = getTokenAtPosition(sourceFile, position);
|
|
167353
167419
|
const commentRanges = getLeadingCommentRanges(sourceFile.text, token.pos);
|
|
167354
167420
|
const range = commentRanges && find(commentRanges, (commentRange) => position >= commentRange.pos && position <= commentRange.end);
|
|
@@ -167366,16 +167432,14 @@ function getTripleSlashReferenceCompletion(sourceFile, position, program, host)
|
|
|
167366
167432
|
toComplete,
|
|
167367
167433
|
scriptPath,
|
|
167368
167434
|
getExtensionOptions(compilerOptions, 0 /* Filename */, sourceFile),
|
|
167369
|
-
program,
|
|
167370
167435
|
host,
|
|
167371
167436
|
/*moduleSpecifierIsRelative*/
|
|
167372
167437
|
true,
|
|
167373
167438
|
sourceFile.path
|
|
167374
|
-
) : kind === "types" ? getCompletionEntriesFromTypings(host,
|
|
167439
|
+
) : kind === "types" ? getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, getFragmentDirectory(toComplete), getExtensionOptions(compilerOptions, 1 /* ModuleSpecifier */, sourceFile)) : Debug.fail();
|
|
167375
167440
|
return addReplacementSpans(toComplete, range.pos + prefix.length, arrayFrom(names.values()));
|
|
167376
167441
|
}
|
|
167377
|
-
function getCompletionEntriesFromTypings(host,
|
|
167378
|
-
const options = program.getCompilerOptions();
|
|
167442
|
+
function getCompletionEntriesFromTypings(host, options, scriptPath, fragmentDirectory, extensionOptions, result = createNameAndKindSet()) {
|
|
167379
167443
|
const seen = /* @__PURE__ */ new Map();
|
|
167380
167444
|
const typeRoots = tryAndIgnoreErrors(() => getEffectiveTypeRoots(options, host)) || emptyArray;
|
|
167381
167445
|
for (const root of typeRoots) {
|
|
@@ -167409,7 +167473,6 @@ function getCompletionEntriesFromTypings(host, program, scriptPath, fragmentDire
|
|
|
167409
167473
|
remainingFragment,
|
|
167410
167474
|
baseDirectory,
|
|
167411
167475
|
extensionOptions,
|
|
167412
|
-
program,
|
|
167413
167476
|
host,
|
|
167414
167477
|
/*moduleSpecifierIsRelative*/
|
|
167415
167478
|
false,
|
|
@@ -178748,6 +178811,7 @@ __export(ts_exports2, {
|
|
|
178748
178811
|
buildOverload: () => buildOverload,
|
|
178749
178812
|
bundlerModuleNameResolver: () => bundlerModuleNameResolver,
|
|
178750
178813
|
canBeConvertedToAsync: () => canBeConvertedToAsync,
|
|
178814
|
+
canEmitTsBuildInfo: () => canEmitTsBuildInfo,
|
|
178751
178815
|
canHaveDecorators: () => canHaveDecorators,
|
|
178752
178816
|
canHaveExportModifier: () => canHaveExportModifier,
|
|
178753
178817
|
canHaveFlowNode: () => canHaveFlowNode,
|
|
@@ -178758,9 +178822,8 @@ __export(ts_exports2, {
|
|
|
178758
178822
|
canHaveJSDoc: () => canHaveJSDoc,
|
|
178759
178823
|
canHaveLocals: () => canHaveLocals,
|
|
178760
178824
|
canHaveModifiers: () => canHaveModifiers,
|
|
178761
|
-
canHaveModuleSpecifier: () => canHaveModuleSpecifier,
|
|
178762
178825
|
canHaveSymbol: () => canHaveSymbol,
|
|
178763
|
-
|
|
178826
|
+
canIncludeBindAndCheckDiagnostics: () => canIncludeBindAndCheckDiagnostics,
|
|
178764
178827
|
canJsonReportNoInputFiles: () => canJsonReportNoInputFiles,
|
|
178765
178828
|
canProduceDiagnostics: () => canProduceDiagnostics,
|
|
178766
178829
|
canUsePropertyAccess: () => canUsePropertyAccess,
|
|
@@ -179235,7 +179298,6 @@ __export(ts_exports2, {
|
|
|
179235
179298
|
getDefaultLibFilePath: () => getDefaultLibFilePath,
|
|
179236
179299
|
getDefaultLikeExportInfo: () => getDefaultLikeExportInfo,
|
|
179237
179300
|
getDefaultLikeExportNameFromDeclaration: () => getDefaultLikeExportNameFromDeclaration,
|
|
179238
|
-
getDefaultResolutionModeForFileWorker: () => getDefaultResolutionModeForFileWorker,
|
|
179239
179301
|
getDiagnosticText: () => getDiagnosticText,
|
|
179240
179302
|
getDiagnosticsWithinSpan: () => getDiagnosticsWithinSpan,
|
|
179241
179303
|
getDirectoryPath: () => getDirectoryPath,
|
|
@@ -179266,7 +179328,6 @@ __export(ts_exports2, {
|
|
|
179266
179328
|
getEmitFlags: () => getEmitFlags,
|
|
179267
179329
|
getEmitHelpers: () => getEmitHelpers,
|
|
179268
179330
|
getEmitModuleDetectionKind: () => getEmitModuleDetectionKind,
|
|
179269
|
-
getEmitModuleFormatOfFileWorker: () => getEmitModuleFormatOfFileWorker,
|
|
179270
179331
|
getEmitModuleKind: () => getEmitModuleKind,
|
|
179271
179332
|
getEmitModuleResolutionKind: () => getEmitModuleResolutionKind,
|
|
179272
179333
|
getEmitScriptTarget: () => getEmitScriptTarget,
|
|
@@ -179317,7 +179378,6 @@ __export(ts_exports2, {
|
|
|
179317
179378
|
getIdentifierGeneratedImportReference: () => getIdentifierGeneratedImportReference,
|
|
179318
179379
|
getIdentifierTypeArguments: () => getIdentifierTypeArguments,
|
|
179319
179380
|
getImmediatelyInvokedFunctionExpression: () => getImmediatelyInvokedFunctionExpression,
|
|
179320
|
-
getImpliedNodeFormatForEmitWorker: () => getImpliedNodeFormatForEmitWorker,
|
|
179321
179381
|
getImpliedNodeFormatForFile: () => getImpliedNodeFormatForFile,
|
|
179322
179382
|
getImpliedNodeFormatForFileWorker: () => getImpliedNodeFormatForFileWorker,
|
|
179323
179383
|
getImportNeedsImportDefaultHelper: () => getImportNeedsImportDefaultHelper,
|
|
@@ -179442,6 +179502,7 @@ __export(ts_exports2, {
|
|
|
179442
179502
|
getNonAssignmentOperatorForCompoundAssignment: () => getNonAssignmentOperatorForCompoundAssignment,
|
|
179443
179503
|
getNonAugmentationDeclaration: () => getNonAugmentationDeclaration,
|
|
179444
179504
|
getNonDecoratorTokenPosOfNode: () => getNonDecoratorTokenPosOfNode,
|
|
179505
|
+
getNonIncrementalBuildInfoRoots: () => getNonIncrementalBuildInfoRoots,
|
|
179445
179506
|
getNormalizedAbsolutePath: () => getNormalizedAbsolutePath,
|
|
179446
179507
|
getNormalizedAbsolutePathWithoutRoot: () => getNormalizedAbsolutePathWithoutRoot,
|
|
179447
179508
|
getNormalizedPathComponents: () => getNormalizedPathComponents,
|
|
@@ -179677,7 +179738,6 @@ __export(ts_exports2, {
|
|
|
179677
179738
|
importDefaultHelper: () => importDefaultHelper,
|
|
179678
179739
|
importFromModuleSpecifier: () => importFromModuleSpecifier,
|
|
179679
179740
|
importStarHelper: () => importStarHelper,
|
|
179680
|
-
importSyntaxAffectsModuleResolution: () => importSyntaxAffectsModuleResolution,
|
|
179681
179741
|
indexOfAnyCharCode: () => indexOfAnyCharCode,
|
|
179682
179742
|
indexOfNode: () => indexOfNode,
|
|
179683
179743
|
indicesOf: () => indicesOf,
|
|
@@ -180153,6 +180213,7 @@ __export(ts_exports2, {
|
|
|
180153
180213
|
isNonExportDefaultModifier: () => isNonExportDefaultModifier,
|
|
180154
180214
|
isNonGlobalAmbientModule: () => isNonGlobalAmbientModule,
|
|
180155
180215
|
isNonGlobalDeclaration: () => isNonGlobalDeclaration,
|
|
180216
|
+
isNonIncrementalBuildInfo: () => isNonIncrementalBuildInfo,
|
|
180156
180217
|
isNonNullAccess: () => isNonNullAccess,
|
|
180157
180218
|
isNonNullChain: () => isNonNullChain,
|
|
180158
180219
|
isNonNullExpression: () => isNonNullExpression,
|
|
@@ -180265,6 +180326,7 @@ __export(ts_exports2, {
|
|
|
180265
180326
|
isSimpleParameter: () => isSimpleParameter,
|
|
180266
180327
|
isSimpleParameterList: () => isSimpleParameterList,
|
|
180267
180328
|
isSingleOrDoubleQuote: () => isSingleOrDoubleQuote,
|
|
180329
|
+
isSourceElement: () => isSourceElement,
|
|
180268
180330
|
isSourceFile: () => isSourceFile,
|
|
180269
180331
|
isSourceFileFromLibrary: () => isSourceFileFromLibrary,
|
|
180270
180332
|
isSourceFileJS: () => isSourceFileJS,
|
|
@@ -180398,7 +180460,6 @@ __export(ts_exports2, {
|
|
|
180398
180460
|
linkNamePart: () => linkNamePart,
|
|
180399
180461
|
linkPart: () => linkPart,
|
|
180400
180462
|
linkTextPart: () => linkTextPart,
|
|
180401
|
-
listFiles: () => listFiles,
|
|
180402
180463
|
loadModuleFromGlobalCache: () => loadModuleFromGlobalCache,
|
|
180403
180464
|
loadWithModeAwareCache: () => loadWithModeAwareCache,
|
|
180404
180465
|
makeIdentifierFromModuleName: () => makeIdentifierFromModuleName,
|
|
@@ -180477,6 +180538,7 @@ __export(ts_exports2, {
|
|
|
180477
180538
|
noopFileWatcher: () => noopFileWatcher,
|
|
180478
180539
|
normalizePath: () => normalizePath,
|
|
180479
180540
|
normalizeSlashes: () => normalizeSlashes,
|
|
180541
|
+
normalizeSpans: () => normalizeSpans,
|
|
180480
180542
|
not: () => not,
|
|
180481
180543
|
notImplemented: () => notImplemented,
|
|
180482
180544
|
notImplementedResolver: () => notImplementedResolver,
|
|
@@ -180528,7 +180590,6 @@ __export(ts_exports2, {
|
|
|
180528
180590
|
pathIsBareSpecifier: () => pathIsBareSpecifier,
|
|
180529
180591
|
pathIsRelative: () => pathIsRelative,
|
|
180530
180592
|
patternText: () => patternText,
|
|
180531
|
-
perfLogger: () => perfLogger,
|
|
180532
180593
|
performIncrementalCompilation: () => performIncrementalCompilation,
|
|
180533
180594
|
performance: () => ts_performance_exports,
|
|
180534
180595
|
plainJSErrors: () => plainJSErrors,
|
|
@@ -180736,7 +180797,10 @@ __export(ts_exports2, {
|
|
|
180736
180797
|
textOrKeywordPart: () => textOrKeywordPart,
|
|
180737
180798
|
textPart: () => textPart,
|
|
180738
180799
|
textRangeContainsPositionInclusive: () => textRangeContainsPositionInclusive,
|
|
180800
|
+
textRangeContainsTextSpan: () => textRangeContainsTextSpan,
|
|
180801
|
+
textRangeIntersectsWithTextSpan: () => textRangeIntersectsWithTextSpan,
|
|
180739
180802
|
textSpanContainsPosition: () => textSpanContainsPosition,
|
|
180803
|
+
textSpanContainsTextRange: () => textSpanContainsTextRange,
|
|
180740
180804
|
textSpanContainsTextSpan: () => textSpanContainsTextSpan,
|
|
180741
180805
|
textSpanEnd: () => textSpanEnd,
|
|
180742
180806
|
textSpanIntersection: () => textSpanIntersection,
|
|
@@ -180777,11 +180841,11 @@ __export(ts_exports2, {
|
|
|
180777
180841
|
transformESDecorators: () => transformESDecorators,
|
|
180778
180842
|
transformESNext: () => transformESNext,
|
|
180779
180843
|
transformGenerators: () => transformGenerators,
|
|
180780
|
-
transformImpliedNodeFormatDependentModule: () => transformImpliedNodeFormatDependentModule,
|
|
180781
180844
|
transformJsx: () => transformJsx,
|
|
180782
180845
|
transformLegacyDecorators: () => transformLegacyDecorators,
|
|
180783
180846
|
transformModule: () => transformModule,
|
|
180784
180847
|
transformNamedEvaluation: () => transformNamedEvaluation,
|
|
180848
|
+
transformNodeModule: () => transformNodeModule,
|
|
180785
180849
|
transformNodes: () => transformNodes,
|
|
180786
180850
|
transformSystemModule: () => transformSystemModule,
|
|
180787
180851
|
transformTypeScript: () => transformTypeScript,
|
|
@@ -181613,14 +181677,11 @@ var ThrottledOperations = class _ThrottledOperations {
|
|
|
181613
181677
|
return this.pendingTimeouts.delete(operationId);
|
|
181614
181678
|
}
|
|
181615
181679
|
static run(operationId, self, cb) {
|
|
181616
|
-
var _a, _b;
|
|
181617
|
-
(_a = perfLogger) == null ? void 0 : _a.logStartScheduledOperation(operationId);
|
|
181618
181680
|
self.pendingTimeouts.delete(operationId);
|
|
181619
181681
|
if (self.logger) {
|
|
181620
181682
|
self.logger.info(`Running: ${operationId}`);
|
|
181621
181683
|
}
|
|
181622
181684
|
cb();
|
|
181623
|
-
(_b = perfLogger) == null ? void 0 : _b.logStopScheduledOperation();
|
|
181624
181685
|
}
|
|
181625
181686
|
};
|
|
181626
181687
|
var GcTimer = class _GcTimer {
|
|
@@ -181636,9 +181697,7 @@ var GcTimer = class _GcTimer {
|
|
|
181636
181697
|
this.timerId = this.host.setTimeout(_GcTimer.run, this.delay, this);
|
|
181637
181698
|
}
|
|
181638
181699
|
static run(self) {
|
|
181639
|
-
var _a, _b;
|
|
181640
181700
|
self.timerId = void 0;
|
|
181641
|
-
(_a = perfLogger) == null ? void 0 : _a.logStartScheduledOperation("GC collect");
|
|
181642
181701
|
const log = self.logger.hasLevel(2 /* requestTime */);
|
|
181643
181702
|
const before = log && self.host.getMemoryUsage();
|
|
181644
181703
|
self.host.gc();
|
|
@@ -181646,7 +181705,6 @@ var GcTimer = class _GcTimer {
|
|
|
181646
181705
|
const after = self.host.getMemoryUsage();
|
|
181647
181706
|
self.logger.perftrc(`GC::before ${before}, after ${after}`);
|
|
181648
181707
|
}
|
|
181649
|
-
(_b = perfLogger) == null ? void 0 : _b.logStopScheduledOperation();
|
|
181650
181708
|
}
|
|
181651
181709
|
};
|
|
181652
181710
|
function getBaseConfigFileName(configFilePath) {
|
|
@@ -183373,9 +183431,8 @@ var Project3 = class _Project {
|
|
|
183373
183431
|
* @returns: true if set of files in the project stays the same and false - otherwise.
|
|
183374
183432
|
*/
|
|
183375
183433
|
updateGraph() {
|
|
183376
|
-
var _a, _b
|
|
183434
|
+
var _a, _b;
|
|
183377
183435
|
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "updateGraph", { name: this.projectName, kind: ProjectKind[this.projectKind] });
|
|
183378
|
-
(_b = perfLogger) == null ? void 0 : _b.logStartUpdateGraph();
|
|
183379
183436
|
this.resolutionCache.startRecordingFilesWithChangedResolutions();
|
|
183380
183437
|
const hasNewProgram = this.updateGraphWorker();
|
|
183381
183438
|
const hasAddedorRemovedFiles = this.hasAddedorRemovedFiles;
|
|
@@ -183403,8 +183460,7 @@ var Project3 = class _Project {
|
|
|
183403
183460
|
if (isFirstProgramLoad) {
|
|
183404
183461
|
this.getPackageJsonAutoImportProvider();
|
|
183405
183462
|
}
|
|
183406
|
-
(
|
|
183407
|
-
(_d = tracing) == null ? void 0 : _d.pop();
|
|
183463
|
+
(_b = tracing) == null ? void 0 : _b.pop();
|
|
183408
183464
|
return !hasNewProgram;
|
|
183409
183465
|
}
|
|
183410
183466
|
/** @internal */
|
|
@@ -184152,8 +184208,11 @@ var Project3 = class _Project {
|
|
|
184152
184208
|
const originalText = Debug.checkDefined(rootSourceFile.getText());
|
|
184153
184209
|
(_b = this.getScriptInfo(rootFile)) == null ? void 0 : _b.editContent(0, originalText.length, updatedText);
|
|
184154
184210
|
this.updateGraph();
|
|
184155
|
-
|
|
184156
|
-
|
|
184211
|
+
try {
|
|
184212
|
+
cb(this.program, originalProgram, (_c = this.program) == null ? void 0 : _c.getSourceFile(rootFile));
|
|
184213
|
+
} finally {
|
|
184214
|
+
(_d = this.getScriptInfo(rootFile)) == null ? void 0 : _d.editContent(0, this.program.getSourceFile(rootFile).getText().length, originalText);
|
|
184215
|
+
}
|
|
184157
184216
|
}
|
|
184158
184217
|
/** @internal */
|
|
184159
184218
|
getCompilerOptionsForNoDtsResolutionProject() {
|
|
@@ -189094,6 +189153,9 @@ var invalidSyntacticModeCommands = [
|
|
|
189094
189153
|
var Session3 = class _Session {
|
|
189095
189154
|
constructor(opts) {
|
|
189096
189155
|
this.changeSeq = 0;
|
|
189156
|
+
// Minimum number of lines for attempting to use region diagnostics for a file.
|
|
189157
|
+
/** @internal */
|
|
189158
|
+
this.regionDiagLineCountThreshold = 500;
|
|
189097
189159
|
this.handlers = new Map(Object.entries({
|
|
189098
189160
|
// TODO(jakebailey): correctly type the handlers
|
|
189099
189161
|
["status" /* Status */]: () => {
|
|
@@ -189964,9 +190026,7 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
189964
190026
|
this.writeMessage(msg);
|
|
189965
190027
|
}
|
|
189966
190028
|
writeMessage(msg) {
|
|
189967
|
-
var _a;
|
|
189968
190029
|
const msgText = formatMessage2(msg, this.logger, this.byteLength, this.host.newLine);
|
|
189969
|
-
(_a = perfLogger) == null ? void 0 : _a.logEvent(`Response message size: ${msgText.length}`);
|
|
189970
190030
|
this.host.write(msgText);
|
|
189971
190031
|
}
|
|
189972
190032
|
event(body, eventName) {
|
|
@@ -190010,32 +190070,70 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
190010
190070
|
}
|
|
190011
190071
|
semanticCheck(file, project) {
|
|
190012
190072
|
var _a, _b;
|
|
190073
|
+
const diagnosticsStartTime = this.hrtime();
|
|
190013
190074
|
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "semanticCheck", { file, configFilePath: project.canonicalConfigFilePath });
|
|
190014
190075
|
const diags = isDeclarationFileInJSOnlyNonConfiguredProject(project, file) ? emptyArray2 : project.getLanguageService().getSemanticDiagnostics(file).filter((d) => !!d.file);
|
|
190015
|
-
this.sendDiagnosticsEvent(file, project, diags, "semanticDiag");
|
|
190076
|
+
this.sendDiagnosticsEvent(file, project, diags, "semanticDiag", diagnosticsStartTime);
|
|
190016
190077
|
(_b = tracing) == null ? void 0 : _b.pop();
|
|
190017
190078
|
}
|
|
190018
190079
|
syntacticCheck(file, project) {
|
|
190019
190080
|
var _a, _b;
|
|
190081
|
+
const diagnosticsStartTime = this.hrtime();
|
|
190020
190082
|
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "syntacticCheck", { file, configFilePath: project.canonicalConfigFilePath });
|
|
190021
|
-
this.sendDiagnosticsEvent(file, project, project.getLanguageService().getSyntacticDiagnostics(file), "syntaxDiag");
|
|
190083
|
+
this.sendDiagnosticsEvent(file, project, project.getLanguageService().getSyntacticDiagnostics(file), "syntaxDiag", diagnosticsStartTime);
|
|
190022
190084
|
(_b = tracing) == null ? void 0 : _b.pop();
|
|
190023
190085
|
}
|
|
190024
190086
|
suggestionCheck(file, project) {
|
|
190025
190087
|
var _a, _b;
|
|
190088
|
+
const diagnosticsStartTime = this.hrtime();
|
|
190026
190089
|
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "suggestionCheck", { file, configFilePath: project.canonicalConfigFilePath });
|
|
190027
|
-
this.sendDiagnosticsEvent(file, project, project.getLanguageService().getSuggestionDiagnostics(file), "suggestionDiag");
|
|
190090
|
+
this.sendDiagnosticsEvent(file, project, project.getLanguageService().getSuggestionDiagnostics(file), "suggestionDiag", diagnosticsStartTime);
|
|
190028
190091
|
(_b = tracing) == null ? void 0 : _b.pop();
|
|
190029
190092
|
}
|
|
190030
|
-
|
|
190093
|
+
regionSemanticCheck(file, project, ranges) {
|
|
190094
|
+
var _a, _b, _c;
|
|
190095
|
+
const diagnosticsStartTime = this.hrtime();
|
|
190096
|
+
(_a = tracing) == null ? void 0 : _a.push(tracing.Phase.Session, "regionSemanticCheck", { file, configFilePath: project.canonicalConfigFilePath });
|
|
190097
|
+
let diagnosticsResult;
|
|
190098
|
+
if (!this.shouldDoRegionCheck(file) || !(diagnosticsResult = project.getLanguageService().getRegionSemanticDiagnostics(file, ranges))) {
|
|
190099
|
+
(_b = tracing) == null ? void 0 : _b.pop();
|
|
190100
|
+
return;
|
|
190101
|
+
}
|
|
190102
|
+
this.sendDiagnosticsEvent(file, project, diagnosticsResult.diagnostics, "regionSemanticDiag", diagnosticsStartTime, diagnosticsResult.spans);
|
|
190103
|
+
(_c = tracing) == null ? void 0 : _c.pop();
|
|
190104
|
+
return;
|
|
190105
|
+
}
|
|
190106
|
+
// We should only do the region-based semantic check if we think it would be
|
|
190107
|
+
// considerably faster than a whole-file semantic check.
|
|
190108
|
+
/** @internal */
|
|
190109
|
+
shouldDoRegionCheck(file) {
|
|
190110
|
+
var _a;
|
|
190111
|
+
const lineCount = (_a = this.projectService.getScriptInfoForNormalizedPath(file)) == null ? void 0 : _a.textStorage.getLineInfo().getLineCount();
|
|
190112
|
+
return !!(lineCount && lineCount >= this.regionDiagLineCountThreshold);
|
|
190113
|
+
}
|
|
190114
|
+
sendDiagnosticsEvent(file, project, diagnostics, kind, diagnosticsStartTime, spans) {
|
|
190031
190115
|
try {
|
|
190032
|
-
|
|
190116
|
+
const scriptInfo = Debug.checkDefined(project.getScriptInfo(file));
|
|
190117
|
+
const duration = hrTimeToMilliseconds(this.hrtime(diagnosticsStartTime));
|
|
190118
|
+
const body = {
|
|
190119
|
+
file,
|
|
190120
|
+
diagnostics: diagnostics.map((diag2) => formatDiag(file, project, diag2)),
|
|
190121
|
+
spans: spans == null ? void 0 : spans.map((span) => toProtocolTextSpan(span, scriptInfo)),
|
|
190122
|
+
duration
|
|
190123
|
+
};
|
|
190124
|
+
this.event(
|
|
190125
|
+
body,
|
|
190126
|
+
kind
|
|
190127
|
+
);
|
|
190033
190128
|
} catch (err) {
|
|
190034
190129
|
this.logError(err, kind);
|
|
190035
190130
|
}
|
|
190036
190131
|
}
|
|
190037
190132
|
/** It is the caller's responsibility to verify that `!this.suppressDiagnosticEvents`. */
|
|
190038
190133
|
updateErrorCheck(next, checkList, ms, requireOpen = true) {
|
|
190134
|
+
if (checkList.length === 0) {
|
|
190135
|
+
return;
|
|
190136
|
+
}
|
|
190039
190137
|
Debug.assert(!this.suppressDiagnosticEvents);
|
|
190040
190138
|
const seq = this.changeSeq;
|
|
190041
190139
|
const followMs = Math.min(ms, 200);
|
|
@@ -190043,20 +190141,36 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
190043
190141
|
const goNext = () => {
|
|
190044
190142
|
index++;
|
|
190045
190143
|
if (checkList.length > index) {
|
|
190046
|
-
next.delay("checkOne", followMs, checkOne);
|
|
190144
|
+
return next.delay("checkOne", followMs, checkOne);
|
|
190145
|
+
}
|
|
190146
|
+
};
|
|
190147
|
+
const doSemanticCheck = (fileName, project) => {
|
|
190148
|
+
this.semanticCheck(fileName, project);
|
|
190149
|
+
if (this.changeSeq !== seq) {
|
|
190150
|
+
return;
|
|
190151
|
+
}
|
|
190152
|
+
if (this.getPreferences(fileName).disableSuggestions) {
|
|
190153
|
+
return goNext();
|
|
190047
190154
|
}
|
|
190155
|
+
next.immediate("suggestionCheck", () => {
|
|
190156
|
+
this.suggestionCheck(fileName, project);
|
|
190157
|
+
goNext();
|
|
190158
|
+
});
|
|
190048
190159
|
};
|
|
190049
190160
|
const checkOne = () => {
|
|
190050
190161
|
if (this.changeSeq !== seq) {
|
|
190051
190162
|
return;
|
|
190052
190163
|
}
|
|
190164
|
+
let ranges;
|
|
190053
190165
|
let item = checkList[index];
|
|
190054
190166
|
if (isString(item)) {
|
|
190055
190167
|
item = this.toPendingErrorCheck(item);
|
|
190056
|
-
|
|
190057
|
-
|
|
190058
|
-
|
|
190059
|
-
|
|
190168
|
+
} else if ("ranges" in item) {
|
|
190169
|
+
ranges = item.ranges;
|
|
190170
|
+
item = this.toPendingErrorCheck(item.file);
|
|
190171
|
+
}
|
|
190172
|
+
if (!item) {
|
|
190173
|
+
return goNext();
|
|
190060
190174
|
}
|
|
190061
190175
|
const { fileName, project } = item;
|
|
190062
190176
|
updateProjectIfDirty(project);
|
|
@@ -190068,23 +190182,21 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
190068
190182
|
return;
|
|
190069
190183
|
}
|
|
190070
190184
|
if (project.projectService.serverMode !== 0 /* Semantic */) {
|
|
190071
|
-
goNext();
|
|
190072
|
-
return;
|
|
190185
|
+
return goNext();
|
|
190073
190186
|
}
|
|
190074
|
-
|
|
190075
|
-
|
|
190076
|
-
|
|
190077
|
-
|
|
190078
|
-
|
|
190079
|
-
|
|
190080
|
-
|
|
190081
|
-
|
|
190082
|
-
|
|
190083
|
-
|
|
190084
|
-
this.suggestionCheck(fileName, project);
|
|
190085
|
-
goNext();
|
|
190187
|
+
if (ranges) {
|
|
190188
|
+
return next.immediate("regionSemanticCheck", () => {
|
|
190189
|
+
const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(fileName);
|
|
190190
|
+
if (scriptInfo) {
|
|
190191
|
+
this.regionSemanticCheck(fileName, project, ranges.map((range) => this.getRange({ file: fileName, ...range }, scriptInfo)));
|
|
190192
|
+
}
|
|
190193
|
+
if (this.changeSeq !== seq) {
|
|
190194
|
+
return;
|
|
190195
|
+
}
|
|
190196
|
+
next.immediate("semanticCheck", () => doSemanticCheck(fileName, project));
|
|
190086
190197
|
});
|
|
190087
|
-
}
|
|
190198
|
+
}
|
|
190199
|
+
next.immediate("semanticCheck", () => doSemanticCheck(fileName, project));
|
|
190088
190200
|
};
|
|
190089
190201
|
if (checkList.length > index && this.changeSeq === seq) {
|
|
190090
190202
|
next.delay("checkOne", ms, checkOne);
|
|
@@ -191163,12 +191275,12 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
191163
191275
|
const project = this.projectService.tryGetDefaultProjectForFile(fileName);
|
|
191164
191276
|
return project && { fileName, project };
|
|
191165
191277
|
}
|
|
191166
|
-
getDiagnostics(next, delay,
|
|
191278
|
+
getDiagnostics(next, delay, fileArgs) {
|
|
191167
191279
|
if (this.suppressDiagnosticEvents) {
|
|
191168
191280
|
return;
|
|
191169
191281
|
}
|
|
191170
|
-
if (
|
|
191171
|
-
this.updateErrorCheck(next,
|
|
191282
|
+
if (fileArgs.length > 0) {
|
|
191283
|
+
this.updateErrorCheck(next, fileArgs, delay);
|
|
191172
191284
|
}
|
|
191173
191285
|
}
|
|
191174
191286
|
change(args) {
|
|
@@ -191804,7 +191916,7 @@ ${e.message}`;
|
|
|
191804
191916
|
}
|
|
191805
191917
|
}
|
|
191806
191918
|
onMessage(message) {
|
|
191807
|
-
var _a, _b, _c, _d, _e, _f, _g
|
|
191919
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
191808
191920
|
this.gcTimer.scheduleCollect();
|
|
191809
191921
|
this.performanceData = void 0;
|
|
191810
191922
|
let start;
|
|
@@ -191820,8 +191932,7 @@ ${e.message}`;
|
|
|
191820
191932
|
request = this.parseMessage(message);
|
|
191821
191933
|
relevantFile = request.arguments && request.arguments.file ? request.arguments : void 0;
|
|
191822
191934
|
(_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.Session, "request", { seq: request.seq, command: request.command });
|
|
191823
|
-
(_b =
|
|
191824
|
-
(_c = tracing) == null ? void 0 : _c.push(
|
|
191935
|
+
(_b = tracing) == null ? void 0 : _b.push(
|
|
191825
191936
|
tracing.Phase.Session,
|
|
191826
191937
|
"executeCommand",
|
|
191827
191938
|
{ seq: request.seq, command: request.command },
|
|
@@ -191829,7 +191940,7 @@ ${e.message}`;
|
|
|
191829
191940
|
true
|
|
191830
191941
|
);
|
|
191831
191942
|
const { response, responseRequired } = this.executeCommand(request);
|
|
191832
|
-
(
|
|
191943
|
+
(_c = tracing) == null ? void 0 : _c.pop();
|
|
191833
191944
|
if (this.logger.hasLevel(2 /* requestTime */)) {
|
|
191834
191945
|
const elapsedTime = hrTimeToMilliseconds(this.hrtime(start)).toFixed(4);
|
|
191835
191946
|
if (responseRequired) {
|
|
@@ -191838,8 +191949,7 @@ ${e.message}`;
|
|
|
191838
191949
|
this.logger.perftrc(`${request.seq}::${request.command}: async elapsed time (in milliseconds) ${elapsedTime}`);
|
|
191839
191950
|
}
|
|
191840
191951
|
}
|
|
191841
|
-
(
|
|
191842
|
-
(_f = tracing) == null ? void 0 : _f.instant(tracing.Phase.Session, "response", { seq: request.seq, command: request.command, success: !!response });
|
|
191952
|
+
(_d = tracing) == null ? void 0 : _d.instant(tracing.Phase.Session, "response", { seq: request.seq, command: request.command, success: !!response });
|
|
191843
191953
|
if (response) {
|
|
191844
191954
|
this.doOutput(
|
|
191845
191955
|
response,
|
|
@@ -191860,10 +191970,9 @@ ${e.message}`;
|
|
|
191860
191970
|
);
|
|
191861
191971
|
}
|
|
191862
191972
|
} catch (err) {
|
|
191863
|
-
(
|
|
191973
|
+
(_e = tracing) == null ? void 0 : _e.popAll();
|
|
191864
191974
|
if (err instanceof OperationCanceledException) {
|
|
191865
|
-
(
|
|
191866
|
-
(_i = tracing) == null ? void 0 : _i.instant(tracing.Phase.Session, "commandCanceled", { seq: request == null ? void 0 : request.seq, command: request == null ? void 0 : request.command });
|
|
191975
|
+
(_f = tracing) == null ? void 0 : _f.instant(tracing.Phase.Session, "commandCanceled", { seq: request == null ? void 0 : request.seq, command: request == null ? void 0 : request.command });
|
|
191867
191976
|
this.doOutput(
|
|
191868
191977
|
{ canceled: true },
|
|
191869
191978
|
request.command,
|
|
@@ -191874,8 +191983,7 @@ ${e.message}`;
|
|
|
191874
191983
|
return;
|
|
191875
191984
|
}
|
|
191876
191985
|
this.logErrorWorker(err, this.toStringMessage(message), relevantFile);
|
|
191877
|
-
(
|
|
191878
|
-
(_k = tracing) == null ? void 0 : _k.instant(tracing.Phase.Session, "commandError", { seq: request == null ? void 0 : request.seq, command: request == null ? void 0 : request.command, message: err.message });
|
|
191986
|
+
(_g = tracing) == null ? void 0 : _g.instant(tracing.Phase.Session, "commandError", { seq: request == null ? void 0 : request.seq, command: request == null ? void 0 : request.command, message: err.message });
|
|
191879
191987
|
this.doOutput(
|
|
191880
191988
|
/*info*/
|
|
191881
191989
|
void 0,
|
|
@@ -193184,6 +193292,7 @@ if (typeof console !== "undefined") {
|
|
|
193184
193292
|
buildOverload,
|
|
193185
193293
|
bundlerModuleNameResolver,
|
|
193186
193294
|
canBeConvertedToAsync,
|
|
193295
|
+
canEmitTsBuildInfo,
|
|
193187
193296
|
canHaveDecorators,
|
|
193188
193297
|
canHaveExportModifier,
|
|
193189
193298
|
canHaveFlowNode,
|
|
@@ -193194,9 +193303,8 @@ if (typeof console !== "undefined") {
|
|
|
193194
193303
|
canHaveJSDoc,
|
|
193195
193304
|
canHaveLocals,
|
|
193196
193305
|
canHaveModifiers,
|
|
193197
|
-
canHaveModuleSpecifier,
|
|
193198
193306
|
canHaveSymbol,
|
|
193199
|
-
|
|
193307
|
+
canIncludeBindAndCheckDiagnostics,
|
|
193200
193308
|
canJsonReportNoInputFiles,
|
|
193201
193309
|
canProduceDiagnostics,
|
|
193202
193310
|
canUsePropertyAccess,
|
|
@@ -193671,7 +193779,6 @@ if (typeof console !== "undefined") {
|
|
|
193671
193779
|
getDefaultLibFilePath,
|
|
193672
193780
|
getDefaultLikeExportInfo,
|
|
193673
193781
|
getDefaultLikeExportNameFromDeclaration,
|
|
193674
|
-
getDefaultResolutionModeForFileWorker,
|
|
193675
193782
|
getDiagnosticText,
|
|
193676
193783
|
getDiagnosticsWithinSpan,
|
|
193677
193784
|
getDirectoryPath,
|
|
@@ -193702,7 +193809,6 @@ if (typeof console !== "undefined") {
|
|
|
193702
193809
|
getEmitFlags,
|
|
193703
193810
|
getEmitHelpers,
|
|
193704
193811
|
getEmitModuleDetectionKind,
|
|
193705
|
-
getEmitModuleFormatOfFileWorker,
|
|
193706
193812
|
getEmitModuleKind,
|
|
193707
193813
|
getEmitModuleResolutionKind,
|
|
193708
193814
|
getEmitScriptTarget,
|
|
@@ -193753,7 +193859,6 @@ if (typeof console !== "undefined") {
|
|
|
193753
193859
|
getIdentifierGeneratedImportReference,
|
|
193754
193860
|
getIdentifierTypeArguments,
|
|
193755
193861
|
getImmediatelyInvokedFunctionExpression,
|
|
193756
|
-
getImpliedNodeFormatForEmitWorker,
|
|
193757
193862
|
getImpliedNodeFormatForFile,
|
|
193758
193863
|
getImpliedNodeFormatForFileWorker,
|
|
193759
193864
|
getImportNeedsImportDefaultHelper,
|
|
@@ -193878,6 +193983,7 @@ if (typeof console !== "undefined") {
|
|
|
193878
193983
|
getNonAssignmentOperatorForCompoundAssignment,
|
|
193879
193984
|
getNonAugmentationDeclaration,
|
|
193880
193985
|
getNonDecoratorTokenPosOfNode,
|
|
193986
|
+
getNonIncrementalBuildInfoRoots,
|
|
193881
193987
|
getNormalizedAbsolutePath,
|
|
193882
193988
|
getNormalizedAbsolutePathWithoutRoot,
|
|
193883
193989
|
getNormalizedPathComponents,
|
|
@@ -194113,7 +194219,6 @@ if (typeof console !== "undefined") {
|
|
|
194113
194219
|
importDefaultHelper,
|
|
194114
194220
|
importFromModuleSpecifier,
|
|
194115
194221
|
importStarHelper,
|
|
194116
|
-
importSyntaxAffectsModuleResolution,
|
|
194117
194222
|
indexOfAnyCharCode,
|
|
194118
194223
|
indexOfNode,
|
|
194119
194224
|
indicesOf,
|
|
@@ -194589,6 +194694,7 @@ if (typeof console !== "undefined") {
|
|
|
194589
194694
|
isNonExportDefaultModifier,
|
|
194590
194695
|
isNonGlobalAmbientModule,
|
|
194591
194696
|
isNonGlobalDeclaration,
|
|
194697
|
+
isNonIncrementalBuildInfo,
|
|
194592
194698
|
isNonNullAccess,
|
|
194593
194699
|
isNonNullChain,
|
|
194594
194700
|
isNonNullExpression,
|
|
@@ -194701,6 +194807,7 @@ if (typeof console !== "undefined") {
|
|
|
194701
194807
|
isSimpleParameter,
|
|
194702
194808
|
isSimpleParameterList,
|
|
194703
194809
|
isSingleOrDoubleQuote,
|
|
194810
|
+
isSourceElement,
|
|
194704
194811
|
isSourceFile,
|
|
194705
194812
|
isSourceFileFromLibrary,
|
|
194706
194813
|
isSourceFileJS,
|
|
@@ -194834,7 +194941,6 @@ if (typeof console !== "undefined") {
|
|
|
194834
194941
|
linkNamePart,
|
|
194835
194942
|
linkPart,
|
|
194836
194943
|
linkTextPart,
|
|
194837
|
-
listFiles,
|
|
194838
194944
|
loadModuleFromGlobalCache,
|
|
194839
194945
|
loadWithModeAwareCache,
|
|
194840
194946
|
makeIdentifierFromModuleName,
|
|
@@ -194913,6 +195019,7 @@ if (typeof console !== "undefined") {
|
|
|
194913
195019
|
noopFileWatcher,
|
|
194914
195020
|
normalizePath,
|
|
194915
195021
|
normalizeSlashes,
|
|
195022
|
+
normalizeSpans,
|
|
194916
195023
|
not,
|
|
194917
195024
|
notImplemented,
|
|
194918
195025
|
notImplementedResolver,
|
|
@@ -194964,7 +195071,6 @@ if (typeof console !== "undefined") {
|
|
|
194964
195071
|
pathIsBareSpecifier,
|
|
194965
195072
|
pathIsRelative,
|
|
194966
195073
|
patternText,
|
|
194967
|
-
perfLogger,
|
|
194968
195074
|
performIncrementalCompilation,
|
|
194969
195075
|
performance,
|
|
194970
195076
|
plainJSErrors,
|
|
@@ -195172,7 +195278,10 @@ if (typeof console !== "undefined") {
|
|
|
195172
195278
|
textOrKeywordPart,
|
|
195173
195279
|
textPart,
|
|
195174
195280
|
textRangeContainsPositionInclusive,
|
|
195281
|
+
textRangeContainsTextSpan,
|
|
195282
|
+
textRangeIntersectsWithTextSpan,
|
|
195175
195283
|
textSpanContainsPosition,
|
|
195284
|
+
textSpanContainsTextRange,
|
|
195176
195285
|
textSpanContainsTextSpan,
|
|
195177
195286
|
textSpanEnd,
|
|
195178
195287
|
textSpanIntersection,
|
|
@@ -195213,11 +195322,11 @@ if (typeof console !== "undefined") {
|
|
|
195213
195322
|
transformESDecorators,
|
|
195214
195323
|
transformESNext,
|
|
195215
195324
|
transformGenerators,
|
|
195216
|
-
transformImpliedNodeFormatDependentModule,
|
|
195217
195325
|
transformJsx,
|
|
195218
195326
|
transformLegacyDecorators,
|
|
195219
195327
|
transformModule,
|
|
195220
195328
|
transformNamedEvaluation,
|
|
195329
|
+
transformNodeModule,
|
|
195221
195330
|
transformNodes,
|
|
195222
195331
|
transformSystemModule,
|
|
195223
195332
|
transformTypeScript,
|