typescript 4.7.0-dev.20220427 → 4.7.0-dev.20220430

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/protocol.d.ts CHANGED
@@ -1825,6 +1825,7 @@ declare namespace ts.server.protocol {
1825
1825
  body?: CompletionInfo;
1826
1826
  }
1827
1827
  interface CompletionInfo {
1828
+ readonly flags?: number;
1828
1829
  readonly isGlobalCompletion: boolean;
1829
1830
  readonly isMemberCompletion: boolean;
1830
1831
  readonly isNewIdentifierLocation: boolean;
package/lib/tsc.js CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.7";
72
- ts.version = ts.versionMajorMinor + ".0-dev.20220427";
72
+ ts.version = ts.versionMajorMinor + ".0-dev.20220430";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -5456,7 +5456,7 @@ var ts;
5456
5456
  Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node12_or_nodenext: diag(1323, ts.DiagnosticCategory.Error, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node12', or 'nodenext'."),
5457
5457
  Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_or_nodenext: diag(1324, ts.DiagnosticCategory.Error, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_or_nodenext_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext' or 'nodenext'."),
5458
5458
  Argument_of_dynamic_import_cannot_be_spread_element: diag(1325, ts.DiagnosticCategory.Error, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."),
5459
- Dynamic_import_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "Dynamic_import_cannot_have_type_arguments_1326", "Dynamic import cannot have type arguments."),
5459
+ This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326", "This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."),
5460
5460
  String_literal_with_double_quotes_expected: diag(1327, ts.DiagnosticCategory.Error, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."),
5461
5461
  Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal: diag(1328, ts.DiagnosticCategory.Error, "Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_li_1328", "Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal."),
5462
5462
  _0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0: diag(1329, ts.DiagnosticCategory.Error, "_0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write__1329", "'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?"),
@@ -5843,7 +5843,6 @@ var ts;
5843
5843
  A_rest_element_cannot_have_a_property_name: diag(2566, ts.DiagnosticCategory.Error, "A_rest_element_cannot_have_a_property_name_2566", "A rest element cannot have a property name."),
5844
5844
  Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations: diag(2567, ts.DiagnosticCategory.Error, "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567", "Enum declarations can only merge with namespace or other enum declarations."),
5845
5845
  Property_0_may_not_exist_on_type_1_Did_you_mean_2: diag(2568, ts.DiagnosticCategory.Error, "Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568", "Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?"),
5846
- Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators: diag(2569, ts.DiagnosticCategory.Error, "Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterati_2569", "Type '{0}' is not an array type or a string type. Use compiler option '--downlevelIteration' to allow iterating of iterators."),
5847
5846
  Could_not_find_name_0_Did_you_mean_1: diag(2570, ts.DiagnosticCategory.Error, "Could_not_find_name_0_Did_you_mean_1_2570", "Could not find name '{0}'. Did you mean '{1}'?"),
5848
5847
  Object_is_of_type_unknown: diag(2571, ts.DiagnosticCategory.Error, "Object_is_of_type_unknown_2571", "Object is of type 'unknown'."),
5849
5848
  A_rest_element_type_must_be_an_array_type: diag(2574, ts.DiagnosticCategory.Error, "A_rest_element_type_must_be_an_array_type_2574", "A rest element type must be an array type."),
@@ -6057,6 +6056,7 @@ var ts;
6057
6056
  This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0: diag(2807, ts.DiagnosticCategory.Error, "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807", "This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."),
6058
6057
  A_get_accessor_must_be_at_least_as_accessible_as_the_setter: diag(2808, ts.DiagnosticCategory.Error, "A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808", "A get accessor must be at least as accessible as the setter"),
6059
6058
  Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses: diag(2809, ts.DiagnosticCategory.Error, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses."),
6059
+ Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments: diag(2810, ts.DiagnosticCategory.Error, "Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_2810", "Expected 1 argument, but got 0. 'new Promise()' needs a JSDoc hint to produce a 'resolve' that can be called without arguments."),
6060
6060
  Initializer_for_property_0: diag(2811, ts.DiagnosticCategory.Error, "Initializer_for_property_0_2811", "Initializer for property '{0}'"),
6061
6061
  Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: diag(2812, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."),
6062
6062
  Class_declaration_cannot_implement_overload_list_for_0: diag(2813, ts.DiagnosticCategory.Error, "Class_declaration_cannot_implement_overload_list_for_0_2813", "Class declaration cannot implement overload list for '{0}'."),
@@ -30687,7 +30687,8 @@ var ts;
30687
30687
  if (!comment) {
30688
30688
  comment = parseTrailingTagComments(start, getNodePos(), indent, indentText);
30689
30689
  }
30690
- return finishNode(factory.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start);
30690
+ var end = comment !== undefined ? getNodePos() : typeExpression.end;
30691
+ return finishNode(factory.createJSDocCallbackTag(tagName, typeExpression, fullName, comment), start, end);
30691
30692
  }
30692
30693
  function escapedTextsEqual(a, b) {
30693
30694
  while (!ts.isIdentifier(a) || !ts.isIdentifier(b)) {
@@ -63146,8 +63147,14 @@ var ts;
63146
63147
  var parameterRange = hasRestParameter ? min
63147
63148
  : min < max ? min + "-" + max
63148
63149
  : min;
63149
- var error = hasRestParameter ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1
63150
- : parameterRange === 1 && args.length === 0 && isPromiseResolveArityError(node) ? ts.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise
63150
+ var isVoidPromiseError = !hasRestParameter && parameterRange === 1 && args.length === 0 && isPromiseResolveArityError(node);
63151
+ if (isVoidPromiseError && ts.isInJSFile(node)) {
63152
+ return getDiagnosticForCallNode(node, ts.Diagnostics.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments);
63153
+ }
63154
+ var error = hasRestParameter
63155
+ ? ts.Diagnostics.Expected_at_least_0_arguments_but_got_1
63156
+ : isVoidPromiseError
63157
+ ? ts.Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise
63151
63158
  : ts.Diagnostics.Expected_0_arguments_but_got_1;
63152
63159
  if (min < args.length && args.length < max) {
63153
63160
  return getDiagnosticForCallNode(node, ts.Diagnostics.No_overload_expects_0_arguments_but_overloads_do_exist_that_expect_either_1_or_2_arguments, args.length, maxBelow, minAbove);
@@ -69228,7 +69235,7 @@ var ts;
69228
69235
  }
69229
69236
  var yieldType = getIterationTypeOfIterable(use, 0, inputType, undefined);
69230
69237
  if (yieldType) {
69231
- return [ts.Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators, false];
69238
+ return [ts.Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, false];
69232
69239
  }
69233
69240
  if (isES2015OrLaterIterable((_a = inputType.symbol) === null || _a === void 0 ? void 0 : _a.escapedName)) {
69234
69241
  return [ts.Diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, true];
@@ -72058,7 +72065,7 @@ var ts;
72058
72065
  var symbol = getIntrinsicTagSymbol(name.parent);
72059
72066
  return symbol === unknownSymbol ? undefined : symbol;
72060
72067
  }
72061
- var result = resolveEntityName(name, meaning, false, !isJSDoc_1, ts.getHostSignatureFromJSDoc(name));
72068
+ var result = resolveEntityName(name, meaning, false, true, ts.getHostSignatureFromJSDoc(name));
72062
72069
  if (!result && isJSDoc_1) {
72063
72070
  var container = ts.findAncestor(name, ts.or(ts.isClassLike, ts.isInterfaceDeclaration));
72064
72071
  if (container) {
@@ -73740,6 +73747,9 @@ var ts;
73740
73747
  return ts.some(types, checkGrammarExpressionWithTypeArguments);
73741
73748
  }
73742
73749
  function checkGrammarExpressionWithTypeArguments(node) {
73750
+ if (ts.isExpressionWithTypeArguments(node) && ts.isImportKeyword(node.expression) && node.typeArguments) {
73751
+ return grammarErrorOnNode(node, ts.Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
73752
+ }
73743
73753
  return checkGrammarTypeArguments(node, node.typeArguments);
73744
73754
  }
73745
73755
  function checkGrammarClassDeclarationHeritageClauses(node) {
@@ -74600,7 +74610,7 @@ var ts;
74600
74610
  return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node12_or_nodenext);
74601
74611
  }
74602
74612
  if (node.typeArguments) {
74603
- return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_import_cannot_have_type_arguments);
74613
+ return grammarErrorOnNode(node, ts.Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
74604
74614
  }
74605
74615
  var nodeArguments = node.arguments;
74606
74616
  if (moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.NodeNext) {
@@ -88954,6 +88964,8 @@ var ts;
88954
88964
  var varDecl = factory.createVariableDeclaration(newId, undefined, resolver.createTypeOfExpression(input.expression, input, declarationEmitNodeBuilderFlags, symbolTracker), undefined);
88955
88965
  errorFallbackNode = undefined;
88956
88966
  var statement = factory.createVariableStatement(needsDeclare ? [factory.createModifier(135)] : [], factory.createVariableDeclarationList([varDecl], 2));
88967
+ preserveJsDoc(statement, input);
88968
+ ts.removeAllComments(input);
88957
88969
  return [statement, factory.updateExportAssignment(input, input.decorators, input.modifiers, newId)];
88958
88970
  }
88959
88971
  }
@@ -103523,7 +103535,7 @@ var ts;
103523
103535
  if (!state.watch || !state.lastCachedPackageJsonLookups)
103524
103536
  return;
103525
103537
  ts.mutateMap(getOrCreateValueMapFromConfigFileMap(state.allWatchedPackageJsonFiles, resolvedPath), new ts.Map(state.lastCachedPackageJsonLookups.get(resolvedPath)), {
103526
- createNewValue: function (path, _input) { return state.watchFile(path, function () { return invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.Full); }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.PackageJson, resolved); },
103538
+ createNewValue: function (path, _input) { return state.watchFile(path, function () { return invalidateProjectAndScheduleBuilds(state, resolvedPath, ts.ConfigFileProgramReloadLevel.None); }, ts.PollingInterval.High, parsed === null || parsed === void 0 ? void 0 : parsed.watchOptions, ts.WatchType.PackageJson, resolved); },
103527
103539
  onDeleteValue: ts.closeFileWatcher,
103528
103540
  });
103529
103541
  }