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/typescript.js
CHANGED
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211023";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -8335,6 +8335,7 @@ var ts;
|
|
|
8335
8335
|
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."),
|
|
8336
8336
|
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."),
|
|
8337
8337
|
_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."),
|
|
8338
|
+
_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."),
|
|
8338
8339
|
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'"),
|
|
8339
8340
|
Imported_via_0_from_file_1: diag(1393, ts.DiagnosticCategory.Message, "Imported_via_0_from_file_1_1393", "Imported via {0} from file '{1}'"),
|
|
8340
8341
|
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}'"),
|
|
@@ -20187,7 +20188,7 @@ var ts;
|
|
|
20187
20188
|
includeFilePattern: getRegularExpressionForWildcard(includes, absolutePath, "files"),
|
|
20188
20189
|
includeDirectoryPattern: getRegularExpressionForWildcard(includes, absolutePath, "directories"),
|
|
20189
20190
|
excludePattern: getRegularExpressionForWildcard(excludes, absolutePath, "exclude"),
|
|
20190
|
-
basePaths: getBasePaths(
|
|
20191
|
+
basePaths: getBasePaths(absolutePath, includes, useCaseSensitiveFileNames)
|
|
20191
20192
|
};
|
|
20192
20193
|
}
|
|
20193
20194
|
ts.getFileMatcherPatterns = getFileMatcherPatterns;
|
|
@@ -20209,20 +20210,20 @@ var ts;
|
|
|
20209
20210
|
var visited = new ts.Map();
|
|
20210
20211
|
var toCanonical = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
|
|
20211
20212
|
for (var _i = 0, _a = patterns.basePaths; _i < _a.length; _i++) {
|
|
20212
|
-
var
|
|
20213
|
-
if (directoryExists(
|
|
20214
|
-
visitDirectory(
|
|
20213
|
+
var absoluteBasePath = _a[_i];
|
|
20214
|
+
if (directoryExists(absoluteBasePath)) {
|
|
20215
|
+
visitDirectory(absoluteBasePath, depth);
|
|
20215
20216
|
}
|
|
20216
20217
|
}
|
|
20217
20218
|
return ts.flatten(results);
|
|
20218
|
-
function visitDirectory(
|
|
20219
|
+
function visitDirectory(absolutePath, depth) {
|
|
20219
20220
|
var canonicalPath = toCanonical(realpath(absolutePath));
|
|
20220
20221
|
if (visited.has(canonicalPath))
|
|
20221
20222
|
return;
|
|
20222
20223
|
visited.set(canonicalPath, true);
|
|
20223
|
-
var _a = getFileSystemEntries(
|
|
20224
|
+
var _a = getFileSystemEntries(absolutePath), files = _a.files, directories = _a.directories;
|
|
20224
20225
|
var _loop_1 = function (current) {
|
|
20225
|
-
var name = ts.combinePaths(
|
|
20226
|
+
var name = ts.combinePaths(absolutePath, current);
|
|
20226
20227
|
var absoluteName = ts.combinePaths(absolutePath, current);
|
|
20227
20228
|
if (extensions && !ts.fileExtensionIsOneOf(name, extensions))
|
|
20228
20229
|
return "continue";
|
|
@@ -20250,11 +20251,10 @@ var ts;
|
|
|
20250
20251
|
}
|
|
20251
20252
|
for (var _c = 0, _d = ts.sort(directories, ts.compareStringsCaseSensitive); _c < _d.length; _c++) {
|
|
20252
20253
|
var current = _d[_c];
|
|
20253
|
-
var name = ts.combinePaths(path, current);
|
|
20254
20254
|
var absoluteName = ts.combinePaths(absolutePath, current);
|
|
20255
20255
|
if ((!includeDirectoryRegex || includeDirectoryRegex.test(absoluteName)) &&
|
|
20256
20256
|
(!excludeRegex || !excludeRegex.test(absoluteName))) {
|
|
20257
|
-
visitDirectory(
|
|
20257
|
+
visitDirectory(absoluteName, depth);
|
|
20258
20258
|
}
|
|
20259
20259
|
}
|
|
20260
20260
|
}
|
|
@@ -20262,10 +20262,11 @@ var ts;
|
|
|
20262
20262
|
ts.matchFiles = matchFiles;
|
|
20263
20263
|
/**
|
|
20264
20264
|
* Computes the unique non-wildcard base paths amongst the provided include patterns.
|
|
20265
|
+
* @returns Absolute directory paths
|
|
20265
20266
|
*/
|
|
20266
|
-
function getBasePaths(
|
|
20267
|
+
function getBasePaths(absoluteTsconfigPath, includes, useCaseSensitiveFileNames) {
|
|
20267
20268
|
// Storage for our results in the form of literal paths (e.g. the paths as written by the user).
|
|
20268
|
-
var basePaths = [
|
|
20269
|
+
var basePaths = [absoluteTsconfigPath];
|
|
20269
20270
|
if (includes) {
|
|
20270
20271
|
// Storage for literal base paths amongst the include patterns.
|
|
20271
20272
|
var includeBasePaths = [];
|
|
@@ -20273,14 +20274,14 @@ var ts;
|
|
|
20273
20274
|
var include = includes_1[_i];
|
|
20274
20275
|
// We also need to check the relative paths by converting them to absolute and normalizing
|
|
20275
20276
|
// in case they escape the base path (e.g "..\somedirectory")
|
|
20276
|
-
var
|
|
20277
|
+
var absoluteIncludePath = ts.isRootedDiskPath(include) ? include : ts.normalizePath(ts.combinePaths(absoluteTsconfigPath, include));
|
|
20277
20278
|
// Append the literal and canonical candidate base paths.
|
|
20278
|
-
includeBasePaths.push(getIncludeBasePath(
|
|
20279
|
+
includeBasePaths.push(getIncludeBasePath(absoluteIncludePath));
|
|
20279
20280
|
}
|
|
20280
20281
|
// Sort the offsets array using either the literal or canonical path representations.
|
|
20281
20282
|
includeBasePaths.sort(ts.getStringComparer(!useCaseSensitiveFileNames));
|
|
20282
20283
|
var _loop_2 = function (includeBasePath) {
|
|
20283
|
-
if (ts.every(basePaths, function (basePath) { return !ts.containsPath(basePath, includeBasePath,
|
|
20284
|
+
if (ts.every(basePaths, function (basePath) { return !ts.containsPath(basePath, includeBasePath, absoluteTsconfigPath, !useCaseSensitiveFileNames); })) {
|
|
20284
20285
|
basePaths.push(includeBasePath);
|
|
20285
20286
|
}
|
|
20286
20287
|
};
|
|
@@ -32127,7 +32128,10 @@ var ts;
|
|
|
32127
32128
|
case 12 /* ObjectLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Property_assignment_expected);
|
|
32128
32129
|
case 15 /* ArrayLiteralMembers */: return parseErrorAtCurrentToken(ts.Diagnostics.Expression_or_comma_expected);
|
|
32129
32130
|
case 17 /* JSDocParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected);
|
|
32130
|
-
case 16 /* Parameters */:
|
|
32131
|
+
case 16 /* Parameters */:
|
|
32132
|
+
return ts.isKeyword(token())
|
|
32133
|
+
? parseErrorAtCurrentToken(ts.Diagnostics._0_is_not_allowed_as_a_parameter_name, ts.tokenToString(token()))
|
|
32134
|
+
: parseErrorAtCurrentToken(ts.Diagnostics.Parameter_declaration_expected);
|
|
32131
32135
|
case 19 /* TypeParameters */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_parameter_declaration_expected);
|
|
32132
32136
|
case 20 /* TypeArguments */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_argument_expected);
|
|
32133
32137
|
case 21 /* TupleElementTypes */: return parseErrorAtCurrentToken(ts.Diagnostics.Type_expected);
|
|
@@ -38172,7 +38176,7 @@ var ts;
|
|
|
38172
38176
|
var ts;
|
|
38173
38177
|
(function (ts) {
|
|
38174
38178
|
/* @internal */
|
|
38175
|
-
ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean" };
|
|
38179
|
+
ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean", defaultValueDescription: "false" };
|
|
38176
38180
|
var jsxOptionMap = new ts.Map(ts.getEntries({
|
|
38177
38181
|
"preserve": 1 /* Preserve */,
|
|
38178
38182
|
"react-native": 3 /* ReactNative */,
|
|
@@ -38309,6 +38313,7 @@ var ts;
|
|
|
38309
38313
|
type: "boolean",
|
|
38310
38314
|
category: ts.Diagnostics.Watch_and_Build_Modes,
|
|
38311
38315
|
description: ts.Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,
|
|
38316
|
+
defaultValueDescription: "false",
|
|
38312
38317
|
},
|
|
38313
38318
|
{
|
|
38314
38319
|
name: "excludeDirectories",
|
|
@@ -38344,11 +38349,13 @@ var ts;
|
|
|
38344
38349
|
showInSimplifiedHelpView: true,
|
|
38345
38350
|
category: ts.Diagnostics.Command_line_Options,
|
|
38346
38351
|
description: ts.Diagnostics.Print_this_message,
|
|
38352
|
+
defaultValueDescription: "false",
|
|
38347
38353
|
},
|
|
38348
38354
|
{
|
|
38349
38355
|
name: "help",
|
|
38350
38356
|
shortName: "?",
|
|
38351
|
-
type: "boolean"
|
|
38357
|
+
type: "boolean",
|
|
38358
|
+
defaultValueDescription: "false",
|
|
38352
38359
|
},
|
|
38353
38360
|
{
|
|
38354
38361
|
name: "watch",
|
|
@@ -38358,6 +38365,7 @@ var ts;
|
|
|
38358
38365
|
isCommandLineOnly: true,
|
|
38359
38366
|
category: ts.Diagnostics.Command_line_Options,
|
|
38360
38367
|
description: ts.Diagnostics.Watch_input_files,
|
|
38368
|
+
defaultValueDescription: "false",
|
|
38361
38369
|
},
|
|
38362
38370
|
{
|
|
38363
38371
|
name: "preserveWatchOutput",
|
|
@@ -38365,7 +38373,7 @@ var ts;
|
|
|
38365
38373
|
showInSimplifiedHelpView: false,
|
|
38366
38374
|
category: ts.Diagnostics.Output_Formatting,
|
|
38367
38375
|
description: ts.Diagnostics.Disable_wiping_the_console_in_watch_mode,
|
|
38368
|
-
defaultValueDescription: "
|
|
38376
|
+
defaultValueDescription: "false",
|
|
38369
38377
|
},
|
|
38370
38378
|
{
|
|
38371
38379
|
name: "listFiles",
|
|
@@ -38378,7 +38386,8 @@ var ts;
|
|
|
38378
38386
|
name: "explainFiles",
|
|
38379
38387
|
type: "boolean",
|
|
38380
38388
|
category: ts.Diagnostics.Compiler_Diagnostics,
|
|
38381
|
-
description: ts.Diagnostics.Print_files_read_during_the_compilation_including_why_it_was_included
|
|
38389
|
+
description: ts.Diagnostics.Print_files_read_during_the_compilation_including_why_it_was_included,
|
|
38390
|
+
defaultValueDescription: "false",
|
|
38382
38391
|
},
|
|
38383
38392
|
{
|
|
38384
38393
|
name: "listEmittedFiles",
|
|
@@ -38449,7 +38458,8 @@ var ts;
|
|
|
38449
38458
|
affectsSemanticDiagnostics: true,
|
|
38450
38459
|
affectsEmit: true,
|
|
38451
38460
|
category: ts.Diagnostics.Watch_and_Build_Modes,
|
|
38452
|
-
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
|
|
38461
|
+
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,
|
|
38462
|
+
defaultValueDescription: "false",
|
|
38453
38463
|
},
|
|
38454
38464
|
{
|
|
38455
38465
|
name: "locale",
|
|
@@ -38494,6 +38504,7 @@ var ts;
|
|
|
38494
38504
|
showInSimplifiedHelpView: true,
|
|
38495
38505
|
category: ts.Diagnostics.Command_line_Options,
|
|
38496
38506
|
description: ts.Diagnostics.Show_all_compiler_options,
|
|
38507
|
+
defaultValueDescription: "false",
|
|
38497
38508
|
},
|
|
38498
38509
|
{
|
|
38499
38510
|
name: "version",
|
|
@@ -38502,6 +38513,7 @@ var ts;
|
|
|
38502
38513
|
showInSimplifiedHelpView: true,
|
|
38503
38514
|
category: ts.Diagnostics.Command_line_Options,
|
|
38504
38515
|
description: ts.Diagnostics.Print_the_compiler_s_version,
|
|
38516
|
+
defaultValueDescription: "false",
|
|
38505
38517
|
},
|
|
38506
38518
|
{
|
|
38507
38519
|
name: "init",
|
|
@@ -38509,6 +38521,7 @@ var ts;
|
|
|
38509
38521
|
showInSimplifiedHelpView: true,
|
|
38510
38522
|
category: ts.Diagnostics.Command_line_Options,
|
|
38511
38523
|
description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file,
|
|
38524
|
+
defaultValueDescription: "false",
|
|
38512
38525
|
},
|
|
38513
38526
|
{
|
|
38514
38527
|
name: "project",
|
|
@@ -38526,7 +38539,8 @@ var ts;
|
|
|
38526
38539
|
shortName: "b",
|
|
38527
38540
|
showInSimplifiedHelpView: true,
|
|
38528
38541
|
category: ts.Diagnostics.Command_line_Options,
|
|
38529
|
-
description: ts.Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date
|
|
38542
|
+
description: ts.Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,
|
|
38543
|
+
defaultValueDescription: "false",
|
|
38530
38544
|
},
|
|
38531
38545
|
{
|
|
38532
38546
|
name: "showConfig",
|
|
@@ -38534,7 +38548,8 @@ var ts;
|
|
|
38534
38548
|
showInSimplifiedHelpView: true,
|
|
38535
38549
|
category: ts.Diagnostics.Command_line_Options,
|
|
38536
38550
|
isCommandLineOnly: true,
|
|
38537
|
-
description: ts.Diagnostics.Print_the_final_configuration_instead_of_building
|
|
38551
|
+
description: ts.Diagnostics.Print_the_final_configuration_instead_of_building,
|
|
38552
|
+
defaultValueDescription: "false",
|
|
38538
38553
|
},
|
|
38539
38554
|
{
|
|
38540
38555
|
name: "listFilesOnly",
|
|
@@ -38543,7 +38558,8 @@ var ts;
|
|
|
38543
38558
|
affectsSemanticDiagnostics: true,
|
|
38544
38559
|
affectsEmit: true,
|
|
38545
38560
|
isCommandLineOnly: true,
|
|
38546
|
-
description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing
|
|
38561
|
+
description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
|
|
38562
|
+
defaultValueDescription: "false",
|
|
38547
38563
|
},
|
|
38548
38564
|
// Basic
|
|
38549
38565
|
ts.targetOptionDeclaration,
|
|
@@ -38663,7 +38679,6 @@ var ts;
|
|
|
38663
38679
|
category: ts.Diagnostics.Emit,
|
|
38664
38680
|
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,
|
|
38665
38681
|
transpileOptionValue: undefined,
|
|
38666
|
-
defaultValueDescription: "n/a"
|
|
38667
38682
|
},
|
|
38668
38683
|
{
|
|
38669
38684
|
name: "outDir",
|
|
@@ -38674,7 +38689,6 @@ var ts;
|
|
|
38674
38689
|
showInSimplifiedHelpView: true,
|
|
38675
38690
|
category: ts.Diagnostics.Emit,
|
|
38676
38691
|
description: ts.Diagnostics.Specify_an_output_folder_for_all_emitted_files,
|
|
38677
|
-
defaultValueDescription: "n/a"
|
|
38678
38692
|
},
|
|
38679
38693
|
{
|
|
38680
38694
|
name: "rootDir",
|
|
@@ -38831,6 +38845,7 @@ var ts;
|
|
|
38831
38845
|
strictFlag: true,
|
|
38832
38846
|
category: ts.Diagnostics.Type_Checking,
|
|
38833
38847
|
description: ts.Diagnostics.Type_catch_clause_variables_as_unknown_instead_of_any,
|
|
38848
|
+
defaultValueDescription: "false",
|
|
38834
38849
|
},
|
|
38835
38850
|
{
|
|
38836
38851
|
name: "alwaysStrict",
|
|
@@ -38863,7 +38878,8 @@ var ts;
|
|
|
38863
38878
|
type: "boolean",
|
|
38864
38879
|
affectsSemanticDiagnostics: true,
|
|
38865
38880
|
category: ts.Diagnostics.Type_Checking,
|
|
38866
|
-
description: ts.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined
|
|
38881
|
+
description: ts.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined,
|
|
38882
|
+
defaultValueDescription: "false",
|
|
38867
38883
|
},
|
|
38868
38884
|
{
|
|
38869
38885
|
name: "noImplicitReturns",
|
|
@@ -38879,21 +38895,24 @@ var ts;
|
|
|
38879
38895
|
affectsBindDiagnostics: true,
|
|
38880
38896
|
affectsSemanticDiagnostics: true,
|
|
38881
38897
|
category: ts.Diagnostics.Type_Checking,
|
|
38882
|
-
description: ts.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements
|
|
38898
|
+
description: ts.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,
|
|
38899
|
+
defaultValueDescription: "false",
|
|
38883
38900
|
},
|
|
38884
38901
|
{
|
|
38885
38902
|
name: "noUncheckedIndexedAccess",
|
|
38886
38903
|
type: "boolean",
|
|
38887
38904
|
affectsSemanticDiagnostics: true,
|
|
38888
38905
|
category: ts.Diagnostics.Type_Checking,
|
|
38889
|
-
description: ts.Diagnostics.Include_undefined_in_index_signature_results
|
|
38906
|
+
description: ts.Diagnostics.Include_undefined_in_index_signature_results,
|
|
38907
|
+
defaultValueDescription: "false",
|
|
38890
38908
|
},
|
|
38891
38909
|
{
|
|
38892
38910
|
name: "noImplicitOverride",
|
|
38893
38911
|
type: "boolean",
|
|
38894
38912
|
affectsSemanticDiagnostics: true,
|
|
38895
38913
|
category: ts.Diagnostics.Type_Checking,
|
|
38896
|
-
description: ts.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier
|
|
38914
|
+
description: ts.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,
|
|
38915
|
+
defaultValueDescription: "false",
|
|
38897
38916
|
},
|
|
38898
38917
|
{
|
|
38899
38918
|
name: "noPropertyAccessFromIndexSignature",
|
|
@@ -39002,7 +39021,7 @@ var ts;
|
|
|
39002
39021
|
type: "boolean",
|
|
39003
39022
|
category: ts.Diagnostics.Interop_Constraints,
|
|
39004
39023
|
description: ts.Diagnostics.Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node,
|
|
39005
|
-
defaultValueDescription: "
|
|
39024
|
+
defaultValueDescription: "false",
|
|
39006
39025
|
},
|
|
39007
39026
|
{
|
|
39008
39027
|
name: "allowUmdGlobalAccess",
|
|
@@ -39051,7 +39070,8 @@ var ts;
|
|
|
39051
39070
|
type: "boolean",
|
|
39052
39071
|
affectsSemanticDiagnostics: true,
|
|
39053
39072
|
category: ts.Diagnostics.Language_and_Environment,
|
|
39054
|
-
description: ts.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators
|
|
39073
|
+
description: ts.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators,
|
|
39074
|
+
defaultValueDescription: "false",
|
|
39055
39075
|
},
|
|
39056
39076
|
{
|
|
39057
39077
|
name: "emitDecoratorMetadata",
|
|
@@ -39059,7 +39079,8 @@ var ts;
|
|
|
39059
39079
|
affectsSemanticDiagnostics: true,
|
|
39060
39080
|
affectsEmit: true,
|
|
39061
39081
|
category: ts.Diagnostics.Language_and_Environment,
|
|
39062
|
-
description: ts.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files
|
|
39082
|
+
description: ts.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files,
|
|
39083
|
+
defaultValueDescription: "false",
|
|
39063
39084
|
},
|
|
39064
39085
|
// Advanced
|
|
39065
39086
|
{
|
|
@@ -39102,7 +39123,6 @@ var ts;
|
|
|
39102
39123
|
category: ts.Diagnostics.Backwards_Compatibility,
|
|
39103
39124
|
paramType: ts.Diagnostics.FILE,
|
|
39104
39125
|
transpileOptionValue: undefined,
|
|
39105
|
-
defaultValueDescription: "n/a",
|
|
39106
39126
|
description: ts.Diagnostics.Deprecated_setting_Use_outFile_instead,
|
|
39107
39127
|
},
|
|
39108
39128
|
{
|
|
@@ -39183,6 +39203,7 @@ var ts;
|
|
|
39183
39203
|
affectsEmit: true,
|
|
39184
39204
|
category: ts.Diagnostics.Emit,
|
|
39185
39205
|
description: ts.Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,
|
|
39206
|
+
defaultValueDescription: "false",
|
|
39186
39207
|
},
|
|
39187
39208
|
{
|
|
39188
39209
|
name: "disableSizeLimit",
|
|
@@ -39197,21 +39218,24 @@ var ts;
|
|
|
39197
39218
|
type: "boolean",
|
|
39198
39219
|
isTSConfigOnly: true,
|
|
39199
39220
|
category: ts.Diagnostics.Projects,
|
|
39200
|
-
description: ts.Diagnostics.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects
|
|
39221
|
+
description: ts.Diagnostics.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects,
|
|
39222
|
+
defaultValueDescription: "false",
|
|
39201
39223
|
},
|
|
39202
39224
|
{
|
|
39203
39225
|
name: "disableSolutionSearching",
|
|
39204
39226
|
type: "boolean",
|
|
39205
39227
|
isTSConfigOnly: true,
|
|
39206
39228
|
category: ts.Diagnostics.Projects,
|
|
39207
|
-
description: ts.Diagnostics.Opt_a_project_out_of_multi_project_reference_checking_when_editing
|
|
39229
|
+
description: ts.Diagnostics.Opt_a_project_out_of_multi_project_reference_checking_when_editing,
|
|
39230
|
+
defaultValueDescription: "false",
|
|
39208
39231
|
},
|
|
39209
39232
|
{
|
|
39210
39233
|
name: "disableReferencedProjectLoad",
|
|
39211
39234
|
type: "boolean",
|
|
39212
39235
|
isTSConfigOnly: true,
|
|
39213
39236
|
category: ts.Diagnostics.Projects,
|
|
39214
|
-
description: ts.Diagnostics.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript
|
|
39237
|
+
description: ts.Diagnostics.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript,
|
|
39238
|
+
defaultValueDescription: "false",
|
|
39215
39239
|
},
|
|
39216
39240
|
{
|
|
39217
39241
|
name: "noImplicitUseStrict",
|
|
@@ -39244,7 +39268,7 @@ var ts;
|
|
|
39244
39268
|
affectsEmit: true,
|
|
39245
39269
|
category: ts.Diagnostics.Emit,
|
|
39246
39270
|
description: ts.Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code,
|
|
39247
|
-
defaultValueDescription: "
|
|
39271
|
+
defaultValueDescription: "false",
|
|
39248
39272
|
},
|
|
39249
39273
|
{
|
|
39250
39274
|
name: "declarationDir",
|
|
@@ -39255,7 +39279,6 @@ var ts;
|
|
|
39255
39279
|
category: ts.Diagnostics.Emit,
|
|
39256
39280
|
transpileOptionValue: undefined,
|
|
39257
39281
|
description: ts.Diagnostics.Specify_the_output_directory_for_generated_declaration_files,
|
|
39258
|
-
defaultValueDescription: "n/a"
|
|
39259
39282
|
},
|
|
39260
39283
|
{
|
|
39261
39284
|
name: "skipLibCheck",
|
|
@@ -39337,6 +39360,7 @@ var ts;
|
|
|
39337
39360
|
affectsEmit: true,
|
|
39338
39361
|
category: ts.Diagnostics.Emit,
|
|
39339
39362
|
description: ts.Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,
|
|
39363
|
+
defaultValueDescription: "false",
|
|
39340
39364
|
},
|
|
39341
39365
|
{
|
|
39342
39366
|
name: "keyofStringsOnly",
|
|
@@ -39384,27 +39408,31 @@ var ts;
|
|
|
39384
39408
|
shortName: "v",
|
|
39385
39409
|
category: ts.Diagnostics.Command_line_Options,
|
|
39386
39410
|
description: ts.Diagnostics.Enable_verbose_logging,
|
|
39387
|
-
type: "boolean"
|
|
39411
|
+
type: "boolean",
|
|
39412
|
+
defaultValueDescription: "false",
|
|
39388
39413
|
},
|
|
39389
39414
|
{
|
|
39390
39415
|
name: "dry",
|
|
39391
39416
|
shortName: "d",
|
|
39392
39417
|
category: ts.Diagnostics.Command_line_Options,
|
|
39393
39418
|
description: ts.Diagnostics.Show_what_would_be_built_or_deleted_if_specified_with_clean,
|
|
39394
|
-
type: "boolean"
|
|
39419
|
+
type: "boolean",
|
|
39420
|
+
defaultValueDescription: "false",
|
|
39395
39421
|
},
|
|
39396
39422
|
{
|
|
39397
39423
|
name: "force",
|
|
39398
39424
|
shortName: "f",
|
|
39399
39425
|
category: ts.Diagnostics.Command_line_Options,
|
|
39400
39426
|
description: ts.Diagnostics.Build_all_projects_including_those_that_appear_to_be_up_to_date,
|
|
39401
|
-
type: "boolean"
|
|
39427
|
+
type: "boolean",
|
|
39428
|
+
defaultValueDescription: "false",
|
|
39402
39429
|
},
|
|
39403
39430
|
{
|
|
39404
39431
|
name: "clean",
|
|
39405
39432
|
category: ts.Diagnostics.Command_line_Options,
|
|
39406
39433
|
description: ts.Diagnostics.Delete_the_outputs_of_all_projects,
|
|
39407
|
-
type: "boolean"
|
|
39434
|
+
type: "boolean",
|
|
39435
|
+
defaultValueDescription: "false",
|
|
39408
39436
|
}
|
|
39409
39437
|
];
|
|
39410
39438
|
/* @internal */
|
|
@@ -39417,10 +39445,12 @@ var ts;
|
|
|
39417
39445
|
*/
|
|
39418
39446
|
name: "enableAutoDiscovery",
|
|
39419
39447
|
type: "boolean",
|
|
39448
|
+
defaultValueDescription: "false",
|
|
39420
39449
|
},
|
|
39421
39450
|
{
|
|
39422
39451
|
name: "enable",
|
|
39423
39452
|
type: "boolean",
|
|
39453
|
+
defaultValueDescription: "false",
|
|
39424
39454
|
},
|
|
39425
39455
|
{
|
|
39426
39456
|
name: "include",
|
|
@@ -39441,6 +39471,7 @@ var ts;
|
|
|
39441
39471
|
{
|
|
39442
39472
|
name: "disableFilenameBasedTypeAcquisition",
|
|
39443
39473
|
type: "boolean",
|
|
39474
|
+
defaultValueDescription: "false",
|
|
39444
39475
|
},
|
|
39445
39476
|
];
|
|
39446
39477
|
/*@internal*/
|
|
@@ -45860,6 +45891,7 @@ var ts;
|
|
|
45860
45891
|
case 168 /* MethodDeclaration */:
|
|
45861
45892
|
case 171 /* GetAccessor */:
|
|
45862
45893
|
case 172 /* SetAccessor */:
|
|
45894
|
+
case 169 /* ClassStaticBlockDeclaration */:
|
|
45863
45895
|
// this.foo assignment in a JavaScript class
|
|
45864
45896
|
// Bind this property to the containing class
|
|
45865
45897
|
var containingClass = thisContainer.parent;
|
|
@@ -49920,8 +49952,8 @@ var ts;
|
|
|
49920
49952
|
if (exportEquals !== moduleSymbol) {
|
|
49921
49953
|
var type = getTypeOfSymbol(exportEquals);
|
|
49922
49954
|
if (shouldTreatPropertiesOfExternalModuleAsExports(type)) {
|
|
49923
|
-
|
|
49924
|
-
cb(symbol,
|
|
49955
|
+
forEachPropertyOfType(type, function (symbol, escapedName) {
|
|
49956
|
+
cb(symbol, escapedName);
|
|
49925
49957
|
});
|
|
49926
49958
|
}
|
|
49927
49959
|
}
|
|
@@ -50253,12 +50285,15 @@ var ts;
|
|
|
50253
50285
|
function getNamedMembers(members) {
|
|
50254
50286
|
var result;
|
|
50255
50287
|
members.forEach(function (symbol, id) {
|
|
50256
|
-
if (
|
|
50288
|
+
if (isNamedMember(symbol, id)) {
|
|
50257
50289
|
(result || (result = [])).push(symbol);
|
|
50258
50290
|
}
|
|
50259
50291
|
});
|
|
50260
50292
|
return result || ts.emptyArray;
|
|
50261
50293
|
}
|
|
50294
|
+
function isNamedMember(member, escapedName) {
|
|
50295
|
+
return !isReservedMemberName(escapedName) && symbolIsValue(member);
|
|
50296
|
+
}
|
|
50262
50297
|
function getNamedOrIndexSignatureMembers(members) {
|
|
50263
50298
|
var result = getNamedMembers(members);
|
|
50264
50299
|
var index = getIndexSymbolFromSymbolTable(members);
|
|
@@ -57091,6 +57126,16 @@ var ts;
|
|
|
57091
57126
|
getPropertiesOfUnionOrIntersectionType(type) :
|
|
57092
57127
|
getPropertiesOfObjectType(type);
|
|
57093
57128
|
}
|
|
57129
|
+
function forEachPropertyOfType(type, action) {
|
|
57130
|
+
type = getReducedApparentType(type);
|
|
57131
|
+
if (type.flags & 3670016 /* StructuredType */) {
|
|
57132
|
+
resolveStructuredTypeMembers(type).members.forEach(function (symbol, escapedName) {
|
|
57133
|
+
if (isNamedMember(symbol, escapedName)) {
|
|
57134
|
+
action(symbol, escapedName);
|
|
57135
|
+
}
|
|
57136
|
+
});
|
|
57137
|
+
}
|
|
57138
|
+
}
|
|
57094
57139
|
function isTypeInvalidDueToUnionDiscriminant(contextualType, obj) {
|
|
57095
57140
|
var list = obj.properties;
|
|
57096
57141
|
return list.some(function (property) {
|
|
@@ -60566,12 +60611,6 @@ var ts;
|
|
|
60566
60611
|
}
|
|
60567
60612
|
return type[cache] = type;
|
|
60568
60613
|
}
|
|
60569
|
-
function isConditionalTypeAlwaysTrueDisregardingInferTypes(type) {
|
|
60570
|
-
var extendsInferParamMapper = type.root.inferTypeParameters && createTypeMapper(type.root.inferTypeParameters, ts.map(type.root.inferTypeParameters, function () { return wildcardType; }));
|
|
60571
|
-
var checkType = type.checkType;
|
|
60572
|
-
var extendsType = type.extendsType;
|
|
60573
|
-
return isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(instantiateType(extendsType, extendsInferParamMapper)));
|
|
60574
|
-
}
|
|
60575
60614
|
function getSimplifiedConditionalType(type, writing) {
|
|
60576
60615
|
var checkType = type.checkType;
|
|
60577
60616
|
var extendsType = type.extendsType;
|
|
@@ -60880,6 +60919,10 @@ var ts;
|
|
|
60880
60919
|
}
|
|
60881
60920
|
return result;
|
|
60882
60921
|
}
|
|
60922
|
+
function isDistributionDependent(root) {
|
|
60923
|
+
return root.isDistributive && (isTypeParameterPossiblyReferenced(root.checkType, root.node.trueType) ||
|
|
60924
|
+
isTypeParameterPossiblyReferenced(root.checkType, root.node.falseType));
|
|
60925
|
+
}
|
|
60883
60926
|
function getTypeFromConditionalTypeNode(node) {
|
|
60884
60927
|
var links = getNodeLinks(node);
|
|
60885
60928
|
if (!links.resolvedType) {
|
|
@@ -64036,31 +64079,21 @@ var ts;
|
|
|
64036
64079
|
return 3 /* Maybe */;
|
|
64037
64080
|
}
|
|
64038
64081
|
var c = target;
|
|
64039
|
-
//
|
|
64040
|
-
|
|
64041
|
-
|
|
64042
|
-
|
|
64043
|
-
|
|
64044
|
-
|
|
64045
|
-
|
|
64046
|
-
|
|
64047
|
-
|
|
64048
|
-
|
|
64049
|
-
|
|
64050
|
-
|
|
64051
|
-
|
|
64052
|
-
|
|
64053
|
-
|
|
64054
|
-
var expanding = isDeeplyNestedType(target, targetStack, targetDepth);
|
|
64055
|
-
var localResult = expanding ? 3 /* Maybe */ : undefined;
|
|
64056
|
-
if (skipTrue || expanding || (localResult = isRelatedTo(source, distributionMapper ? instantiateType(getTypeFromTypeNode(c.root.node.trueType), distributionMapper) : getTrueTypeFromConditionalType(c), 2 /* Target */, /*reportErrors*/ false))) {
|
|
64057
|
-
if (!skipFalse && !expanding) {
|
|
64058
|
-
localResult = (localResult || 3 /* Maybe */) & isRelatedTo(source, distributionMapper ? instantiateType(getTypeFromTypeNode(c.root.node.falseType), distributionMapper) : getFalseTypeFromConditionalType(c), 2 /* Target */, /*reportErrors*/ false);
|
|
64059
|
-
}
|
|
64060
|
-
}
|
|
64061
|
-
if (localResult) {
|
|
64062
|
-
resetErrorInfo(saveErrorInfo);
|
|
64063
|
-
return localResult;
|
|
64082
|
+
// We check for a relationship to a conditional type target only when the conditional type has no
|
|
64083
|
+
// 'infer' positions and is not distributive or is distributive but doesn't reference the check type
|
|
64084
|
+
// parameter in either of the result types.
|
|
64085
|
+
if (!c.root.inferTypeParameters && !isDistributionDependent(c.root)) {
|
|
64086
|
+
// Check if the conditional is always true or always false but still deferred for distribution purposes.
|
|
64087
|
+
var skipTrue = !isTypeAssignableTo(getPermissiveInstantiation(c.checkType), getPermissiveInstantiation(c.extendsType));
|
|
64088
|
+
var skipFalse = !skipTrue && isTypeAssignableTo(getRestrictiveInstantiation(c.checkType), getRestrictiveInstantiation(c.extendsType));
|
|
64089
|
+
// TODO: Find a nice way to include potential conditional type breakdowns in error output, if they seem good (they usually don't)
|
|
64090
|
+
if (result = skipTrue ? -1 /* True */ : isRelatedTo(source, getTrueTypeFromConditionalType(c), 2 /* Target */, /*reportErrors*/ false)) {
|
|
64091
|
+
result &= skipFalse ? -1 /* True */ : isRelatedTo(source, getFalseTypeFromConditionalType(c), 2 /* Target */, /*reportErrors*/ false);
|
|
64092
|
+
if (result) {
|
|
64093
|
+
resetErrorInfo(saveErrorInfo);
|
|
64094
|
+
return result;
|
|
64095
|
+
}
|
|
64096
|
+
}
|
|
64064
64097
|
}
|
|
64065
64098
|
}
|
|
64066
64099
|
else if (target.flags & 134217728 /* TemplateLiteral */) {
|
|
@@ -67207,17 +67240,16 @@ var ts;
|
|
|
67207
67240
|
var inferredType = void 0;
|
|
67208
67241
|
var signature = context.signature;
|
|
67209
67242
|
if (signature) {
|
|
67210
|
-
var
|
|
67243
|
+
var inferredCovariantType_1 = inference.candidates ? getCovariantInference(inference, signature) : undefined;
|
|
67211
67244
|
if (inference.contraCandidates) {
|
|
67212
|
-
var inferredContravariantType = getContravariantInference(inference);
|
|
67213
67245
|
// If we have both co- and contra-variant inferences, we prefer the contra-variant inference
|
|
67214
|
-
// unless the co-variant inference is a subtype and not 'never'.
|
|
67215
|
-
inferredType =
|
|
67216
|
-
isTypeSubtypeOf(
|
|
67217
|
-
|
|
67246
|
+
// unless the co-variant inference is a subtype of some contra-variant inference and not 'never'.
|
|
67247
|
+
inferredType = inferredCovariantType_1 && !(inferredCovariantType_1.flags & 131072 /* Never */) &&
|
|
67248
|
+
ts.some(inference.contraCandidates, function (t) { return isTypeSubtypeOf(inferredCovariantType_1, t); }) ?
|
|
67249
|
+
inferredCovariantType_1 : getContravariantInference(inference);
|
|
67218
67250
|
}
|
|
67219
|
-
else if (
|
|
67220
|
-
inferredType =
|
|
67251
|
+
else if (inferredCovariantType_1) {
|
|
67252
|
+
inferredType = inferredCovariantType_1;
|
|
67221
67253
|
}
|
|
67222
67254
|
else if (context.flags & 1 /* NoDefault */) {
|
|
67223
67255
|
// We use silentNeverType as the wildcard that signals no inferences.
|
|
@@ -125167,9 +125199,9 @@ var ts;
|
|
|
125167
125199
|
return displayPart(text, ts.SymbolDisplayPartKind.linkText);
|
|
125168
125200
|
}
|
|
125169
125201
|
ts.linkTextPart = linkTextPart;
|
|
125170
|
-
function linkNamePart(
|
|
125202
|
+
function linkNamePart(text, target) {
|
|
125171
125203
|
return {
|
|
125172
|
-
text:
|
|
125204
|
+
text: text,
|
|
125173
125205
|
kind: ts.SymbolDisplayPartKind[ts.SymbolDisplayPartKind.linkName],
|
|
125174
125206
|
target: {
|
|
125175
125207
|
fileName: ts.getSourceFileOfNode(target).fileName,
|
|
@@ -125194,20 +125226,41 @@ var ts;
|
|
|
125194
125226
|
}
|
|
125195
125227
|
else {
|
|
125196
125228
|
var symbol = checker === null || checker === void 0 ? void 0 : checker.getSymbolAtLocation(link.name);
|
|
125229
|
+
var suffix = findLinkNameEnd(link.text);
|
|
125230
|
+
var name = ts.getTextOfNode(link.name) + link.text.slice(0, suffix);
|
|
125231
|
+
var text = link.text.slice(suffix);
|
|
125197
125232
|
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]);
|
|
125198
125233
|
if (decl) {
|
|
125199
|
-
parts.push(linkNamePart(
|
|
125200
|
-
if (
|
|
125201
|
-
parts.push(linkTextPart(
|
|
125234
|
+
parts.push(linkNamePart(name, decl));
|
|
125235
|
+
if (text)
|
|
125236
|
+
parts.push(linkTextPart(text));
|
|
125202
125237
|
}
|
|
125203
125238
|
else {
|
|
125204
|
-
parts.push(linkTextPart(
|
|
125239
|
+
parts.push(linkTextPart(name + (suffix ? "" : " ") + text));
|
|
125205
125240
|
}
|
|
125206
125241
|
}
|
|
125207
125242
|
parts.push(linkPart("}"));
|
|
125208
125243
|
return parts;
|
|
125209
125244
|
}
|
|
125210
125245
|
ts.buildLinkParts = buildLinkParts;
|
|
125246
|
+
function findLinkNameEnd(text) {
|
|
125247
|
+
if (text.indexOf("()") === 0)
|
|
125248
|
+
return 2;
|
|
125249
|
+
if (text[0] !== "<")
|
|
125250
|
+
return 0;
|
|
125251
|
+
var brackets = 0;
|
|
125252
|
+
var i = 0;
|
|
125253
|
+
while (i < text.length) {
|
|
125254
|
+
if (text[i] === "<")
|
|
125255
|
+
brackets++;
|
|
125256
|
+
if (text[i] === ">")
|
|
125257
|
+
brackets--;
|
|
125258
|
+
i++;
|
|
125259
|
+
if (!brackets)
|
|
125260
|
+
return i;
|
|
125261
|
+
}
|
|
125262
|
+
return 0;
|
|
125263
|
+
}
|
|
125211
125264
|
var carriageReturnLineFeed = "\r\n";
|
|
125212
125265
|
/**
|
|
125213
125266
|
* The default is CRLF.
|
|
@@ -126111,10 +126164,14 @@ var ts;
|
|
|
126111
126164
|
}
|
|
126112
126165
|
var isDefault = exportKind === 1 /* Default */;
|
|
126113
126166
|
var namedSymbol = isDefault && ts.getLocalSymbolForExportDefault(symbol) || symbol;
|
|
126114
|
-
// A
|
|
126115
|
-
//
|
|
126116
|
-
//
|
|
126117
|
-
|
|
126167
|
+
// 1. A named export must be imported by its key in `moduleSymbol.exports` or `moduleSymbol.members`.
|
|
126168
|
+
// 2. A re-export merged with an export from a module augmentation can result in `symbol`
|
|
126169
|
+
// being an external module symbol; the name it is re-exported by will be `symbolTableKey`
|
|
126170
|
+
// (which comes from the keys of `moduleSymbol.exports`.)
|
|
126171
|
+
// 3. Otherwise, we have a default/namespace import that can be imported by any name, and
|
|
126172
|
+
// `symbolTableKey` will be something undesirable like `export=` or `default`, so we try to
|
|
126173
|
+
// get a better name.
|
|
126174
|
+
var importedName = exportKind === 0 /* Named */ || ts.isExternalModuleSymbol(namedSymbol)
|
|
126118
126175
|
? ts.unescapeLeadingUnderscores(symbolTableKey)
|
|
126119
126176
|
: ts.getNameForExportedSymbol(namedSymbol, scriptTarget);
|
|
126120
126177
|
var moduleName = ts.stripQuotes(moduleSymbol.name);
|
|
@@ -126345,7 +126402,7 @@ var ts;
|
|
|
126345
126402
|
cache.add(importingFile.path, defaultInfo.symbol, defaultInfo.exportKind === 1 /* Default */ ? "default" /* Default */ : "export=" /* ExportEquals */, moduleSymbol, moduleFile, defaultInfo.exportKind, isFromPackageJson, scriptTarget, checker);
|
|
126346
126403
|
}
|
|
126347
126404
|
checker.forEachExportAndPropertyOfModule(moduleSymbol, function (exported, key) {
|
|
126348
|
-
if (exported !== (defaultInfo === null || defaultInfo === void 0 ? void 0 : defaultInfo.symbol) && isImportableSymbol(exported, checker) && ts.addToSeen(seenExports,
|
|
126405
|
+
if (exported !== (defaultInfo === null || defaultInfo === void 0 ? void 0 : defaultInfo.symbol) && isImportableSymbol(exported, checker) && ts.addToSeen(seenExports, key)) {
|
|
126349
126406
|
cache.add(importingFile.path, exported, key, moduleSymbol, moduleFile, 0 /* Named */, isFromPackageJson, scriptTarget, checker);
|
|
126350
126407
|
}
|
|
126351
126408
|
});
|
|
@@ -129200,8 +129257,8 @@ var ts;
|
|
|
129200
129257
|
}
|
|
129201
129258
|
var checker = origin.isFromPackageJson ? host.getPackageJsonAutoImportProvider().getTypeChecker() : program.getTypeChecker();
|
|
129202
129259
|
var moduleSymbol = origin.moduleSymbol;
|
|
129203
|
-
var
|
|
129204
|
-
var _b = ts.codefix.getImportCompletionAction(
|
|
129260
|
+
var targetSymbol = checker.getMergedSymbol(ts.skipAlias(symbol.exportSymbol || symbol, checker));
|
|
129261
|
+
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;
|
|
129205
129262
|
ts.Debug.assert(!(data === null || data === void 0 ? void 0 : data.moduleSpecifier) || moduleSpecifier === data.moduleSpecifier);
|
|
129206
129263
|
return { sourceDisplay: [ts.textPart(moduleSpecifier)], codeActions: [codeAction] };
|
|
129207
129264
|
}
|
|
@@ -130096,8 +130153,9 @@ var ts;
|
|
|
130096
130153
|
function isNewIdentifierDefinitionLocation() {
|
|
130097
130154
|
if (contextToken) {
|
|
130098
130155
|
var containingNodeKind = contextToken.parent.kind;
|
|
130156
|
+
var tokenKind = keywordForNode(contextToken);
|
|
130099
130157
|
// Previous token may have been a keyword that was converted to an identifier.
|
|
130100
|
-
switch (
|
|
130158
|
+
switch (tokenKind) {
|
|
130101
130159
|
case 27 /* CommaToken */:
|
|
130102
130160
|
return containingNodeKind === 207 /* CallExpression */ // func( a, |
|
|
130103
130161
|
|| containingNodeKind === 170 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */
|
|
@@ -130132,10 +130190,12 @@ var ts;
|
|
|
130132
130190
|
return containingNodeKind === 222 /* TemplateExpression */; // `aa ${|
|
|
130133
130191
|
case 16 /* TemplateMiddle */:
|
|
130134
130192
|
return containingNodeKind === 232 /* TemplateSpan */; // `aa ${10} dd ${|
|
|
130135
|
-
case
|
|
130136
|
-
|
|
130137
|
-
|
|
130138
|
-
|
|
130193
|
+
case 131 /* AsyncKeyword */:
|
|
130194
|
+
return containingNodeKind === 168 /* MethodDeclaration */ // const obj = { async c|()
|
|
130195
|
+
|| containingNodeKind === 295 /* ShorthandPropertyAssignment */; // const obj = { async c|
|
|
130196
|
+
}
|
|
130197
|
+
if (isClassMemberCompletionKeyword(tokenKind)) {
|
|
130198
|
+
return true;
|
|
130139
130199
|
}
|
|
130140
130200
|
}
|
|
130141
130201
|
return false;
|
|
@@ -148440,11 +148500,11 @@ var ts;
|
|
|
148440
148500
|
AddAsTypeOnly[AddAsTypeOnly["Required"] = 2] = "Required";
|
|
148441
148501
|
AddAsTypeOnly[AddAsTypeOnly["NotAllowed"] = 4] = "NotAllowed";
|
|
148442
148502
|
})(AddAsTypeOnly || (AddAsTypeOnly = {}));
|
|
148443
|
-
function getImportCompletionAction(
|
|
148503
|
+
function getImportCompletionAction(targetSymbol, moduleSymbol, sourceFile, symbolName, host, program, formatContext, position, preferences) {
|
|
148444
148504
|
var compilerOptions = program.getCompilerOptions();
|
|
148445
148505
|
var exportInfos = ts.pathIsBareSpecifier(ts.stripQuotes(moduleSymbol.name))
|
|
148446
|
-
? [getSymbolExportInfoForSymbol(
|
|
148447
|
-
: getAllReExportingModules(sourceFile,
|
|
148506
|
+
? [getSymbolExportInfoForSymbol(targetSymbol, moduleSymbol, program, host)]
|
|
148507
|
+
: getAllReExportingModules(sourceFile, targetSymbol, moduleSymbol, symbolName, host, program, preferences, /*useAutoImportProvider*/ true);
|
|
148448
148508
|
var useRequire = shouldUseRequire(sourceFile, program);
|
|
148449
148509
|
var isValidTypeOnlyUseSite = ts.isValidTypeOnlyAliasUseSite(ts.getTokenAtPosition(sourceFile, position));
|
|
148450
148510
|
var fix = ts.Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, symbolName, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences));
|
|
@@ -148482,7 +148542,7 @@ var ts;
|
|
|
148482
148542
|
}
|
|
148483
148543
|
}
|
|
148484
148544
|
}
|
|
148485
|
-
function getAllReExportingModules(importingFile,
|
|
148545
|
+
function getAllReExportingModules(importingFile, targetSymbol, exportingModuleSymbol, symbolName, host, program, preferences, useAutoImportProvider) {
|
|
148486
148546
|
var result = [];
|
|
148487
148547
|
var compilerOptions = program.getCompilerOptions();
|
|
148488
148548
|
var getModuleSpecifierResolutionHost = ts.memoizeOne(function (isFromPackageJson) {
|
|
@@ -148495,12 +148555,12 @@ var ts;
|
|
|
148495
148555
|
return;
|
|
148496
148556
|
}
|
|
148497
148557
|
var defaultInfo = ts.getDefaultLikeExportInfo(moduleSymbol, checker, compilerOptions);
|
|
148498
|
-
if (defaultInfo && (defaultInfo.name === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, ts.getEmitScriptTarget(compilerOptions)) === symbolName) && ts.skipAlias(defaultInfo.symbol, checker) ===
|
|
148558
|
+
if (defaultInfo && (defaultInfo.name === symbolName || moduleSymbolToValidIdentifier(moduleSymbol, ts.getEmitScriptTarget(compilerOptions)) === symbolName) && ts.skipAlias(defaultInfo.symbol, checker) === targetSymbol && isImportable(program, moduleFile, isFromPackageJson)) {
|
|
148499
148559
|
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 });
|
|
148500
148560
|
}
|
|
148501
148561
|
for (var _i = 0, _a = checker.getExportsAndPropertiesOfModule(moduleSymbol); _i < _a.length; _i++) {
|
|
148502
148562
|
var exported = _a[_i];
|
|
148503
|
-
if (exported.name === symbolName && ts.skipAlias(exported, checker) ===
|
|
148563
|
+
if (exported.name === symbolName && checker.getMergedSymbol(ts.skipAlias(exported, checker)) === targetSymbol && isImportable(program, moduleFile, isFromPackageJson)) {
|
|
148504
148564
|
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 });
|
|
148505
148565
|
}
|
|
148506
148566
|
}
|
|
@@ -148751,12 +148811,14 @@ var ts;
|
|
|
148751
148811
|
}
|
|
148752
148812
|
var allowsImportingSpecifier = ts.createPackageJsonImportFilter(sourceFile, preferences, host).allowsImportingSpecifier;
|
|
148753
148813
|
return fixes.reduce(function (best, fix) {
|
|
148814
|
+
// Takes true branch of conditional if `fix` is better than `best`
|
|
148754
148815
|
return compareModuleSpecifiers(fix, best, sourceFile, program, allowsImportingSpecifier) === -1 /* LessThan */ ? fix : best;
|
|
148755
148816
|
});
|
|
148756
148817
|
}
|
|
148818
|
+
/** @returns `Comparison.LessThan` if `a` is better than `b`. */
|
|
148757
148819
|
function compareModuleSpecifiers(a, b, importingFile, program, allowsImportingSpecifier) {
|
|
148758
148820
|
if (a.kind !== 0 /* UseNamespace */ && b.kind !== 0 /* UseNamespace */) {
|
|
148759
|
-
return ts.compareBooleans(allowsImportingSpecifier(
|
|
148821
|
+
return ts.compareBooleans(allowsImportingSpecifier(b.moduleSpecifier), allowsImportingSpecifier(a.moduleSpecifier))
|
|
148760
148822
|
|| compareNodeCoreModuleSpecifiers(a.moduleSpecifier, b.moduleSpecifier, importingFile, program)
|
|
148761
148823
|
|| ts.compareNumberOfDirectorySeparators(a.moduleSpecifier, b.moduleSpecifier);
|
|
148762
148824
|
}
|
|
@@ -151408,7 +151470,8 @@ var ts;
|
|
|
151408
151470
|
insertBefore = ts.findChildOfKind(containingFunction, 98 /* FunctionKeyword */, sourceFile);
|
|
151409
151471
|
break;
|
|
151410
151472
|
case 213 /* ArrowFunction */:
|
|
151411
|
-
|
|
151473
|
+
var kind = containingFunction.typeParameters ? 29 /* LessThanToken */ : 20 /* OpenParenToken */;
|
|
151474
|
+
insertBefore = ts.findChildOfKind(containingFunction, kind, sourceFile) || ts.first(containingFunction.parameters);
|
|
151412
151475
|
break;
|
|
151413
151476
|
default:
|
|
151414
151477
|
return;
|