typescript 5.0.0-dev.20230209 → 5.0.0-dev.20230211

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
@@ -2287,7 +2287,7 @@ module.exports = __toCommonJS(server_exports);
2287
2287
 
2288
2288
  // src/compiler/corePublic.ts
2289
2289
  var versionMajorMinor = "5.0";
2290
- var version = `${versionMajorMinor}.0-dev.20230209`;
2290
+ var version = `${versionMajorMinor}.0-dev.20230211`;
2291
2291
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2292
2292
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2293
2293
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -9643,6 +9643,7 @@ var Diagnostics = {
9643
9643
  To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module: diag(1483, 3 /* Message */, "To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483", 'To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.'),
9644
9644
  _0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1484, 1 /* Error */, "_0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled_1484", "'{0}' is a type and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."),
9645
9645
  _0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled: diag(1485, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimMo_1485", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'verbatimModuleSyntax' is enabled."),
9646
+ Decorator_used_before_export_here: diag(1486, 1 /* Error */, "Decorator_used_before_export_here_1486", "Decorator used before 'export' here."),
9646
9647
  The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
9647
9648
  The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
9648
9649
  Call_signature_return_types_0_and_1_are_incompatible: diag(
@@ -10999,7 +11000,7 @@ var Diagnostics = {
10999
11000
  You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder: diag(8035, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_a_node_modules_folder_8035", "You cannot rename elements that are defined in a 'node_modules' folder."),
11000
11001
  You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder: diag(8036, 1 /* Error */, "You_cannot_rename_elements_that_are_defined_in_another_node_modules_folder_8036", "You cannot rename elements that are defined in another 'node_modules' folder."),
11001
11002
  Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files: diag(8037, 1 /* Error */, "Type_satisfaction_expressions_can_only_be_used_in_TypeScript_files_8037", "Type satisfaction expressions can only be used in TypeScript files."),
11002
- Decorators_must_come_after_export_or_export_default_in_JavaScript_files: diag(8038, 1 /* Error */, "Decorators_must_come_after_export_or_export_default_in_JavaScript_files_8038", "Decorators must come after 'export' or 'export default' in JavaScript files."),
11003
+ Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export: diag(8038, 1 /* Error */, "Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export_8038", "Decorators may not appear after 'export' or 'export default' if they also appear before 'export'."),
11003
11004
  Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9005, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_An_explicit_type_annotation_may_unblock_9005", "Declaration emit for this file requires using private name '{0}'. An explicit type annotation may unblock declaration emit."),
11004
11005
  Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotation_may_unblock_declaration_emit: diag(9006, 1 /* Error */, "Declaration_emit_for_this_file_requires_using_private_name_0_from_module_1_An_explicit_type_annotati_9006", "Declaration emit for this file requires using private name '{0}' from module '{1}'. An explicit type annotation may unblock declaration emit."),
11005
11006
  JSX_attributes_must_only_be_assigned_a_non_empty_expression: diag(17e3, 1 /* Error */, "JSX_attributes_must_only_be_assigned_a_non_empty_expression_17000", "JSX attributes must only be assigned a non-empty 'expression'."),
@@ -15334,101 +15335,400 @@ function getInternalEmitFlags(node) {
15334
15335
  return emitNode && emitNode.internalFlags || 0;
15335
15336
  }
15336
15337
  function getScriptTargetFeatures() {
15337
- return {
15338
- es2015: {
15339
- Array: ["find", "findIndex", "fill", "copyWithin", "entries", "keys", "values"],
15340
- RegExp: ["flags", "sticky", "unicode"],
15341
- Reflect: ["apply", "construct", "defineProperty", "deleteProperty", "get", " getOwnPropertyDescriptor", "getPrototypeOf", "has", "isExtensible", "ownKeys", "preventExtensions", "set", "setPrototypeOf"],
15342
- ArrayConstructor: ["from", "of"],
15343
- ObjectConstructor: ["assign", "getOwnPropertySymbols", "keys", "is", "setPrototypeOf"],
15344
- NumberConstructor: ["isFinite", "isInteger", "isNaN", "isSafeInteger", "parseFloat", "parseInt"],
15345
- Math: ["clz32", "imul", "sign", "log10", "log2", "log1p", "expm1", "cosh", "sinh", "tanh", "acosh", "asinh", "atanh", "hypot", "trunc", "fround", "cbrt"],
15346
- Map: ["entries", "keys", "values"],
15347
- Set: ["entries", "keys", "values"],
15348
- Promise: emptyArray,
15349
- PromiseConstructor: ["all", "race", "reject", "resolve"],
15350
- Symbol: ["for", "keyFor"],
15351
- WeakMap: ["entries", "keys", "values"],
15352
- WeakSet: ["entries", "keys", "values"],
15353
- Iterator: emptyArray,
15354
- AsyncIterator: emptyArray,
15355
- String: ["codePointAt", "includes", "endsWith", "normalize", "repeat", "startsWith", "anchor", "big", "blink", "bold", "fixed", "fontcolor", "fontsize", "italics", "link", "small", "strike", "sub", "sup"],
15356
- StringConstructor: ["fromCodePoint", "raw"]
15357
- },
15358
- es2016: {
15359
- Array: ["includes"]
15360
- },
15361
- es2017: {
15362
- Atomics: emptyArray,
15363
- SharedArrayBuffer: emptyArray,
15364
- String: ["padStart", "padEnd"],
15365
- ObjectConstructor: ["values", "entries", "getOwnPropertyDescriptors"],
15366
- DateTimeFormat: ["formatToParts"]
15367
- },
15368
- es2018: {
15369
- Promise: ["finally"],
15370
- RegExpMatchArray: ["groups"],
15371
- RegExpExecArray: ["groups"],
15372
- RegExp: ["dotAll"],
15373
- Intl: ["PluralRules"],
15374
- AsyncIterable: emptyArray,
15375
- AsyncIterableIterator: emptyArray,
15376
- AsyncGenerator: emptyArray,
15377
- AsyncGeneratorFunction: emptyArray,
15378
- NumberFormat: ["formatToParts"]
15379
- },
15380
- es2019: {
15381
- Array: ["flat", "flatMap"],
15382
- ObjectConstructor: ["fromEntries"],
15383
- String: ["trimStart", "trimEnd", "trimLeft", "trimRight"],
15384
- Symbol: ["description"]
15385
- },
15386
- es2020: {
15387
- BigInt: emptyArray,
15388
- BigInt64Array: emptyArray,
15389
- BigUint64Array: emptyArray,
15390
- PromiseConstructor: ["allSettled"],
15391
- SymbolConstructor: ["matchAll"],
15392
- String: ["matchAll"],
15393
- DataView: ["setBigInt64", "setBigUint64", "getBigInt64", "getBigUint64"],
15394
- RelativeTimeFormat: ["format", "formatToParts", "resolvedOptions"]
15395
- },
15396
- es2021: {
15397
- PromiseConstructor: ["any"],
15398
- String: ["replaceAll"]
15399
- },
15400
- es2022: {
15401
- Array: ["at"],
15402
- String: ["at"],
15403
- Int8Array: ["at"],
15404
- Uint8Array: ["at"],
15405
- Uint8ClampedArray: ["at"],
15406
- Int16Array: ["at"],
15407
- Uint16Array: ["at"],
15408
- Int32Array: ["at"],
15409
- Uint32Array: ["at"],
15410
- Float32Array: ["at"],
15411
- Float64Array: ["at"],
15412
- BigInt64Array: ["at"],
15413
- BigUint64Array: ["at"],
15414
- ObjectConstructor: ["hasOwn"],
15415
- Error: ["cause"]
15416
- },
15417
- es2023: {
15418
- Array: ["findLastIndex", "findLast"],
15419
- Int8Array: ["findLastIndex", "findLast"],
15420
- Uint8Array: ["findLastIndex", "findLast"],
15421
- Uint8ClampedArray: ["findLastIndex", "findLast"],
15422
- Int16Array: ["findLastIndex", "findLast"],
15423
- Uint16Array: ["findLastIndex", "findLast"],
15424
- Int32Array: ["findLastIndex", "findLast"],
15425
- Uint32Array: ["findLastIndex", "findLast"],
15426
- Float32Array: ["findLastIndex", "findLast"],
15427
- Float64Array: ["findLastIndex", "findLast"],
15428
- BigInt64Array: ["findLastIndex", "findLast"],
15429
- BigUint64Array: ["findLastIndex", "findLast"]
15430
- }
15431
- };
15338
+ return new Map(Object.entries({
15339
+ Array: new Map(Object.entries({
15340
+ es2015: [
15341
+ "find",
15342
+ "findIndex",
15343
+ "fill",
15344
+ "copyWithin",
15345
+ "entries",
15346
+ "keys",
15347
+ "values"
15348
+ ],
15349
+ es2016: [
15350
+ "includes"
15351
+ ],
15352
+ es2019: [
15353
+ "flat",
15354
+ "flatMap"
15355
+ ],
15356
+ es2022: [
15357
+ "at"
15358
+ ],
15359
+ es2023: [
15360
+ "findLastIndex",
15361
+ "findLast"
15362
+ ]
15363
+ })),
15364
+ Iterator: new Map(Object.entries({
15365
+ es2015: emptyArray
15366
+ })),
15367
+ AsyncIterator: new Map(Object.entries({
15368
+ es2015: emptyArray
15369
+ })),
15370
+ Atomics: new Map(Object.entries({
15371
+ es2017: emptyArray
15372
+ })),
15373
+ SharedArrayBuffer: new Map(Object.entries({
15374
+ es2017: emptyArray
15375
+ })),
15376
+ AsyncIterable: new Map(Object.entries({
15377
+ es2018: emptyArray
15378
+ })),
15379
+ AsyncIterableIterator: new Map(Object.entries({
15380
+ es2018: emptyArray
15381
+ })),
15382
+ AsyncGenerator: new Map(Object.entries({
15383
+ es2018: emptyArray
15384
+ })),
15385
+ AsyncGeneratorFunction: new Map(Object.entries({
15386
+ es2018: emptyArray
15387
+ })),
15388
+ RegExp: new Map(Object.entries({
15389
+ es2015: [
15390
+ "flags",
15391
+ "sticky",
15392
+ "unicode"
15393
+ ],
15394
+ es2018: [
15395
+ "dotAll"
15396
+ ]
15397
+ })),
15398
+ Reflect: new Map(Object.entries({
15399
+ es2015: [
15400
+ "apply",
15401
+ "construct",
15402
+ "defineProperty",
15403
+ "deleteProperty",
15404
+ "get",
15405
+ " getOwnPropertyDescriptor",
15406
+ "getPrototypeOf",
15407
+ "has",
15408
+ "isExtensible",
15409
+ "ownKeys",
15410
+ "preventExtensions",
15411
+ "set",
15412
+ "setPrototypeOf"
15413
+ ]
15414
+ })),
15415
+ ArrayConstructor: new Map(Object.entries({
15416
+ es2015: [
15417
+ "from",
15418
+ "of"
15419
+ ]
15420
+ })),
15421
+ ObjectConstructor: new Map(Object.entries({
15422
+ es2015: [
15423
+ "assign",
15424
+ "getOwnPropertySymbols",
15425
+ "keys",
15426
+ "is",
15427
+ "setPrototypeOf"
15428
+ ],
15429
+ es2017: [
15430
+ "values",
15431
+ "entries",
15432
+ "getOwnPropertyDescriptors"
15433
+ ],
15434
+ es2019: [
15435
+ "fromEntries"
15436
+ ],
15437
+ es2022: [
15438
+ "hasOwn"
15439
+ ]
15440
+ })),
15441
+ NumberConstructor: new Map(Object.entries({
15442
+ es2015: [
15443
+ "isFinite",
15444
+ "isInteger",
15445
+ "isNaN",
15446
+ "isSafeInteger",
15447
+ "parseFloat",
15448
+ "parseInt"
15449
+ ]
15450
+ })),
15451
+ Math: new Map(Object.entries({
15452
+ es2015: [
15453
+ "clz32",
15454
+ "imul",
15455
+ "sign",
15456
+ "log10",
15457
+ "log2",
15458
+ "log1p",
15459
+ "expm1",
15460
+ "cosh",
15461
+ "sinh",
15462
+ "tanh",
15463
+ "acosh",
15464
+ "asinh",
15465
+ "atanh",
15466
+ "hypot",
15467
+ "trunc",
15468
+ "fround",
15469
+ "cbrt"
15470
+ ]
15471
+ })),
15472
+ Map: new Map(Object.entries({
15473
+ es2015: [
15474
+ "entries",
15475
+ "keys",
15476
+ "values"
15477
+ ]
15478
+ })),
15479
+ Set: new Map(Object.entries({
15480
+ es2015: [
15481
+ "entries",
15482
+ "keys",
15483
+ "values"
15484
+ ]
15485
+ })),
15486
+ PromiseConstructor: new Map(Object.entries({
15487
+ es2015: [
15488
+ "all",
15489
+ "race",
15490
+ "reject",
15491
+ "resolve"
15492
+ ],
15493
+ es2020: [
15494
+ "allSettled"
15495
+ ],
15496
+ es2021: [
15497
+ "any"
15498
+ ]
15499
+ })),
15500
+ Symbol: new Map(Object.entries({
15501
+ es2015: [
15502
+ "for",
15503
+ "keyFor"
15504
+ ],
15505
+ es2019: [
15506
+ "description"
15507
+ ]
15508
+ })),
15509
+ WeakMap: new Map(Object.entries({
15510
+ es2015: [
15511
+ "entries",
15512
+ "keys",
15513
+ "values"
15514
+ ]
15515
+ })),
15516
+ WeakSet: new Map(Object.entries({
15517
+ es2015: [
15518
+ "entries",
15519
+ "keys",
15520
+ "values"
15521
+ ]
15522
+ })),
15523
+ String: new Map(Object.entries({
15524
+ es2015: [
15525
+ "codePointAt",
15526
+ "includes",
15527
+ "endsWith",
15528
+ "normalize",
15529
+ "repeat",
15530
+ "startsWith",
15531
+ "anchor",
15532
+ "big",
15533
+ "blink",
15534
+ "bold",
15535
+ "fixed",
15536
+ "fontcolor",
15537
+ "fontsize",
15538
+ "italics",
15539
+ "link",
15540
+ "small",
15541
+ "strike",
15542
+ "sub",
15543
+ "sup"
15544
+ ],
15545
+ es2017: [
15546
+ "padStart",
15547
+ "padEnd"
15548
+ ],
15549
+ es2019: [
15550
+ "trimStart",
15551
+ "trimEnd",
15552
+ "trimLeft",
15553
+ "trimRight"
15554
+ ],
15555
+ es2020: [
15556
+ "matchAll"
15557
+ ],
15558
+ es2021: [
15559
+ "replaceAll"
15560
+ ],
15561
+ es2022: [
15562
+ "at"
15563
+ ]
15564
+ })),
15565
+ StringConstructor: new Map(Object.entries({
15566
+ es2015: [
15567
+ "fromCodePoint",
15568
+ "raw"
15569
+ ]
15570
+ })),
15571
+ DateTimeFormat: new Map(Object.entries({
15572
+ es2017: [
15573
+ "formatToParts"
15574
+ ]
15575
+ })),
15576
+ Promise: new Map(Object.entries({
15577
+ es2015: emptyArray,
15578
+ es2018: [
15579
+ "finally"
15580
+ ]
15581
+ })),
15582
+ RegExpMatchArray: new Map(Object.entries({
15583
+ es2018: [
15584
+ "groups"
15585
+ ]
15586
+ })),
15587
+ RegExpExecArray: new Map(Object.entries({
15588
+ es2018: [
15589
+ "groups"
15590
+ ]
15591
+ })),
15592
+ Intl: new Map(Object.entries({
15593
+ es2018: [
15594
+ "PluralRules"
15595
+ ]
15596
+ })),
15597
+ NumberFormat: new Map(Object.entries({
15598
+ es2018: [
15599
+ "formatToParts"
15600
+ ]
15601
+ })),
15602
+ SymbolConstructor: new Map(Object.entries({
15603
+ es2020: [
15604
+ "matchAll"
15605
+ ]
15606
+ })),
15607
+ DataView: new Map(Object.entries({
15608
+ es2020: [
15609
+ "setBigInt64",
15610
+ "setBigUint64",
15611
+ "getBigInt64",
15612
+ "getBigUint64"
15613
+ ]
15614
+ })),
15615
+ BigInt: new Map(Object.entries({
15616
+ es2020: emptyArray
15617
+ })),
15618
+ RelativeTimeFormat: new Map(Object.entries({
15619
+ es2020: [
15620
+ "format",
15621
+ "formatToParts",
15622
+ "resolvedOptions"
15623
+ ]
15624
+ })),
15625
+ Int8Array: new Map(Object.entries({
15626
+ es2022: [
15627
+ "at"
15628
+ ],
15629
+ es2023: [
15630
+ "findLastIndex",
15631
+ "findLast"
15632
+ ]
15633
+ })),
15634
+ Uint8Array: new Map(Object.entries({
15635
+ es2022: [
15636
+ "at"
15637
+ ],
15638
+ es2023: [
15639
+ "findLastIndex",
15640
+ "findLast"
15641
+ ]
15642
+ })),
15643
+ Uint8ClampedArray: new Map(Object.entries({
15644
+ es2022: [
15645
+ "at"
15646
+ ],
15647
+ es2023: [
15648
+ "findLastIndex",
15649
+ "findLast"
15650
+ ]
15651
+ })),
15652
+ Int16Array: new Map(Object.entries({
15653
+ es2022: [
15654
+ "at"
15655
+ ],
15656
+ es2023: [
15657
+ "findLastIndex",
15658
+ "findLast"
15659
+ ]
15660
+ })),
15661
+ Uint16Array: new Map(Object.entries({
15662
+ es2022: [
15663
+ "at"
15664
+ ],
15665
+ es2023: [
15666
+ "findLastIndex",
15667
+ "findLast"
15668
+ ]
15669
+ })),
15670
+ Int32Array: new Map(Object.entries({
15671
+ es2022: [
15672
+ "at"
15673
+ ],
15674
+ es2023: [
15675
+ "findLastIndex",
15676
+ "findLast"
15677
+ ]
15678
+ })),
15679
+ Uint32Array: new Map(Object.entries({
15680
+ es2022: [
15681
+ "at"
15682
+ ],
15683
+ es2023: [
15684
+ "findLastIndex",
15685
+ "findLast"
15686
+ ]
15687
+ })),
15688
+ Float32Array: new Map(Object.entries({
15689
+ es2022: [
15690
+ "at"
15691
+ ],
15692
+ es2023: [
15693
+ "findLastIndex",
15694
+ "findLast"
15695
+ ]
15696
+ })),
15697
+ Float64Array: new Map(Object.entries({
15698
+ es2022: [
15699
+ "at"
15700
+ ],
15701
+ es2023: [
15702
+ "findLastIndex",
15703
+ "findLast"
15704
+ ]
15705
+ })),
15706
+ BigInt64Array: new Map(Object.entries({
15707
+ es2020: emptyArray,
15708
+ es2022: [
15709
+ "at"
15710
+ ],
15711
+ es2023: [
15712
+ "findLastIndex",
15713
+ "findLast"
15714
+ ]
15715
+ })),
15716
+ BigUint64Array: new Map(Object.entries({
15717
+ es2020: emptyArray,
15718
+ es2022: [
15719
+ "at"
15720
+ ],
15721
+ es2023: [
15722
+ "findLastIndex",
15723
+ "findLast"
15724
+ ]
15725
+ })),
15726
+ Error: new Map(Object.entries({
15727
+ es2022: [
15728
+ "cause"
15729
+ ]
15730
+ }))
15731
+ }));
15432
15732
  }
15433
15733
  var GetLiteralTextFlags = /* @__PURE__ */ ((GetLiteralTextFlags2) => {
15434
15734
  GetLiteralTextFlags2[GetLiteralTextFlags2["None"] = 0] = "None";
@@ -26682,14 +26982,114 @@ function createEmitHelperFactory(context) {
26682
26982
  factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name)
26683
26983
  ]);
26684
26984
  }
26985
+ function createESDecorateClassElementAccessGetMethod(elementName) {
26986
+ const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name);
26987
+ return factory2.createPropertyAssignment(
26988
+ "get",
26989
+ factory2.createArrowFunction(
26990
+ /*modifiers*/
26991
+ void 0,
26992
+ /*typeParameters*/
26993
+ void 0,
26994
+ [factory2.createParameterDeclaration(
26995
+ /*modifiers*/
26996
+ void 0,
26997
+ /*dotDotDotToken*/
26998
+ void 0,
26999
+ factory2.createIdentifier("obj")
27000
+ )],
27001
+ /*type*/
27002
+ void 0,
27003
+ /*equalsGreaterThanToken*/
27004
+ void 0,
27005
+ accessor
27006
+ )
27007
+ );
27008
+ }
27009
+ function createESDecorateClassElementAccessSetMethod(elementName) {
27010
+ const accessor = elementName.computed ? factory2.createElementAccessExpression(factory2.createIdentifier("obj"), elementName.name) : factory2.createPropertyAccessExpression(factory2.createIdentifier("obj"), elementName.name);
27011
+ return factory2.createPropertyAssignment(
27012
+ "set",
27013
+ factory2.createArrowFunction(
27014
+ /*modifiers*/
27015
+ void 0,
27016
+ /*typeParameters*/
27017
+ void 0,
27018
+ [
27019
+ factory2.createParameterDeclaration(
27020
+ /*modifiers*/
27021
+ void 0,
27022
+ /*dotDotDotToken*/
27023
+ void 0,
27024
+ factory2.createIdentifier("obj")
27025
+ ),
27026
+ factory2.createParameterDeclaration(
27027
+ /*modifiers*/
27028
+ void 0,
27029
+ /*dotDotDotToken*/
27030
+ void 0,
27031
+ factory2.createIdentifier("value")
27032
+ )
27033
+ ],
27034
+ /*type*/
27035
+ void 0,
27036
+ /*equalsGreaterThanToken*/
27037
+ void 0,
27038
+ factory2.createBlock([
27039
+ factory2.createExpressionStatement(
27040
+ factory2.createAssignment(
27041
+ accessor,
27042
+ factory2.createIdentifier("value")
27043
+ )
27044
+ )
27045
+ ])
27046
+ )
27047
+ );
27048
+ }
27049
+ function createESDecorateClassElementAccessHasMethod(elementName) {
27050
+ const propertyName = elementName.computed ? elementName.name : isIdentifier(elementName.name) ? factory2.createStringLiteralFromNode(elementName.name) : elementName.name;
27051
+ return factory2.createPropertyAssignment(
27052
+ "has",
27053
+ factory2.createArrowFunction(
27054
+ /*modifiers*/
27055
+ void 0,
27056
+ /*typeParameters*/
27057
+ void 0,
27058
+ [factory2.createParameterDeclaration(
27059
+ /*modifiers*/
27060
+ void 0,
27061
+ /*dotDotDotToken*/
27062
+ void 0,
27063
+ factory2.createIdentifier("obj")
27064
+ )],
27065
+ /*type*/
27066
+ void 0,
27067
+ /*equalsGreaterThanToken*/
27068
+ void 0,
27069
+ factory2.createBinaryExpression(
27070
+ propertyName,
27071
+ 101 /* InKeyword */,
27072
+ factory2.createIdentifier("obj")
27073
+ )
27074
+ )
27075
+ );
27076
+ }
27077
+ function createESDecorateClassElementAccessObject(name, access) {
27078
+ const properties = [];
27079
+ properties.push(createESDecorateClassElementAccessHasMethod(name));
27080
+ if (access.get)
27081
+ properties.push(createESDecorateClassElementAccessGetMethod(name));
27082
+ if (access.set)
27083
+ properties.push(createESDecorateClassElementAccessSetMethod(name));
27084
+ return factory2.createObjectLiteralExpression(properties);
27085
+ }
26685
27086
  function createESDecorateClassElementContextObject(contextIn) {
26686
27087
  return factory2.createObjectLiteralExpression([
26687
27088
  factory2.createPropertyAssignment(factory2.createIdentifier("kind"), factory2.createStringLiteral(contextIn.kind)),
26688
27089
  factory2.createPropertyAssignment(factory2.createIdentifier("name"), contextIn.name.computed ? contextIn.name.name : factory2.createStringLiteralFromNode(contextIn.name.name)),
26689
27090
  factory2.createPropertyAssignment(factory2.createIdentifier("static"), contextIn.static ? factory2.createTrue() : factory2.createFalse()),
26690
- factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse())
26691
- // Disabled, pending resolution of https://github.com/tc39/proposal-decorators/issues/494
26692
- // factory.createPropertyAssignment(factory.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access))
27091
+ factory2.createPropertyAssignment(factory2.createIdentifier("private"), contextIn.private ? factory2.createTrue() : factory2.createFalse()),
27092
+ factory2.createPropertyAssignment(factory2.createIdentifier("access"), createESDecorateClassElementAccessObject(contextIn.name, contextIn.access))
26693
27093
  ]);
26694
27094
  }
