typescript 4.6.0-dev.20211125 → 4.6.0-dev.20211202

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/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.20211125";
103
+ ts.version = ts.versionMajorMinor + ".0-dev.20211202";
104
104
  /* @internal */
105
105
  var Comparison;
106
106
  (function (Comparison) {
@@ -33608,9 +33608,10 @@ var ts;
33608
33608
  // - "(x,y)" is a comma expression parsed as a signature with two parameters.
33609
33609
  // - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation.
33610
33610
  // - "a ? (b): function() {}" will too, since function() is a valid JSDoc function type.
33611
+ // - "a ? (b): (function() {})" as well, but inside of a parenthesized type.
33611
33612
  //
33612
33613
  // So we need just a bit of lookahead to ensure that it can only be a signature.
33613
- var hasJSDocFunctionType = type && ts.isJSDocFunctionType(type);
33614
+ var hasJSDocFunctionType = type && (ts.isJSDocFunctionType(type) || ts.isParenthesizedTypeNode(type) && ts.isJSDocFunctionType(type.type));
33614
33615
  if (!allowAmbiguity && token() !== 38 /* EqualsGreaterThanToken */ && (hasJSDocFunctionType || token() !== 18 /* OpenBraceToken */)) {
33615
33616
  // Returning undefined here will cause our caller to rewind to where we started from.
33616
33617
  return undefined;
@@ -38009,7 +38010,11 @@ var ts;
38009
38010
  var ts;
38010
38011
  (function (ts) {
38011
38012
  /* @internal */
38012
- ts.compileOnSaveCommandLineOption = { name: "compileOnSave", type: "boolean", defaultValueDescription: "false" };
38013
+ ts.compileOnSaveCommandLineOption = {
38014
+ name: "compileOnSave",
38015
+ type: "boolean",
38016
+ defaultValueDescription: false,
38017
+ };
38013
38018
  var jsxOptionMap = new ts.Map(ts.getEntries({
38014
38019
  "preserve": 1 /* Preserve */,
38015
38020
  "react-native": 3 /* ReactNative */,
@@ -38123,6 +38128,7 @@ var ts;
38123
38128
  })),
38124
38129
  category: ts.Diagnostics.Watch_and_Build_Modes,
38125
38130
  description: ts.Diagnostics.Specify_how_the_TypeScript_watch_mode_works,
38131
+ defaultValueDescription: ts.WatchFileKind.UseFsEvents,
38126
38132
  },
38127
38133
  {
38128
38134
  name: "watchDirectory",
@@ -38134,6 +38140,7 @@ var ts;
38134
38140
  })),
38135
38141
  category: ts.Diagnostics.Watch_and_Build_Modes,
38136
38142
  description: ts.Diagnostics.Specify_how_directories_are_watched_on_systems_that_lack_recursive_file_watching_functionality,
38143
+ defaultValueDescription: ts.WatchDirectoryKind.UseFsEvents,
38137
38144
  },
38138
38145
  {
38139
38146
  name: "fallbackPolling",
@@ -38145,13 +38152,14 @@ var ts;
38145
38152
  })),
38146
38153
  category: ts.Diagnostics.Watch_and_Build_Modes,
38147
38154
  description: ts.Diagnostics.Specify_what_approach_the_watcher_should_use_if_the_system_runs_out_of_native_file_watchers,
38155
+ defaultValueDescription: ts.PollingWatchKind.PriorityInterval,
38148
38156
  },
38149
38157
  {
38150
38158
  name: "synchronousWatchDirectory",
38151
38159
  type: "boolean",
38152
38160
  category: ts.Diagnostics.Watch_and_Build_Modes,
38153
38161
  description: ts.Diagnostics.Synchronously_call_callbacks_and_update_the_state_of_directory_watchers_on_platforms_that_don_t_support_recursive_watching_natively,
38154
- defaultValueDescription: "false",
38162
+ defaultValueDescription: false,
38155
38163
  },
38156
38164
  {
38157
38165
  name: "excludeDirectories",
@@ -38187,13 +38195,13 @@ var ts;
38187
38195
  showInSimplifiedHelpView: true,
38188
38196
  category: ts.Diagnostics.Command_line_Options,
38189
38197
  description: ts.Diagnostics.Print_this_message,
38190
- defaultValueDescription: "false",
38198
+ defaultValueDescription: false,
38191
38199
  },
38192
38200
  {
38193
38201
  name: "help",
38194
38202
  shortName: "?",
38195
38203
  type: "boolean",
38196
- defaultValueDescription: "false",
38204
+ defaultValueDescription: false,
38197
38205
  },
38198
38206
  {
38199
38207
  name: "watch",
@@ -38203,7 +38211,7 @@ var ts;
38203
38211
  isCommandLineOnly: true,
38204
38212
  category: ts.Diagnostics.Command_line_Options,
38205
38213
  description: ts.Diagnostics.Watch_input_files,
38206
- defaultValueDescription: "false",
38214
+ defaultValueDescription: false,
38207
38215
  },
38208
38216
  {
38209
38217
  name: "preserveWatchOutput",
@@ -38211,28 +38219,28 @@ var ts;
38211
38219
  showInSimplifiedHelpView: false,
38212
38220
  category: ts.Diagnostics.Output_Formatting,
38213
38221
  description: ts.Diagnostics.Disable_wiping_the_console_in_watch_mode,
38214
- defaultValueDescription: "false",
38222
+ defaultValueDescription: false,
38215
38223
  },
38216
38224
  {
38217
38225
  name: "listFiles",
38218
38226
  type: "boolean",
38219
38227
  category: ts.Diagnostics.Compiler_Diagnostics,
38220
38228
  description: ts.Diagnostics.Print_all_of_the_files_read_during_the_compilation,
38221
- defaultValueDescription: "false"
38229
+ defaultValueDescription: false,
38222
38230
  },
38223
38231
  {
38224
38232
  name: "explainFiles",
38225
38233
  type: "boolean",
38226
38234
  category: ts.Diagnostics.Compiler_Diagnostics,
38227
38235
  description: ts.Diagnostics.Print_files_read_during_the_compilation_including_why_it_was_included,
38228
- defaultValueDescription: "false",
38236
+ defaultValueDescription: false,
38229
38237
  },
38230
38238
  {
38231
38239
  name: "listEmittedFiles",
38232
38240
  type: "boolean",
38233
38241
  category: ts.Diagnostics.Compiler_Diagnostics,
38234
38242
  description: ts.Diagnostics.Print_the_names_of_emitted_files_after_a_compilation,
38235
- defaultValueDescription: "false"
38243
+ defaultValueDescription: false,
38236
38244
  },
38237
38245
  {
38238
38246
  name: "pretty",
@@ -38240,28 +38248,28 @@ var ts;
38240
38248
  showInSimplifiedHelpView: true,
38241
38249
  category: ts.Diagnostics.Output_Formatting,
38242
38250
  description: ts.Diagnostics.Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read,
38243
- defaultValueDescription: "true"
38251
+ defaultValueDescription: true,
38244
38252
  },
38245
38253
  {
38246
38254
  name: "traceResolution",
38247
38255
  type: "boolean",
38248
38256
  category: ts.Diagnostics.Compiler_Diagnostics,
38249
38257
  description: ts.Diagnostics.Log_paths_used_during_the_moduleResolution_process,
38250
- defaultValueDescription: "false"
38258
+ defaultValueDescription: false,
38251
38259
  },
38252
38260
  {
38253
38261
  name: "diagnostics",
38254
38262
  type: "boolean",
38255
38263
  category: ts.Diagnostics.Compiler_Diagnostics,
38256
38264
  description: ts.Diagnostics.Output_compiler_performance_information_after_building,
38257
- defaultValueDescription: "false"
38265
+ defaultValueDescription: false,
38258
38266
  },
38259
38267
  {
38260
38268
  name: "extendedDiagnostics",
38261
38269
  type: "boolean",
38262
38270
  category: ts.Diagnostics.Compiler_Diagnostics,
38263
38271
  description: ts.Diagnostics.Output_more_detailed_compiler_performance_information_after_building,
38264
- defaultValueDescription: "false"
38272
+ defaultValueDescription: false,
38265
38273
  },
38266
38274
  {
38267
38275
  name: "generateCpuProfile",
@@ -38297,7 +38305,7 @@ var ts;
38297
38305
  affectsEmit: true,
38298
38306
  category: ts.Diagnostics.Watch_and_Build_Modes,
38299
38307
  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,
38300
- defaultValueDescription: "false",
38308
+ defaultValueDescription: false,
38301
38309
  },
38302
38310
  {
38303
38311
  name: "locale",
@@ -38333,7 +38341,7 @@ var ts;
38333
38341
  showInSimplifiedHelpView: true,
38334
38342
  category: ts.Diagnostics.Language_and_Environment,
38335
38343
  description: ts.Diagnostics.Set_the_JavaScript_language_version_for_emitted_JavaScript_and_include_compatible_library_declarations,
38336
- defaultValueDescription: "ES3"
38344
+ defaultValueDescription: 0 /* ES3 */,
38337
38345
  };
38338
38346
  var commandOptionsWithoutBuild = [
38339
38347
  // CommandLine only options
@@ -38343,7 +38351,7 @@ var ts;
38343
38351
  showInSimplifiedHelpView: true,
38344
38352
  category: ts.Diagnostics.Command_line_Options,
38345
38353
  description: ts.Diagnostics.Show_all_compiler_options,
38346
- defaultValueDescription: "false",
38354
+ defaultValueDescription: false,
38347
38355
  },
38348
38356
  {
38349
38357
  name: "version",
@@ -38352,7 +38360,7 @@ var ts;
38352
38360
  showInSimplifiedHelpView: true,
38353
38361
  category: ts.Diagnostics.Command_line_Options,
38354
38362
  description: ts.Diagnostics.Print_the_compiler_s_version,
38355
- defaultValueDescription: "false",
38363
+ defaultValueDescription: false,
38356
38364
  },
38357
38365
  {
38358
38366
  name: "init",
@@ -38360,7 +38368,7 @@ var ts;
38360
38368
  showInSimplifiedHelpView: true,
38361
38369
  category: ts.Diagnostics.Command_line_Options,
38362
38370
  description: ts.Diagnostics.Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file,
38363
- defaultValueDescription: "false",
38371
+ defaultValueDescription: false,
38364
38372
  },
