typescript 4.6.0-dev.20211204 → 4.6.0-dev.20211208
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lib.es5.d.ts +1 -1
- package/lib/tsc.js +94 -21
- package/lib/tsserver.js +101 -25
- package/lib/tsserverlibrary.d.ts +5 -1
- package/lib/tsserverlibrary.js +101 -25
- package/lib/typescript.d.ts +5 -1
- package/lib/typescript.js +101 -25
- package/lib/typescriptServices.d.ts +5 -1
- package/lib/typescriptServices.js +101 -25
- package/lib/typingsInstaller.js +96 -22
- package/package.json +1 -1
package/lib/lib.es5.d.ts
CHANGED
|
@@ -1515,7 +1515,7 @@ interface Promise<T> {
|
|
|
1515
1515
|
type Awaited<T> =
|
|
1516
1516
|
T extends null | undefined ? T : // special case for `null | undefined` when not in `--strictNullChecks` mode
|
|
1517
1517
|
T extends object & { then(onfulfilled: infer F): any } ? // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
|
|
1518
|
-
F extends ((value: infer V) => any) ? // if the argument to `then` is callable, extracts the argument
|
|
1518
|
+
F extends ((value: infer V, ...args: any) => any) ? // if the argument to `then` is callable, extracts the first argument
|
|
1519
1519
|
Awaited<V> : // recursively unwrap the value
|
|
1520
1520
|
never : // the argument to `then` was not callable
|
|
1521
1521
|
T; // non-object or non-thenable
|
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.6";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211208";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
function tryGetNativeMap() {
|
|
@@ -5151,7 +5151,7 @@ var ts;
|
|
|
5151
5151
|
Duplicate_label_0: diag(1114, ts.DiagnosticCategory.Error, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
|
|
5152
5152
|
A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, ts.DiagnosticCategory.Error, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."),
|
|
5153
5153
|
A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, ts.DiagnosticCategory.Error, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."),
|
|
5154
|
-
|
|
5154
|
+
An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."),
|
|
5155
5155
|
An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."),
|
|
5156
5156
|
An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."),
|
|
5157
5157
|
An_export_assignment_cannot_have_modifiers: diag(1120, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."),
|
|
@@ -6103,6 +6103,7 @@ var ts;
|
|
|
6103
6103
|
DIRECTORY: diag(6038, ts.DiagnosticCategory.Message, "DIRECTORY_6038", "DIRECTORY"),
|
|
6104
6104
|
STRATEGY: diag(6039, ts.DiagnosticCategory.Message, "STRATEGY_6039", "STRATEGY"),
|
|
6105
6105
|
FILE_OR_DIRECTORY: diag(6040, ts.DiagnosticCategory.Message, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"),
|
|
6106
|
+
Errors_Files: diag(6041, ts.DiagnosticCategory.Message, "Errors_Files_6041", "Errors Files"),
|
|
6106
6107
|
Generates_corresponding_map_file: diag(6043, ts.DiagnosticCategory.Message, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."),
|
|
6107
6108
|
Compiler_option_0_expects_an_argument: diag(6044, ts.DiagnosticCategory.Error, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."),
|
|
6108
6109
|
Unterminated_quoted_string_in_response_file_0: diag(6045, ts.DiagnosticCategory.Error, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."),
|
|
@@ -6296,6 +6297,9 @@ var ts;
|
|
|
6296
6297
|
Output_Formatting: diag(6256, ts.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"),
|
|
6297
6298
|
Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
|
|
6298
6299
|
_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
|
|
6300
|
+
Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
|
|
6301
|
+
Found_0_errors_in_1_file: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_file_6260", "Found {0} errors in 1 file."),
|
|
6302
|
+
Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
|
|
6299
6303
|
Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
|
|
6300
6304
|
Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
|
|
6301
6305
|
Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, ts.DiagnosticCategory.Message, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."),
|
|
@@ -27083,7 +27087,11 @@ var ts;
|
|
|
27083
27087
|
if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) {
|
|
27084
27088
|
return undefined;
|
|
27085
27089
|
}
|
|
27086
|
-
var
|
|
27090
|
+
var unwrappedType = type;
|
|
27091
|
+
while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 190) {
|
|
27092
|
+
unwrappedType = unwrappedType.type;
|
|
27093
|
+
}
|
|
27094
|
+
var hasJSDocFunctionType = unwrappedType && ts.isJSDocFunctionType(unwrappedType);
|
|
27087
27095
|
if (!allowAmbiguity && token() !== 38 && (hasJSDocFunctionType || token() !== 18)) {
|
|
27088
27096
|
return undefined;
|
|
27089
27097
|
}
|
|
@@ -33823,7 +33831,10 @@ var ts;
|
|
|
33823
33831
|
}
|
|
33824
33832
|
}
|
|
33825
33833
|
var failedLookupLocations = [];
|
|
33826
|
-
var
|
|
33834
|
+
var features = ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default :
|
|
33835
|
+
ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
|
|
33836
|
+
NodeResolutionFeatures.None;
|
|
33837
|
+
var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: ["node", "require", "types"] };
|
|
33827
33838
|
var resolved = primaryLookup();
|
|
33828
33839
|
var primary = true;
|
|
33829
33840
|
if (!resolved) {
|
|
@@ -34376,13 +34387,15 @@ var ts;
|
|
|
34376
34387
|
NodeResolutionFeatures[NodeResolutionFeatures["Exports"] = 8] = "Exports";
|
|
34377
34388
|
NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers";
|
|
34378
34389
|
NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures";
|
|
34390
|
+
NodeResolutionFeatures[NodeResolutionFeatures["Node12Default"] = 14] = "Node12Default";
|
|
34391
|
+
NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault";
|
|
34379
34392
|
NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode";
|
|
34380
34393
|
})(NodeResolutionFeatures || (NodeResolutionFeatures = {}));
|
|
34381
34394
|
function node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
34382
|
-
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.
|
|
34395
|
+
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node12Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
34383
34396
|
}
|
|
34384
34397
|
function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
34385
|
-
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.
|
|
34398
|
+
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
34386
34399
|
}
|
|
34387
34400
|
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
34388
34401
|
var containingDirectory = ts.getDirectoryPath(containingFile);
|
|
@@ -36822,10 +36835,6 @@ var ts;
|
|
|
36822
36835
|
seen.set(identifier.escapedText, currentKind);
|
|
36823
36836
|
continue;
|
|
36824
36837
|
}
|
|
36825
|
-
if (currentKind === 1 && existingKind === 1) {
|
|
36826
|
-
var span = ts.getErrorSpanForNode(file, identifier);
|
|
36827
|
-
file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode));
|
|
36828
|
-
}
|
|
36829
36838
|
}
|
|
36830
36839
|
}
|
|
36831
36840
|
return bindAnonymousDeclaration(node, 4096, "__object");
|
|
@@ -37030,7 +37039,7 @@ var ts;
|
|
|
37030
37039
|
}
|
|
37031
37040
|
}
|
|
37032
37041
|
function checkStrictModeNumericLiteral(node) {
|
|
37033
|
-
if (inStrictMode && node.numericLiteralFlags & 32) {
|
|
37042
|
+
if (languageVersion < 1 && inStrictMode && node.numericLiteralFlags & 32) {
|
|
37034
37043
|
file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));
|
|
37035
37044
|
}
|
|
37036
37045
|
}
|
|
@@ -40027,7 +40036,8 @@ var ts;
|
|
|
40027
40036
|
}
|
|
40028
40037
|
}
|
|
40029
40038
|
function isSameScopeDescendentOf(initial, parent, stopAt) {
|
|
40030
|
-
return !!parent && !!ts.findAncestor(initial, function (n) { return n ===
|
|
40039
|
+
return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
|
|
40040
|
+
|| (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
|
|
40031
40041
|
}
|
|
40032
40042
|
function getAnyImportSyntax(node) {
|
|
40033
40043
|
switch (node.kind) {
|
|
@@ -54661,7 +54671,7 @@ var ts;
|
|
|
54661
54671
|
}
|
|
54662
54672
|
function getBaseTypeOfLiteralType(type) {
|
|
54663
54673
|
return type.flags & 1024 ? getBaseTypeOfEnumLiteralType(type) :
|
|
54664
|
-
type.flags & 128 ? stringType :
|
|
54674
|
+
type.flags & (128 | 134217728 | 268435456) ? stringType :
|
|
54665
54675
|
type.flags & 256 ? numberType :
|
|
54666
54676
|
type.flags & 2048 ? bigintType :
|
|
54667
54677
|
type.flags & 512 ? booleanType :
|
|
@@ -72221,9 +72231,12 @@ var ts;
|
|
|
72221
72231
|
seen.set(effectiveName, currentKind);
|
|
72222
72232
|
}
|
|
72223
72233
|
else {
|
|
72224
|
-
if ((currentKind &
|
|
72234
|
+
if ((currentKind & 8) && (existingKind & 8)) {
|
|
72225
72235
|
grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name));
|
|
72226
72236
|
}
|
|
72237
|
+
else if ((currentKind & 4) && (existingKind & 4)) {
|
|
72238
|
+
grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name, ts.getTextOfNode(name));
|
|
72239
|
+
}
|
|
72227
72240
|
else if ((currentKind & 3) && (existingKind & 3)) {
|
|
72228
72241
|
if (existingKind !== 3 && currentKind !== existingKind) {
|
|
72229
72242
|
seen.set(effectiveName, currentKind | existingKind);
|
|
@@ -99004,19 +99017,74 @@ var ts;
|
|
|
99004
99017
|
return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
|
|
99005
99018
|
}
|
|
99006
99019
|
ts.getErrorCountForSummary = getErrorCountForSummary;
|
|
99020
|
+
function getFilesInErrorForSummary(diagnostics) {
|
|
99021
|
+
var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
|
|
99022
|
+
.map(function (errorDiagnostic) {
|
|
99023
|
+
if (errorDiagnostic.file === undefined)
|
|
99024
|
+
return;
|
|
99025
|
+
return "" + errorDiagnostic.file.fileName;
|
|
99026
|
+
});
|
|
99027
|
+
return filesInError.map(function (fileName) {
|
|
99028
|
+
var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
|
|
99029
|
+
return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
|
|
99030
|
+
});
|
|
99031
|
+
if (diagnosticForFileName !== undefined) {
|
|
99032
|
+
var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
|
|
99033
|
+
return {
|
|
99034
|
+
fileName: fileName,
|
|
99035
|
+
line: line + 1,
|
|
99036
|
+
};
|
|
99037
|
+
}
|
|
99038
|
+
});
|
|
99039
|
+
}
|
|
99040
|
+
ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
|
|
99007
99041
|
function getWatchErrorSummaryDiagnosticMessage(errorCount) {
|
|
99008
99042
|
return errorCount === 1 ?
|
|
99009
99043
|
ts.Diagnostics.Found_1_error_Watching_for_file_changes :
|
|
99010
99044
|
ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
|
|
99011
99045
|
}
|
|
99012
99046
|
ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
|
|
99013
|
-
function getErrorSummaryText(errorCount, newLine) {
|
|
99047
|
+
function getErrorSummaryText(errorCount, filesInError, newLine) {
|
|
99014
99048
|
if (errorCount === 0)
|
|
99015
99049
|
return "";
|
|
99016
|
-
var
|
|
99017
|
-
|
|
99050
|
+
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
|
|
99051
|
+
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
|
|
99052
|
+
.filter(function (value, index, self) { return self.indexOf(value) === index; });
|
|
99053
|
+
var d = errorCount === 1 ?
|
|
99054
|
+
ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
|
|
99055
|
+
ts.Diagnostics.Found_1_error_in_1 :
|
|
99056
|
+
ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
|
|
99057
|
+
ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
|
|
99058
|
+
ts.Diagnostics.Found_0_errors :
|
|
99059
|
+
distinctFileNamesWithLines.length === 1 ?
|
|
99060
|
+
ts.Diagnostics.Found_0_errors_in_1_file :
|
|
99061
|
+
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
|
|
99062
|
+
return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
|
|
99018
99063
|
}
|
|
99019
99064
|
ts.getErrorSummaryText = getErrorSummaryText;
|
|
99065
|
+
function createTabularErrorsDisplay(filesInError) {
|
|
99066
|
+
var distinctFiles = filesInError.filter(function (value, index, self) { return index === self.findIndex(function (file) { return (file === null || file === void 0 ? void 0 : file.fileName) === (value === null || value === void 0 ? void 0 : value.fileName); }); });
|
|
99067
|
+
if (distinctFiles.length === 0)
|
|
99068
|
+
return "";
|
|
99069
|
+
var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
|
|
99070
|
+
var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
|
|
99071
|
+
var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
|
|
99072
|
+
var headerRow = ts.Diagnostics.Errors_Files.message;
|
|
99073
|
+
var leftColumnHeadingLength = headerRow.split(" ")[0].length;
|
|
99074
|
+
var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
|
|
99075
|
+
var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
|
|
99076
|
+
var tabularData = "";
|
|
99077
|
+
tabularData += " ".repeat(headerPadding) + headerRow + "\n";
|
|
99078
|
+
fileToErrorCount.forEach(function (row) {
|
|
99079
|
+
var file = row[0], errorCount = row[1];
|
|
99080
|
+
var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
|
|
99081
|
+
var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
|
|
99082
|
+
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
|
|
99083
|
+
: "";
|
|
99084
|
+
tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
|
|
99085
|
+
});
|
|
99086
|
+
return tabularData;
|
|
99087
|
+
}
|
|
99020
99088
|
function isBuilderProgram(program) {
|
|
99021
99089
|
return !!program.getState;
|
|
99022
99090
|
}
|
|
@@ -99205,7 +99273,7 @@ var ts;
|
|
|
99205
99273
|
listFiles(program, write);
|
|
99206
99274
|
}
|
|
99207
99275
|
if (reportSummary) {
|
|
99208
|
-
reportSummary(getErrorCountForSummary(diagnostics));
|
|
99276
|
+
reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
|
|
99209
99277
|
}
|
|
99210
99278
|
return {
|
|
99211
99279
|
emitResult: emitResult,
|
|
@@ -99395,7 +99463,7 @@ var ts;
|
|
|
99395
99463
|
var system = input.system || ts.sys;
|
|
99396
99464
|
var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
|
|
99397
99465
|
var builderProgram = ts.createIncrementalProgram(input);
|
|
99398
|
-
var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount) { return system.write(getErrorSummaryText(errorCount, system.newLine)); } : undefined);
|
|
99466
|
+
var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine)); } : undefined);
|
|
99399
99467
|
if (input.afterProgramEmitAndDiagnostics)
|
|
99400
99468
|
input.afterProgramEmitAndDiagnostics(builderProgram);
|
|
99401
99469
|
return exitStatus;
|
|
@@ -101453,11 +101521,14 @@ var ts;
|
|
|
101453
101521
|
var canReportSummary = state.watch || !!state.host.reportErrorSummary;
|
|
101454
101522
|
var diagnostics = state.diagnostics;
|
|
101455
101523
|
var totalErrors = 0;
|
|
101524
|
+
var filesInError = [];
|
|
101456
101525
|
if (isCircularBuildOrder(buildOrder)) {
|
|
101457
101526
|
reportBuildQueue(state, buildOrder.buildOrder);
|
|
101458
101527
|
reportErrors(state, buildOrder.circularDiagnostics);
|
|
101459
101528
|
if (canReportSummary)
|
|
101460
101529
|
totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
|
|
101530
|
+
if (canReportSummary)
|
|
101531
|
+
filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
|
|
101461
101532
|
}
|
|
101462
101533
|
else {
|
|
101463
101534
|
buildOrder.forEach(function (project) {
|
|
@@ -101468,12 +101539,14 @@ var ts;
|
|
|
101468
101539
|
});
|
|
101469
101540
|
if (canReportSummary)
|
|
101470
101541
|
diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
|
|
101542
|
+
if (canReportSummary)
|
|
101543
|
+
diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
|
|
101471
101544
|
}
|
|
101472
101545
|
if (state.watch) {
|
|
101473
101546
|
reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
|
|
101474
101547
|
}
|
|
101475
101548
|
else if (state.host.reportErrorSummary) {
|
|
101476
|
-
state.host.reportErrorSummary(totalErrors);
|
|
101549
|
+
state.host.reportErrorSummary(totalErrors, filesInError);
|
|
101477
101550
|
}
|
|
101478
101551
|
}
|
|
101479
101552
|
function reportBuildQueue(state, buildQueue) {
|
|
@@ -102100,7 +102173,7 @@ var ts;
|
|
|
102100
102173
|
}
|
|
102101
102174
|
function createReportErrorSummary(sys, options) {
|
|
102102
102175
|
return shouldBePretty(sys, options) ?
|
|
102103
|
-
function (errorCount) { return sys.write(ts.getErrorSummaryText(errorCount, sys.newLine)); } :
|
|
102176
|
+
function (errorCount, filesInError) { return sys.write(ts.getErrorSummaryText(errorCount, filesInError, sys.newLine)); } :
|
|
102104
102177
|
undefined;
|
|
102105
102178
|
}
|
|
102106
102179
|
function performCompilation(sys, cb, reportDiagnostic, config) {
|
package/lib/tsserver.js
CHANGED
|
@@ -100,7 +100,7 @@ var ts;
|
|
|
100
100
|
// The following is baselined as a literal template type without intervention
|
|
101
101
|
/** The version of the TypeScript compiler release */
|
|
102
102
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
103
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
103
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211208";
|
|
104
104
|
/* @internal */
|
|
105
105
|
var Comparison;
|
|
106
106
|
(function (Comparison) {
|
|
@@ -7937,7 +7937,7 @@ var ts;
|
|
|
7937
7937
|
Duplicate_label_0: diag(1114, ts.DiagnosticCategory.Error, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
|
|
7938
7938
|
A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, ts.DiagnosticCategory.Error, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."),
|
|
7939
7939
|
A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, ts.DiagnosticCategory.Error, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."),
|
|
7940
|
-
|
|
7940
|
+
An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."),
|
|
7941
7941
|
An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."),
|
|
7942
7942
|
An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."),
|
|
7943
7943
|
An_export_assignment_cannot_have_modifiers: diag(1120, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."),
|
|
@@ -8889,6 +8889,7 @@ var ts;
|
|
|
8889
8889
|
DIRECTORY: diag(6038, ts.DiagnosticCategory.Message, "DIRECTORY_6038", "DIRECTORY"),
|
|
8890
8890
|
STRATEGY: diag(6039, ts.DiagnosticCategory.Message, "STRATEGY_6039", "STRATEGY"),
|
|
8891
8891
|
FILE_OR_DIRECTORY: diag(6040, ts.DiagnosticCategory.Message, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"),
|
|
8892
|
+
Errors_Files: diag(6041, ts.DiagnosticCategory.Message, "Errors_Files_6041", "Errors Files"),
|
|
8892
8893
|
Generates_corresponding_map_file: diag(6043, ts.DiagnosticCategory.Message, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."),
|
|
8893
8894
|
Compiler_option_0_expects_an_argument: diag(6044, ts.DiagnosticCategory.Error, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."),
|
|
8894
8895
|
Unterminated_quoted_string_in_response_file_0: diag(6045, ts.DiagnosticCategory.Error, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."),
|
|
@@ -9082,6 +9083,9 @@ var ts;
|
|
|
9082
9083
|
Output_Formatting: diag(6256, ts.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"),
|
|
9083
9084
|
Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
|
|
9084
9085
|
_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
|
|
9086
|
+
Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
|
|
9087
|
+
Found_0_errors_in_1_file: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_file_6260", "Found {0} errors in 1 file."),
|
|
9088
|
+
Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
|
|
9085
9089
|
Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
|
|
9086
9090
|
Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
|
|
9087
9091
|
Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, ts.DiagnosticCategory.Message, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."),
|
|
@@ -33620,10 +33624,14 @@ var ts;
|
|
|
33620
33624
|
// - "(x,y)" is a comma expression parsed as a signature with two parameters.
|
|
33621
33625
|
// - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation.
|
|
33622
33626
|
// - "a ? (b): function() {}" will too, since function() is a valid JSDoc function type.
|
|
33623
|
-
// - "a ? (b): (function() {})" as well, but inside of a parenthesized type.
|
|
33627
|
+
// - "a ? (b): (function() {})" as well, but inside of a parenthesized type with an arbitrary amount of nesting.
|
|
33624
33628
|
//
|
|
33625
33629
|
// So we need just a bit of lookahead to ensure that it can only be a signature.
|
|
33626
|
-
var
|
|
33630
|
+
var unwrappedType = type;
|
|
33631
|
+
while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 190 /* ParenthesizedType */) {
|
|
33632
|
+
unwrappedType = unwrappedType.type; // Skip parens if need be
|
|
33633
|
+
}
|
|
33634
|
+
var hasJSDocFunctionType = unwrappedType && ts.isJSDocFunctionType(unwrappedType);
|
|
33627
33635
|
if (!allowAmbiguity && token() !== 38 /* EqualsGreaterThanToken */ && (hasJSDocFunctionType || token() !== 18 /* OpenBraceToken */)) {
|
|
33628
33636
|
// Returning undefined here will cause our caller to rewind to where we started from.
|
|
33629
33637
|
return undefined;
|
|
@@ -41465,7 +41473,10 @@ var ts;
|
|
|
41465
41473
|
}
|
|
41466
41474
|
}
|
|
41467
41475
|
var failedLookupLocations = [];
|
|
41468
|
-
var
|
|
41476
|
+
var features = ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default :
|
|
41477
|
+
ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
|
|
41478
|
+
NodeResolutionFeatures.None;
|
|
41479
|
+
var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: ["node", "require", "types"] };
|
|
41469
41480
|
var resolved = primaryLookup();
|
|
41470
41481
|
var primary = true;
|
|
41471
41482
|
if (!resolved) {
|
|
@@ -42140,13 +42151,15 @@ var ts;
|
|
|
42140
42151
|
// not currently backported to node 12 - https://github.com/nodejs/Release/issues/690
|
|
42141
42152
|
NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers";
|
|
42142
42153
|
NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures";
|
|
42154
|
+
NodeResolutionFeatures[NodeResolutionFeatures["Node12Default"] = 14] = "Node12Default";
|
|
42155
|
+
NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault";
|
|
42143
42156
|
NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode";
|
|
42144
42157
|
})(NodeResolutionFeatures || (NodeResolutionFeatures = {}));
|
|
42145
42158
|
function node12ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
42146
|
-
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.
|
|
42159
|
+
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node12Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
42147
42160
|
}
|
|
42148
42161
|
function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
42149
|
-
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.
|
|
42162
|
+
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
42150
42163
|
}
|
|
42151
42164
|
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
42152
42165
|
var containingDirectory = ts.getDirectoryPath(containingFile);
|
|
@@ -44949,10 +44962,6 @@ var ts;
|
|
|
44949
44962
|
seen.set(identifier.escapedText, currentKind);
|
|
44950
44963
|
continue;
|
|
44951
44964
|
}
|
|
44952
|
-
if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) {
|
|
44953
|
-
var span = ts.getErrorSpanForNode(file, identifier);
|
|
44954
|
-
file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode));
|
|
44955
|
-
}
|
|
44956
44965
|
}
|
|
44957
44966
|
}
|
|
44958
44967
|
return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object" /* Object */);
|
|
@@ -45186,7 +45195,7 @@ var ts;
|
|
|
45186
45195
|
}
|
|
45187
45196
|
}
|
|
45188
45197
|
function checkStrictModeNumericLiteral(node) {
|
|
45189
|
-
if (inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
|
|
45198
|
+
if (languageVersion < 1 /* ES5 */ && inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
|
|
45190
45199
|
file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));
|
|
45191
45200
|
}
|
|
45192
45201
|
}
|
|
@@ -48791,10 +48800,12 @@ var ts;
|
|
|
48791
48800
|
}
|
|
48792
48801
|
/* Starting from 'initial' node walk up the parent chain until 'stopAt' node is reached.
|
|
48793
48802
|
* If at any point current node is equal to 'parent' node - return true.
|
|
48803
|
+
* If current node is an IIFE, continue walking up.
|
|
48794
48804
|
* Return false if 'stopAt' node is reached or isFunctionLike(current) === true.
|
|
48795
48805
|
*/
|
|
48796
48806
|
function isSameScopeDescendentOf(initial, parent, stopAt) {
|
|
48797
|
-
return !!parent && !!ts.findAncestor(initial, function (n) { return n ===
|
|
48807
|
+
return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
|
|
48808
|
+
|| (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
|
|
48798
48809
|
}
|
|
48799
48810
|
function getAnyImportSyntax(node) {
|
|
48800
48811
|
switch (node.kind) {
|
|
@@ -65576,7 +65587,7 @@ var ts;
|
|
|
65576
65587
|
}
|
|
65577
65588
|
function getBaseTypeOfLiteralType(type) {
|
|
65578
65589
|
return type.flags & 1024 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) :
|
|
65579
|
-
type.flags & 128 /* StringLiteral */ ? stringType :
|
|
65590
|
+
type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType :
|
|
65580
65591
|
type.flags & 256 /* NumberLiteral */ ? numberType :
|
|
65581
65592
|
type.flags & 2048 /* BigIntLiteral */ ? bigintType :
|
|
65582
65593
|
type.flags & 512 /* BooleanLiteral */ ? booleanType :
|
|
@@ -85944,9 +85955,12 @@ var ts;
|
|
|
85944
85955
|
seen.set(effectiveName, currentKind);
|
|
85945
85956
|
}
|
|
85946
85957
|
else {
|
|
85947
|
-
if ((currentKind &
|
|
85958
|
+
if ((currentKind & 8 /* Method */) && (existingKind & 8 /* Method */)) {
|
|
85948
85959
|
grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name));
|
|
85949
85960
|
}
|
|
85961
|
+
else if ((currentKind & 4 /* PropertyAssignment */) && (existingKind & 4 /* PropertyAssignment */)) {
|
|
85962
|
+
grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name, ts.getTextOfNode(name));
|
|
85963
|
+
}
|
|
85950
85964
|
else if ((currentKind & 3 /* GetOrSetAccessor */) && (existingKind & 3 /* GetOrSetAccessor */)) {
|
|
85951
85965
|
if (existingKind !== 3 /* GetOrSetAccessor */ && currentKind !== existingKind) {
|
|
85952
85966
|
seen.set(effectiveName, currentKind | existingKind);
|
|
@@ -119715,7 +119729,7 @@ var ts;
|
|
|
119715
119729
|
getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)
|
|
119716
119730
|
} : undefined;
|
|
119717
119731
|
/**
|
|
119718
|
-
* Create a function that reports error by writing to the system and handles the
|
|
119732
|
+
* Create a function that reports error by writing to the system and handles the formatting of the diagnostic
|
|
119719
119733
|
*/
|
|
119720
119734
|
function createDiagnosticReporter(system, pretty) {
|
|
119721
119735
|
var host = system === ts.sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : {
|
|
@@ -119801,19 +119815,74 @@ var ts;
|
|
|
119801
119815
|
return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
|
|
119802
119816
|
}
|
|
119803
119817
|
ts.getErrorCountForSummary = getErrorCountForSummary;
|
|
119818
|
+
function getFilesInErrorForSummary(diagnostics) {
|
|
119819
|
+
var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
|
|
119820
|
+
.map(function (errorDiagnostic) {
|
|
119821
|
+
if (errorDiagnostic.file === undefined)
|
|
119822
|
+
return;
|
|
119823
|
+
return "" + errorDiagnostic.file.fileName;
|
|
119824
|
+
});
|
|
119825
|
+
return filesInError.map(function (fileName) {
|
|
119826
|
+
var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
|
|
119827
|
+
return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
|
|
119828
|
+
});
|
|
119829
|
+
if (diagnosticForFileName !== undefined) {
|
|
119830
|
+
var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
|
|
119831
|
+
return {
|
|
119832
|
+
fileName: fileName,
|
|
119833
|
+
line: line + 1,
|
|
119834
|
+
};
|
|
119835
|
+
}
|
|
119836
|
+
});
|
|
119837
|
+
}
|
|
119838
|
+
ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
|
|
119804
119839
|
function getWatchErrorSummaryDiagnosticMessage(errorCount) {
|
|
119805
119840
|
return errorCount === 1 ?
|
|
119806
119841
|
ts.Diagnostics.Found_1_error_Watching_for_file_changes :
|
|
119807
119842
|
ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
|
|
119808
119843
|
}
|
|
119809
119844
|
ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
|
|
119810
|
-
function getErrorSummaryText(errorCount, newLine) {
|
|
119845
|
+
function getErrorSummaryText(errorCount, filesInError, newLine) {
|
|
119811
119846
|
if (errorCount === 0)
|
|
119812
119847
|
return "";
|
|
119813
|
-
var
|
|
119814
|
-
|
|
119848
|
+
var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
|
|
119849
|
+
var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
|
|
119850
|
+
.filter(function (value, index, self) { return self.indexOf(value) === index; });
|
|
119851
|
+
var d = errorCount === 1 ?
|
|
119852
|
+
ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
|
|
119853
|
+
ts.Diagnostics.Found_1_error_in_1 :
|
|
119854
|
+
ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
|
|
119855
|
+
ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
|
|
119856
|
+
ts.Diagnostics.Found_0_errors :
|
|
119857
|
+
distinctFileNamesWithLines.length === 1 ?
|
|
119858
|
+
ts.Diagnostics.Found_0_errors_in_1_file :
|
|
119859
|
+
ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
|
|
119860
|
+
return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
|
|
119815
119861
|
}
|
|
119816
119862
|
ts.getErrorSummaryText = getErrorSummaryText;
|
|
119863
|
+
function createTabularErrorsDisplay(filesInError) {
|
|
119864
|
+
var distinctFiles = filesInError.filter(function (value, index, self) { return index === self.findIndex(function (file) { return (file === null || file === void 0 ? void 0 : file.fileName) === (value === null || value === void 0 ? void 0 : value.fileName); }); });
|
|
119865
|
+
if (distinctFiles.length === 0)
|
|
119866
|
+
return "";
|
|
119867
|
+
var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
|
|
119868
|
+
var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
|
|
119869
|
+
var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
|
|
119870
|
+
var headerRow = ts.Diagnostics.Errors_Files.message;
|
|
119871
|
+
var leftColumnHeadingLength = headerRow.split(" ")[0].length;
|
|
119872
|
+
var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
|
|
119873
|
+
var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
|
|
119874
|
+
var tabularData = "";
|
|
119875
|
+
tabularData += " ".repeat(headerPadding) + headerRow + "\n";
|
|
119876
|
+
fileToErrorCount.forEach(function (row) {
|
|
119877
|
+
var file = row[0], errorCount = row[1];
|
|
119878
|
+
var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
|
|
119879
|
+
var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
|
|
119880
|
+
" ".repeat(leftPaddingGoal - errorCountDigitsLength)
|
|
119881
|
+
: "";
|
|
119882
|
+
tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
|
|
119883
|
+
});
|
|
119884
|
+
return tabularData;
|
|
119885
|
+
}
|
|
119817
119886
|
function isBuilderProgram(program) {
|
|
119818
119887
|
return !!program.getState;
|
|
119819
119888
|
}
|
|
@@ -120017,7 +120086,7 @@ var ts;
|
|
|
120017
120086
|
listFiles(program, write);
|
|
120018
120087
|
}
|
|
120019
120088
|
if (reportSummary) {
|
|
120020
|
-
reportSummary(getErrorCountForSummary(diagnostics));
|
|
120089
|
+
reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
|
|
120021
120090
|
}
|
|
120022
120091
|
return {
|
|
120023
120092
|
emitResult: emitResult,
|
|
@@ -120228,7 +120297,7 @@ var ts;
|
|
|
120228
120297
|
var system = input.system || ts.sys;
|
|
120229
120298
|
var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
|
|
120230
120299
|
var builderProgram = ts.createIncrementalProgram(input);
|
|
120231
|
-
var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount) { return system.write(getErrorSummaryText(errorCount, system.newLine)); } : undefined);
|
|
120300
|
+
var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine)); } : undefined);
|
|
120232
120301
|
if (input.afterProgramEmitAndDiagnostics)
|
|
120233
120302
|
input.afterProgramEmitAndDiagnostics(builderProgram);
|
|
120234
120303
|
return exitStatus;
|
|
@@ -122447,11 +122516,14 @@ var ts;
|
|
|
122447
122516
|
var canReportSummary = state.watch || !!state.host.reportErrorSummary;
|
|
122448
122517
|
var diagnostics = state.diagnostics;
|
|
122449
122518
|
var totalErrors = 0;
|
|
122519
|
+
var filesInError = [];
|
|
122450
122520
|
if (isCircularBuildOrder(buildOrder)) {
|
|
122451
122521
|
reportBuildQueue(state, buildOrder.buildOrder);
|
|
122452
122522
|
reportErrors(state, buildOrder.circularDiagnostics);
|
|
122453
122523
|
if (canReportSummary)
|
|
122454
122524
|
totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
|
|
122525
|
+
if (canReportSummary)
|
|
122526
|
+
filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
|
|
122455
122527
|
}
|
|
122456
122528
|
else {
|
|
122457
122529
|
// Report errors from the other projects
|
|
@@ -122463,12 +122535,14 @@ var ts;
|
|
|
122463
122535
|
});
|
|
122464
122536
|
if (canReportSummary)
|
|
122465
122537
|
diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
|
|
122538
|
+
if (canReportSummary)
|
|
122539
|
+
diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
|
|
122466
122540
|
}
|
|
122467
122541
|
if (state.watch) {
|
|
122468
122542
|
reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
|
|
122469
122543
|
}
|
|
122470
122544
|
else if (state.host.reportErrorSummary) {
|
|
122471
|
-
state.host.reportErrorSummary(totalErrors);
|
|
122545
|
+
state.host.reportErrorSummary(totalErrors, filesInError);
|
|
122472
122546
|
}
|
|
122473
122547
|
}
|
|
122474
122548
|
/**
|
|
@@ -131145,8 +131219,10 @@ var ts;
|
|
|
131145
131219
|
}
|
|
131146
131220
|
/** Get the corresponding JSDocTag node if the position is in a jsDoc comment */
|
|
131147
131221
|
function getJsDocTagAtPosition(node, position) {
|
|
131148
|
-
|
|
131149
|
-
|
|
131222
|
+
return ts.findAncestor(node, function (n) {
|
|
131223
|
+
return ts.isJSDocTag(n) && ts.rangeContainsPosition(n, position) ? true :
|
|
131224
|
+
ts.isJSDoc(n) ? "quit" : false;
|
|
131225
|
+
});
|
|
131150
131226
|
}
|
|
131151
131227
|
function getPropertiesForObjectExpression(contextualType, completionsType, obj, checker) {
|
|
131152
131228
|
var hasCompletionsType = completionsType && completionsType !== contextualType;
|
|
@@ -140902,7 +140978,7 @@ var ts;
|
|
|
140902
140978
|
displayParts.push(ts.spacePart());
|
|
140903
140979
|
displayParts.push(ts.operatorPart(63 /* EqualsToken */));
|
|
140904
140980
|
displayParts.push(ts.spacePart());
|
|
140905
|
-
ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));
|
|
140981
|
+
ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, ts.isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));
|
|
140906
140982
|
}
|
|
140907
140983
|
if (symbolFlags & 384 /* Enum */) {
|
|
140908
140984
|
prefixNextMeaning();
|
package/lib/tsserverlibrary.d.ts
CHANGED
|
@@ -5352,7 +5352,11 @@ declare namespace ts {
|
|
|
5352
5352
|
traceResolution?: boolean;
|
|
5353
5353
|
[option: string]: CompilerOptionsValue | undefined;
|
|
5354
5354
|
}
|
|
5355
|
-
type ReportEmitErrorSummary = (errorCount: number) => void;
|
|
5355
|
+
type ReportEmitErrorSummary = (errorCount: number, filesInError: (ReportFileInError | undefined)[]) => void;
|
|
5356
|
+
interface ReportFileInError {
|
|
5357
|
+
fileName: string;
|
|
5358
|
+
line: number;
|
|
5359
|
+
}
|
|
5356
5360
|
interface SolutionBuilderHostBase<T extends BuilderProgram> extends ProgramHost<T> {
|
|
5357
5361
|
createDirectory?(path: string): void;
|
|
5358
5362
|
/**
|