26695
27095
  function createESDecorateContextObject(contextIn) {
@@ -33143,6 +33543,12 @@ var Parser;
33143
33543
  case 114 /* VoidKeyword */:
33144
33544
  return parseVoidExpression();
33145
33545
  case 29 /* LessThanToken */:
33546
+ if (languageVariant === 1 /* JSX */) {
33547
+ return parseJsxElementOrSelfClosingElementOrFragment(
33548
+ /*inExpressionContext*/
33549
+ true
33550
+ );
33551
+ }
33146
33552
  return parseTypeAssertion();
33147
33553
  case 133 /* AwaitKeyword */:
33148
33554
  if (isAwaitExpression2()) {
@@ -33514,6 +33920,7 @@ var Parser;
33514
33920
  return finishNode(factory2.createJsxJsxClosingFragment(), pos);
33515
33921
  }
33516
33922
  function parseTypeAssertion() {
33923
+ Debug.assert(scriptKind === 3 /* TS */, "Type assertions should never be parsed outside of TS; they should either be comparisons or JSX.");
33517
33924
  const pos = getNodePos();
33518
33925
  parseExpected(29 /* LessThanToken */);
33519
33926
  const type = parseType();
@@ -34864,17 +35271,25 @@ var Parser;
34864
35271
  function parseModifiers(allowDecorators, permitConstAsModifier, stopOnStartOfClassStaticBlock) {
34865
35272
  const pos = getNodePos();
34866
35273
  let list;
34867
- let modifier, hasSeenStaticModifier = false;
35274
+ let decorator, modifier, hasSeenStaticModifier = false, hasLeadingModifier = false, hasTrailingDecorator = false;
35275
+ if (allowDecorators && token() === 59 /* AtToken */) {
35276
+ while (decorator = tryParseDecorator()) {
35277
+ list = append(list, decorator);
35278
+ }
35279
+ }
34868
35280
  while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) {
34869
35281
  if (modifier.kind === 124 /* StaticKeyword */)
34870
35282
  hasSeenStaticModifier = true;
34871
35283
  list = append(list, modifier);
35284
+ hasLeadingModifier = true;
34872
35285
  }
34873
- if (allowDecorators && token() === 59 /* AtToken */) {
34874
- let decorator;
35286
+ if (hasLeadingModifier && allowDecorators && token() === 59 /* AtToken */) {
34875
35287
  while (decorator = tryParseDecorator()) {
34876
35288
  list = append(list, decorator);
35289
+ hasTrailingDecorator = true;
34877
35290
  }
35291
+ }
35292
+ if (hasTrailingDecorator) {
34878
35293
  while (modifier = tryParseModifier(hasSeenStaticModifier, permitConstAsModifier, stopOnStartOfClassStaticBlock)) {
34879
35294
  if (modifier.kind === 124 /* StaticKeyword */)
34880
35295
  hasSeenStaticModifier = true;
@@ -47456,6 +47871,7 @@ function createTypeChecker(host) {
47456
47871
  let flowTypeCache;
47457
47872
  const contextualTypeNodes = [];
47458
47873
  const contextualTypes = [];
47874
+ const contextualIsCache = [];
47459
47875
  let contextualTypeCount = 0;
47460
47876
  const inferenceContextNodes = [];
47461
47877
  const inferenceContexts = [];
@@ -59892,7 +60308,7 @@ function createTypeChecker(host) {
59892
60308
  }
59893
60309
  }
59894
60310
  function removeStringLiteralsMatchedByTemplateLiterals(types) {
59895
- const templates = filter(types, isPatternLiteralType);
60311
+ const templates = filter(types, (t) => !!(t.flags & 134217728 /* TemplateLiteral */) && isPatternLiteralType(t));
59896
60312
  if (templates.length) {
59897
60313
  let i = types.length;
59898
60314
  while (i > 0) {
@@ -62417,7 +62833,12 @@ function createTypeChecker(host) {
62417
62833
  }
62418
62834
  }
62419
62835
  function checkExpressionForMutableLocationWithContextualType(next, sourcePropType) {
62420
- pushContextualType(next, sourcePropType);
62836
+ pushContextualType(
62837
+ next,
62838
+ sourcePropType,
62839
+ /*isCache*/
62840
+ false
62841
+ );
62421
62842
  const result = checkExpressionForMutableLocation(next, 1 /* Contextual */);
62422
62843
  popContextualType();
62423
62844
  return result;
@@ -62725,7 +63146,12 @@ function createTypeChecker(host) {
62725
63146
  if (isTupleLikeType(source)) {
62726
63147
  return elaborateElementwise(generateLimitedTupleElements(node, target), source, target, relation, containingMessageChain, errorOutputContainer);
62727
63148
  }
62728
- pushContextualType(node, target);
63149
+ pushContextualType(
63150
+ node,
63151
+ target,
63152
+ /*isCache*/
63153
+ false
63154
+ );
62729
63155
  const tupleizedType = checkArrayLiteral(
62730
63156
  node,
62731
63157
  1 /* Contextual */,
@@ -68415,10 +68841,12 @@ function createTypeChecker(host) {
68415
68841
  }
68416
68842
  function isConstantReference(node) {
68417
68843
  switch (node.kind) {
68418
- case 79 /* Identifier */: {
68419
- const symbol = getResolvedSymbol(node);
68420
- return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
68421
- }
68844
+ case 79 /* Identifier */:
68845
+ if (!isThisInTypeQuery(node)) {
68846
+ const symbol = getResolvedSymbol(node);
68847
+ return isConstVariable(symbol) || isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
68848
+ }
68849
+ break;
68422
68850
  case 208 /* PropertyAccessExpression */:
68423
68851
  case 209 /* ElementAccessExpression */:
68424
68852
  return isConstantReference(node.expression) && isReadonlySymbol(getNodeLinks(node).resolvedSymbol || unknownSymbol);
@@ -70772,11 +71200,13 @@ function createTypeChecker(host) {
70772
71200
  if (node.flags & 33554432 /* InWithStatement */) {
70773
71201
  return void 0;
70774
71202
  }
70775
- const index = findContextualNode(node);
71203
+ const index = findContextualNode(
71204
+ node,
71205
+ /*includeCaches*/
71206
+ !contextFlags
71207
+ );
70776
71208
  if (index >= 0) {
70777
- const cached = contextualTypes[index];
70778
- if (cached || !contextFlags)
70779
- return cached;
71209
+ return contextualTypes[index];
70780
71210
  }
70781
71211
  const { parent: parent2 } = node;
70782
71212
  switch (parent2.kind) {
@@ -70847,17 +71277,30 @@ function createTypeChecker(host) {
70847
71277
  }
70848
71278
  return void 0;
70849
71279
  }
70850
- function pushContextualType(node, type) {
71280
+ function pushCachedContextualType(node) {
71281
+ pushContextualType(
71282
+ node,
71283
+ getContextualType2(
71284
+ node,
71285
+ /*contextFlags*/
71286
+ void 0
71287
+ ),
71288
+ /*isCache*/
71289
+ true
71290
+ );
71291
+ }
71292
+ function pushContextualType(node, type, isCache) {
70851
71293
  contextualTypeNodes[contextualTypeCount] = node;
70852
71294
  contextualTypes[contextualTypeCount] = type;
71295
+ contextualIsCache[contextualTypeCount] = isCache;
70853
71296
  contextualTypeCount++;
70854
71297
  }
70855
71298
  function popContextualType() {
70856
71299
  contextualTypeCount--;
70857
71300
  }
70858
- function findContextualNode(node) {
71301
+ function findContextualNode(node, includeCaches) {
70859
71302
  for (let i = contextualTypeCount - 1; i >= 0; i--) {
70860
- if (node === contextualTypeNodes[i]) {
71303
+ if (node === contextualTypeNodes[i] && (includeCaches || !contextualIsCache[i])) {
70861
71304
  return i;
70862
71305
  }
70863
71306
  }
@@ -70880,7 +71323,11 @@ function createTypeChecker(host) {
70880
71323
  }
70881
71324
  function getContextualJsxElementAttributesType(node, contextFlags) {
70882
71325
  if (isJsxOpeningElement(node) && contextFlags !== 4 /* Completions */) {
70883
- const index = findContextualNode(node.parent);
71326
+ const index = findContextualNode(
71327
+ node.parent,
71328
+ /*includeCaches*/
71329
+ !contextFlags
71330
+ );
70884
71331
  if (index >= 0) {
70885
71332
  return contextualTypes[index];
70886
71333
  }
@@ -71151,11 +71598,7 @@ function createTypeChecker(host) {
71151
71598
  const elementCount = elements.length;
71152
71599
  const elementTypes = [];
71153
71600
  const elementFlags = [];
71154
- pushContextualType(node, getContextualType2(
71155
- node,
71156
- /*contextFlags*/
71157
- void 0
71158
- ));
71601
+ pushCachedContextualType(node);
71159
71602
  const inDestructuringPattern = isAssignmentTarget(node);
71160
71603
  const inConstContext = isConstContext(node);
71161
71604
  const contextualType = getApparentTypeOfContextualType(
@@ -71318,11 +71761,7 @@ function createTypeChecker(host) {
71318
71761
  let propertiesTable = createSymbolTable();
71319
71762
  let propertiesArray = [];
71320
71763
  let spread = emptyObjectType;
71321
- pushContextualType(node, getContextualType2(
71322
- node,
71323
- /*contextFlags*/
71324
- void 0
71325
- ));
71764
+ pushCachedContextualType(node);
71326
71765
  const contextualType = getApparentTypeOfContextualType(
71327
71766
  node,
71328
71767
  /*contextFlags*/
@@ -72662,26 +73101,22 @@ function createTypeChecker(host) {
72662
73101
  function getSuggestedLibForNonExistentName(name) {
72663
73102
  const missingName = diagnosticName(name);
72664
73103
  const allFeatures = getScriptTargetFeatures();
72665
- const libTargets = getOwnKeys(allFeatures);
72666
- for (const libTarget of libTargets) {
72667
- const containingTypes = getOwnKeys(allFeatures[libTarget]);
72668
- if (containingTypes !== void 0 && contains(containingTypes, missingName)) {
72669
- return libTarget;
72670
- }
72671
- }
73104
+ const typeFeatures = allFeatures.get(missingName);
73105
+ return typeFeatures && firstIterator(typeFeatures.keys());
72672
73106
  }
72673
73107
  function getSuggestedLibForNonExistentProperty(missingProperty, containingType) {
72674
73108
  const container = getApparentType(containingType).symbol;
72675
73109
  if (!container) {
72676
73110
  return void 0;
72677
73111
  }
73112
+ const containingTypeName = symbolName(container);
72678
73113
  const allFeatures = getScriptTargetFeatures();
72679
- const libTargets = getOwnKeys(allFeatures);
72680
- for (const libTarget of libTargets) {
72681
- const featuresOfLib = allFeatures[libTarget];
72682
- const featuresOfContainingType = featuresOfLib[symbolName(container)];
72683
- if (featuresOfContainingType !== void 0 && contains(featuresOfContainingType, missingProperty)) {
72684
- return libTarget;
73114
+ const typeFeatures = allFeatures.get(containingTypeName);
73115
+ if (typeFeatures) {
73116
+ for (const [libTarget, featuresOfType] of typeFeatures) {
73117
+ if (contains(featuresOfType, missingProperty)) {
73118
+ return libTarget;
73119
+ }
72685
73120
  }
72686
73121
  }
72687
73122
  }
@@ -77337,14 +77772,19 @@ function createTypeChecker(host) {
77337
77772
  return !!(type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */) || type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 402653316 /* StringLike */));
77338
77773
  }
77339
77774
  function getContextNode2(node) {
77340
- if (node.kind === 289 /* JsxAttributes */ && !isJsxSelfClosingElement(node.parent)) {
77775
+ if (isJsxAttributes(node) && !isJsxSelfClosingElement(node.parent)) {
77341
77776
  return node.parent.parent;
77342
77777
  }
77343
77778
  return node;
77344
77779
  }
77345
77780
  function checkExpressionWithContextualType(node, contextualType, inferenceContext, checkMode) {
77346
77781
  const contextNode = getContextNode2(node);
77347
- pushContextualType(contextNode, contextualType);
77782
+ pushContextualType(
77783
+ contextNode,
77784
+ contextualType,
77785
+ /*isCache*/
77786
+ false
77787
+ );
77348
77788
  pushInferenceContext(contextNode, inferenceContext);
77349
77789
  const type = checkExpression(node, checkMode | 1 /* Contextual */ | (inferenceContext ? 2 /* Inferential */ : 0));
77350
77790
  if (inferenceContext && inferenceContext.intraExpressionInferenceSites) {
@@ -77685,7 +78125,12 @@ function createTypeChecker(host) {
77685
78125
  if (links.contextFreeType) {
77686
78126
  return links.contextFreeType;
77687
78127
  }
77688
- pushContextualType(node, anyType);
78128
+ pushContextualType(
78129
+ node,
78130
+ anyType,
78131
+ /*isCache*/
78132
+ false
78133
+ );
77689
78134
  const type = links.contextFreeType = checkExpression(node, 4 /* SkipContextSensitive */);
77690
78135
  popContextualType();
77691
78136
  return type;
@@ -85139,6 +85584,7 @@ function createTypeChecker(host) {
85139
85584
  let lastStatic, lastDeclare, lastAsync, lastOverride, firstDecorator;
85140
85585
  let flags = 0 /* None */;
85141
85586
  let sawExportBeforeDecorators = false;
85587
+ let hasLeadingDecorators = false;
85142
85588
  for (const modifier of node.modifiers) {
85143
85589
  if (isDecorator(modifier)) {
85144
85590
  if (!nodeCanBeDecorated(legacyDecorators, node, node.parent, node.parent.parent)) {
@@ -85156,8 +85602,22 @@ function createTypeChecker(host) {
85156
85602
  if (flags & ~(1025 /* ExportDefault */ | 131072 /* Decorator */)) {
85157
85603
  return grammarErrorOnNode(modifier, Diagnostics.Decorators_are_not_valid_here);
85158
85604
  }
85605
+ if (hasLeadingDecorators && flags & 126975 /* Modifier */) {
85606
+ Debug.assertIsDefined(firstDecorator);
85607
+ const sourceFile = getSourceFileOfNode(modifier);
85608
+ if (!hasParseDiagnostics(sourceFile)) {
85609
+ addRelatedInfo(
85610
+ error(modifier, Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),
85611
+ createDiagnosticForNode(firstDecorator, Diagnostics.Decorator_used_before_export_here)
85612
+ );
85613
+ return true;
85614
+ }
85615
+ return false;
85616
+ }
85159
85617
  flags |= 131072 /* Decorator */;
85160
- if (flags & 1 /* Export */) {
85618
+ if (!(flags & 126975 /* Modifier */)) {
85619
+ hasLeadingDecorators = true;
85620
+ } else if (flags & 1 /* Export */) {
85161
85621
  sawExportBeforeDecorators = true;
85162
85622
  }
85163
85623
  firstDecorator != null ? firstDecorator : firstDecorator = modifier;
@@ -118320,11 +118780,19 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
118320
118780
  diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here));
118321
118781
  } else if (isClassDeclaration(parent2)) {
118322
118782
  const exportIndex = findIndex(parent2.modifiers, isExportModifier);
118323
- const defaultIndex = findIndex(parent2.modifiers, isDefaultModifier);
118324
- if (exportIndex >= 0 && decoratorIndex < exportIndex) {
118325
- diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_must_come_after_export_or_export_default_in_JavaScript_files));
118326
- } else if (defaultIndex >= 0 && decoratorIndex < defaultIndex) {
118327
- diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here));
118783
+ if (exportIndex >= 0) {
118784
+ const defaultIndex = findIndex(parent2.modifiers, isDefaultModifier);
118785
+ if (decoratorIndex > exportIndex && defaultIndex >= 0 && decoratorIndex < defaultIndex) {
118786
+ diagnostics.push(createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorators_are_not_valid_here));
118787
+ } else if (exportIndex >= 0 && decoratorIndex < exportIndex) {
118788
+ const trailingDecoratorIndex = findIndex(parent2.modifiers, isDecorator, exportIndex);
118789
+ if (trailingDecoratorIndex >= 0) {
118790
+ diagnostics.push(addRelatedInfo(
118791
+ createDiagnosticForNode2(parent2.modifiers[trailingDecoratorIndex], Diagnostics.Decorators_may_not_appear_after_export_or_export_default_if_they_also_appear_before_export),
118792
+ createDiagnosticForNode2(parent2.modifiers[decoratorIndex], Diagnostics.Decorator_used_before_export_here)
118793
+ ));
118794
+ }
118795
+ }
118328
118796
  }
118329
118797
  }
118330
118798
  }
@@ -129430,10 +129898,13 @@ function needsNameFromDeclaration(symbol) {
129430
129898
  return !(symbol.flags & 33554432 /* Transient */) && (symbol.escapedName === "export=" /* ExportEquals */ || symbol.escapedName === "default" /* Default */);
129431
129899
  }
129432
129900
  function getDefaultLikeExportNameFromDeclaration(symbol) {
129433
- return firstDefined(symbol.declarations, (d) => {
129434
- var _a2;
129435
- return isExportAssignment(d) ? (_a2 = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a2.text : void 0;
129436
- });
129901
+ return firstDefined(
129902
+ symbol.declarations,
129903
+ (d) => {
129904
+ var _a2, _b;
129905
+ return isExportAssignment(d) ? (_a2 = tryCast(skipOuterExpressions(d.expression), isIdentifier)) == null ? void 0 : _a2.text : (_b = tryCast(getNameOfDeclaration(d), isIdentifier)) == null ? void 0 : _b.text;
129906
+ }
129907
+ );
129437
129908
  }
129438
129909
  function getSymbolParentOrFail(symbol) {
129439
129910
  var _a2;
@@ -140792,6 +141263,7 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre
140792
141263
  sourceFile,
140793
141264
  symbol,
140794
141265
  symbolName2,
141266
+ moduleSymbol,
140795
141267
  /*isJsxTagName*/
140796
141268
  false,
140797
141269
  program,
@@ -140803,7 +141275,6 @@ function createImportAdderWorker(sourceFile, program, useAutoImportProvider, pre
140803
141275
  const fix = getImportFixForSymbol(
140804
141276
  sourceFile,
140805
141277
  Debug.checkDefined(exportInfo),
140806
- moduleSymbol,
140807
141278
  program,
140808
141279
  /*position*/
140809
141280
  void 0,
@@ -140981,13 +141452,19 @@ function createImportSpecifierResolver(importingFile, program, host, preferences
140981
141452
  return result && { ...result, computedWithoutCacheCount };
140982
141453
  }
140983
141454
  }
140984
- function getImportCompletionAction(targetSymbol, moduleSymbol, sourceFile, symbolName2, isJsxTagName, host, program, formatContext, position, preferences, cancellationToken) {
141455
+ function getImportCompletionAction(targetSymbol, moduleSymbol, exportMapKey, sourceFile, symbolName2, isJsxTagName, host, program, formatContext, position, preferences, cancellationToken) {
140985
141456
  const compilerOptions = program.getCompilerOptions();
140986
- const exportInfos = pathIsBareSpecifier(stripQuotes(moduleSymbol.name)) ? [getSingleExportInfoForSymbol(targetSymbol, moduleSymbol, program, host)] : getAllExportInfoForSymbol(sourceFile, targetSymbol, symbolName2, isJsxTagName, program, host, preferences, cancellationToken);
140987
- Debug.assertIsDefined(exportInfos);
141457
+ let exportInfos;
141458
+ if (exportMapKey) {
141459
+ exportInfos = getExportInfoMap(sourceFile, host, program, preferences, cancellationToken).get(sourceFile.path, exportMapKey);
141460
+ Debug.assertIsDefined(exportInfos, "Some exportInfo should match the specified exportMapKey");
141461
+ } else {
141462
+ exportInfos = pathIsBareSpecifier(stripQuotes(moduleSymbol.name)) ? [getSingleExportInfoForSymbol(targetSymbol, symbolName2, moduleSymbol, program, host)] : getAllExportInfoForSymbol(sourceFile, targetSymbol, symbolName2, moduleSymbol, isJsxTagName, program, host, preferences, cancellationToken);
141463
+ Debug.assertIsDefined(exportInfos, "Some exportInfo should match the specified symbol / moduleSymbol");
141464
+ }
140988
141465
  const useRequire = shouldUseRequire(sourceFile, program);
140989
141466
  const isValidTypeOnlyUseSite = isValidTypeOnlyAliasUseSite(getTokenAtPosition(sourceFile, position));
140990
- const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences));
141467
+ const fix = Debug.checkDefined(getImportFixForSymbol(sourceFile, exportInfos, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences));
140991
141468
  return {
140992
141469
  moduleSpecifier: fix.moduleSpecifier,
140993
141470
  codeAction: codeFixActionToCodeAction(codeActionForFix(
@@ -141009,23 +141486,22 @@ function getPromoteTypeOnlyCompletionAction(sourceFile, symbolToken, program, ho
141009
141486
  const includeSymbolNameInDescription = symbolName2 !== symbolToken.text;
141010
141487
  return fix && codeFixActionToCodeAction(codeActionForFix({ host, formatContext, preferences }, sourceFile, symbolName2, fix, includeSymbolNameInDescription, compilerOptions, preferences));
141011
141488
  }
141012
- function getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences) {
141013
- Debug.assert(exportInfos.some((info) => info.moduleSymbol === moduleSymbol || info.symbol.parent === moduleSymbol), "Some exportInfo should match the specified moduleSymbol");
141489
+ function getImportFixForSymbol(sourceFile, exportInfos, program, position, isValidTypeOnlyUseSite, useRequire, host, preferences) {
141014
141490
  const packageJsonImportFilter = createPackageJsonImportFilter(sourceFile, preferences, host);
141015
141491
  return getBestFix(getImportFixes(exportInfos, position, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences).fixes, sourceFile, program, packageJsonImportFilter, host);
141016
141492
  }
141017
141493
  function codeFixActionToCodeAction({ description: description2, changes, commands }) {
141018
141494
  return { description: description2, changes, commands };
141019
141495
  }
141020
- function getAllExportInfoForSymbol(importingFile, symbol, symbolName2, preferCapitalized, program, host, preferences, cancellationToken) {
141496
+ function getAllExportInfoForSymbol(importingFile, symbol, symbolName2, moduleSymbol, preferCapitalized, program, host, preferences, cancellationToken) {
141021
141497
  const getChecker = createGetChecker(program, host);
141022
141498
  return getExportInfoMap(importingFile, host, program, preferences, cancellationToken).search(importingFile.path, preferCapitalized, (name) => name === symbolName2, (info) => {
141023
- if (skipAlias(info[0].symbol, getChecker(info[0].isFromPackageJson)) === symbol) {
141499
+ if (skipAlias(info[0].symbol, getChecker(info[0].isFromPackageJson)) === symbol && info.some((i) => i.moduleSymbol === moduleSymbol || i.symbol.parent === moduleSymbol)) {
141024
141500
  return info;
141025
141501
  }
141026
141502
  });
141027
141503
  }
141028
- function getSingleExportInfoForSymbol(symbol, moduleSymbol, program, host) {
141504
+ function getSingleExportInfoForSymbol(symbol, symbolName2, moduleSymbol, program, host) {
141029
141505
  var _a2, _b;
141030
141506
  const compilerOptions = program.getCompilerOptions();
141031
141507
  const mainProgramInfo = getInfoWithChecker(
@@ -141047,7 +141523,7 @@ function getSingleExportInfoForSymbol(symbol, moduleSymbol, program, host) {
141047
141523
  if (defaultInfo && skipAlias(defaultInfo.symbol, checker) === symbol) {
141048
141524
  return { symbol: defaultInfo.symbol, moduleSymbol, moduleFileName: void 0, exportKind: defaultInfo.exportKind, targetFlags: skipAlias(symbol, checker).flags, isFromPackageJson };
141049
141525
  }
141050
- const named = checker.tryGetMemberInModuleExportsAndProperties(symbol.name, moduleSymbol);
141526
+ const named = checker.tryGetMemberInModuleExportsAndProperties(symbolName2, moduleSymbol);
141051
141527
  if (named && skipAlias(named, checker) === symbol) {
141052
141528
  return { symbol: named, moduleSymbol, moduleFileName: void 0, exportKind: 0 /* Named */, targetFlags: skipAlias(symbol, checker).flags, isFromPackageJson };
141053
141529
  }
@@ -148706,6 +149182,7 @@ function originToCompletionEntryData(origin) {
148706
149182
  if (originIsResolvedExport(origin)) {
148707
149183
  const resolvedData = {
148708
149184
  exportName: origin.exportName,
149185
+ exportMapKey: origin.exportMapKey,
148709
149186
  moduleSpecifier: origin.moduleSpecifier,
148710
149187
  ambientModuleName,
148711
149188
  fileName: origin.fileName,
@@ -148729,6 +149206,7 @@ function completionEntryDataToSymbolOriginInfo(data, completionName, moduleSymbo
148729
149206
  const resolvedOrigin = {
148730
149207
  kind: 32 /* ResolvedExport */,
148731
149208
  exportName: data.exportName,
149209
+ exportMapKey: data.exportMapKey,
148732
149210
  moduleSpecifier: data.moduleSpecifier,
148733
149211
  symbolName: completionName,
148734
149212
  fileName: data.fileName,
@@ -149107,6 +149585,7 @@ function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextTo
149107
149585
  const { moduleSpecifier, codeAction } = ts_codefix_exports.getImportCompletionAction(
149108
149586
  targetSymbol,
149109
149587
  moduleSymbol,
149588
+ data == null ? void 0 : data.exportMapKey,
149110
149589
  sourceFile,
149111
149590
  name,
149112
149591
  isJsxOpeningTagName,
@@ -149805,16 +150284,16 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
149805
150284
  if (detailsEntryId && !some(info, (i) => detailsEntryId.source === stripQuotes(i.moduleSymbol.name))) {
149806
150285
  return;
149807
150286
  }
149808
- const firstImportableExportInfo = find(info, isImportableExportInfo);
149809
- if (!firstImportableExportInfo) {
150287
+ info = filter(info, isImportableExportInfo);
150288
+ if (!info.length) {
149810
150289
  return;
149811
150290
  }
149812
150291
  const result = context.tryResolve(info, isFromAmbientModule) || {};
149813
150292
  if (result === "failed")
149814
150293
  return;
149815
- let exportInfo2 = firstImportableExportInfo, moduleSpecifier;
150294
+ let exportInfo2 = info[0], moduleSpecifier;
149816
150295
  if (result !== "skipped") {
149817
- ({ exportInfo: exportInfo2 = firstImportableExportInfo, moduleSpecifier } = result);
150296
+ ({ exportInfo: exportInfo2 = info[0], moduleSpecifier } = result);
149818
150297
  }
149819
150298
  const isDefaultExport = exportInfo2.exportKind === 1 /* Default */;
149820
150299
  const symbol = isDefaultExport && getLocalSymbolForExportDefault(exportInfo2.symbol) || exportInfo2.symbol;
@@ -149978,7 +150457,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
149978
150457
  return false;
149979
150458
  }
149980
150459
  function isInStringOrRegularExpressionOrTemplateLiteral(contextToken2) {
149981
- return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(createTextRangeFromSpan(createTextSpanFromNode(contextToken2)), position) || position === contextToken2.end && (!!contextToken2.isUnterminated || isRegularExpressionLiteral(contextToken2)));
150460
+ return (isRegularExpressionLiteral(contextToken2) || isStringTextContainingNode(contextToken2)) && (rangeContainsPositionExclusive(contextToken2, position) || position === contextToken2.end && (!!contextToken2.isUnterminated || isRegularExpressionLiteral(contextToken2)));
149982
150461
  }
149983
150462
  function tryGetObjectTypeLiteralInTypeArgumentCompletionSymbols() {
149984
150463
  const typeLiteralNode = tryGetTypeLiteralNode(contextToken);