38365
38373
  {
38366
38374
  name: "project",
@@ -38379,7 +38387,7 @@ var ts;
38379
38387
  showInSimplifiedHelpView: true,
38380
38388
  category: ts.Diagnostics.Command_line_Options,
38381
38389
  description: ts.Diagnostics.Build_one_or_more_projects_and_their_dependencies_if_out_of_date,
38382
- defaultValueDescription: "false",
38390
+ defaultValueDescription: false,
38383
38391
  },
38384
38392
  {
38385
38393
  name: "showConfig",
@@ -38388,7 +38396,7 @@ var ts;
38388
38396
  category: ts.Diagnostics.Command_line_Options,
38389
38397
  isCommandLineOnly: true,
38390
38398
  description: ts.Diagnostics.Print_the_final_configuration_instead_of_building,
38391
- defaultValueDescription: "false",
38399
+ defaultValueDescription: false,
38392
38400
  },
38393
38401
  {
38394
38402
  name: "listFilesOnly",
@@ -38398,7 +38406,7 @@ var ts;
38398
38406
  affectsEmit: true,
38399
38407
  isCommandLineOnly: true,
38400
38408
  description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
38401
- defaultValueDescription: "false",
38409
+ defaultValueDescription: false,
38402
38410
  },
38403
38411
  // Basic
38404
38412
  ts.targetOptionDeclaration,
@@ -38425,13 +38433,15 @@ var ts;
38425
38433
  showInSimplifiedHelpView: true,
38426
38434
  category: ts.Diagnostics.Modules,
38427
38435
  description: ts.Diagnostics.Specify_what_module_code_is_generated,
38436
+ defaultValueDescription: undefined,
38428
38437
  },
38429
38438
  {
38430
38439
  name: "lib",
38431
38440
  type: "list",
38432
38441
  element: {
38433
38442
  name: "lib",
38434
- type: ts.libMap
38443
+ type: ts.libMap,
38444
+ defaultValueDescription: undefined,
38435
38445
  },
38436
38446
  affectsProgramStructure: true,
38437
38447
  showInSimplifiedHelpView: true,
@@ -38446,7 +38456,7 @@ var ts;
38446
38456
  showInSimplifiedHelpView: true,
38447
38457
  category: ts.Diagnostics.JavaScript_Support,
38448
38458
  description: ts.Diagnostics.Allow_JavaScript_files_to_be_a_part_of_your_program_Use_the_checkJS_option_to_get_errors_from_these_files,
38449
- defaultValueDescription: "false"
38459
+ defaultValueDescription: false,
38450
38460
  },
38451
38461
  {
38452
38462
  name: "checkJs",
@@ -38454,7 +38464,7 @@ var ts;
38454
38464
  showInSimplifiedHelpView: true,
38455
38465
  category: ts.Diagnostics.JavaScript_Support,
38456
38466
  description: ts.Diagnostics.Enable_error_reporting_in_type_checked_JavaScript_files,
38457
- defaultValueDescription: "false"
38467
+ defaultValueDescription: false,
38458
38468
  },
38459
38469
  {
38460
38470
  name: "jsx",
@@ -38466,7 +38476,7 @@ var ts;
38466
38476
  showInSimplifiedHelpView: true,
38467
38477
  category: ts.Diagnostics.Language_and_Environment,
38468
38478
  description: ts.Diagnostics.Specify_what_JSX_code_is_generated,
38469
- defaultValueDescription: "undefined"
38479
+ defaultValueDescription: undefined,
38470
38480
  },
38471
38481
  {
38472
38482
  name: "declaration",
@@ -38486,7 +38496,7 @@ var ts;
38486
38496
  showInSimplifiedHelpView: true,
38487
38497
  category: ts.Diagnostics.Emit,
38488
38498
  transpileOptionValue: undefined,
38489
- defaultValueDescription: "false",
38499
+ defaultValueDescription: false,
38490
38500
  description: ts.Diagnostics.Create_sourcemaps_for_d_ts_files
38491
38501
  },
38492
38502
  {
@@ -38497,7 +38507,7 @@ var ts;
38497
38507
  category: ts.Diagnostics.Emit,
38498
38508
  description: ts.Diagnostics.Only_output_d_ts_files_and_not_JavaScript_files,
38499
38509
  transpileOptionValue: undefined,
38500
- defaultValueDescription: "false",
38510
+ defaultValueDescription: false,
38501
38511
  },
38502
38512
  {
38503
38513
  name: "sourceMap",
@@ -38505,7 +38515,7 @@ var ts;
38505
38515
  affectsEmit: true,
38506
38516
  showInSimplifiedHelpView: true,
38507
38517
  category: ts.Diagnostics.Emit,
38508
- defaultValueDescription: "false",
38518
+ defaultValueDescription: false,
38509
38519
  description: ts.Diagnostics.Create_source_map_files_for_emitted_JavaScript_files,
38510
38520
  },
38511
38521
  {
@@ -38546,7 +38556,7 @@ var ts;
38546
38556
  isTSConfigOnly: true,
38547
38557
  category: ts.Diagnostics.Projects,
38548
38558
  transpileOptionValue: undefined,
38549
- defaultValueDescription: "false",
38559
+ defaultValueDescription: false,
38550
38560
  description: ts.Diagnostics.Enable_constraints_that_allow_a_TypeScript_project_to_be_used_with_project_references,
38551
38561
  },
38552
38562
  {
@@ -38566,7 +38576,7 @@ var ts;
38566
38576
  affectsEmit: true,
38567
38577
  showInSimplifiedHelpView: true,
38568
38578
  category: ts.Diagnostics.Emit,
38569
- defaultValueDescription: "false",
38579
+ defaultValueDescription: false,
38570
38580
  description: ts.Diagnostics.Disable_emitting_comments,
38571
38581
  },
38572
38582
  {
@@ -38576,7 +38586,7 @@ var ts;
38576
38586
  category: ts.Diagnostics.Emit,
38577
38587
  description: ts.Diagnostics.Disable_emitting_files_from_a_compilation,
38578
38588
  transpileOptionValue: undefined,
38579
- defaultValueDescription: "false"
38589
+ defaultValueDescription: false,
38580
38590
  },
38581
38591
  {
38582
38592
  name: "importHelpers",
@@ -38584,7 +38594,7 @@ var ts;
38584
38594
  affectsEmit: true,
38585
38595
  category: ts.Diagnostics.Emit,
38586
38596
  description: ts.Diagnostics.Allow_importing_helper_functions_from_tslib_once_per_project_instead_of_including_them_per_file,
38587
- defaultValueDescription: "false"
38597
+ defaultValueDescription: false,
38588
38598
  },
38589
38599
  {
38590
38600
  name: "importsNotUsedAsValues",
@@ -38596,7 +38606,8 @@ var ts;
38596
38606
  affectsEmit: true,
38597
38607
  affectsSemanticDiagnostics: true,
38598
38608
  category: ts.Diagnostics.Emit,
38599
- description: ts.Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types
38609
+ description: ts.Diagnostics.Specify_emit_Slashchecking_behavior_for_imports_that_are_only_used_for_types,
38610
+ defaultValueDescription: 0 /* Remove */,
38600
38611
  },
38601
38612
  {
38602
38613
  name: "downlevelIteration",
@@ -38604,7 +38615,7 @@ var ts;
38604
38615
  affectsEmit: true,
38605
38616
  category: ts.Diagnostics.Emit,
38606
38617
  description: ts.Diagnostics.Emit_more_compliant_but_verbose_and_less_performant_JavaScript_for_iteration,
38607
- defaultValueDescription: "false"
38618
+ defaultValueDescription: false,
38608
38619
  },
38609
38620
  {
38610
38621
  name: "isolatedModules",
@@ -38612,7 +38623,7 @@ var ts;
38612
38623
  category: ts.Diagnostics.Interop_Constraints,
38613
38624
  description: ts.Diagnostics.Ensure_that_each_file_can_be_safely_transpiled_without_relying_on_other_imports,
38614
38625
  transpileOptionValue: true,
38615
- defaultValueDescription: "false"
38626
+ defaultValueDescription: false,
38616
38627
  },
38617
38628
  // Strict Type Checks
38618
38629
  {
@@ -38623,7 +38634,7 @@ var ts;
38623
38634
  showInSimplifiedHelpView: true,
38624
38635
  category: ts.Diagnostics.Type_Checking,
38625
38636
  description: ts.Diagnostics.Enable_all_strict_type_checking_options,
38626
- defaultValueDescription: "false"
38637
+ defaultValueDescription: false,
38627
38638
  },
38628
38639
  {
38629
38640
  name: "noImplicitAny",
@@ -38684,7 +38695,7 @@ var ts;
38684
38695
  strictFlag: true,
38685
38696
  category: ts.Diagnostics.Type_Checking,
38686
38697
  description: ts.Diagnostics.Type_catch_clause_variables_as_unknown_instead_of_any,
38687
- defaultValueDescription: "false",
38698
+ defaultValueDescription: false,
38688
38699
  },
38689
38700
  {
38690
38701
  name: "alwaysStrict",
@@ -38702,7 +38713,7 @@ var ts;
38702
38713
  affectsSemanticDiagnostics: true,
38703
38714
  category: ts.Diagnostics.Type_Checking,
38704
38715
  description: ts.Diagnostics.Enable_error_reporting_when_a_local_variables_aren_t_read,
38705
- defaultValueDescription: "false"
38716
+ defaultValueDescription: false,
38706
38717
  },
38707
38718
  {
38708
38719
  name: "noUnusedParameters",
@@ -38710,7 +38721,7 @@ var ts;
38710
38721
  affectsSemanticDiagnostics: true,
38711
38722
  category: ts.Diagnostics.Type_Checking,
38712
38723
  description: ts.Diagnostics.Raise_an_error_when_a_function_parameter_isn_t_read,
38713
- defaultValueDescription: "false"
38724
+ defaultValueDescription: false,
38714
38725
  },
38715
38726
  {
38716
38727
  name: "exactOptionalPropertyTypes",
@@ -38718,7 +38729,7 @@ var ts;
38718
38729
  affectsSemanticDiagnostics: true,
38719
38730
  category: ts.Diagnostics.Type_Checking,
38720
38731
  description: ts.Diagnostics.Interpret_optional_property_types_as_written_rather_than_adding_undefined,
38721
- defaultValueDescription: "false",
38732
+ defaultValueDescription: false,
38722
38733
  },
