typescript 4.5.0-dev.20211019 → 4.5.0-dev.20211023
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/cs/diagnosticMessages.generated.json +1 -0
- package/lib/de/diagnosticMessages.generated.json +1 -0
- package/lib/es/diagnosticMessages.generated.json +1 -0
- package/lib/fr/diagnosticMessages.generated.json +1 -0
- package/lib/it/diagnosticMessages.generated.json +1 -0
- package/lib/ja/diagnosticMessages.generated.json +1 -0
- package/lib/ko/diagnosticMessages.generated.json +1 -0
- package/lib/lib.es5.d.ts +2 -2
- package/lib/pl/diagnosticMessages.generated.json +1 -0
- package/lib/pt-br/diagnosticMessages.generated.json +1 -0
- package/lib/ru/diagnosticMessages.generated.json +1 -0
- package/lib/tr/diagnosticMessages.generated.json +1 -0
- package/lib/tsc.js +110 -78
- package/lib/tsserver.js +174 -111
- package/lib/tsserverlibrary.js +174 -111
- package/lib/typescript.js +174 -111
- package/lib/typescriptServices.js +174 -111
- package/lib/typingsInstaller.js +117 -85
- package/lib/zh-cn/diagnosticMessages.generated.json +1 -0
- package/lib/zh-tw/diagnosticMessages.generated.json +1 -0
- package/package.json +1 -1
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.20211023";
|
|
104
104
|
/* @internal */
|
|
105
105
|
var Comparison;
|
|
106
106
|
(function (Comparison) {
|
|
@@ -8141,6 +8141,7 @@ var ts;
|
|
|
8141
8141
|
Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, ts.DiagnosticCategory.Error, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."),
|
|
8142
8142
|
Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1388, ts.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1388", "Constructor type notation must be parenthesized when used in an intersection type."),
|
|
8143
8143
|
_0_is_not_allowed_as_a_variable_declaration_name: diag(1389, ts.DiagnosticCategory.Error, "_0_is_not_allowed_as_a_variable_declaration_name_1389", "'{0}' is not allowed as a variable declaration name."),
|
|
8144
|
+
_0_is_not_allowed_as_a_parameter_name: diag(1390, ts.DiagnosticCategory.Error, "_0_is_not_allowed_as_a_parameter_name_1390", "'{0}' is not allowed as a parameter name."),
|
|
8144
8145
|
An_import_alias_cannot_use_import_type: diag(1392, ts.DiagnosticCategory.Error, "An_import_alias_cannot_use_import_type_1392", "An import alias cannot use 'import type'"),
|
|
8145
8146
|
Imported_via_0_from_file_1: diag(1393, ts.DiagnosticCategory.Message, "Imported_via_0_from_file_1_1393", "Imported via {0} from file '{1}'"),
|
|
8146
8147
|
Imported_via_0_from_file_1_with_packageId_2: diag(1394, ts.DiagnosticCategory.Message, "Imported_via_0_from_file_1_with_packageId_2_1394", "Imported via {0} from file '{1}' with packageId '{2}'"),
|
|
@@ -19993,7 +19994,7 @@ var ts;
|
|
|
19993
19994
|
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
|
|
19994
19995
|
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
|
|
19995
19996
|
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
|
|
19996
|
-
basePaths: getBasePaths(
|
|
19997
|
+
basePaths: getBasePaths(absolutePath, includes, useCaseSensitiveFileNames)
|
|
19997
19998
|
};
|
|
19998
19999
|
}
|
|
19999
20000
|
ts.getFileMatcherPatterns = getFileMatcherPatterns;
|
|
@@ -20015,20 +20016,20 @@ var ts;
|
|
|
20015
20016
|
var visited = new ts.Map();
|
|
20016
20017
|
var toCanonical = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
|
|
20017
20018
|
for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) {
|
|
20018
|
-
var
|
|
20019
|
-
if (directoryExists(
|
|
20020
|
-
visitDirectory(
|
|
20019
|
+
var absoluteBasePath = _a[_i];
|
|
20020
|
+
if (directoryExists(absoluteBasePath)) {
|
|
20021
|
+
visitDirectory(absoluteBasePath, depth);
|
|
20021
20022
|
}
|
|
20022
20023
|
}
|
|
20023
20024
|
return ts.flatten(results);
|
|
20024
|
-
function visitDirectory(
|
|
20025
|
+
function visitDirectory(absolutePath, depth) {
|
|
20025
20026
|
var canonicalPath = toCanonical(realpath(absolutePath));
|
|
20026
20027
|
if (visited.has(canonicalPath))
|
|
20027
20028
|
return;
|
|
20028
20029
|
visited.set(canonicalPath, true);
|
|
20029
|
-
var _a = getFileSystemEntries(
|
|
20030
|
+
var _a = getFileSystemEntries(absolutePath), files = _a.files, directories = _a.directories;
|
|
20030
20031
|
var _loop_1 = function (current) {
|
|
20031
|
-
var name = ts.combinePaths(
|
|
20032
|
+
var name = ts.combinePaths(absolutePath, current);
|
|
20032
20033
|
var absoluteName = ts.combinePaths(absolutePath, current);
|
|
20033
20034
|
if (extensions && !ts.fileExtensionIsOneOf(name, extensions))
|
|
20034
20035
|
return "continue";
|
|
@@ -20056,11 +20057,10 @@ var ts;
|
|
|
20056
20057
|
}
|
|
20057
20058
|
for (var _c = 0, _d = ts.sort(directories, ts.compareStringsCaseSensitive); _c < _d.length; _c++) {
|
|
20058
20059
|
var current = _d[_c];
|
|
20059
|
-
var name = ts.combinePaths(path, current);
|
|
20060
20060
|
var absoluteName = ts.combinePaths(absolutePath, current);
|
|
20061
20061
|
if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) &&
|
|
20062
20062
|
(!excludeRegex || !excludeRegex.test(absoluteName))) {
|
|
20063
|
-
visitDirectory(
|
|
20063
|
+
visitDirectory(absoluteName, depth);
|
|
20064
20064
|
}
|
|
20065
20065
|
}
|
|
20066
20066
|
}
|
|
@@ -20068,10 +20068,11 @@ var ts;
|
|
|
20068
20068
|
ts.matchFiles = matchFiles;
|
|
20069
20069
|
/**
|
|
20070
20070
|
* Computes the unique non-wildcard base paths amongst the provided include patterns.
|
|
20071
|
+
* @returns Absolute directory paths
|
|
20071
20072
|
*/
|
|
20072
|
-
function getBasePaths(
|
|
20073
|
+
function getBasePaths(absoluteTsconfigPath, includes, useCaseSensitiveFileNames) {
|
|
20073
20074
|
// Storage for our results in the form of literal paths (e.g. the paths as written by the user).
|
|
20074
|
-
var basePaths = [
|
|
20075
|
+
var basePaths = [absoluteTsconfigPath];
|
|
20075
20076
|
if (includes) {
|
|
20076
20077
|
// Storage for literal base paths amongst the include patterns.
|
|
20077
20078
|
var includeBasePaths = [];
|
|
@@ -20079,14 +20080,14 @@ var ts;
|
|
|
20079
20080
|
var include = includes_1[_i];
|
|
20080
20081
|
// We also need to check the relative paths by converting them to absolute and normalizing
|
|
20081
20082
|
// in case they escape the base path (e.g "..\somedirectory")
|
|
20082
|
-
var
|
|
20083
|
+
var absoluteIncludePath = ts.isRootedDiskPath(include) ? include : ts.normalizePath(ts.combinePaths(absoluteTsconfigPath, include));
|
|
20083
20084
|
// Append the literal and canonical candidate base paths.
|
|
20084
|
-
includeBasePaths.push(getIncludeBasePath(
|
|
20085
|
+
includeBasePaths.push(getIncludeBasePath(absoluteIncludePath));
|
|
20085
20086
|
}
|
|
20086
20087
|
// Sort the offsets array using either the literal or canonical path representations.
|
|
20087
20088
|
includeBasePaths.sort(ts.getStringComparer(!useCaseSensitiveFileNames));
|
|
20088
20089
|
var _loop_2 = function (includeBasePath) {
|
|
20089
|
-
if (ts.every(basePaths, function (basePath) { return !ts.containsPath(basePath, includeBasePath,
|
|
20090
|
+
if (ts.every(basePaths, function (basePath) { return !ts.containsPath(basePath, includeBasePath, absoluteTsconfigPath, !useCaseSensitiveFileNames); })) {
|
|
20090
20091
|
basePaths.push(includeBasePath);
|
|
20091
20092
|
}
|
|
20092
20093
|
};
|
|
@@ -31933,7 +31934,10 @@ var ts;
|
|
|
31933
31934
|
case 12 /* ObjectLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_assignment_expected);
|
|
31934
31935
|
case 15 /* ArrayLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_or_comma_expected);
|
|
31935
31936
|
case 17 /* JSDocParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected);
|
|
31936
|
-
case 16 /* Parameters */:
|
|
31937
|
+
case 16 /* Parameters */:
|
|
31938
|
+
return ts.isKeyword(token())
|
|
31939
|
+
? parseErrorAtCurrentToken(ts.Diagnostics._0_is_not_allowed_as_a_parameter_name, ts.tokenToString(token()))
|
|
31940
|
+
: parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected);
|
|
31937
31941
|
case 19 /* TypeParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_parameter_declaration_expected);
|
|
31938
31942
|
case 20 /* TypeArguments */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_argument_expected);
|
|
31939
31943
|
case 21 /* TupleElementTypes */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_expected);
|
|
@@ -37978,7 +37982,7 @@ var ts;
|
|
|
37978
37982
|
var ts;
|
|
37979
37983
|
(function (ts) {
|
|
37980
37984
|
/* @internal */
|
|
37981
|
-
ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" };
|
|
37985
|
+
ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean", defaultValueDescription: "false" };
|
|
37982
37986
|
var jsxOptionMap = new ts.Map(ts.getEntries({
|
|
37983
37987
|
"preserve": 1 /* Preserve */,
|
|
37984
37988
|
"react-native": 3 /* ReactNative */,
|
|
@@ -38115,6 +38119,7 @@ var ts;
|
|
|
38115
38119
|
type: "boolean",
|
|
38116
38120
|
category: ts.Diagnostics.Watch_and_Build_Modes,
|
|
38117
38121
|
description: ts.Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,
|
|
38122
|
+
defaultValueDescription: "false",
|
|
38118
38123
|
},
|
|
38119
38124
|
{
|
|
38120
38125
|
name: "excludeDirectories",
|
|
@@ -38150,11 +38155,13 @@ var ts;
|
|
|
38150
38155
|
showInSimplifiedHelpView: true,
|
|
38151
38156
|
category: ts.Diagnostics.Command_line_Options,
|
|
38152
38157
|
description: ts.Diagnostics.Print_this_message,
|
|
38158
|
+
defaultValueDescription: "false",
|
|
38153
38159
|
},
|
|
38154
38160
|
{
|
|
38155
38161
|
name: "help",
|
|
38156
38162
|
shortName: "?",
|
|
38157
|
-
type: "boolean"
|
|
38163
|
+
type: "boolean",
|
|
38164
|
+
defaultValueDescription: "false",
|
|
38158
38165
|
},
|
|
38159
38166
|
{
|
|
38160
38167
|
name: "watch",
|
|
@@ -38164,6 +38171,7 @@ var ts;
|
|
|
38164
38171
|
isCommandLineOnly: true,
|
|
38165
38172
|
category: ts.Diagnostics.Command_line_Options,
|
|
38166
38173
|
description: ts.Diagnostics.Watch_input_files,
|
|
38174
|
+
defaultValueDescription: "false",
|
|
38167
38175
|
},
|
|
38168
38176
|
{
|
|
38169
38177
|
name: "preserveWatchOutput",
|
|
@@ -38171,7 +38179,7 @@ var ts;
|
|
|
38171
38179
|
showInSimplifiedHelpView: false,
|
|
38172
38180
|
category: ts.Diagnostics.Output_Formatting,
|
|
38173
38181
|
description: ts.Diagnostics.Disable_wiping_the_console_in_watch_mode,
|
|
38174
|
-
defaultValueDescription: "
|
|
38182
|
+
defaultValueDescription: "false",
|
|
38175
38183
|
},
|
|
38176
38184
|
{
|
|
38177
38185
|
name: "listFiles",
|
|
@@ -38184,7 +38192,8 @@ var ts;
|
|
|
38184
38192
|
name: "explainFiles",
|
|
38185
38193
|
type: "boolean",
|
|
38186
38194
|
category: ts.Diagnostics.Compiler_Diagnostics,
|
|
38187
|
-
description: ts.Diagnostics.Print_files_read_during_the_compilation_including_why_it_was_included
|
|
38195
|
+
description: ts.Diagnostics.Print_files_read_during_the_compilation_including_why_it_was_included,
|
|
38196
|
+
defaultValueDescription: "false",
|
|
38188
38197
|
},
|
|
38189
38198
|
{
|
|
38190
38199
|
name: "listEmittedFiles",
|
|
@@ -38255,7 +38264,8 @@ var ts;
|
|
|
38255
38264
|
affectsSemanticDiagnostics: true,
|
|
38256
38265
|
affectsEmit: true,
|
|
38257
38266
|
category: ts.Diagnostics.Watch_and_Build_Modes,
|
|
38258
|
-
description: ts.Diagnostics.Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it
|
|
38267
|
+
description: ts.Diagnostics.Have_recompiles_in_projects_that_use_incremental_and_watch_mode_assume_that_changes_within_a_file_will_only_affect_files_directly_depending_on_it,
|
|
38268
|
+
defaultValueDescription: "false",
|
|
38259
38269
|
},
|
|
38260
38270
|
{
|
|
38261
38271
|
name: "locale",
|
|
@@ -38300,6 +38310,7 @@ var ts;
|
|
|
38300
38310
|
showInSimplifiedHelpView: true,
|
|
38301
38311
|
category: ts.Diagnostics.Command_line_Options,
|
|
38302
38312
|
description: ts.Diagnostics.Show_all_compiler_options,
|
|
38313
|
+
defaultValueDescription: "false",
|
|
38303
38314
|
},
|
|
38304
38315
|
{
|
|
38305
38316
|
name: "version",
|
|
@@ -38308,6 +38319,7 @@ var ts;
|
|
|
38308
38319
|
showInSimplifiedHelpView: true,
|
|
38309
38320
|
category: ts.Diagnostics.Command_line_Options,
|
|
38310
38321
|
description: ts.Diagnostics.Print_the_compiler_s_version,
|
|
38322
|
+
defaultValueDescription: "false",
|
|
38311
38323
|
},
|
|
38312
38324
|
{
|
|
38313
38325
|
name: "init",
|
|
@@ -38315,6 +38327,7 @@ var ts;
|
|
|
38315
38327
|
showInSimplifiedHelpView: true,
|
|
38316
38328
|
category: ts.Diagnostics.Command_line_Options,
|
|
38317
38329
|
description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file,
|
|
38330
|
+
defaultValueDescription: "false",
|
|
38318
38331
|
},
|
|
38319
38332
|
{
|
|
38320
38333
|
name: "project",
|
|
@@ -38332,7 +38345,8 @@ var ts;
|
|
|
38332
38345
|
shortName: "b",
|
|
38333
38346
|
showInSimplifiedHelpView: true,
|
|
38334
38347
|
category: ts.Diagnostics.Command_line_Options,
|
|
38335
|
-
description: ts.Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date
|
|
38348
|
+
description: ts.Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,
|
|
38349
|
+
defaultValueDescription: "false",
|
|
38336
38350
|
},
|
|
38337
38351
|
{
|
|
38338
38352
|
name: "showConfig",
|
|
@@ -38340,7 +38354,8 @@ var ts;
|
|
|
38340
38354
|
showInSimplifiedHelpView: true,
|
|
38341
38355
|
category: ts.Diagnostics.Command_line_Options,
|
|
38342
38356
|
isCommandLineOnly: true,
|
|
38343
|
-
description: ts.Diagnostics.Print_the_final_configuration_instead_of_building
|
|
38357
|
+
description: ts.Diagnostics.Print_the_final_configuration_instead_of_building,
|
|
38358
|
+
defaultValueDescription: "false",
|
|
38344
38359
|
},
|
|
38345
38360
|
{
|
|
38346
38361
|
name: "listFilesOnly",
|
|
@@ -38349,7 +38364,8 @@ var ts;
|
|
|
38349
38364
|
affectsSemanticDiagnostics: true,
|
|
38350
38365
|
affectsEmit: true,
|
|
38351
38366
|
isCommandLineOnly: true,
|
|
38352
|
-
description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing
|
|
38367
|
+
description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
|
|
38368
|
+
defaultValueDescription: "false",
|
|
38353
38369
|
},
|
|
38354
38370
|
// Basic
|
|
38355
38371
|
ts.targetOptionDeclaration,
|
|
@@ -38469,7 +38485,6 @@ var ts;
|
|
|
38469
38485
|
category: ts.Diagnostics.Emit,
|
|
38470
38486
|
description: ts.Diagnostics.Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designates_a_file_that_bundles_all_d_ts_output,
|
|
38471
38487
|
transpileOptionValue: undefined,
|
|
38472
|
-
defaultValueDescription: "n/a"
|
|
38473
38488
|
},
|
|
38474
38489
|
{
|
|
38475
38490
|
name: "outDir",
|
|
@@ -38480,7 +38495,6 @@ var ts;
|
|
|
38480
38495
|
showInSimplifiedHelpView: true,
|
|
38481
38496
|
category: ts.Diagnostics.Emit,
|
|
38482
38497
|
description: ts.Diagnostics.Specify_an_output_folder_for_all_emitted_files,
|
|
38483
|
-
defaultValueDescription: "n/a"
|
|
38484
38498
|
},
|
|
38485
38499
|
{
|
|
38486
38500
|
name: "rootDir",
|
|
@@ -38637,6 +38651,7 @@ var ts;
|
|
|
38637
38651
|
strictFlag: true,
|
|
38638
38652
|
category: ts.Diagnostics.Type_Checking,
|
|
38639
38653
|
description: ts.Diagnostics.Type_catch_clause_variables_as_unknown_instead_of_any,
|
|
38654
|
+
defaultValueDescription: "false",
|
|
38640
38655
|
},
|
|
38641
38656
|
{
|
|
38642
38657
|
name: "alwaysStrict",
|
|
@@ -38669,7 +38684,8 @@ var ts;
|
|
|
38669
38684
|
type: "boolean",
|
|
38670
38685
|
affectsSemanticDiagnostics: true,
|
|
38671
38686
|
category: ts.Diagnostics.Type_Checking,
|
|
38672
|
-
description: ts.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined
|
|
38687
|
+
description: ts.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined,
|
|
38688
|
+
defaultValueDescription: "false",
|
|
38673
38689
|
},
|
|
38674
38690
|
{
|
|
38675
38691
|
name: "noImplicitReturns",
|
|
@@ -38685,21 +38701,24 @@ var ts;
|
|
|
38685
38701
|
affectsBindDiagnostics: true,
|
|
38686
38702
|
affectsSemanticDiagnostics: true,
|
|
38687
38703
|
category: ts.Diagnostics.Type_Checking,
|
|
38688
|
-
description: ts.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements
|
|
38704
|
+
description: ts.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,
|
|
38705
|
+
defaultValueDescription: "false",
|
|
38689
38706
|
},
|
|
38690
38707
|
{
|
|
38691
38708
|
name: "noUncheckedIndexedAccess",
|
|
38692
38709
|
type: "boolean",
|
|
38693
38710
|
affectsSemanticDiagnostics: true,
|
|
38694
38711
|
category: ts.Diagnostics.Type_Checking,
|
|
38695
|
-
description: ts.Diagnostics.Include_undefined_in_index_signature_results
|
|
38712
|
+
description: ts.Diagnostics.Include_undefined_in_index_signature_results,
|
|
38713
|
+
defaultValueDescription: "false",
|
|
38696
38714
|
},
|
|
38697
38715
|
{
|
|
38698
38716
|
name: "noImplicitOverride",
|
|
38699
38717
|
type: "boolean",
|
|
38700
38718
|
affectsSemanticDiagnostics: true,
|
|
38701
38719
|
category: ts.Diagnostics.Type_Checking,
|
|
38702
|
-
description: ts.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier
|
|
38720
|
+
description: ts.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,
|
|
38721
|
+
defaultValueDescription: "false",
|
|
38703
38722
|
},
|
|
38704
38723
|
{
|
|
38705
38724
|
name: "noPropertyAccessFromIndexSignature",
|
|
@@ -38808,7 +38827,7 @@ var ts;
|
|
|
38808
38827
|
type: "boolean",
|
|
38809
38828
|
category: ts.Diagnostics.Interop_Constraints,
|
|
38810
38829
|
description: ts.Diagnostics.Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node,
|
|
38811
|
-
defaultValueDescription: "
|
|
38830
|
+
defaultValueDescription: "false",
|
|
38812
38831
|
},
|
|
38813
38832
|
{
|
|
38814
38833
|
name: "allowUmdGlobalAccess",
|
|
@@ -38857,7 +38876,8 @@ var ts;
|
|
|
38857
38876
|
type: "boolean",
|
|
38858
38877
|
affectsSemanticDiagnostics: true,
|
|
38859
38878
|
category: ts.Diagnostics.Language_and_Environment,
|
|
38860
|
-
description: ts.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators
|
|
38879
|
+
description: ts.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators,
|
|
38880
|
+
defaultValueDescription: "false",
|
|
38861
38881
|
},
|
|
38862
38882
|
{
|
|
38863
38883
|
name: "emitDecoratorMetadata",
|
|
@@ -38865,7 +38885,8 @@ var ts;
|
|
|
38865
38885
|
affectsSemanticDiagnostics: true,
|
|
38866
38886
|
affectsEmit: true,
|
|
38867
38887
|
category: ts.Diagnostics.Language_and_Environment,
|
|
38868
|
-
description: ts.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files
|
|
38888
|
+
description: ts.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files,
|
|
38889
|
+
defaultValueDescription: "false",
|
|
38869
38890
|
},
|
|
38870
38891
|
// Advanced
|
|
38871
38892
|
{
|
|
@@ -38908,7 +38929,6 @@ var ts;
|
|
|
38908
38929
|
category: ts.Diagnostics.Backwards_Compatibility,
|
|
38909
38930
|
paramType: ts.Diagnostics.FILE,
|
|
38910
38931
|
transpileOptionValue: undefined,
|
|
38911
|
-
defaultValueDescription: "n/a",
|
|
38912
38932
|
description: ts.Diagnostics.Deprecated_setting_Use_outFile_instead,
|
|
38913
38933
|
},
|
|
38914
38934
|
{
|
|
@@ -38989,6 +39009,7 @@ var ts;
|
|
|
38989
39009
|
affectsEmit: true,
|
|
38990
39010
|
category: ts.Diagnostics.Emit,
|
|
38991
39011
|
description: ts.Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,
|
|
39012
|
+
defaultValueDescription: "false",
|
|
38992
39013
|
},
|
|
38993
39014
|
{
|
|
38994
39015
|
name: "disableSizeLimit",
|
|
@@ -39003,21 +39024,24 @@ var ts;
|
|
|
39003
39024
|
type: "boolean",
|
|
39004
39025
|
isTSConfigOnly: true,
|
|
39005
39026
|
category: ts.Diagnostics.Projects,
|
|
39006
|
-
description: ts.Diagnostics.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects
|
|
39027
|
+
description: ts.Diagnostics.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects,
|
|
39028
|
+
defaultValueDescription: "false",
|
|
39007
39029
|
},
|
|
39008
39030
|
{
|
|
39009
39031
|
name: "disableSolutionSearching",
|
|
39010
39032
|
type: "boolean",
|
|
39011
39033
|
isTSConfigOnly: true,
|
|
39012
39034
|
category: ts.Diagnostics.Projects,
|
|
39013
|
-
description: ts.Diagnostics.Opt_a_project_out_of_multi_project_reference_checking_when_editing
|
|
39035
|
+
description: ts.Diagnostics.Opt_a_project_out_of_multi_project_reference_checking_when_editing,
|
|
39036
|
+
defaultValueDescription: "false",
|
|
39014
39037
|
},
|
|
39015
39038
|
{
|
|
39016
39039
|
name: "disableReferencedProjectLoad",
|
|
39017
39040
|
type: "boolean",
|
|
39018
39041
|
isTSConfigOnly: true,
|
|
39019
39042
|
category: ts.Diagnostics.Projects,
|
|
39020
|
-
description: ts.Diagnostics.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript
|
|
39043
|
+
description: ts.Diagnostics.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript,
|
|
39044
|
+
defaultValueDescription: "false",
|
|
39021
39045
|
},
|
|
39022
39046
|
{
|
|
39023
39047
|
name: "noImplicitUseStrict",
|
|
@@ -39050,7 +39074,7 @@ var ts;
|
|
|
39050
39074
|
affectsEmit: true,
|
|
39051
39075
|
category: ts.Diagnostics.Emit,
|
|
39052
39076
|
description: ts.Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code,
|
|
39053
|
-
defaultValueDescription: "
|
|
39077
|
+
defaultValueDescription: "false",
|
|
39054
39078
|
},
|
|
39055
39079
|
{
|
|
39056
39080
|
name: "declarationDir",
|
|
@@ -39061,7 +39085,6 @@ var ts;
|
|
|
39061
39085
|
category: ts.Diagnostics.Emit,
|
|
39062
39086
|
transpileOptionValue: undefined,
|
|
39063
39087
|
description: ts.Diagnostics.Specify_the_output_directory_for_generated_declaration_files,
|
|
39064
|
-
defaultValueDescription: "n/a"
|
|
39065
39088
|
},
|
|
39066
39089
|
{
|
|
39067
39090
|
name: "skipLibCheck",
|
|
@@ -39143,6 +39166,7 @@ var ts;
|
|
|
39143
39166
|
affectsEmit: true,
|
|
39144
39167
|
category: ts.Diagnostics.Emit,
|
|
39145
39168
|
description: ts.Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,
|
|
39169
|
+
defaultValueDescription: "false",
|
|
39146
39170
|
},
|
|
39147
39171
|
{
|
|
39148
39172
|
name: "keyofStringsOnly",
|
|
@@ -39190,27 +39214,31 @@ var ts;
|
|
|
39190
39214
|
shortName: "v",
|
|
39191
39215
|
category: ts.Diagnostics.Command_line_Options,
|
|
39192
39216
|
description: ts.Diagnostics.Enable_verbose_logging,
|
|
39193
|
-
type: "boolean"
|
|
39217
|
+
type: "boolean",
|
|
39218
|
+
defaultValueDescription: "false",
|
|
39194
39219
|
},
|
|
39195
39220
|
{
|
|
39196
39221
|
name: "dry",
|
|
39197
39222
|
shortName: "d",
|
|
39198
39223
|
category: ts.Diagnostics.Command_line_Options,
|
|
39199
39224
|
description: ts.Diagnostics.Show_what_would_be_built_or_deleted_if_specified_with_clean,
|
|
39200
|
-
type: "boolean"
|
|
39225
|
+
type: "boolean",
|
|
39226
|
+
defaultValueDescription: "false",
|
|
39201
39227
|
},
|
|
39202
39228
|
{
|
|
39203
39229
|
name: "force",
|
|
39204
39230
|
shortName: "f",
|
|
39205
39231
|
category: ts.Diagnostics.Command_line_Options,
|
|
39206
39232
|
description: ts.Diagnostics.Build_all_projects_including_those_that_appear_to_be_up_to_date,
|
|
39207
|
-
type: "boolean"
|
|
39233
|
+
type: "boolean",
|
|
39234
|
+
defaultValueDescription: "false",
|
|
39208
39235
|
},
|
|
39209
39236
|
{
|
|
39210
39237
|
name: "clean",
|
|
39211
39238
|
category: ts.Diagnostics.Command_line_Options,
|
|
39212
39239
|
description: ts.Diagnostics.Delete_the_outputs_of_all_projects,
|
|
39213
|
-
type: "boolean"
|
|
39240
|
+
type: "boolean",
|
|
39241
|
+
defaultValueDescription: "false",
|
|
39214
39242
|
}
|
|
39215
39243
|
];
|
|
39216
39244
|
/* @internal */
|
|
@@ -39223,10 +39251,12 @@ var ts;
|
|
|
39223
39251
|
*/
|
|
39224
39252
|
name: "enableAutoDiscovery",
|
|
39225
39253
|
type: "boolean",
|
|
39254
|
+
defaultValueDescription: "false",
|
|
39226
39255
|
},
|
|
39227
39256
|
{
|
|
39228
39257
|
name: "enable",
|
|
39229
39258
|
type: "boolean",
|
|
39259
|
+
defaultValueDescription: "false",
|
|
39230
39260
|
},
|
|
39231
39261
|
{
|
|
39232
39262
|
name: "include",
|
|
@@ -39247,6 +39277,7 @@ var ts;
|
|
|
39247
39277
|
{
|
|
39248
39278
|
name: "disableFilenameBasedTypeAcquisition",
|
|
39249
39279
|
type: "boolean",
|
|
39280
|
+
defaultValueDescription: "false",
|
|
39250
39281
|
},
|
|
39251
39282
|
];
|
|
39252
39283
|
/*@internal*/
|
|
@@ -45666,6 +45697,7 @@ var ts;
|
|
|
45666
45697
|
case 168 /* MethodDeclaration */:
|
|
45667
45698
|
case 171 /* GetAccessor */:
|
|
45668
45699
|
case 172 /* SetAccessor */:
|
|
45700
|
+
case 169 /* ClassStaticBlockDeclaration */:
|
|
45669
45701
|
// this.foo assignment in a JavaScript class
|
|
45670
45702
|
// Bind this property to the containing class
|
|
45671
45703
|
var containingClass = thisContainer.parent;
|
|
@@ -49726,8 +49758,8 @@ var ts;
|
|
|
49726
49758
|
if (exportEquals !== moduleSymbol) {
|
|
49727
49759
|
var type = getTypeOfSymbol(exportEquals);
|
|
49728
49760
|
if (shouldTreatPropertiesOfExternalModuleAsExports(type)) {
|
|
49729
|
-
|
|
49730
|
-
cb(symbol,
|
|
49761
|
+
forEachPropertyOfType(type, function (symbol, escapedName) {
|
|
49762
|
+
cb(symbol, escapedName);
|
|
49731
49763
|
});
|
|
49732
49764
|
}
|
|
49733
49765
|
}
|
|
@@ -50059,12 +50091,15 @@ var ts;
|
|
|
50059
50091
|
function getNamedMembers(members) {
|
|
50060
50092
|
var result;
|
|
50061
50093
|
members.forEach(function (symbol, id) {
|
|
50062
|
-
if (
|
|
50094
|
+
if (isNamedMember(symbol, id)) {
|
|
50063
50095
|
(result || (result = [])).push(symbol);
|
|
50064
50096
|
}
|
|
50065
50097
|
});
|
|
50066
50098
|
return result || ts.emptyArray;
|
|
50067
50099
|
}
|
|
50100
|
+
function isNamedMember(member, escapedName) {
|
|
50101
|
+
return !isReservedMemberName(escapedName) && symbolIsValue(member);
|
|
50102
|
+
}
|
|
50068
50103
|
function getNamedOrIndexSignatureMembers(members) {
|
|
50069
50104
|
var result = getNamedMembers(members);
|
|
50070
50105
|
var index = getIndexSymbolFromSymbolTable(members);
|
|
@@ -56897,6 +56932,16 @@ var ts;
|
|
|
56897
56932
|
getPropertiesOfUnionOrIntersectionType(type) :
|
|
56898
56933
|
getPropertiesOfObjectType(type);
|
|
56899
56934
|
}
|
|
56935
|
+
function forEachPropertyOfType(type, action) {
|
|
56936
|
+
type = getReducedApparentType(type);
|
|
56937
|
+
if (type.flags & 3670016 /* StructuredType */) {
|
|
56938
|
+
resolveStructuredTypeMembers(type).members.forEach(function (symbol, escapedName) {
|
|
56939
|
+
if (isNamedMember(symbol, escapedName)) {
|
|
56940
|
+
action(symbol, escapedName);
|
|
56941
|
+
}
|
|
56942
|
+
});
|
|
56943
|
+
}
|
|
56944
|
+
}
|
|
56900
56945
|
function isTypeInvalidDueToUnionDiscriminant(contextualType, obj) {
|
|
56901
56946
|
var list = obj.properties;
|
|
56902
56947
|
return list.some(function (property) {
|
|
@@ -60372,12 +60417,6 @@ var ts;
|
|
|
60372
60417
|
}
|
|
60373
60418
|
return type[cache] = type;
|
|
60374
60419
|
}
|
|
60375
|
-
function isConditionalTypeAlwaysTrueDisregardingInferTypes(type) {
|
|
60376
|
-
var extendsInferParamMapper = type.root.inferTypeParameters && createTypeMapper(type.root.inferTypeParameters, ts.map(type.root.inferTypeParameters, function () { return wildcardType; }));
|
|
60377
|
-
var checkType = type.checkType;
|
|
60378
|
-
var extendsType = type.extendsType;
|
|
60379
|
-
return isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(instantiateType(extendsType, extendsInferParamMapper)));
|
|
60380
|
-
}
|
|
60381
60420
|
function getSimplifiedConditionalType(type, writing) {
|
|
60382
60421
|
var checkType = type.checkType;
|
|
60383
60422
|
var extendsType = type.extendsType;
|
|
@@ -60686,6 +60725,10 @@ var ts;
|
|
|
60686
60725
|
}
|
|
60687
60726
|
return result;
|
|
60688
60727
|
}
|
|
60728
|
+
function isDistributionDependent(root) {
|
|
60729
|
+
return root.isDistributive && (isTypeParameterPossiblyReferenced(root.checkType, root.node.trueType) ||
|
|
60730
|
+
isTypeParameterPossiblyReferenced(root.checkType, root.node.falseType));
|
|
60731
|
+
}
|
|
60689
60732
|
function getTypeFromConditionalTypeNode(node) {
|
|
60690
60733
|
var links = getNodeLinks(node);
|
|
60691
60734
|
if (!links.resolvedType) {
|
|
@@ -63842,31 +63885,21 @@ var ts;
|
|
|
63842
63885
|
return 3 /* Maybe */;
|
|
63843
63886
|
}
|
|
63844
63887
|
var c = target;
|
|
63845
|
-
//
|
|
63846
|
-
|
|
63847
|
-
|
|
63848
|
-
|
|
63849
|
-
|
|
63850
|
-
|
|
63851
|
-
|
|
63852
|
-
|
|
63853
|
-
|
|
63854
|
-
|
|
63855
|
-
|
|
63856
|
-
|
|
63857
|
-
|
|
63858
|
-
|
|
63859
|
-
|
|
63860
|
-
var expanding = isDeeplyNestedType(target, targetStack, targetDepth);
|
|
63861
|
-
var localResult = expanding ? 3 /* Maybe */ : undefined;
|
|
63862
|
-
if (skipTrue || expanding || (localResult = isRelatedTo(source, distributionMapper ? instantiateType(getTypeFromTypeNode(c.root.node.trueType), distributionMapper) : getTrueTypeFromConditionalType(c), 2 /* Target */, /*reportErrors*/ false))) {
|
|
63863
|
-
if (!skipFalse && !expanding) {
|
|
63864
|
-
localResult = (localResult || 3 /* Maybe */) & isRelatedTo(source, distributionMapper ? instantiateType(getTypeFromTypeNode(c.root.node.falseType), distributionMapper) : getFalseTypeFromConditionalType(c), 2 /* Target */, /*reportErrors*/ false);
|
|
63865
|
-
}
|
|
63866
|
-
}
|
|
63867
|
-
if (localResult) {
|
|
63868
|
-
resetErrorInfo(saveErrorInfo);
|
|
63869
|
-
return localResult;
|
|
63888
|
+
// We check for a relationship to a conditional type target only when the conditional type has no
|
|
63889
|
+
// 'infer' positions and is not distributive or is distributive but doesn't reference the check type
|
|
63890
|
+
// parameter in either of the result types.
|
|
63891
|
+
if (!c.root.inferTypeParameters && !isDistributionDependent(c.root)) {
|
|
63892
|
+
// Check if the conditional is always true or always false but still deferred for distribution purposes.
|
|
63893
|
+
var skipTrue = !isTypeAssignableTo(getPermissiveInstantiation(c.checkType), getPermissiveInstantiation(c.extendsType));
|
|
63894
|
+
var skipFalse = !skipTrue && isTypeAssignableTo(getRestrictiveInstantiation(c.checkType), getRestrictiveInstantiation(c.extendsType));
|
|
63895
|
+
// TODO: Find a nice way to include potential conditional type breakdowns in error output, if they seem good (they usually don't)
|
|
63896
|
+
if (result = skipTrue ? -1 /* True */ : isRelatedTo(source, getTrueTypeFromConditionalType(c), 2 /* Target */, /*reportErrors*/ false)) {
|
|
63897
|
+
result &= skipFalse ? -1 /* True */ : isRelatedTo(source, getFalseTypeFromConditionalType(c), 2 /* Target */, /*reportErrors*/ false);
|
|
63898
|
+
if (result) {
|
|
63899
|
+
resetErrorInfo(saveErrorInfo);
|
|
63900
|
+
return result;
|
|
63901
|
+
}
|
|
63902
|
+
}
|
|
63870
63903
|
}
|
|
63871
63904
|
}
|
|
63872
63905
|
else if (target.flags & 134217728 /* TemplateLiteral */) {
|
|
@@ -67013,17 +67046,16 @@ var ts;
|
|
|
67013
67046
|
var inferredType = void 0;
|
|
67014
67047
|
var signature = context.signature;
|
|
67015
67048
|
if (signature) {
|
|
67016
|
-
var
|
|
67049
|
+
var inferredCovariantType_1 = inference.candidates ? getCovariantInference(inference, signature) : undefined;
|
|
67017
67050
|
if (inference.contraCandidates) {
|
|
67018
|
-
var inferredContravariantType = getContravariantInference(inference);
|
|
67019
67051
|
// If we have both co- and contra-variant inferences, we prefer the contra-variant inference
|
|
67020
|
-
// unless the co-variant inference is a subtype and not 'never'.
|
|
67021
|
-
inferredType =
|
|
67022
|
-
isTypeSubtypeOf(
|
|
67023
|
-
|
|
67052
|
+
// unless the co-variant inference is a subtype of some contra-variant inference and not 'never'.
|
|
67053
|
+
inferredType = inferredCovariantType_1 && !(inferredCovariantType_1.flags & 131072 /* Never */) &&
|
|
67054
|
+
ts.some(inference.contraCandidates, function (t) { return isTypeSubtypeOf(inferredCovariantType_1, t); }) ?
|
|
67055
|
+
inferredCovariantType_1 : getContravariantInference(inference);
|
|
67024
67056
|
}
|
|
67025
|
-
else if (
|
|
67026
|
-
inferredType =
|
|
67057
|
+
else if (inferredCovariantType_1) {
|
|
67058
|
+
inferredType = inferredCovariantType_1;
|
|
67027
67059
|
}
|
|
67028
67060
|
else if (context.flags & 1 /* NoDefault */) {
|
|
67029
67061
|
// We use silentNeverType as the wildcard that signals no inferences.
|
|
@@ -124585,9 +124617,9 @@ var ts;
|
|
|
124585
124617
|
return displayPart(text, ts.SymbolDisplayPartKind.linkText);
|
|
124586
124618
|
}
|
|
124587
124619
|
ts.linkTextPart = linkTextPart;
|
|
124588
|
-
function linkNamePart(
|
|
124620
|
+
function linkNamePart(text, target) {
|
|
124589
124621
|
return {
|
|
124590
|
-
text:
|
|
124622
|
+
text: text,
|
|
124591
124623
|
kind: ts.SymbolDisplayPartKind[ts.SymbolDisplayPartKind.linkName],
|
|
124592
124624
|
target: {
|
|
124593
124625
|
fileName: ts.getSourceFileOfNode(target).fileName,
|
|
@@ -124612,20 +124644,41 @@ var ts;
|
|
|
124612
124644
|
}
|
|
124613
124645
|
else {
|
|
124614
124646
|
var symbol = checker === null || checker === void 0 ? void 0 : checker.getSymbolAtLocation(link.name);
|
|
124647
|
+
var suffix = findLinkNameEnd(link.text);
|
|
124648
|
+
var name = ts.getTextOfNode(link.name) + link.text.slice(0, suffix);
|
|
124649
|
+
var text = link.text.slice(suffix);
|
|
124615
124650
|
var decl = (symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration) || ((_a = symbol === null || symbol === void 0 ? void 0 : symbol.declarations) === null || _a === void 0 ? void 0 : _a[0]);
|
|
124616
124651
|
if (decl) {
|
|
124617
|
-
parts.push(linkNamePart(
|
|
124618
|
-
if (
|
|
124619
|
-
parts.push(linkTextPart(
|
|
124652
|
+
parts.push(linkNamePart(name, decl));
|
|
124653
|
+
if (text)
|
|
124654
|
+
parts.push(linkTextPart(text));
|
|
124620
124655
|
}
|
|
124621
124656
|
else {
|
|
124622
|
-
parts.push(linkTextPart(
|
|
124657
|
+
parts.push(linkTextPart(name + (suffix ? "" : " ") + text));
|
|
124623
124658
|
}
|
|
124624
124659
|
}
|
|
124625
124660
|
parts.push(linkPart("}"));
|
|
124626
124661
|
return parts;
|
|
124627
124662
|
}
|
|
124628
124663
|
ts.buildLinkParts = buildLinkParts;
|
|
124664
|
+
function findLinkNameEnd(text) {
|
|
124665
|
+
if (text.indexOf("()") === 0)
|
|
124666
|
+
return 2;
|
|
124667
|
+
if (text[0] !== "<")
|
|
124668
|
+
return 0;
|
|
124669
|
+
var brackets = 0;
|
|
124670
|
+
var i = 0;
|
|
124671
|
+
while (i < text.length) {
|
|
124672
|
+
if (text[i] === "<")
|
|
124673
|
+
brackets++;
|
|
124674
|
+
if (text[i] === ">")
|
|
124675
|
+
brackets--;
|
|
124676
|
+
i++;
|
|
124677
|
+
if (!brackets)
|
|
124678
|
+
return i;
|
|
124679
|
+
}
|
|
124680
|
+
return 0;
|
|
124681
|
+
}
|
|
124629
124682
|
var carriageReturnLineFeed = "\r\n";
|
|
124630
124683
|
/**
|
|
124631
124684
|
* The default is CRLF.
|
|
@@ -125529,10 +125582,14 @@ var ts;
|
|
|
125529
125582
|
}
|
|
125530
125583
|
var isDefault = exportKind === 1 /* Default */;
|
|
125531
125584
|
var namedSymbol = isDefault && ts.getLocalSymbolForExportDefault(symbol) || symbol;
|
|
125532
|
-
// A
|
|
125533
|
-
//
|
|
125534
|
-
//
|
|
125535
|
-
|
|
125585
|
+
// 1. A named export must be imported by its key in `moduleSymbol.exports` or `moduleSymbol.members`.
|
|
125586
|
+
// 2. A re-export merged with an export from a module augmentation can result in `symbol`
|
|
125587
|
+
// being an external module symbol; the name it is re-exported by will be `symbolTableKey`
|
|
125588
|
+
// (which comes from the keys of `moduleSymbol.exports`.)
|
|
125589
|
+
// 3. Otherwise, we have a default/namespace import that can be imported by any name, and
|
|
125590
|
+
// `symbolTableKey` will be something undesirable like `export=` or `default`, so we try to
|
|
125591
|
+
// get a better name.
|
|
125592
|
+
var importedName = exportKind === 0 /* Named */ || ts.isExternalModuleSymbol(namedSymbol)
|
|
125536
125593
|
? ts.unescapeLeadingUnderscores(symbolTableKey)
|
|
125537
125594
|
: ts.getNameForExportedSymbol(namedSymbol, scriptTarget);
|
|
125538
125595
|
var moduleName = ts.stripQuotes(moduleSymbol.name);
|
|
@@ -125763,7 +125820,7 @@ var ts;
|
|
|
125763
125820
|
cache.add(importingFile.path, defaultInfo.symbol, defaultInfo.exportKind === 1 /* Default */ ? "default" /* Default */ : "export=" /* ExportEquals */, moduleSymbol, moduleFile, defaultInfo.exportKind, isFromPackageJson, scriptTarget, checker);
|
|
125764
125821
|
}
|
|
125765
125822
|
checker.forEachExportAndPropertyOfModule(moduleSymbol, function (exported, key) {
|
|
125766
|
-
if (exported !== (defaultInfo === null || defaultInfo === void 0 ? void 0 : defaultInfo.symbol) && isImportableSymbol(exported, checker) && ts.addToSeen(seenExports,
|
|
125823
|
+
if (exported !== (defaultInfo === null || defaultInfo === void 0 ? void 0 : defaultInfo.symbol) && isImportableSymbol(exported, checker) && ts.addToSeen(seenExports, key)) {
|
|
125767
125824
|
cache.add(importingFile.path, exported, key, moduleSymbol, moduleFile, 0 /* Named */, isFromPackageJson, scriptTarget, checker);
|
|
125768
125825
|
}
|
|
125769
125826
|
});
|
|
@@ -128618,8 +128675,8 @@ var ts;
|
|
|
128618
128675
|
}
|
|
128619
128676
|
var checker = origin.isFromPackageJson ? host.getPackageJsonAutoImportProvider().getTypeChecker() : program.getTypeChecker();
|
|
128620
128677
|
var moduleSymbol = origin.moduleSymbol;
|
|
128621
|
-
var
|
|
128622
|
-
var _b = ts.codefix.getImportCompletionAction(
|
|
128678
|
+
var targetSymbol = checker.getMergedSymbol(ts.skipAlias(symbol.exportSymbol || symbol, checker));
|
|
128679
|
+
var _b = ts.codefix.getImportCompletionAction(targetSymbol, moduleSymbol, sourceFile, ts.getNameForExportedSymbol(symbol, ts.getEmitScriptTarget(compilerOptions)), host, program, formatContext, previousToken && ts.isIdentifier(previousToken) ? previousToken.getStart(sourceFile) : position, preferences), moduleSpecifier = _b.moduleSpecifier, codeAction = _b.codeAction;
|
|
128623
128680
|
ts.Debug.assert(!(data === null || data === void 0 ? void 0 : data.moduleSpecifier) || moduleSpecifier === data.moduleSpecifier);
|
|
128624
128681
|
return { sourceDisplay: [ts.textPart(moduleSpecifier)], codeActions: [codeAction] };
|
|
128625
128682
|
}
|
|
@@ -129514,8 +129571,9 @@ var ts;
|
|
|
129514
129571
|
function isNewIdentifierDefinitionLocation() {
|
|
129515
129572
|
if (contextToken) {
|
|
129516
129573
|
var containingNodeKind = contextToken.parent.kind;
|
|
129574
|
+
var tokenKind = keywordForNode(contextToken);
|
|
129517
129575
|
// Previous token may have been a keyword that was converted to an identifier.
|
|
129518
|
-
switch (
|
|
129576
|
+
switch (tokenKind) {
|
|
129519
129577
|
case 27 /* CommaToken */:
|
|
129520
129578
|
return containingNodeKind === 207 /* CallExpression */ // func( a, |
|
|
129521
129579
|
|| containingNodeKind === 170 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */
|
|
@@ -129550,10 +129608,12 @@ var ts;
|
|
|
129550
129608
|
return containingNodeKind === 222 /* TemplateExpression */; // `aa ${|
|
|
129551
129609
|
case 16 /* TemplateMiddle */:
|
|
129552
129610
|
return containingNodeKind === 232 /* TemplateSpan */; // `aa ${10} dd ${|
|
|
129553
|
-
case
|
|
129554
|
-
|
|
129555
|
-
|
|
129556
|
-
|
|
129611
|
+
case 131 /* AsyncKeyword */:
|
|
129612
|
+
return containingNodeKind === 168 /* MethodDeclaration */ // const obj = { async c|()
|
|
129613
|
+
|| containingNodeKind === 295 /* ShorthandPropertyAssignment */; // const obj = { async c|
|
|
129614
|
+
}
|
|
129615
|
+
if (isClassMemberCompletionKeyword(tokenKind)) {
|
|
129616
|
+
return true;
|
|
129557
129617
|
}
|
|
129558
129618
|
}
|
|
129559
129619
|
return false;
|
|
@@ -147858,11 +147918,11 @@ var ts;
|
|
|
147858
147918
|
AddAsTypeOnly[AddAsTypeOnly["Required"] = 2] = "Required";
|
|
147859
147919
|
AddAsTypeOnly[AddAsTypeOnly["NotAllowed"] = 4] = "NotAllowed";
|
|
147860
147920
|
})(AddAsTypeOnly || (AddAsTypeOnly = {}));
|
|
147861
|
-
function getImportCompletionAction(
|
|
147921
|
+
function getImportCompletionAction(targetSymbol, moduleSymbol, sourceFile, symbolName, host, program, formatContext, position, preferences) {
|
|
147862
147922
|
var compilerOptions = program.getCompilerOptions();
|
|
147863
147923
|
var exportInfos = ts.pathIsBareSpecifier(ts.stripQuotes(moduleSymbol.name))
|
|
147864
|
-
? [getSymbolExportInfoForSymbol(
|
|
147865
|
-
: getAllReExportingModules(sourceFile,
|
|
147924
|
+
? [getSymbolExportInfoForSymbol(targetSymbol, moduleSymbol, program, host)]
|
|
147925
|
+
: getAllReExportingModules(sourceFile, targetSymbol, moduleSymbol, symbolName, host, program, preferences, /*useAutoImportProvider*/ true);
|
|
147866
147926
|
var useRequire = shouldUseRequire(sourceFile, program);
|
|
147867
147927
|
var isValidTypeOnlyUseSite = ts.isValidTypeOnlyAliasUseSite(ts.getTokenAtPosition(sourceFile, position));
|
|
147868
147928
|
var fix = ts.Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, symbolName, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences));
|
|
@@ -147900,7 +147960,7 @@ var ts;
|
|
|
147900
147960
|
}
|
|
147901
147961
|
}
|
|
147902
147962
|
}
|
|
147903
|
-
function getAllReExportingModules(importingFile,
|
|
147963
|
+
function getAllReExportingModules(importingFile, targetSymbol, exportingModuleSymbol, symbolName, host, program, preferences, useAutoImportProvider) {
|
|
147904
147964
|
var result = [];
|
|
147905
147965
|
var compilerOptions = program.getCompilerOptions();
|
|
147906
147966
|
var getModuleSpecifierResolutionHost = ts.memoizeOne(function (isFromPackageJson) {
|
|
@@ -147913,12 +147973,12 @@ var ts;
|
|
|
147913
147973
|
return;
|
|
147914
147974
|
}
|
|
147915
147975
|
var defaultInfo = ts.getDefaultLikeExportInfo(moduleSymbol, checker, compilerOptions);
|
|
147916
|
-
if (defaultInfo && (defaultInfo.name === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, ts.getEmitScriptTarget(compilerOptions)) === symbolName) && ts.skipAlias(defaultInfo.symbol, checker) ===
|
|
147976
|
+
if (defaultInfo && (defaultInfo.name === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, ts.getEmitScriptTarget(compilerOptions)) === symbolName) && ts.skipAlias(defaultInfo.symbol, checker) === targetSymbol && isImportable(program, moduleFile, isFromPackageJson)) {
|
|
147917
147977
|
result.push({ symbol: defaultInfo.symbol, moduleSymbol: moduleSymbol, moduleFileName: moduleFile === null || moduleFile === void 0 ? void 0 : moduleFile.fileName, exportKind: defaultInfo.exportKind, targetFlags: ts.skipAlias(defaultInfo.symbol, checker).flags, isFromPackageJson: isFromPackageJson });
|
|
147918
147978
|
}
|
|
147919
147979
|
for (var _i = 0, _a = checker.getExportsAndPropertiesOfModule(moduleSymbol); _i < _a.length; _i++) {
|
|
147920
147980
|
var exported = _a[_i];
|
|
147921
|
-
if (exported.name === symbolName && ts.skipAlias(exported, checker) ===
|
|
147981
|
+
if (exported.name === symbolName && checker.getMergedSymbol(ts.skipAlias(exported, checker)) === targetSymbol && isImportable(program, moduleFile, isFromPackageJson)) {
|
|
147922
147982
|
result.push({ symbol: exported, moduleSymbol: moduleSymbol, moduleFileName: moduleFile === null || moduleFile === void 0 ? void 0 : moduleFile.fileName, exportKind: 0 /* Named */, targetFlags: ts.skipAlias(exported, checker).flags, isFromPackageJson: isFromPackageJson });
|
|
147923
147983
|
}
|
|
147924
147984
|
}
|
|
@@ -148169,12 +148229,14 @@ var ts;
|
|
|
148169
148229
|
}
|
|
148170
148230
|
var allowsImportingSpecifier = ts.createPackageJsonImportFilter(sourceFile, preferences, host).allowsImportingSpecifier;
|
|
148171
148231
|
return fixes.reduce(function (best, fix) {
|
|
148232
|
+
// Takes true branch of conditional if `fix` is better than `best`
|
|
148172
148233
|
return compareModuleSpecifiers(fix, best, sourceFile, program, allowsImportingSpecifier) === -1 /* LessThan */ ? fix : best;
|
|
148173
148234
|
});
|
|
148174
148235
|
}
|
|
148236
|
+
/** @returns `Comparison.LessThan` if `a` is better than `b`. */
|
|
148175
148237
|
function compareModuleSpecifiers(a, b, importingFile, program, allowsImportingSpecifier) {
|
|
148176
148238
|
if (a.kind !== 0 /* UseNamespace */ && b.kind !== 0 /* UseNamespace */) {
|
|
148177
|
-
return ts.compareBooleans(allowsImportingSpecifier(
|
|
148239
|
+
return ts.compareBooleans(allowsImportingSpecifier(b.moduleSpecifier), allowsImportingSpecifier(a.moduleSpecifier))
|
|
148178
148240
|
|| compareNodeCoreModuleSpecifiers(a.moduleSpecifier, b.moduleSpecifier, importingFile, program)
|
|
148179
148241
|
|| ts.compareNumberOfDirectorySeparators(a.moduleSpecifier, b.moduleSpecifier);
|
|
148180
148242
|
}
|
|
@@ -150826,7 +150888,8 @@ var ts;
|
|
|
150826
150888
|
insertBefore = ts.findChildOfKind(containingFunction, 98 /* FunctionKeyword */, sourceFile);
|
|
150827
150889
|
break;
|
|
150828
150890
|
case 213 /* ArrowFunction */:
|
|
150829
|
-
|
|
150891
|
+
var kind = containingFunction.typeParameters ? 29 /* LessThanToken */ : 20 /* OpenParenToken */;
|
|
150892
|
+
insertBefore = ts.findChildOfKind(containingFunction, kind, sourceFile) || ts.first(containingFunction.parameters);
|
|
150830
150893
|
break;
|
|
150831
150894
|
default:
|
|
150832
150895
|
return;
|