38723
38734
  {
38724
38735
  name: "noImplicitReturns",
@@ -38726,7 +38737,7 @@ var ts;
38726
38737
  affectsSemanticDiagnostics: true,
38727
38738
  category: ts.Diagnostics.Type_Checking,
38728
38739
  description: ts.Diagnostics.Enable_error_reporting_for_codepaths_that_do_not_explicitly_return_in_a_function,
38729
- defaultValueDescription: "false"
38740
+ defaultValueDescription: false,
38730
38741
  },
38731
38742
  {
38732
38743
  name: "noFallthroughCasesInSwitch",
@@ -38735,7 +38746,7 @@ var ts;
38735
38746
  affectsSemanticDiagnostics: true,
38736
38747
  category: ts.Diagnostics.Type_Checking,
38737
38748
  description: ts.Diagnostics.Enable_error_reporting_for_fallthrough_cases_in_switch_statements,
38738
- defaultValueDescription: "false",
38749
+ defaultValueDescription: false,
38739
38750
  },
38740
38751
  {
38741
38752
  name: "noUncheckedIndexedAccess",
@@ -38743,7 +38754,7 @@ var ts;
38743
38754
  affectsSemanticDiagnostics: true,
38744
38755
  category: ts.Diagnostics.Type_Checking,
38745
38756
  description: ts.Diagnostics.Include_undefined_in_index_signature_results,
38746
- defaultValueDescription: "false",
38757
+ defaultValueDescription: false,
38747
38758
  },
38748
38759
  {
38749
38760
  name: "noImplicitOverride",
@@ -38751,7 +38762,7 @@ var ts;
38751
38762
  affectsSemanticDiagnostics: true,
38752
38763
  category: ts.Diagnostics.Type_Checking,
38753
38764
  description: ts.Diagnostics.Ensure_overriding_members_in_derived_classes_are_marked_with_an_override_modifier,
38754
- defaultValueDescription: "false",
38765
+ defaultValueDescription: false,
38755
38766
  },
38756
38767
  {
38757
38768
  name: "noPropertyAccessFromIndexSignature",
@@ -38759,7 +38770,7 @@ var ts;
38759
38770
  showInSimplifiedHelpView: false,
38760
38771
  category: ts.Diagnostics.Type_Checking,
38761
38772
  description: ts.Diagnostics.Enforces_using_indexed_accessors_for_keys_declared_using_an_indexed_type,
38762
- defaultValueDescription: "false"
38773
+ defaultValueDescription: false,
38763
38774
  },
38764
38775
  // Module Resolution
38765
38776
  {
@@ -38853,14 +38864,14 @@ var ts;
38853
38864
  showInSimplifiedHelpView: true,
38854
38865
  category: ts.Diagnostics.Interop_Constraints,
38855
38866
  description: ts.Diagnostics.Emit_additional_JavaScript_to_ease_support_for_importing_CommonJS_modules_This_enables_allowSyntheticDefaultImports_for_type_compatibility,
38856
- defaultValueDescription: "false"
38867
+ defaultValueDescription: false,
38857
38868
  },
38858
38869
  {
38859
38870
  name: "preserveSymlinks",
38860
38871
  type: "boolean",
38861
38872
  category: ts.Diagnostics.Interop_Constraints,
38862
38873
  description: ts.Diagnostics.Disable_resolving_symlinks_to_their_realpath_This_correlates_to_the_same_flag_in_node,
38863
- defaultValueDescription: "false",
38874
+ defaultValueDescription: false,
38864
38875
  },
38865
38876
  {
38866
38877
  name: "allowUmdGlobalAccess",
@@ -38868,7 +38879,7 @@ var ts;
38868
38879
  affectsSemanticDiagnostics: true,
38869
38880
  category: ts.Diagnostics.Modules,
38870
38881
  description: ts.Diagnostics.Allow_accessing_UMD_globals_from_modules,
38871
- defaultValueDescription: "false"
38882
+ defaultValueDescription: false,
38872
38883
  },
38873
38884
  // Source Maps
38874
38885
  {
@@ -38893,7 +38904,7 @@ var ts;
38893
38904
  affectsEmit: true,
38894
38905
  category: ts.Diagnostics.Emit,
38895
38906
  description: ts.Diagnostics.Include_sourcemap_files_inside_the_emitted_JavaScript,
38896
- defaultValueDescription: "false"
38907
+ defaultValueDescription: false,
38897
38908
  },
38898
38909
  {
38899
38910
  name: "inlineSources",
@@ -38901,7 +38912,7 @@ var ts;
38901
38912
  affectsEmit: true,
38902
38913
  category: ts.Diagnostics.Emit,
38903
38914
  description: ts.Diagnostics.Include_source_code_in_the_sourcemaps_inside_the_emitted_JavaScript,
38904
- defaultValueDescription: "false"
38915
+ defaultValueDescription: false,
38905
38916
  },
38906
38917
  // Experimental
38907
38918
  {
@@ -38910,7 +38921,7 @@ var ts;
38910
38921
  affectsSemanticDiagnostics: true,
38911
38922
  category: ts.Diagnostics.Language_and_Environment,
38912
38923
  description: ts.Diagnostics.Enable_experimental_support_for_TC39_stage_2_draft_decorators,
38913
- defaultValueDescription: "false",
38924
+ defaultValueDescription: false,
38914
38925
  },
38915
38926
  {
38916
38927
  name: "emitDecoratorMetadata",
@@ -38919,7 +38930,7 @@ var ts;
38919
38930
  affectsEmit: true,
38920
38931
  category: ts.Diagnostics.Language_and_Environment,
38921
38932
  description: ts.Diagnostics.Emit_design_type_metadata_for_decorated_declarations_in_source_files,
38922
- defaultValueDescription: "false",
38933
+ defaultValueDescription: false,
38923
38934
  },
38924
38935
  // Advanced
38925
38936
  {
@@ -38951,7 +38962,7 @@ var ts;
38951
38962
  affectsModuleResolution: true,
38952
38963
  category: ts.Diagnostics.Modules,
38953
38964
  description: ts.Diagnostics.Enable_importing_json_files,
38954
- defaultValueDescription: "false"
38965
+ defaultValueDescription: false,
38955
38966
  },
38956
38967
  {
38957
38968
  name: "out",
@@ -38977,7 +38988,7 @@ var ts;
38977
38988
  type: "boolean",
38978
38989
  category: ts.Diagnostics.Completeness,
38979
38990
  description: ts.Diagnostics.Skip_type_checking_d_ts_files_that_are_included_with_TypeScript,
38980
- defaultValueDescription: "false",
38991
+ defaultValueDescription: false,
38981
38992
  },
38982
38993
  {
38983
38994
  name: "charset",
@@ -38992,7 +39003,7 @@ var ts;
38992
39003
  affectsEmit: true,
38993
39004
  category: ts.Diagnostics.Emit,
38994
39005
  description: ts.Diagnostics.Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files,
38995
- defaultValueDescription: "false"
39006
+ defaultValueDescription: false,
38996
39007
  },
38997
39008
  {
38998
39009
  name: "newLine",
@@ -39012,7 +39023,7 @@ var ts;
39012
39023
  affectsSemanticDiagnostics: true,
39013
39024
  category: ts.Diagnostics.Output_Formatting,
39014
39025
  description: ts.Diagnostics.Disable_truncating_types_in_error_messages,
39015
- defaultValueDescription: "false"
39026
+ defaultValueDescription: false,
39016
39027
  },
39017
39028
  {
39018
39029
  name: "noLib",
@@ -39023,7 +39034,7 @@ var ts;
39023
39034
  // We are not returning a sourceFile for lib file when asked by the program,
39024
39035
  // so pass --noLib to avoid reporting a file not found error.
39025
39036
  transpileOptionValue: true,
39026
- defaultValueDescription: "false"
39037
+ defaultValueDescription: false,
39027
39038
  },
39028
39039
  {
39029
39040
  name: "noResolve",
@@ -39034,7 +39045,7 @@ var ts;
39034
39045
  // We are not doing a full typecheck, we are not resolving the whole context,
39035
39046
  // so pass --noResolve to avoid reporting missing file errors.
39036
39047
  transpileOptionValue: true,
39037
- defaultValueDescription: "false"
39048
+ defaultValueDescription: false,
39038
39049
  },
39039
39050
  {
39040
39051
  name: "stripInternal",
@@ -39042,7 +39053,7 @@ var ts;
39042
39053
  affectsEmit: true,
39043
39054
  category: ts.Diagnostics.Emit,
39044
39055
  description: ts.Diagnostics.Disable_emitting_declarations_that_have_internal_in_their_JSDoc_comments,
39045
- defaultValueDescription: "false",
39056
+ defaultValueDescription: false,
39046
39057
  },
39047
39058
  {
39048
39059
  name: "disableSizeLimit",
@@ -39050,7 +39061,7 @@ var ts;
39050
39061
  affectsProgramStructure: true,
39051
39062
  category: ts.Diagnostics.Editor_Support,
39052
39063
  description: ts.Diagnostics.Remove_the_20mb_cap_on_total_source_code_size_for_JavaScript_files_in_the_TypeScript_language_server,
39053
- defaultValueDescription: "false"
39064
+ defaultValueDescription: false,
39054
39065
  },
39055
39066
  {
39056
39067
  name: "disableSourceOfProjectReferenceRedirect",
@@ -39058,7 +39069,7 @@ var ts;
39058
39069
  isTSConfigOnly: true,
39059
39070
  category: ts.Diagnostics.Projects,
39060
39071
  description: ts.Diagnostics.Disable_preferring_source_files_instead_of_declaration_files_when_referencing_composite_projects,
39061
- defaultValueDescription: "false",
39072
+ defaultValueDescription: false,
39062
39073
  },
39063
39074
  {
39064
39075
  name: "disableSolutionSearching",
@@ -39066,7 +39077,7 @@ var ts;
39066
39077
  isTSConfigOnly: true,
39067
39078
  category: ts.Diagnostics.Projects,
39068
39079
  description: ts.Diagnostics.Opt_a_project_out_of_multi_project_reference_checking_when_editing,
39069
- defaultValueDescription: "false",
39080
+ defaultValueDescription: false,
39070
39081
  },
39071
39082
  {
39072
39083
  name: "disableReferencedProjectLoad",
@@ -39074,7 +39085,7 @@ var ts;
39074
39085
  isTSConfigOnly: true,
39075
39086
  category: ts.Diagnostics.Projects,
39076
39087
  description: ts.Diagnostics.Reduce_the_number_of_projects_loaded_automatically_by_TypeScript,
39077
- defaultValueDescription: "false",
39088
+ defaultValueDescription: false,
39078
39089
  },
39079
39090
  {
39080
39091
  name: "noImplicitUseStrict",
@@ -39082,7 +39093,7 @@ var ts;
39082
39093
  affectsSemanticDiagnostics: true,
39083
39094
  category: ts.Diagnostics.Backwards_Compatibility,
39084
39095
  description: ts.Diagnostics.Disable_adding_use_strict_directives_in_emitted_JavaScript_files,
39085
- defaultValueDescription: "false"
39096
+ defaultValueDescription: false,
39086
39097
  },
39087
39098
  {
39088
39099
  name: "noEmitHelpers",
@@ -39090,7 +39101,7 @@ var ts;
39090
39101
  affectsEmit: true,
39091
39102
  category: ts.Diagnostics.Emit,
39092
39103
  description: ts.Diagnostics.Disable_generating_custom_helper_functions_like_extends_in_compiled_output,
39093
- defaultValueDescription: "false"
39104
+ defaultValueDescription: false,
39094
39105
  },
39095
39106
  {
39096
39107
  name: "noEmitOnError",
@@ -39099,7 +39110,7 @@ var ts;
39099
39110
  category: ts.Diagnostics.Emit,
39100
39111
  transpileOptionValue: undefined,
39101
39112
  description: ts.Diagnostics.Disable_emitting_files_if_any_type_checking_errors_are_reported,
39102
- defaultValueDescription: "false"
39113
+ defaultValueDescription: false,
39103
39114
  },
39104
39115
  {
39105
39116
  name: "preserveConstEnums",
@@ -39107,7 +39118,7 @@ var ts;
39107
39118
  affectsEmit: true,
39108
39119
  category: ts.Diagnostics.Emit,
39109
39120
  description: ts.Diagnostics.Disable_erasing_const_enum_declarations_in_generated_code,
39110
- defaultValueDescription: "false",
39121
+ defaultValueDescription: false,
39111
39122
  },
39112
39123
  {
39113
39124
  name: "declarationDir",
@@ -39124,7 +39135,7 @@ var ts;
39124
39135
  type: "boolean",
39125
39136
  category: ts.Diagnostics.Completeness,
39126
39137
  description: ts.Diagnostics.Skip_type_checking_all_d_ts_files,
39127
- defaultValueDescription: "false"
39138
+ defaultValueDescription: false,
39128
39139
  },
39129
39140
  {
39130
39141
  name: "allowUnusedLabels",
@@ -39133,7 +39144,7 @@ var ts;
39133
39144
  affectsSemanticDiagnostics: true,
39134
39145
  category: ts.Diagnostics.Type_Checking,
39135
39146
  description: ts.Diagnostics.Disable_error_reporting_for_unused_labels,
39136
- defaultValueDescription: "undefined"
39147
+ defaultValueDescription: undefined,
39137
39148
  },
39138
39149
  {
39139
39150
  name: "allowUnreachableCode",
@@ -39142,7 +39153,7 @@ var ts;
39142
39153
  affectsSemanticDiagnostics: true,
39143
39154
  category: ts.Diagnostics.Type_Checking,
39144
39155
  description: ts.Diagnostics.Disable_error_reporting_for_unreachable_code,
39145
- defaultValueDescription: "undefined"
39156
+ defaultValueDescription: undefined,
39146
39157
  },
39147
39158
  {
39148
39159
  name: "suppressExcessPropertyErrors",
@@ -39150,7 +39161,7 @@ var ts;
39150
39161
  affectsSemanticDiagnostics: true,
39151
39162
  category: ts.Diagnostics.Backwards_Compatibility,
39152
39163
  description: ts.Diagnostics.Disable_reporting_of_excess_property_errors_during_the_creation_of_object_literals,
39153
- defaultValueDescription: "false"
39164
+ defaultValueDescription: false,
39154
39165
  },
39155
39166
  {
39156
39167
  name: "suppressImplicitAnyIndexErrors",
@@ -39158,7 +39169,7 @@ var ts;
39158
39169
  affectsSemanticDiagnostics: true,
39159
39170
  category: ts.Diagnostics.Backwards_Compatibility,
39160
39171
  description: ts.Diagnostics.Suppress_noImplicitAny_errors_when_indexing_objects_that_lack_index_signatures,
39161
- defaultValueDescription: "false"
39172
+ defaultValueDescription: false,
39162
39173
  },
39163
39174
  {
39164
39175
  name: "forceConsistentCasingInFileNames",
@@ -39166,7 +39177,7 @@ var ts;
39166
39177
  affectsModuleResolution: true,
39167
39178
  category: ts.Diagnostics.Interop_Constraints,
39168
39179
  description: ts.Diagnostics.Ensure_that_casing_is_correct_in_imports,
39169
- defaultValueDescription: "false"
39180
+ defaultValueDescription: false,
39170
39181
  },
39171
39182
  {
39172
39183
  name: "maxNodeModuleJsDepth",
@@ -39174,7 +39185,7 @@ var ts;
39174
39185
  affectsModuleResolution: true,
39175
39186
  category: ts.Diagnostics.JavaScript_Support,
39176
39187
  description: ts.Diagnostics.Specify_the_maximum_folder_depth_used_for_checking_JavaScript_files_from_node_modules_Only_applicable_with_allowJs,
39177
- defaultValueDescription: "0"
39188
+ defaultValueDescription: 0,
39178
39189
  },
39179
39190
  {
39180
39191
  name: "noStrictGenericChecks",
@@ -39182,7 +39193,7 @@ var ts;
39182
39193
  affectsSemanticDiagnostics: true,
39183
39194
  category: ts.Diagnostics.Backwards_Compatibility,
39184
39195
  description: ts.Diagnostics.Disable_strict_checking_of_generic_signatures_in_function_types,
39185
- defaultValueDescription: "false"
39196
+ defaultValueDescription: false,
39186
39197
  },
39187
39198
  {
39188
39199
  name: "useDefineForClassFields",
@@ -39199,14 +39210,14 @@ var ts;
39199
39210
  affectsEmit: true,
39200
39211
  category: ts.Diagnostics.Emit,
39201
39212
  description: ts.Diagnostics.Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed,
39202
- defaultValueDescription: "false",
39213
+ defaultValueDescription: false,
39203
39214
  },
39204
39215
  {
39205
39216
  name: "keyofStringsOnly",
39206
39217
  type: "boolean",
39207
39218
  category: ts.Diagnostics.Backwards_Compatibility,
39208
39219
  description: ts.Diagnostics.Make_keyof_only_return_strings_instead_of_string_numbers_or_symbols_Legacy_option,
39209
- defaultValueDescription: "false"
39220
+ defaultValueDescription: false,
39210
39221
  },
39211
39222
  {
39212
39223
  // A list of plugins to load in the language service
@@ -39248,7 +39259,7 @@ var ts;
39248
39259
  category: ts.Diagnostics.Command_line_Options,
39249
39260
  description: ts.Diagnostics.Enable_verbose_logging,
39250
39261
  type: "boolean",
39251
- defaultValueDescription: "false",
39262
+ defaultValueDescription: false,
39252
39263
  },
39253
39264
  {
39254
39265
  name: "dry",
@@ -39256,7 +39267,7 @@ var ts;
39256
39267
  category: ts.Diagnostics.Command_line_Options,
39257
39268
  description: ts.Diagnostics.Show_what_would_be_built_or_deleted_if_specified_with_clean,
39258
39269
  type: "boolean",
39259
- defaultValueDescription: "false",
39270
+ defaultValueDescription: false,
39260
39271
  },
39261
39272
  {
39262
39273
  name: "force",
@@ -39264,14 +39275,14 @@ var ts;
39264
39275
  category: ts.Diagnostics.Command_line_Options,
39265
39276
  description: ts.Diagnostics.Build_all_projects_including_those_that_appear_to_be_up_to_date,
39266
39277
  type: "boolean",
39267
- defaultValueDescription: "false",
39278
+ defaultValueDescription: false,
39268
39279
  },
39269
39280
  {
39270
39281
  name: "clean",
39271
39282
  category: ts.Diagnostics.Command_line_Options,
39272
39283
  description: ts.Diagnostics.Delete_the_outputs_of_all_projects,
39273
39284
  type: "boolean",
39274
- defaultValueDescription: "false",
39285
+ defaultValueDescription: false,
39275
39286
  }
39276
39287
  ];
39277
39288
  /* @internal */
@@ -39284,12 +39295,12 @@ var ts;
39284
39295
  */
39285
39296
  name: "enableAutoDiscovery",
39286
39297
  type: "boolean",
39287
- defaultValueDescription: "false",
39298
+ defaultValueDescription: false,
39288
39299
  },
39289
39300
  {
39290
39301
  name: "enable",
39291
39302
  type: "boolean",
39292
- defaultValueDescription: "false",
39303
+ defaultValueDescription: false,
39293
39304
  },
39294
39305
  {
39295
39306
  name: "include",
@@ -39310,7 +39321,7 @@ var ts;
39310
39321
  {
39311
39322
  name: "disableFilenameBasedTypeAcquisition",
39312
39323
  type: "boolean",
39313
- defaultValueDescription: "false",
39324
+ defaultValueDescription: false,
39314
39325
  },
39315
39326
  ];
39316
39327
  /*@internal*/
@@ -90910,11 +90921,10 @@ var ts;
90910
90921
  // we can safely elide the parentheses here, as a new synthetic
90911
90922
  // ParenthesizedExpression will be inserted if we remove parentheses too
90912
90923
  // aggressively.
90913
- // HOWEVER - if there are leading comments on the expression itself, to handle ASI
90914
- // correctly for return and throw, we must keep the parenthesis
90915
- if (ts.length(ts.getLeadingCommentRangesOfNode(expression, currentSourceFile))) {
90916
- return factory.updateParenthesizedExpression(node, expression);
90917
- }
90924
+ //
90925
+ // If there are leading comments on the expression itself, the emitter will handle ASI
90926
+ // for return, throw, and yield by re-introducing parenthesis during emit on an as-need
90927
+ // basis.
90918
90928
  return factory.createPartiallyEmittedExpression(expression, node);
90919
90929
  }
90920
90930
  return ts.visitEachChild(node, visitor, context);
@@ -94862,11 +94872,11 @@ var ts;
94862
94872
  }
94863
94873
  function visitOptionalExpression(node, captureThisArg, isDelete) {
94864
94874
  var _a = flattenChain(node), expression = _a.expression, chain = _a.chain;
94865
- var left = visitNonOptionalExpression(expression, ts.isCallChain(chain[0]), /*isDelete*/ false);
94875
+ var left = visitNonOptionalExpression(ts.skipPartiallyEmittedExpressions(expression), ts.isCallChain(chain[0]), /*isDelete*/ false);
94866
94876
  var leftThisArg = ts.isSyntheticReference(left) ? left.thisArg : undefined;
94867
- var leftExpression = ts.isSyntheticReference(left) ? left.expression : left;
94868
- var capturedLeft = leftExpression;
94869
- if (!ts.isSimpleCopiableExpression(leftExpression)) {
94877
+ var capturedLeft = ts.isSyntheticReference(left) ? left.expression : left;
94878
+ var leftExpression = factory.restoreOuterExpressions(expression, capturedLeft, 8 /* PartiallyEmittedExpressions */);
94879
+ if (!ts.isSimpleCopiableExpression(capturedLeft)) {
94870
94880
  capturedLeft = factory.createTempVariable(hoistVariableDeclaration);
94871
94881
  leftExpression = factory.createAssignment(capturedLeft, leftExpression);
94872
94882
  }
@@ -94892,6 +94902,10 @@ var ts;
94892
94902
  break;
94893
94903
  case 207 /* CallExpression */:
94894
94904
  if (i === 0 && leftThisArg) {
94905
+ if (!ts.isGeneratedIdentifier(leftThisArg)) {
94906
+ leftThisArg = factory.cloneNode(leftThisArg);
94907
+ ts.addEmitFlags(leftThisArg, 1536 /* NoComments */);
94908
+ }
94895
94909
  rightExpression = factory.createFunctionCallCall(rightExpression, leftThisArg.kind === 106 /* SuperKeyword */ ? factory.createThis() : leftThisArg, ts.visitNodes(segment.arguments, visitor, ts.isExpression));
94896
94910
  }
94897
94911
  else {
@@ -109674,7 +109688,7 @@ var ts;
109674
109688
  function emitYieldExpression(node) {
109675
109689
  emitTokenWithComment(125 /* YieldKeyword */, node.pos, writeKeyword, node);
109676
109690
  emit(node.asteriskToken);
109677
- emitExpressionWithLeadingSpace(node.expression, parenthesizer.parenthesizeExpressionForDisallowedComma);
109691
+ emitExpressionWithLeadingSpace(node.expression && parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsiAndDisallowedComma);
109678
109692
  }
109679
109693
  function emitSpreadElement(node) {
109680
109694
  emitTokenWithComment(25 /* DotDotDotToken */, node.pos, writePunctuation, node);
@@ -109871,9 +109885,49 @@ var ts;
109871
109885
  }
109872
109886
  return pos;
109873
109887
  }
109888
+ function commentWillEmitNewLine(node) {
109889
+ return node.kind === 2 /* SingleLineCommentTrivia */ || !!node.hasTrailingNewLine;
109890
+ }
109891
+ function willEmitLeadingNewLine(node) {
109892
+ if (!currentSourceFile)
109893
+ return false;
109894
+ if (ts.some(ts.getLeadingCommentRanges(currentSourceFile.text, node.pos), commentWillEmitNewLine))
109895
+ return true;
109896
+ if (ts.some(ts.getSyntheticLeadingComments(node), commentWillEmitNewLine))
109897
+ return true;
109898
+ if (ts.isPartiallyEmittedExpression(node)) {
109899
+ if (node.pos !== node.expression.pos) {
109900
+ if (ts.some(ts.getTrailingCommentRanges(currentSourceFile.text, node.expression.pos), commentWillEmitNewLine))
109901
+ return true;
109902
+ }
109903
+ return willEmitLeadingNewLine(node.expression);
109904
+ }
109905
+ return false;
109906
+ }
109907
+ /**
109908
+ * Wraps an expression in parens if we would emit a leading comment that would introduce a line separator
109909
+ * between the node and its parent.
109910
+ */
109911
+ function parenthesizeExpressionForNoAsi(node) {
109912
+ if (!commentsDisabled && ts.isPartiallyEmittedExpression(node) && willEmitLeadingNewLine(node)) {
109913
+ var parseNode = ts.getParseTreeNode(node);
109914
+ if (parseNode && ts.isParenthesizedExpression(parseNode)) {
109915
+ // If the original node was a parenthesized expression, restore it to preserve comment and source map emit
109916
+ var parens = ts.factory.createParenthesizedExpression(node.expression);
109917
+ ts.setOriginalNode(parens, node);
109918
+ ts.setTextRange(parens, parseNode);
109919
+ return parens;
109920
+ }
109921
+ return ts.factory.createParenthesizedExpression(node);
109922
+ }
109923
+ return node;
109924
+ }
109925
+ function parenthesizeExpressionForNoAsiAndDisallowedComma(node) {
109926
+ return parenthesizeExpressionForNoAsi(parenthesizer.parenthesizeExpressionForDisallowedComma(node));
109927
+ }
109874
109928
  function emitReturnStatement(node) {
109875
109929
  emitTokenWithComment(105 /* ReturnKeyword */, node.pos, writeKeyword, /*contextNode*/ node);
109876
- emitExpressionWithLeadingSpace(node.expression);
109930
+ emitExpressionWithLeadingSpace(node.expression && parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsi);
109877
109931
  writeTrailingSemicolon();
109878
109932
  }
109879
109933
  function emitWithStatement(node) {
@@ -109901,7 +109955,7 @@ var ts;
109901
109955
  }
109902
109956
  function emitThrowStatement(node) {
109903
109957
  emitTokenWithComment(109 /* ThrowKeyword */, node.pos, writeKeyword, node);
109904
- emitExpressionWithLeadingSpace(node.expression);
109958
+ emitExpressionWithLeadingSpace(parenthesizeExpressionForNoAsi(node.expression), parenthesizeExpressionForNoAsi);
109905
109959
  writeTrailingSemicolon();
109906
109960
  }
109907
109961
  function emitTryStatement(node) {
@@ -110745,7 +110799,14 @@ var ts;
110745
110799
  }
110746
110800
  // Transformation nodes
110747
110801
  function emitPartiallyEmittedExpression(node) {
110802
+ var emitFlags = ts.getEmitFlags(node);
110803
+ if (!(emitFlags & 512 /* NoLeadingComments */) && node.pos !== node.expression.pos) {
110804
+ emitTrailingCommentsOfPosition(node.expression.pos);
110805
+ }
110748
110806
  emitExpression(node.expression);
110807
+ if (!(emitFlags & 1024 /* NoTrailingComments */) && node.end !== node.expression.end) {
110808
+ emitLeadingCommentsOfPosition(node.expression.end);
110809
+ }
110749
110810
  }
110750
110811
  function emitCommaList(node) {
110751
110812
  emitExpressionList(node, node.elements, 528 /* CommaListElements */, /*parenthesizerRule*/ undefined);
@@ -111109,10 +111170,8 @@ var ts;
111109
111170
  // Emit this child.
111110
111171
  previousSourceFileTextKind = recordBundleFileInternalSectionStart(child);
111111
111172
  if (shouldEmitInterveningComments) {
111112
- if (emitTrailingCommentsOfPosition) {
111113
- var commentRange = ts.getCommentRange(child);
111114
- emitTrailingCommentsOfPosition(commentRange.pos);
111115
- }
111173
+ var commentRange = ts.getCommentRange(child);
111174
+ emitTrailingCommentsOfPosition(commentRange.pos);
111116
111175
  }
111117
111176
  else {
111118
111177
  shouldEmitInterveningComments = mayEmitInterveningComments;
@@ -111433,7 +111492,7 @@ var ts;
111433
111492
  function writeLineSeparatorsAndIndentBefore(node, parent) {
111434
111493
  var leadingNewlines = preserveSourceNewlines && getLeadingLineTerminatorCount(parent, [node], 0 /* None */);
111435
111494
  if (leadingNewlines) {
111436
- writeLinesAndIndent(leadingNewlines, /*writeLinesIfNotIndenting*/ false);
111495
+ writeLinesAndIndent(leadingNewlines, /*writeSpaceIfNotIndenting*/ false);
111437
111496
  }
111438
111497
  return !!leadingNewlines;
111439
111498
  }
@@ -125423,7 +125482,6 @@ var ts;
125423
125482
  || kind === 165 /* PropertySignature */
125424
125483
  || kind === 167 /* MethodSignature */;
125425
125484
  }
125426
- ts.syntaxRequiresTrailingCommaOrSemicolonOrASI = syntaxRequiresTrailingCommaOrSemicolonOrASI;
125427
125485
  function syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI(kind) {
125428
125486
  return kind === 255 /* FunctionDeclaration */
125429
125487
  || kind === 170 /* Constructor */
@@ -125431,11 +125489,9 @@ var ts;
125431
125489
  || kind === 171 /* GetAccessor */
125432
125490
  || kind === 172 /* SetAccessor */;
125433
125491
  }
125434
- ts.syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI = syntaxRequiresTrailingFunctionBlockOrSemicolonOrASI;
125435
125492
  function syntaxRequiresTrailingModuleBlockOrSemicolonOrASI(kind) {
125436
125493
  return kind === 260 /* ModuleDeclaration */;
125437
125494
  }
125438
- ts.syntaxRequiresTrailingModuleBlockOrSemicolonOrASI = syntaxRequiresTrailingModuleBlockOrSemicolonOrASI;
125439
125495
  function syntaxRequiresTrailingSemicolonOrASI(kind) {
125440
125496
  return kind === 236 /* VariableStatement */
125441
125497
  || kind === 237 /* ExpressionStatement */
@@ -125510,19 +125566,34 @@ var ts;
125510
125566
  ts.forEachChild(sourceFile, function visit(node) {
125511
125567
  if (syntaxRequiresTrailingSemicolonOrASI(node.kind)) {
125512
125568
  var lastToken = node.getLastToken(sourceFile);
125513
- if (lastToken && lastToken.kind === 26 /* SemicolonToken */) {
125569
+ if ((lastToken === null || lastToken === void 0 ? void 0 : lastToken.kind) === 26 /* SemicolonToken */) {
125514
125570
  withSemicolon++;
125515
125571
  }
125516
125572
  else {
125517
125573
  withoutSemicolon++;
125518
125574
  }
125519
125575
  }
125576
+ else if (syntaxRequiresTrailingCommaOrSemicolonOrASI(node.kind)) {
125577
+ var lastToken = node.getLastToken(sourceFile);
125578
+ if ((lastToken === null || lastToken === void 0 ? void 0 : lastToken.kind) === 26 /* SemicolonToken */) {
125579
+ withSemicolon++;
125580
+ }
125581
+ else if (lastToken && lastToken.kind !== 27 /* CommaToken */) {
125582
+ var lastTokenLine = ts.getLineAndCharacterOfPosition(sourceFile, lastToken.getStart(sourceFile)).line;
125583
+ var nextTokenLine = ts.getLineAndCharacterOfPosition(sourceFile, ts.getSpanOfTokenAtPosition(sourceFile, lastToken.end).start).line;
125584
+ // Avoid counting missing semicolon in single-line objects:
125585
+ // `function f(p: { x: string /*no semicolon here is insignificant*/ }) {`
125586
+ if (lastTokenLine !== nextTokenLine) {
125587
+ withoutSemicolon++;
125588
+ }
125589
+ }
125590
+ }
125520
125591
  if (withSemicolon + withoutSemicolon >= nStatementsToObserve) {
125521
125592
  return true;
125522
125593
  }
125523
125594
  return ts.forEachChild(node, visit);
125524
125595
  });
125525
- // One statement missing a semicolon isn’t sufficient evidence to say the user
125596
+ // One statement missing a semicolon isn't sufficient evidence to say the user
125526
125597
  // doesn’t want semicolons, because they may not even be done writing that statement.
125527
125598
  if (withSemicolon === 0 && withoutSemicolon <= 1) {
125528
125599
  return true;
@@ -141388,6 +141459,7 @@ var ts;
141388
141459
  lastTrailingTriviaWasNewLine: function () { return wasNewLine; },
141389
141460
  skipToEndOf: skipToEndOf,
141390
141461
  skipToStartOf: skipToStartOf,
141462
+ getStartPos: function () { var _a; return (_a = lastTokenInfo === null || lastTokenInfo === void 0 ? void 0 : lastTokenInfo.token.pos) !== null && _a !== void 0 ? _a : scanner.getTokenPos(); },
141391
141463
  });
141392
141464
  lastTokenInfo = undefined;
141393
141465
  scanner.setText(undefined);
@@ -141561,8 +141633,7 @@ var ts;
141561
141633
  }
141562
141634
  function isOnToken() {
141563
141635
  var current = lastTokenInfo ? lastTokenInfo.token.kind : scanner.getToken();
141564
- var startPos = lastTokenInfo ? lastTokenInfo.token.pos : scanner.getStartPos();
141565
- return startPos < endPos && current !== 1 /* EndOfFileToken */ && !ts.isTrivia(current);
141636
+ return current !== 1 /* EndOfFileToken */ && !ts.isTrivia(current);
141566
141637
  }
141567
141638
  function isOnEOF() {
141568
141639
  var current = lastTokenInfo ? lastTokenInfo.token.kind : scanner.getToken();
@@ -142750,7 +142821,7 @@ var ts;
142750
142821
  return 0;
142751
142822
  }
142752
142823
  function formatNodeGivenIndentation(node, sourceFileLike, languageVariant, initialIndentation, delta, formatContext) {
142753
- var range = { pos: 0, end: sourceFileLike.text.length };
142824
+ var range = { pos: node.pos, end: node.end };
142754
142825
  return formatting.getFormattingScanner(sourceFileLike.text, languageVariant, range.pos, range.end, function (scanner) { return formatSpanWorker(range, node, initialIndentation, delta, scanner, formatContext, 1 /* FormatSelection */, function (_) { return false; }, // assume that node does not have any errors
142755
142826
  sourceFileLike); });
142756
142827
  }
@@ -142801,6 +142872,15 @@ var ts;
142801
142872
  }
142802
142873
  }
142803
142874
  }
142875
+ if (previousRange && formattingScanner.getStartPos() >= originalRange.end) {
142876
+ var token = formattingScanner.isOnEOF() ? formattingScanner.readEOFTokenRange() :
142877
+ formattingScanner.isOnToken() ? formattingScanner.readTokenInfo(enclosingNode).token :
142878
+ undefined;
142879
+ if (token) {
142880
+ processPair(token, sourceFile.getLineAndCharacterOfPosition(token.pos).line, enclosingNode, previousRange, previousRangeStartLine, previousParent, enclosingNode,
142881
+ /*dynamicIndentation*/ undefined);
142882
+ }
142883
+ }
142804
142884
  return edits;
142805
142885
  // local functions
142806
142886
  /** Tries to compute the indentation for a list element.
@@ -142983,19 +143063,13 @@ var ts;
142983
143063
  processChildNodes(nodes, node, nodeStartLine, nodeDynamicIndentation);
142984
143064
  });
142985
143065
  // proceed any tokens in the node that are located after child nodes
142986
- while (formattingScanner.isOnToken()) {
143066
+ while (formattingScanner.isOnToken() && formattingScanner.getStartPos() < originalRange.end) {
142987
143067
  var tokenInfo = formattingScanner.readTokenInfo(node);
142988
- if (tokenInfo.token.end > node.end) {
143068
+ if (tokenInfo.token.end > Math.min(node.end, originalRange.end)) {
142989
143069
  break;
142990
143070
  }
142991
143071
  consumeTokenAndAdvanceScanner(tokenInfo, node, nodeDynamicIndentation, node);
142992
143072
  }
142993
- if (!node.parent && formattingScanner.isOnEOF()) {
142994
- var token = formattingScanner.readEOFTokenRange();
142995
- if (token.end <= node.end && previousRange) {
142996
- processPair(token, sourceFile.getLineAndCharacterOfPosition(token.pos).line, node, previousRange, previousRangeStartLine, previousParent, contextNode, nodeDynamicIndentation);
142997
- }
142998
- }
142999
143073
  function processChildNode(child, inheritedIndentation, parent, parentDynamicIndentation, parentStartLine, undecoratedParentStartLine, isListItem, isFirstListItem) {
143000
143074
  var childStartPos = child.getStart(sourceFile);
143001
143075
  var childStartLine = sourceFile.getLineAndCharacterOfPosition(childStartPos).line;
@@ -143021,9 +143095,12 @@ var ts;
143021
143095
  if (child.getFullWidth() === 0) {
143022
143096
  return inheritedIndentation;
143023
143097
  }
143024
- while (formattingScanner.isOnToken()) {
143098
+ while (formattingScanner.isOnToken() && formattingScanner.getStartPos() < originalRange.end) {
143025
143099
  // proceed any parent tokens that are located prior to child.getStart()
143026
143100
  var tokenInfo = formattingScanner.readTokenInfo(node);
143101
+ if (tokenInfo.token.end > originalRange.end) {
143102
+ return inheritedIndentation;
143103
+ }
143027
143104
  if (tokenInfo.token.end > childStartPos) {
143028
143105
  if (tokenInfo.token.pos > childStartPos) {
143029
143106
  formattingScanner.skipToStartOf(child);
@@ -143033,7 +143110,7 @@ var ts;
143033
143110
  }
143034
143111
  consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, node);
143035
143112
  }
143036
- if (!formattingScanner.isOnToken()) {
143113
+ if (!formattingScanner.isOnToken() || formattingScanner.getStartPos() >= originalRange.end) {
143037
143114
  return inheritedIndentation;
143038
143115
  }
143039
143116
  if (ts.isToken(child)) {
@@ -143062,7 +143139,7 @@ var ts;
143062
143139
  var startLine = parentStartLine;
143063
143140
  if (listStartToken !== 0 /* Unknown */) {
143064
143141
  // introduce a new indentation scope for lists (including list start and end tokens)
143065
- while (formattingScanner.isOnToken()) {
143142
+ while (formattingScanner.isOnToken() && formattingScanner.getStartPos() < originalRange.end) {
143066
143143
  var tokenInfo = formattingScanner.readTokenInfo(parent);
143067
143144
  if (tokenInfo.token.end > nodes.pos) {
143068
143145
  // stop when formatting scanner moves past the beginning of node list
@@ -143098,7 +143175,7 @@ var ts;
143098
143175
  inheritedIndentation = processChildNode(child, inheritedIndentation, node, listDynamicIndentation, startLine, startLine, /*isListItem*/ true, /*isFirstListItem*/ i === 0);
143099
143176
  }
143100
143177
  var listEndToken = getCloseTokenForOpenToken(listStartToken);
143101
- if (listEndToken !== 0 /* Unknown */ && formattingScanner.isOnToken()) {
143178
+ if (listEndToken !== 0 /* Unknown */ && formattingScanner.isOnToken() && formattingScanner.getStartPos() < originalRange.end) {
143102
143179
  var tokenInfo = formattingScanner.readTokenInfo(parent);
143103
143180
  if (tokenInfo.token.kind === 27 /* CommaToken */ && ts.isCallLikeExpression(parent)) {
143104
143181
  var commaTokenLine = sourceFile.getLineAndCharacterOfPosition(tokenInfo.token.pos).line;
@@ -143229,24 +143306,26 @@ var ts;
143229
143306
  // win in a conflict with lower priority rules.
143230
143307
  ts.forEachRight(rules, function (rule) {
143231
143308
  lineAction = applyRuleEdits(rule, previousItem, previousStartLine, currentItem, currentStartLine);
143232
- switch (lineAction) {
143233
- case 2 /* LineRemoved */:
143234
- // Handle the case where the next line is moved to be the end of this line.
143235
- // In this case we don't indent the next line in the next pass.
143236
- if (currentParent.getStart(sourceFile) === currentItem.pos) {
143237
- dynamicIndentation.recomputeIndentation(/*lineAddedByFormatting*/ false, contextNode);
143238
- }
143239
- break;
143240
- case 1 /* LineAdded */:
143241
- // Handle the case where token2 is moved to the new line.
143242
- // In this case we indent token2 in the next pass but we set
143243
- // sameLineIndent flag to notify the indenter that the indentation is within the line.
143244
- if (currentParent.getStart(sourceFile) === currentItem.pos) {
143245
- dynamicIndentation.recomputeIndentation(/*lineAddedByFormatting*/ true, contextNode);
143246
- }
143247
- break;
143248
- default:
143249
- ts.Debug.assert(lineAction === 0 /* None */);
143309
+ if (dynamicIndentation) {
143310
+ switch (lineAction) {
143311
+ case 2 /* LineRemoved */:
143312
+ // Handle the case where the next line is moved to be the end of this line.
143313
+ // In this case we don't indent the next line in the next pass.
143314
+ if (currentParent.getStart(sourceFile) === currentItem.pos) {
143315
+ dynamicIndentation.recomputeIndentation(/*lineAddedByFormatting*/ false, contextNode);
143316
+ }
143317
+ break;
143318
+ case 1 /* LineAdded */:
143319
+ // Handle the case where token2 is moved to the new line.
143320
+ // In this case we indent token2 in the next pass but we set
143321
+ // sameLineIndent flag to notify the indenter that the indentation is within the line.
143322
+ if (currentParent.getStart(sourceFile) === currentItem.pos) {
143323
+ dynamicIndentation.recomputeIndentation(/*lineAddedByFormatting*/ true, contextNode);
143324
+ }
143325
+ break;
143326
+ default:
143327
+ ts.Debug.assert(lineAction === 0 /* None */);
143328
+ }
143250
143329
  }
143251
143330
  // We need to trim trailing whitespace between the tokens if they were on different lines, and no rule was applied to put them on the same line
143252
143331
  trimTrailingWhitespaces = trimTrailingWhitespaces && !(rule.action & 16 /* DeleteSpace */) && rule.flags !== 1 /* CanDeleteNewLines */;
@@ -145724,7 +145803,7 @@ var ts;
145724
145803
  var errorCodes = [ts.Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first.code];
145725
145804
  codefix.registerCodeFix({
145726
145805
  errorCodes: errorCodes,
145727
- getCodeActions: function (context) {
145806
+ getCodeActions: function getCodeActionsToAddConvertToUnknownForNonOverlappingTypes(context) {
145728
145807
  var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span.start); });
145729
145808
  return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_unknown_conversion_for_non_overlapping_types, fixId, ts.Diagnostics.Add_unknown_to_all_conversions_of_non_overlapping_types)];
145730
145809
  },
@@ -145751,7 +145830,7 @@ var ts;
145751
145830
  ts.Diagnostics.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code,
145752
145831
  ts.Diagnostics.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code,
145753
145832
  ],
145754
- getCodeActions: function (context) {
145833
+ getCodeActions: function getCodeActionsToAddEmptyExportDeclaration(context) {
145755
145834
  var sourceFile = context.sourceFile;
145756
145835
  var changes = ts.textChanges.ChangeTracker.with(context, function (changes) {
145757
145836
  var exportDeclaration = ts.factory.createExportDeclaration(
@@ -145780,7 +145859,7 @@ var ts;
145780
145859
  codefix.registerCodeFix({
145781
145860
  fixIds: [fixId],
145782
145861
  errorCodes: errorCodes,
145783
- getCodeActions: function (context) {
145862
+ getCodeActions: function getCodeActionsToAddMissingAsync(context) {
145784
145863
  var sourceFile = context.sourceFile, errorCode = context.errorCode, cancellationToken = context.cancellationToken, program = context.program, span = context.span;
145785
145864
  var diagnostic = ts.find(program.getDiagnosticsProducingTypeChecker().getDiagnostics(sourceFile, cancellationToken), getIsMatchingAsyncError(span, errorCode));
145786
145865
  var directSpan = diagnostic && diagnostic.relatedInformation && ts.find(diagnostic.relatedInformation, function (r) { return r.code === ts.Diagnostics.Did_you_mean_to_mark_this_function_as_async.code; });
@@ -145877,7 +145956,7 @@ var ts;
145877
145956
  codefix.registerCodeFix({
145878
145957
  fixIds: [fixId],
145879
145958
  errorCodes: errorCodes,
145880
- getCodeActions: function (context) {
145959
+ getCodeActions: function getCodeActionsToAddMissingAwait(context) {
145881
145960
  var sourceFile = context.sourceFile, errorCode = context.errorCode, span = context.span, cancellationToken = context.cancellationToken, program = context.program;
145882
145961
  var expression = getAwaitErrorSpanExpression(sourceFile, errorCode, span, cancellationToken, program);
145883
145962
  if (!expression) {
@@ -146109,7 +146188,7 @@ var ts;
146109
146188
  ];
146110
146189
  codefix.registerCodeFix({
146111
146190
  errorCodes: errorCodes,
146112
- getCodeActions: function (context) {
146191
+ getCodeActions: function getCodeActionsToAddMissingConst(context) {
146113
146192
  var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span.start, context.program); });
146114
146193
  if (changes.length > 0) {
146115
146194
  return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_const_to_unresolved_variable, fixId, ts.Diagnostics.Add_const_to_all_unresolved_variables)];
@@ -146209,7 +146288,7 @@ var ts;
146209
146288
  ];
146210
146289
  codefix.registerCodeFix({
146211
146290
  errorCodes: errorCodes,
146212
- getCodeActions: function (context) {
146291
+ getCodeActions: function getCodeActionsToAddMissingDeclareOnProperty(context) {
146213
146292
  var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span.start); });
146214
146293
  if (changes.length > 0) {
146215
146294
  return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Prefix_with_declare, fixId, ts.Diagnostics.Prefix_all_incorrect_property_declarations_with_declare)];
@@ -146243,7 +146322,7 @@ var ts;
146243
146322
  var errorCodes = [ts.Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code];
146244
146323
  codefix.registerCodeFix({
146245
146324
  errorCodes: errorCodes,
146246
- getCodeActions: function (context) {
146325
+ getCodeActions: function getCodeActionsToAddMissingInvocationForDecorator(context) {
146247
146326
  var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span.start); });
146248
146327
  return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Call_decorator_expression, fixId, ts.Diagnostics.Add_to_all_uncalled_decorators)];
146249
146328
  },
@@ -146268,7 +146347,7 @@ var ts;
146268
146347
  var errorCodes = [ts.Diagnostics.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1.code];
146269
146348
  codefix.registerCodeFix({
146270
146349
  errorCodes: errorCodes,
146271
- getCodeActions: function (context) {
146350
+ getCodeActions: function getCodeActionsToAddNameToNamelessParameter(context) {
146272
146351
  var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span.start); });
146273
146352
  return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_parameter_name, fixId, ts.Diagnostics.Add_names_to_all_parameters_without_names)];
146274
146353
  },
@@ -148070,14 +148149,14 @@ var ts;
148070
148149
  var fixId = "convertToTypeOnlyExport";
148071
148150
  codefix.registerCodeFix({
148072
148151
  errorCodes: errorCodes,
148073
- getCodeActions: function (context) {
148152
+ getCodeActions: function getCodeActionsToConvertToTypeOnlyExport(context) {
148074
148153
  var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return fixSingleExportDeclaration(t, getExportSpecifierForDiagnosticSpan(context.span, context.sourceFile), context); });
148075
148154
  if (changes.length) {
148076
148155
  return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Convert_to_type_only_export, fixId, ts.Diagnostics.Convert_all_re_exported_types_to_type_only_exports)];
148077
148156
  }
148078
148157
  },
148079
148158
  fixIds: [fixId],
148080
- getAllCodeActions: function (context) {
148159
+ getAllCodeActions: function getAllCodeActionsToConvertToTypeOnlyExport(context) {
148081
148160
  var fixedExportDeclarations = new ts.Map();
148082
148161
  return codefix.codeFixAll(context, errorCodes, function (changes, diag) {
148083
148162
  var exportSpecifier = getExportSpecifierForDiagnosticSpan(diag, context.sourceFile);
@@ -148138,7 +148217,7 @@ var ts;
148138
148217
  var fixId = "convertToTypeOnlyImport";
148139
148218
  codefix.registerCodeFix({
148140
148219
  errorCodes: errorCodes,
148141
- getCodeActions: function (context) {
148220
+ getCodeActions: function getCodeActionsToConvertToTypeOnlyImport(context) {
148142
148221
  var changes = ts.textChanges.ChangeTracker.with(context, function (t) {
148143
148222
  var importDeclaration = getImportDeclarationForDiagnosticSpan(context.span, context.sourceFile);
148144
148223
  fixSingleImportDeclaration(t, importDeclaration, context);
@@ -148148,7 +148227,7 @@ var ts;
148148
148227
  }
148149
148228
  },
148150
148229
  fixIds: [fixId],
148151
- getAllCodeActions: function (context) {
148230
+ getAllCodeActions: function getAllCodeActionsToConvertToTypeOnlyImport(context) {
148152
148231
  return codefix.codeFixAll(context, errorCodes, function (changes, diag) {
148153
148232
  var importDeclaration = getImportDeclarationForDiagnosticSpan(diag, context.sourceFile);
148154
148233
  fixSingleImportDeclaration(changes, importDeclaration, context);
@@ -148187,7 +148266,7 @@ var ts;
148187
148266
  var errorCodes = [ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0.code];
148188
148267
  codefix.registerCodeFix({
148189
148268
  errorCodes: errorCodes,
148190
- getCodeActions: function (context) {
148269
+ getCodeActions: function getCodeActionsToConvertLiteralTypeToMappedType(context) {
148191
148270
  var sourceFile = context.sourceFile, span = context.span;
148192
148271
  var info = getInfo(sourceFile, span.start);
148193
148272
  if (!info) {
@@ -149331,7 +149410,7 @@ var ts;
149331
149410
  _a);
149332
149411
  codefix.registerCodeFix({
149333
149412
  errorCodes: errorCodes,
149334
- getCodeActions: function (context) {
149413
+ getCodeActions: function getCodeActionsToFixOverrideModifierIssues(context) {
149335
149414
  var errorCode = context.errorCode, span = context.span;
149336
149415
  var info = errorCodeFixIdMap[errorCode];
149337
149416
  if (!info)
@@ -149527,7 +149606,7 @@ var ts;
149527
149606
  ];
149528
149607
  codefix.registerCodeFix({
149529
149608
  errorCodes: errorCodes,
149530
- getCodeActions: function (context) {
149609
+ getCodeActions: function getCodeActionsToFixIncorrectNamedTupleSyntax(context) {
149531
149610
  var sourceFile = context.sourceFile, span = context.span;
149532
149611
  var namedTupleMember = getNamedTupleMember(sourceFile, span.start);
149533
149612
  var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, namedTupleMember); });
@@ -149726,7 +149805,7 @@ var ts;
149726
149805
  codefix.registerCodeFix({
149727
149806
  errorCodes: errorCodes,
149728
149807
  fixIds: [fixIdAddReturnStatement, fixRemoveBracesFromArrowFunctionBody, fixIdWrapTheBlockWithParen],
149729
- getCodeActions: function (context) {
149808
+ getCodeActions: function getCodeActionsToCorrectReturnValue(context) {
149730
149809
  var program = context.program, sourceFile = context.sourceFile, start = context.span.start, errorCode = context.errorCode;
149731
149810
  var info = getInfo(program.getTypeChecker(), sourceFile, start, errorCode);
149732
149811
  if (!info)
@@ -150476,7 +150555,7 @@ var ts;
150476
150555
  ];
150477
150556
  codefix.registerCodeFix({
150478
150557
  errorCodes: errorCodes,
150479
- getCodeActions: function (context) {
150558
+ getCodeActions: function getCodeActionsToFixNotFoundModule(context) {
150480
150559
  var host = context.host, sourceFile = context.sourceFile, start = context.span.start;
150481
150560
  var packageName = tryGetImportedPackageName(sourceFile, start);
150482
150561
  if (packageName === undefined)
@@ -150537,7 +150616,7 @@ var ts;
150537
150616
  var fixId = "fixClassDoesntImplementInheritedAbstractMember";
150538
150617
  codefix.registerCodeFix({
150539
150618
  errorCodes: errorCodes,
150540
- getCodeActions: function (context) {
150619
+ getCodeActions: function getCodeActionsToFixClassNotImplementingInheritedMembers(context) {
150541
150620
  var sourceFile = context.sourceFile, span = context.span;
150542
150621
  var changes = ts.textChanges.ChangeTracker.with(context, function (t) {
150543
150622
  return addMissingMembers(getClass(sourceFile, span.start), sourceFile, context, t, context.preferences);
@@ -150545,7 +150624,7 @@ var ts;
150545
150624
  return changes.length === 0 ? undefined : [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Implement_inherited_abstract_class, fixId, ts.Diagnostics.Implement_all_inherited_abstract_classes)];
150546
150625
  },
150547
150626
  fixIds: [fixId],
150548
- getAllCodeActions: function (context) {
150627
+ getAllCodeActions: function getAllCodeActionsToFixClassDoesntImplementInheritedAbstractMember(context) {
150549
150628
  var seenClassDeclarations = new ts.Map();
150550
150629
  return codefix.codeFixAll(context, errorCodes, function (changes, diag) {
150551
150630
  var classDeclaration = getClass(diag.file, diag.start);
@@ -150678,7 +150757,7 @@ var ts;
150678
150757
  ];
150679
150758
  codefix.registerCodeFix({
150680
150759
  errorCodes: errorCodes,
150681
- getCodeActions: function (context) {
150760
+ getCodeActions: function getCodeActionsToEnableExperimentalDecorators(context) {
150682
150761
  var configFile = context.program.getCompilerOptions().configFile;
150683
150762
  if (configFile === undefined) {
150684
150763
  return undefined;
@@ -150709,7 +150788,7 @@ var ts;
150709
150788
  var errorCodes = [ts.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code];
150710
150789
  codefix.registerCodeFix({
150711
150790
  errorCodes: errorCodes,
150712
- getCodeActions: function (context) {
150791
+ getCodeActions: function getCodeActionsToFixEnableJsxFlag(context) {
150713
150792
  var configFile = context.program.getCompilerOptions().configFile;
150714
150793
  if (configFile === undefined) {
150715
150794
  return undefined;
@@ -150747,7 +150826,7 @@ var ts;
150747
150826
  ts.Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code,
150748
150827
  ts.Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher.code,
150749
150828
  ],
150750
- getCodeActions: function (context) {
150829
+ getCodeActions: function getCodeActionsToFixModuleAndTarget(context) {
150751
150830
  var compilerOptions = context.program.getCompilerOptions();
150752
150831
  var configFile = compilerOptions.configFile;
150753
150832
  if (configFile === undefined) {
@@ -151519,7 +151598,7 @@ var ts;
151519
151598
  return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Add_async_modifier_to_containing_function, fixId, ts.Diagnostics.Add_all_missing_async_modifiers)];
151520
151599
  },
151521
151600
  fixIds: [fixId],
151522
- getAllCodeActions: function (context) {
151601
+ getAllCodeActions: function getAllCodeActionsToFixAwaitInSyncFunction(context) {
151523
151602
  var seen = new ts.Map();
151524
151603
  return codefix.codeFixAll(context, errorCodes, function (changes, diag) {
151525
151604
  var nodes = getNodes(diag.file, diag.start);
@@ -152641,7 +152720,7 @@ var ts;
152641
152720
  codefix.registerCodeFix({
152642
152721
  errorCodes: errorCodes,
152643
152722
  fixIds: [fixId],
152644
- getCodeActions: function (context) {
152723
+ getCodeActions: function getCodeActionsToFixReturnTypeInAsyncFunction(context) {
152645
152724
  var sourceFile = context.sourceFile, program = context.program, span = context.span;
152646
152725
  var checker = program.getTypeChecker();
152647
152726
  var info = getInfo(sourceFile, program.getTypeChecker(), span.start);
@@ -152695,7 +152774,7 @@ var ts;
152695
152774
  });
152696
152775
  codefix.registerCodeFix({
152697
152776
  errorCodes: errorCodes,
152698
- getCodeActions: function (context) {
152777
+ getCodeActions: function getCodeActionsToDisableJsDiagnostics(context) {
152699
152778
  var sourceFile = context.sourceFile, program = context.program, span = context.span, host = context.host, formatContext = context.formatContext;
152700
152779
  if (!ts.isInJSFile(sourceFile) || !ts.isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) {
152701
152780
  return undefined;
@@ -153464,7 +153543,7 @@ var ts;
153464
153543
  var errorCodes = [ts.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code];
153465
153544
  codefix.registerCodeFix({
153466
153545
  errorCodes: errorCodes,
153467
- getCodeActions: function (context) {
153546
+ getCodeActions: function getCodeActionsForStrictClassInitializationErrors(context) {
153468
153547
  var propertyDeclaration = getPropertyDeclaration(context.sourceFile, context.span.start);
153469
153548
  if (!propertyDeclaration)
153470
153549
  return;
@@ -153687,7 +153766,7 @@ var ts;
153687
153766
  ];
153688
153767
  codefix.registerCodeFix({
153689
153768
  errorCodes: errorCodes,
153690
- getCodeActions: function (context) {
153769
+ getCodeActions: function getCodeActionsToUseBigintLiteral(context) {
153691
153770
  var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span); });
153692
153771
  if (changes.length > 0) {
153693
153772
  return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Convert_to_a_bigint_numeric_literal, fixId, ts.Diagnostics.Convert_all_to_bigint_numeric_literals)];
@@ -153719,7 +153798,7 @@ var ts;
153719
153798
  var errorCodes = [ts.Diagnostics.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code];
153720
153799
  codefix.registerCodeFix({
153721
153800
  errorCodes: errorCodes,
153722
- getCodeActions: function (context) {
153801
+ getCodeActions: function getCodeActionsToAddMissingTypeof(context) {
153723
153802
  var sourceFile = context.sourceFile, span = context.span;
153724
153803
  var importType = getImportTypeNode(sourceFile, span.start);
153725
153804
  var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, importType); });
@@ -153751,7 +153830,7 @@ var ts;
153751
153830
  var errorCodes = [ts.Diagnostics.JSX_expressions_must_have_one_parent_element.code];
153752
153831
  codefix.registerCodeFix({
153753
153832
  errorCodes: errorCodes,
153754
- getCodeActions: function (context) {
153833
+ getCodeActions: function getCodeActionsToWrapJsxInFragment(context) {
153755
153834
  var sourceFile = context.sourceFile, span = context.span;
153756
153835
  var node = findNodeToFix(sourceFile, span.start);
153757
153836
  if (!node)
@@ -153823,12 +153902,11 @@ var ts;
153823
153902
  (function (ts) {
153824
153903
  var codefix;
153825
153904
  (function (codefix) {
153826
- var fixIdAddMissingTypeof = "fixConvertToMappedObjectType";
153827
- var fixId = fixIdAddMissingTypeof;
153905
+ var fixId = "fixConvertToMappedObjectType";
153828
153906
  var errorCodes = [ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code];
153829
153907
  codefix.registerCodeFix({
153830
153908
  errorCodes: errorCodes,
153831
- getCodeActions: function (context) {
153909
+ getCodeActions: function getCodeActionsToConvertToMappedTypeObject(context) {
153832
153910
  var sourceFile = context.sourceFile, span = context.span;
153833
153911
  var info = getInfo(sourceFile, span.start);
153834
153912
  if (!info)
@@ -153907,7 +153985,7 @@ var ts;
153907
153985
  ];
153908
153986
  codefix.registerCodeFix({
153909
153987
  errorCodes: errorCodes,
153910
- getCodeActions: function (context) {
153988
+ getCodeActions: function getCodeActionsToRemoveUnnecessaryAwait(context) {
153911
153989
  var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, context.sourceFile, context.span); });
153912
153990
  if (changes.length > 0) {
153913
153991
  return [codefix.createCodeFixAction(fixId, changes, ts.Diagnostics.Remove_unnecessary_await, fixId, ts.Diagnostics.Remove_all_unnecessary_uses_of_await)];
@@ -153949,7 +154027,7 @@ var ts;
153949
154027
  codefix.registerCodeFix({
153950
154028
  errorCodes: errorCodes,
153951
154029
  fixIds: [fixId],
153952
- getCodeActions: function (context) {
154030
+ getCodeActions: function getCodeActionsToSplitTypeOnlyImport(context) {
153953
154031
  var changes = ts.textChanges.ChangeTracker.with(context, function (t) {
153954
154032
  return splitTypeOnlyImport(t, getImportDeclaration(context.sourceFile, context.span), context);
153955
154033
  });
@@ -153985,7 +154063,7 @@ var ts;
153985
154063
  var errorCodes = [ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_constant.code];
153986
154064
  codefix.registerCodeFix({
153987
154065
  errorCodes: errorCodes,
153988
- getCodeActions: function (context) {
154066
+ getCodeActions: function getCodeActionsToConvertConstToLet(context) {
153989
154067
  var sourceFile = context.sourceFile, span = context.span, program = context.program;
153990
154068
  var range = getConstTokenRange(sourceFile, span.start, program);
153991
154069
  if (range === undefined)