@artel/artc 0.6.25223 → 0.6.25224

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.
Files changed (43) hide show
  1. package/build/Cli.js +3 -3
  2. package/build/api/Api.js +6 -2
  3. package/build/api/ApiNodeJS.js +3 -3
  4. package/build/api/ApiServices.js +627 -498
  5. package/build/{chunk-DZNNWICP.js → chunk-24QZJOMF.js} +4575 -3937
  6. package/build/{chunk-AX3LQ2CF.js → chunk-62KHK23H.js} +2 -2
  7. package/build/{chunk-LG4Z4SWO.js → chunk-Y6DODJCG.js} +1 -1
  8. package/build/types/analysis/AnalyzedTranslationPackage.d.ts +1 -0
  9. package/build/types/analysis/Analyzer.d.ts +11 -5
  10. package/build/types/analysis/DiagnosticCollector.d.ts +1 -1
  11. package/build/types/analysis/ImportedPackageNameTree.d.ts +1 -0
  12. package/build/types/analysis/NamedTypeResolver.d.ts +5 -1
  13. package/build/types/analysis/NamedTypeSpecifierResolver.d.ts +4 -1
  14. package/build/types/analysis/PropertyAccessExpressionMeaning.d.ts +8 -2
  15. package/build/types/analysis/TagMeaning.d.ts +4 -1
  16. package/build/types/analysis/TypeNarrower.d.ts +21 -21
  17. package/build/types/analysis/Utils.d.ts +12 -0
  18. package/build/types/analysis/control-flow/GraphBuilder.d.ts +43 -0
  19. package/build/types/analysis/{ControlFlowGraphVisualizer.d.ts → control-flow/GraphVisualizer.d.ts} +3 -3
  20. package/build/types/analysis/control-flow/NarrowableExpression.d.ts +5 -0
  21. package/build/types/analysis/control-flow/Nodes.d.ts +91 -0
  22. package/build/types/analysis/control-flow/index.d.ts +4 -0
  23. package/build/types/common/HelperPhrases.d.ts +3 -2
  24. package/build/types/diagnostic/DiagnosticCode.d.ts +5 -5
  25. package/build/types/emitter/Entities.d.ts +5 -4
  26. package/build/types/emitter/ir/Nodes.d.ts +2 -2
  27. package/build/types/services/CompletionService.d.ts +0 -1
  28. package/build/types/services/DisplayService.d.ts +11 -8
  29. package/build/types/services/NodeSemanticInfo.d.ts +11 -6
  30. package/build/types/services/source-generation/EntityToSyntax.d.ts +1 -0
  31. package/build/types/tree/NodeKind.d.ts +146 -144
  32. package/build/types/tree/green/Nodes.d.ts +24 -5
  33. package/build/types/tree/green/SyntaxFactory.d.ts +1 -0
  34. package/build/types/tree/green/SyntaxToCode.d.ts +5 -1
  35. package/build/types/tree/red/Nodes.d.ts +30 -5
  36. package/build/types/ts-interop/TsInteropContext.d.ts +1 -0
  37. package/build/types/types/IntersectionType.d.ts +20 -0
  38. package/build/types/types/ParameterType.d.ts +6 -3
  39. package/build/types/types/Type.d.ts +2 -1
  40. package/build/types/types/TypeFactory.d.ts +4 -1
  41. package/build/types/types/index.d.ts +1 -0
  42. package/package.json +1 -1
  43. package/build/types/analysis/ControlFlowGraphBuilder.d.ts +0 -129
@@ -35,6 +35,8 @@ import {
35
35
  IndexerDeclaration_typeMember,
36
36
  IndexerTranslation,
37
37
  IndexerTranslationParameterClause,
38
+ IntersectionTypeSpecifier,
39
+ IntersectionTypeSpecifierTypeList,
38
40
  JavaScriptInterfacePackageImplementationConfig,
39
41
  JsonConfigurationFileNameSet,
40
42
  Keyword,
@@ -182,7 +184,7 @@ import {
182
184
  unwrapParenthesizedExpressions,
183
185
  visitChildren,
184
186
  yieldExecution
185
- } from "../chunk-DZNNWICP.js";
187
+ } from "../chunk-24QZJOMF.js";
186
188
 
187
189
  // source/services/CustomCommand.ts
188
190
  import * as ls from "vscode-languageserver";
@@ -302,7 +304,7 @@ var AddPropertyAssignmentService = class {
302
304
  let result;
303
305
  let leftValueText;
304
306
  if (propertyName !== void 0) {
305
- if (assignmentNode.left.kind !== 78 /* PropertyAccessExpression */) {
307
+ if (assignmentNode.left.kind !== 80 /* PropertyAccessExpression */) {
306
308
  return void 0;
307
309
  }
308
310
  const propertyReceiver = assignmentNode.left.expression;
@@ -319,7 +321,7 @@ var AddPropertyAssignmentService = class {
319
321
  const reassignmentText = `${leftValueText} = ${value}`;
320
322
  const subprogramBody = this.ifShouldBeAssignedAtTheEndOfSubprogramThenBody(assignmentNode);
321
323
  if (subprogramBody !== void 0) {
322
- const lastStatement = subprogramBody.expressionOrStatementList.kind === 92 /* StatementList */ ? subprogramBody.expressionOrStatementList?.statements.last() : subprogramBody.expressionOrStatementList;
324
+ const lastStatement = subprogramBody.expressionOrStatementList.kind === 94 /* StatementList */ ? subprogramBody.expressionOrStatementList?.statements.last() : subprogramBody.expressionOrStatementList;
323
325
  let editRangeStart;
324
326
  let indentationText;
325
327
  if (lastStatement !== void 0) {
@@ -351,9 +353,9 @@ var AddPropertyAssignmentService = class {
351
353
  ifShouldBeAssignedAtTheEndOfSubprogramThenBody(node) {
352
354
  const parent = node.parent.parent;
353
355
  switch (parent.kind) {
354
- case 93 /* StatementBlock */:
356
+ case 95 /* StatementBlock */:
355
357
  return this.getContainingSubprogram(parent)?.block;
356
- case 94 /* FunctionBlock */:
358
+ case 96 /* FunctionBlock */:
357
359
  return void 0;
358
360
  default:
359
361
  Debug.never(parent);
@@ -372,23 +374,23 @@ var AddPropertyAssignmentService = class {
372
374
  };
373
375
  function isSubprogramDeclaration(node) {
374
376
  switch (node.kind) {
375
- case 25 /* PackageConstructorDeclaration */:
376
- case 26 /* PackageEntryPointDeclaration */:
377
- case 27 /* PackageMethodDeclaration */:
378
- case 36 /* PackageVariableGetterDeclaration */:
379
- case 37 /* PackageVariableSetterDeclaration */:
380
- case 45 /* TypeConstructorDeclaration */:
381
- case 46 /* TypeDestructorDeclaration */:
382
- case 47 /* TypeIndexedGetterDeclaration */:
383
- case 48 /* TypeIndexedSetterDeclaration */:
384
- case 50 /* TypeDereferencedVariableGetterDeclaration */:
385
- case 51 /* TypeDereferencedVariableSetterDeclaration */:
386
- case 52 /* TypeMethodDeclaration */:
387
- case 55 /* TypeVariableGetterDeclaration */:
388
- case 56 /* TypeVariableSetterDeclaration */:
389
- case 58 /* NestedMethodDeclaration */:
390
- case 67 /* MethodBlockLiteral */:
391
- case 74 /* MethodLiteral */:
377
+ case 27 /* PackageConstructorDeclaration */:
378
+ case 28 /* PackageEntryPointDeclaration */:
379
+ case 29 /* PackageMethodDeclaration */:
380
+ case 38 /* PackageVariableGetterDeclaration */:
381
+ case 39 /* PackageVariableSetterDeclaration */:
382
+ case 47 /* TypeConstructorDeclaration */:
383
+ case 48 /* TypeDestructorDeclaration */:
384
+ case 49 /* TypeIndexedGetterDeclaration */:
385
+ case 50 /* TypeIndexedSetterDeclaration */:
386
+ case 52 /* TypeDereferencedVariableGetterDeclaration */:
387
+ case 53 /* TypeDereferencedVariableSetterDeclaration */:
388
+ case 54 /* TypeMethodDeclaration */:
389
+ case 57 /* TypeVariableGetterDeclaration */:
390
+ case 58 /* TypeVariableSetterDeclaration */:
391
+ case 60 /* NestedMethodDeclaration */:
392
+ case 69 /* MethodBlockLiteral */:
393
+ case 76 /* MethodLiteral */:
392
394
  return true;
393
395
  default:
394
396
  Debug.typeIsAssignableTo();
@@ -734,6 +736,14 @@ var SyntaxFactory = class {
734
736
  new UnionTypeSpecifierTypeList(this.createTokenSeparatedElements(typeSpecifiers, 17 /* Bar */))
735
737
  );
736
738
  }
739
+ static intersectionTypeSpecifier(typeSpecifiers) {
740
+ return new IntersectionTypeSpecifier(
741
+ new IntersectionTypeSpecifierTypeList(this.createTokenSeparatedElements(
742
+ typeSpecifiers,
743
+ 10 /* Ampersand */
744
+ ))
745
+ );
746
+ }
737
747
  static nullableTypeSpecifier(typeSpecifier) {
738
748
  const questionToken = this.token(49 /* Question */);
739
749
  return new NullableTypeSpecifier(typeSpecifier, questionToken);
@@ -1552,8 +1562,35 @@ var SyntaxToCode = class _SyntaxToCode {
1552
1562
  this.writeVariantTypeDeclarationBody(node.body);
1553
1563
  }
1554
1564
  writeUnionTypeSpecifier(node) {
1555
- for (let i = 0; i < node.typeList.elements.length; i++) {
1556
- const element = node.typeList.elements[i];
1565
+ this.writeUnionTypeSpecifierTypeList(node.typeList);
1566
+ }
1567
+ writeUnionTypeSpecifierTypeList(node) {
1568
+ for (let i = 0; i < node.elements.length; i++) {
1569
+ const element = node.elements[i];
1570
+ if (element.kind === 0 /* Token */) {
1571
+ this.writeWhitespace();
1572
+ this.writeToken(element);
1573
+ } else {
1574
+ if (i > 0) {
1575
+ this.writeWhitespace();
1576
+ }
1577
+ const areParenthesisRequired = this.doesUnionTypeElementRequireParenthesis(element);
1578
+ if (areParenthesisRequired) {
1579
+ this.writeCode("(");
1580
+ }
1581
+ this.writeTypeSpecifier(element, false);
1582
+ if (areParenthesisRequired) {
1583
+ this.writeCode(")");
1584
+ }
1585
+ }
1586
+ }
1587
+ }
1588
+ writeIntersectionTypeSpecifier(node) {
1589
+ this.writeIntersectionTypeSpecifierTypeList(node.typeList);
1590
+ }
1591
+ writeIntersectionTypeSpecifierTypeList(node) {
1592
+ for (let i = 0; i < node.elements.length; i++) {
1593
+ const element = node.elements[i];
1557
1594
  if (element.kind === 0 /* Token */) {
1558
1595
  this.writeWhitespace();
1559
1596
  this.writeToken(element);
@@ -1561,7 +1598,7 @@ var SyntaxToCode = class _SyntaxToCode {
1561
1598
  if (i > 0) {
1562
1599
  this.writeWhitespace();
1563
1600
  }
1564
- const areParenthesisRequired = this.doesConstituentTypeRequireParenthesis(element);
1601
+ const areParenthesisRequired = this.doesIntersectionTypeElementRequireParenthesis(element);
1565
1602
  if (areParenthesisRequired) {
1566
1603
  this.writeCode("(");
1567
1604
  }
@@ -1588,25 +1625,51 @@ var SyntaxToCode = class _SyntaxToCode {
1588
1625
  }
1589
1626
  this.writeToken(node.questionToken);
1590
1627
  }
1591
- doesConstituentTypeRequireParenthesis(node) {
1628
+ doesUnionTypeElementRequireParenthesis(node) {
1629
+ switch (node.kind) {
1630
+ case 11 /* UnionTypeSpecifier */:
1631
+ return true;
1632
+ case 17 /* AnonymousTypeSpecifier */: {
1633
+ switch (node.typeDeclaration.body.kind) {
1634
+ case 31 /* MethodTypeDeclarationBody */:
1635
+ return true;
1636
+ case 36 /* StructuredTypeDeclarationBody */:
1637
+ case 41 /* VariantTypeDeclarationBody */:
1638
+ return false;
1639
+ default:
1640
+ Debug.never(node.typeDeclaration.body);
1641
+ }
1642
+ }
1643
+ case 10 /* NamedTypeSpecifier */:
1644
+ case 15 /* ParenthesizedTypeSpecifier */:
1645
+ case 16 /* NullableTypeSpecifier */:
1646
+ case 18 /* InvalidTypeSpecifier */:
1647
+ case 13 /* IntersectionTypeSpecifier */:
1648
+ return false;
1649
+ default:
1650
+ Debug.never(node);
1651
+ }
1652
+ }
1653
+ doesIntersectionTypeElementRequireParenthesis(node) {
1592
1654
  switch (node.kind) {
1593
1655
  case 11 /* UnionTypeSpecifier */:
1656
+ case 13 /* IntersectionTypeSpecifier */:
1594
1657
  return true;
1595
- case 15 /* AnonymousTypeSpecifier */: {
1658
+ case 17 /* AnonymousTypeSpecifier */: {
1596
1659
  switch (node.typeDeclaration.body.kind) {
1597
- case 29 /* MethodTypeDeclarationBody */:
1660
+ case 31 /* MethodTypeDeclarationBody */:
1598
1661
  return true;
1599
- case 34 /* StructuredTypeDeclarationBody */:
1600
- case 39 /* VariantTypeDeclarationBody */:
1662
+ case 36 /* StructuredTypeDeclarationBody */:
1663
+ case 41 /* VariantTypeDeclarationBody */:
1601
1664
  return false;
1602
1665
  default:
1603
1666
  Debug.never(node.typeDeclaration.body);
1604
1667
  }
1605
1668
  }
1606
1669
  case 10 /* NamedTypeSpecifier */:
1607
- case 13 /* ParenthesizedTypeSpecifier */:
1608
- case 14 /* NullableTypeSpecifier */:
1609
- case 16 /* InvalidTypeSpecifier */:
1670
+ case 15 /* ParenthesizedTypeSpecifier */:
1671
+ case 16 /* NullableTypeSpecifier */:
1672
+ case 18 /* InvalidTypeSpecifier */:
1610
1673
  return false;
1611
1674
  default:
1612
1675
  Debug.never(node);
@@ -1615,12 +1678,13 @@ var SyntaxToCode = class _SyntaxToCode {
1615
1678
  doesTypeMadeNullableRequireParenthesis(node) {
1616
1679
  switch (node.kind) {
1617
1680
  case 11 /* UnionTypeSpecifier */:
1618
- case 15 /* AnonymousTypeSpecifier */:
1681
+ case 13 /* IntersectionTypeSpecifier */:
1682
+ case 17 /* AnonymousTypeSpecifier */:
1619
1683
  return true;
1620
1684
  case 10 /* NamedTypeSpecifier */:
1621
- case 13 /* ParenthesizedTypeSpecifier */:
1622
- case 14 /* NullableTypeSpecifier */:
1623
- case 16 /* InvalidTypeSpecifier */:
1685
+ case 15 /* ParenthesizedTypeSpecifier */:
1686
+ case 16 /* NullableTypeSpecifier */:
1687
+ case 18 /* InvalidTypeSpecifier */:
1624
1688
  return false;
1625
1689
  default:
1626
1690
  Debug.never(node);
@@ -1645,7 +1709,7 @@ var SyntaxToCode = class _SyntaxToCode {
1645
1709
  this.writeNodeDefault(node);
1646
1710
  }
1647
1711
  writeDeclarationBody(node, addLeadingNewLineOrWhitespace = true) {
1648
- if (node.expressionOrStatementList.kind !== 92 /* StatementList */ || node.expressionOrStatementList.elements.length === 0) {
1712
+ if (node.expressionOrStatementList.kind !== 94 /* StatementList */ || node.expressionOrStatementList.elements.length === 0) {
1649
1713
  this.writeWhitespace();
1650
1714
  this.writeFunctionBlock(node, false);
1651
1715
  } else {
@@ -1955,153 +2019,155 @@ var SyntaxToCode = class _SyntaxToCode {
1955
2019
  [9 /* PackagePath */]: this.prototype.writePackagePath,
1956
2020
  [10 /* NamedTypeSpecifier */]: this.prototype.writeNamedTypeSpecifier,
1957
2021
  [11 /* UnionTypeSpecifier */]: this.prototype.writeUnionTypeSpecifier,
1958
- [13 /* ParenthesizedTypeSpecifier */]: this.prototype.writeParenthesizedTypeSpecifier,
1959
- [14 /* NullableTypeSpecifier */]: this.prototype.writeNullableTypeSpecifier,
1960
- [15 /* AnonymousTypeSpecifier */]: this.prototype.writeAnonymousTypeSpecifier,
1961
- [22 /* PackageAliasTypeDeclaration */]: this.prototype.writePackageAliasTypeDeclaration,
1962
- [24 /* PackageMemberGroupDeclaration */]: this.prototype.writePackageMemberGroupDeclaration,
1963
- [25 /* PackageConstructorDeclaration */]: this.prototype.writePackageConstructorDeclaration,
1964
- [26 /* PackageEntryPointDeclaration */]: this.prototype.writePackageEntryPointDeclaration,
1965
- [27 /* PackageMethodDeclaration */]: this.prototype.writePackageMethodDeclaration,
1966
- [28 /* PackageMethodTypeDeclaration */]: this.prototype.writePackageMethodTypeDeclaration,
1967
- [29 /* MethodTypeDeclarationBody */]: this.prototype.writeMethodTypeDeclarationBody,
1968
- [30 /* BaseTypeList */]: this.prototype.writeBaseTypeList,
1969
- [32 /* TypeMemberDeclarationBlock */]: this.prototype.writeTypeMemberDeclarationBlock,
1970
- [33 /* PackageStructuredTypeDeclaration */]: this.prototype.writePackageStructuredTypeDeclaration,
1971
- [34 /* StructuredTypeDeclarationBody */]: this.prototype.writeStructuredTypeDeclarationBody,
1972
- [35 /* PackageVariableDeclaration */]: this.prototype.writePackageVariableDeclaration,
1973
- [36 /* PackageVariableGetterDeclaration */]: this.prototype.writePackageVariableGetterDeclaration,
1974
- [37 /* PackageVariableSetterDeclaration */]: this.prototype.writePackageVariableSetterDeclaration,
1975
- [38 /* PackageVariantTypeDeclaration */]: this.prototype.writePackageVariantTypeDeclaration,
1976
- [39 /* VariantTypeDeclarationBody */]: this.prototype.writeVariantTypeDeclarationBody,
1977
- [44 /* TypeMemberGroupDeclaration */]: this.prototype.writeTypeMemberGroupDeclaration,
1978
- [45 /* TypeConstructorDeclaration */]: this.prototype.writeTypeConstructorDeclaration,
1979
- [46 /* TypeDestructorDeclaration */]: this.prototype.writeTypeDestructorDeclaration,
1980
- [47 /* TypeIndexedGetterDeclaration */]: this.prototype.writeTypeIndexedGetterDeclaration,
1981
- [48 /* TypeIndexedSetterDeclaration */]: this.prototype.writeTypeIndexedSetterDeclaration,
1982
- [50 /* TypeDereferencedVariableGetterDeclaration */]: this.prototype.writeTypeDereferencedVariableGetterDeclaration,
1983
- [51 /* TypeDereferencedVariableSetterDeclaration */]: this.prototype.writeTypeDereferencedVariableSetterDeclaration,
1984
- [52 /* TypeMethodDeclaration */]: this.prototype.writeTypeMethodDeclaration,
1985
- [53 /* OperatorDeclaration */]: this.prototype.writeOperatorDeclaration,
1986
- [54 /* TypeVariableDeclaration */]: this.prototype.writeTypeVariableDeclaration,
1987
- [55 /* TypeVariableGetterDeclaration */]: this.prototype.writeTypeVariableGetterDeclaration,
1988
- [56 /* TypeVariableSetterDeclaration */]: this.prototype.writeTypeVariableSetterDeclaration,
1989
- [93 /* StatementBlock */]: this.prototype.writeStatementBlock,
1990
- [94 /* FunctionBlock */]: this.prototype.writeFunctionBlock,
1991
- [135 /* QualifiedName */]: this.prototype.writeQualifiedName,
1992
- [142 /* VariantDeclaration */]: this.prototype.writeVariantDeclaration,
1993
- [143 /* TypeParameterDeclaration */]: this.prototype.writeTypeParameterDeclaration,
1994
- [144 /* ParameterDeclaration */]: this.prototype.writeParameterDeclaration,
1995
- [145 /* Argument */]: this.prototype.writeArgument,
1996
- [147 /* Tag */]: this.prototype.writeTag,
1997
- [149 /* Modifier */]: this.prototype.writeModifier,
1998
- [150 /* ParameterClause */]: this.prototype.writeParameterClause,
1999
- [151 /* ParameterList */]: this.prototype.writeParameterList,
2000
- [152 /* TypeArgumentClause */]: this.prototype.writeTypeArgumentClause,
2001
- [154 /* TypeParameterClause */]: this.prototype.writeTypeParameterClause,
2002
- [17 /* AnonymousMethodTypeDeclaration */]: this.prototype.writeAnonymousMethodTypeDeclaration,
2003
- [18 /* AnonymousStructuredTypeDeclaration */]: this.prototype.writeAnonymousStructuredTypeDeclaration,
2004
- [19 /* AnonymousVariantTypeDeclaration */]: this.prototype.writeAnonymousVariantTypeDeclaration,
2022
+ [13 /* IntersectionTypeSpecifier */]: this.prototype.writeIntersectionTypeSpecifier,
2023
+ [15 /* ParenthesizedTypeSpecifier */]: this.prototype.writeParenthesizedTypeSpecifier,
2024
+ [16 /* NullableTypeSpecifier */]: this.prototype.writeNullableTypeSpecifier,
2025
+ [17 /* AnonymousTypeSpecifier */]: this.prototype.writeAnonymousTypeSpecifier,
2026
+ [24 /* PackageAliasTypeDeclaration */]: this.prototype.writePackageAliasTypeDeclaration,
2027
+ [26 /* PackageMemberGroupDeclaration */]: this.prototype.writePackageMemberGroupDeclaration,
2028
+ [27 /* PackageConstructorDeclaration */]: this.prototype.writePackageConstructorDeclaration,
2029
+ [28 /* PackageEntryPointDeclaration */]: this.prototype.writePackageEntryPointDeclaration,
2030
+ [29 /* PackageMethodDeclaration */]: this.prototype.writePackageMethodDeclaration,
2031
+ [30 /* PackageMethodTypeDeclaration */]: this.prototype.writePackageMethodTypeDeclaration,
2032
+ [31 /* MethodTypeDeclarationBody */]: this.prototype.writeMethodTypeDeclarationBody,
2033
+ [32 /* BaseTypeList */]: this.prototype.writeBaseTypeList,
2034
+ [34 /* TypeMemberDeclarationBlock */]: this.prototype.writeTypeMemberDeclarationBlock,
2035
+ [35 /* PackageStructuredTypeDeclaration */]: this.prototype.writePackageStructuredTypeDeclaration,
2036
+ [36 /* StructuredTypeDeclarationBody */]: this.prototype.writeStructuredTypeDeclarationBody,
2037
+ [37 /* PackageVariableDeclaration */]: this.prototype.writePackageVariableDeclaration,
2038
+ [38 /* PackageVariableGetterDeclaration */]: this.prototype.writePackageVariableGetterDeclaration,
2039
+ [39 /* PackageVariableSetterDeclaration */]: this.prototype.writePackageVariableSetterDeclaration,
2040
+ [40 /* PackageVariantTypeDeclaration */]: this.prototype.writePackageVariantTypeDeclaration,
2041
+ [41 /* VariantTypeDeclarationBody */]: this.prototype.writeVariantTypeDeclarationBody,
2042
+ [46 /* TypeMemberGroupDeclaration */]: this.prototype.writeTypeMemberGroupDeclaration,
2043
+ [47 /* TypeConstructorDeclaration */]: this.prototype.writeTypeConstructorDeclaration,
2044
+ [48 /* TypeDestructorDeclaration */]: this.prototype.writeTypeDestructorDeclaration,
2045
+ [49 /* TypeIndexedGetterDeclaration */]: this.prototype.writeTypeIndexedGetterDeclaration,
2046
+ [50 /* TypeIndexedSetterDeclaration */]: this.prototype.writeTypeIndexedSetterDeclaration,
2047
+ [52 /* TypeDereferencedVariableGetterDeclaration */]: this.prototype.writeTypeDereferencedVariableGetterDeclaration,
2048
+ [53 /* TypeDereferencedVariableSetterDeclaration */]: this.prototype.writeTypeDereferencedVariableSetterDeclaration,
2049
+ [54 /* TypeMethodDeclaration */]: this.prototype.writeTypeMethodDeclaration,
2050
+ [55 /* OperatorDeclaration */]: this.prototype.writeOperatorDeclaration,
2051
+ [56 /* TypeVariableDeclaration */]: this.prototype.writeTypeVariableDeclaration,
2052
+ [57 /* TypeVariableGetterDeclaration */]: this.prototype.writeTypeVariableGetterDeclaration,
2053
+ [58 /* TypeVariableSetterDeclaration */]: this.prototype.writeTypeVariableSetterDeclaration,
2054
+ [95 /* StatementBlock */]: this.prototype.writeStatementBlock,
2055
+ [96 /* FunctionBlock */]: this.prototype.writeFunctionBlock,
2056
+ [137 /* QualifiedName */]: this.prototype.writeQualifiedName,
2057
+ [144 /* VariantDeclaration */]: this.prototype.writeVariantDeclaration,
2058
+ [145 /* TypeParameterDeclaration */]: this.prototype.writeTypeParameterDeclaration,
2059
+ [146 /* ParameterDeclaration */]: this.prototype.writeParameterDeclaration,
2060
+ [147 /* Argument */]: this.prototype.writeArgument,
2061
+ [149 /* Tag */]: this.prototype.writeTag,
2062
+ [151 /* Modifier */]: this.prototype.writeModifier,
2063
+ [152 /* ParameterClause */]: this.prototype.writeParameterClause,
2064
+ [153 /* ParameterList */]: this.prototype.writeParameterList,
2065
+ [154 /* TypeArgumentClause */]: this.prototype.writeTypeArgumentClause,
2066
+ [156 /* TypeParameterClause */]: this.prototype.writeTypeParameterClause,
2067
+ [19 /* AnonymousMethodTypeDeclaration */]: this.prototype.writeAnonymousMethodTypeDeclaration,
2068
+ [20 /* AnonymousStructuredTypeDeclaration */]: this.prototype.writeAnonymousStructuredTypeDeclaration,
2069
+ [21 /* AnonymousVariantTypeDeclaration */]: this.prototype.writeAnonymousVariantTypeDeclaration,
2005
2070
  [6 /* PackageGroupImportDirective */]: this.prototype.writeNodeDefault,
2006
2071
  [7 /* PackageImportList */]: this.prototype.writeNodeDefault,
2007
- [12 /* UnionTypeSpecifierTypeList */]: this.prototype.writeNodeDefault,
2008
- [16 /* InvalidTypeSpecifier */]: this.prototype.writeNodeDefault,
2009
- [20 /* TopLevelTranslationList */]: this.prototype.writeNodeDefault,
2010
- [21 /* TranslationsDeclaration */]: this.prototype.writeTranslationsDeclaration,
2011
- [23 /* AliasTypeDeclarationBody */]: this.prototype.writeNodeDefault,
2012
- [31 /* TypeMemberDeclarationList */]: this.prototype.writeNodeDefault,
2013
- [40 /* TypeExtensionDeclaration */]: this.prototype.writeNodeDefault,
2014
- [41 /* ExtendedTypeClauseCommaList */]: this.prototype.writeNodeDefault,
2015
- [42 /* ExtendedTypeClause */]: this.prototype.writeNodeDefault,
2016
- [43 /* InvalidPackageMemberDeclaration */]: this.prototype.writeNodeDefault,
2017
- [49 /* TypeIndexerParameterClause */]: this.prototype.writeNodeDefault,
2018
- [57 /* InvalidTypeMemberDeclaration */]: this.prototype.writeNodeDefault,
2019
- [58 /* NestedMethodDeclaration */]: this.prototype.writeNodeDefault,
2020
- [59 /* LocalVariableDeclaration */]: this.prototype.writeNodeDefault,
2021
- [60 /* EnumerationVariableDeclaration */]: this.prototype.writeNodeDefault,
2022
- [61 /* ArrayLiteral */]: this.prototype.writeNodeDefault,
2023
- [62 /* ArrayLiteralElementList */]: this.prototype.writeNodeDefault,
2024
- [63 /* AssertionExpression */]: this.prototype.writeNodeDefault,
2025
- [64 /* AssumptionExpression */]: this.prototype.writeNodeDefault,
2026
- [65 /* AsExpression */]: this.prototype.writeNodeDefault,
2027
- [66 /* BinaryExpression */]: this.prototype.writeNodeDefault,
2028
- [67 /* MethodBlockLiteral */]: this.prototype.writeNodeDefault,
2029
- [68 /* ArgumentList */]: this.prototype.writeNodeDefault,
2030
- [69 /* CallExpression */]: this.prototype.writeNodeDefault,
2031
- [70 /* AutotypeCallExpression */]: this.prototype.writeNodeDefault,
2032
- [71 /* IndexedAccessExpression */]: this.prototype.writeNodeDefault,
2033
- [72 /* InvalidExpression */]: this.prototype.writeNodeDefault,
2034
- [73 /* IsExpression */]: this.prototype.writeNodeDefault,
2035
- [74 /* MethodLiteral */]: this.prototype.writeNodeDefault,
2036
- [75 /* ParenthesizedExpression */]: this.prototype.writeNodeDefault,
2037
- [76 /* WhenTernaryExpression */]: this.prototype.writeNodeDefault,
2038
- [77 /* PrefixUnaryExpression */]: this.prototype.writeNodeDefault,
2039
- [78 /* PropertyAccessExpression */]: this.prototype.writeNodeDefault,
2040
- [79 /* ReferenceExpression */]: this.prototype.writeNodeDefault,
2041
- [80 /* DereferenceExpression */]: this.prototype.writeNodeDefault,
2042
- [81 /* TextTemplateLiteral */]: this.prototype.writeNodeDefault,
2043
- [82 /* TextTemplateSpanList */]: this.prototype.writeNodeDefault,
2044
- [83 /* TextTemplateSpan */]: this.prototype.writeNodeDefault,
2045
- [84 /* TokenExpression */]: this.prototype.writeNodeDefault,
2046
- [85 /* KeywordExpression */]: this.prototype.writeNodeDefault,
2047
- [86 /* ObjectExpression */]: this.prototype.writeNodeDefault,
2048
- [87 /* BaseExpression */]: this.prototype.writeNodeDefault,
2049
- [88 /* IdentifierExpression */]: this.prototype.writeNodeDefault,
2050
- [89 /* GenericSpecializationExpression */]: this.prototype.writeNodeDefault,
2051
- [90 /* DefaultMatchExpression */]: this.prototype.writeNodeDefault,
2052
- [91 /* AssignmentStatement */]: this.prototype.writeNodeDefault,
2053
- [92 /* StatementList */]: this.prototype.writeNodeDefault,
2054
- [95 /* BreakLoopStatement */]: this.prototype.writeNodeDefault,
2055
- [96 /* ContinueLoopStatement */]: this.prototype.writeNodeDefault,
2056
- [97 /* DisposeStatement */]: this.prototype.writeNodeDefault,
2057
- [98 /* RunStatement */]: this.prototype.writeNodeDefault,
2058
- [99 /* TryStatement */]: this.prototype.writeNodeDefault,
2059
- [100 /* CatchClause */]: this.prototype.writeNodeDefault,
2060
- [101 /* ErrorVariableDeclaration */]: this.prototype.writeNodeDefault,
2061
- [102 /* FinallyClause */]: this.prototype.writeNodeDefault,
2062
- [103 /* EmptyStatement */]: this.prototype.writeNodeDefault,
2063
- [104 /* ErrorStatement */]: this.prototype.writeNodeDefault,
2064
- [105 /* ImportantStatement */]: this.prototype.writeNodeDefault,
2065
- [106 /* ExpressionStatement */]: this.prototype.writeNodeDefault,
2066
- [107 /* EnumerationVariableList */]: this.prototype.writeNodeDefault,
2067
- [108 /* ForStatement */]: this.prototype.writeNodeDefault,
2068
- [109 /* IfStatement */]: this.prototype.writeNodeDefault,
2069
- [110 /* ElseIfClauseList */]: this.prototype.writeNodeDefault,
2070
- [111 /* ElseIfClause */]: this.prototype.writeNodeDefault,
2071
- [112 /* ElseClause */]: this.prototype.writeNodeDefault,
2072
- [113 /* InvalidStatement */]: this.prototype.writeNodeDefault,
2073
- [114 /* NestedMethodDeclarationStatement */]: this.prototype.writeNodeDefault,
2074
- [115 /* LocalVariableDeclarationStatement */]: this.prototype.writeNodeDefault,
2075
- [116 /* LoopStatement */]: this.prototype.writeNodeDefault,
2076
- [117 /* ReturnStatement */]: this.prototype.writeNodeDefault,
2077
- [118 /* CaseClauseList */]: this.prototype.writeNodeDefault,
2078
- [119 /* SwitchStatement */]: this.prototype.writeNodeDefault,
2079
- [120 /* MatchExpressionList */]: this.prototype.writeNodeDefault,
2080
- [121 /* CaseClause */]: this.prototype.writeNodeDefault,
2081
- [122 /* WhileStatement */]: this.prototype.writeNodeDefault,
2082
- [123 /* YieldStatement */]: this.prototype.writeNodeDefault,
2083
- [124 /* TranslationParameterList */]: this.prototype.writeNodeDefault,
2084
- [125 /* TranslationParameterClause */]: this.prototype.writeTranslationParameterClause,
2085
- [126 /* ConstructorTranslation */]: this.prototype.writeConstructorTranslation,
2086
- [127 /* IndexerTranslationParameterClause */]: this.prototype.writeIndexerTranslationParameterClause,
2087
- [128 /* IndexerTranslation */]: this.prototype.writeIndexerTranslation,
2088
- [129 /* TranslationTypeParameterList */]: this.prototype.writeNodeDefault,
2089
- [130 /* TranslationTypeParameterClause */]: this.prototype.writeTranslationTypeParameterClause,
2090
- [131 /* PackageMethodTranslation */]: this.prototype.writePackageMethodTranslation,
2091
- [132 /* TypeMethodTranslation */]: this.prototype.writeTypeMethodTranslation,
2092
- [133 /* MethodTypeTranslation */]: this.prototype.writeMethodTypeTranslation,
2093
- [134 /* PackageImportTranslation */]: this.prototype.writePackageImportTranslation,
2094
- [136 /* PackageVariableTranslation */]: this.prototype.writePackageVariableTranslation,
2095
- [137 /* TypeVariableOrVariantTranslation */]: this.prototype.writeTypeVariableOrVariantTranslation,
2096
- [138 /* TypeMemberTranslationList */]: this.prototype.writeNodeDefault,
2097
- [139 /* TypeTranslation */]: this.prototype.writeTypeTranslation,
2098
- [140 /* TextLiteralTranslation */]: this.prototype.writeNodeDefault,
2099
- [141 /* TextTemplateLiteralTranslation */]: this.prototype.writeNodeDefault,
2100
- [146 /* TagList */]: this.prototype.writeNodeDefault,
2101
- [148 /* ModifierList */]: this.prototype.writeNodeDefault,
2102
- [153 /* TypeArgumentList */]: this.prototype.writeNodeDefault,
2103
- [155 /* TypeParameterList */]: this.prototype.writeNodeDefault,
2104
- [156 /* TypeAnnotation */]: this.prototype.writeNodeDefault
2072
+ [12 /* UnionTypeSpecifierTypeList */]: this.prototype.writeUnionTypeSpecifierTypeList,
2073
+ [14 /* IntersectionTypeSpecifierTypeList */]: this.prototype.writeIntersectionTypeSpecifierTypeList,
2074
+ [18 /* InvalidTypeSpecifier */]: this.prototype.writeNodeDefault,
2075
+ [22 /* TopLevelTranslationList */]: this.prototype.writeNodeDefault,
2076
+ [23 /* TranslationsDeclaration */]: this.prototype.writeTranslationsDeclaration,
2077
+ [25 /* AliasTypeDeclarationBody */]: this.prototype.writeNodeDefault,
2078
+ [33 /* TypeMemberDeclarationList */]: this.prototype.writeNodeDefault,
2079
+ [42 /* TypeExtensionDeclaration */]: this.prototype.writeNodeDefault,
2080
+ [43 /* ExtendedTypeClauseCommaList */]: this.prototype.writeNodeDefault,
2081
+ [44 /* ExtendedTypeClause */]: this.prototype.writeNodeDefault,
2082
+ [45 /* InvalidPackageMemberDeclaration */]: this.prototype.writeNodeDefault,
2083
+ [51 /* TypeIndexerParameterClause */]: this.prototype.writeNodeDefault,
2084
+ [59 /* InvalidTypeMemberDeclaration */]: this.prototype.writeNodeDefault,
2085
+ [60 /* NestedMethodDeclaration */]: this.prototype.writeNodeDefault,
2086
+ [61 /* LocalVariableDeclaration */]: this.prototype.writeNodeDefault,
2087
+ [62 /* EnumerationVariableDeclaration */]: this.prototype.writeNodeDefault,
2088
+ [63 /* ArrayLiteral */]: this.prototype.writeNodeDefault,
2089
+ [64 /* ArrayLiteralElementList */]: this.prototype.writeNodeDefault,
2090
+ [65 /* AssertionExpression */]: this.prototype.writeNodeDefault,
2091
+ [66 /* AssumptionExpression */]: this.prototype.writeNodeDefault,
2092
+ [67 /* AsExpression */]: this.prototype.writeNodeDefault,
2093
+ [68 /* BinaryExpression */]: this.prototype.writeNodeDefault,
2094
+ [69 /* MethodBlockLiteral */]: this.prototype.writeNodeDefault,
2095
+ [70 /* ArgumentList */]: this.prototype.writeNodeDefault,
2096
+ [71 /* CallExpression */]: this.prototype.writeNodeDefault,
2097
+ [72 /* AutotypeCallExpression */]: this.prototype.writeNodeDefault,
2098
+ [73 /* IndexedAccessExpression */]: this.prototype.writeNodeDefault,
2099
+ [74 /* InvalidExpression */]: this.prototype.writeNodeDefault,
2100
+ [75 /* IsExpression */]: this.prototype.writeNodeDefault,
2101
+ [76 /* MethodLiteral */]: this.prototype.writeNodeDefault,
2102
+ [77 /* ParenthesizedExpression */]: this.prototype.writeNodeDefault,
2103
+ [78 /* WhenTernaryExpression */]: this.prototype.writeNodeDefault,
2104
+ [79 /* PrefixUnaryExpression */]: this.prototype.writeNodeDefault,
2105
+ [80 /* PropertyAccessExpression */]: this.prototype.writeNodeDefault,
2106
+ [81 /* ReferenceExpression */]: this.prototype.writeNodeDefault,
2107
+ [82 /* DereferenceExpression */]: this.prototype.writeNodeDefault,
2108
+ [83 /* TextTemplateLiteral */]: this.prototype.writeNodeDefault,
2109
+ [84 /* TextTemplateSpanList */]: this.prototype.writeNodeDefault,
2110
+ [85 /* TextTemplateSpan */]: this.prototype.writeNodeDefault,
2111
+ [86 /* TokenExpression */]: this.prototype.writeNodeDefault,
2112
+ [87 /* KeywordExpression */]: this.prototype.writeNodeDefault,
2113
+ [88 /* ObjectExpression */]: this.prototype.writeNodeDefault,
2114
+ [89 /* BaseExpression */]: this.prototype.writeNodeDefault,
2115
+ [90 /* IdentifierExpression */]: this.prototype.writeNodeDefault,
2116
+ [91 /* GenericSpecializationExpression */]: this.prototype.writeNodeDefault,
2117
+ [92 /* DefaultMatchExpression */]: this.prototype.writeNodeDefault,
2118
+ [93 /* AssignmentStatement */]: this.prototype.writeNodeDefault,
2119
+ [94 /* StatementList */]: this.prototype.writeNodeDefault,
2120
+ [97 /* BreakLoopStatement */]: this.prototype.writeNodeDefault,
2121
+ [98 /* ContinueLoopStatement */]: this.prototype.writeNodeDefault,
2122
+ [99 /* DisposeStatement */]: this.prototype.writeNodeDefault,
2123
+ [100 /* RunStatement */]: this.prototype.writeNodeDefault,
2124
+ [101 /* TryStatement */]: this.prototype.writeNodeDefault,
2125
+ [102 /* CatchClause */]: this.prototype.writeNodeDefault,
2126
+ [103 /* ErrorVariableDeclaration */]: this.prototype.writeNodeDefault,
2127
+ [104 /* FinallyClause */]: this.prototype.writeNodeDefault,
2128
+ [105 /* EmptyStatement */]: this.prototype.writeNodeDefault,
2129
+ [106 /* ErrorStatement */]: this.prototype.writeNodeDefault,
2130
+ [107 /* ImportantStatement */]: this.prototype.writeNodeDefault,
2131
+ [108 /* ExpressionStatement */]: this.prototype.writeNodeDefault,
2132
+ [109 /* EnumerationVariableList */]: this.prototype.writeNodeDefault,
2133
+ [110 /* ForStatement */]: this.prototype.writeNodeDefault,
2134
+ [111 /* IfStatement */]: this.prototype.writeNodeDefault,
2135
+ [112 /* ElseIfClauseList */]: this.prototype.writeNodeDefault,
2136
+ [113 /* ElseIfClause */]: this.prototype.writeNodeDefault,
2137
+ [114 /* ElseClause */]: this.prototype.writeNodeDefault,
2138
+ [115 /* InvalidStatement */]: this.prototype.writeNodeDefault,
2139
+ [116 /* NestedMethodDeclarationStatement */]: this.prototype.writeNodeDefault,
2140
+ [117 /* LocalVariableDeclarationStatement */]: this.prototype.writeNodeDefault,
2141
+ [118 /* LoopStatement */]: this.prototype.writeNodeDefault,
2142
+ [119 /* ReturnStatement */]: this.prototype.writeNodeDefault,
2143
+ [120 /* CaseClauseList */]: this.prototype.writeNodeDefault,
2144
+ [121 /* SwitchStatement */]: this.prototype.writeNodeDefault,
2145
+ [122 /* MatchExpressionList */]: this.prototype.writeNodeDefault,
2146
+ [123 /* CaseClause */]: this.prototype.writeNodeDefault,
2147
+ [124 /* WhileStatement */]: this.prototype.writeNodeDefault,
2148
+ [125 /* YieldStatement */]: this.prototype.writeNodeDefault,
2149
+ [126 /* TranslationParameterList */]: this.prototype.writeNodeDefault,
2150
+ [127 /* TranslationParameterClause */]: this.prototype.writeTranslationParameterClause,
2151
+ [128 /* ConstructorTranslation */]: this.prototype.writeConstructorTranslation,
2152
+ [129 /* IndexerTranslationParameterClause */]: this.prototype.writeIndexerTranslationParameterClause,
2153
+ [130 /* IndexerTranslation */]: this.prototype.writeIndexerTranslation,
2154
+ [131 /* TranslationTypeParameterList */]: this.prototype.writeNodeDefault,
2155
+ [132 /* TranslationTypeParameterClause */]: this.prototype.writeTranslationTypeParameterClause,
2156
+ [133 /* PackageMethodTranslation */]: this.prototype.writePackageMethodTranslation,
2157
+ [134 /* TypeMethodTranslation */]: this.prototype.writeTypeMethodTranslation,
2158
+ [135 /* MethodTypeTranslation */]: this.prototype.writeMethodTypeTranslation,
2159
+ [136 /* PackageImportTranslation */]: this.prototype.writePackageImportTranslation,
2160
+ [138 /* PackageVariableTranslation */]: this.prototype.writePackageVariableTranslation,
2161
+ [139 /* TypeVariableOrVariantTranslation */]: this.prototype.writeTypeVariableOrVariantTranslation,
2162
+ [140 /* TypeMemberTranslationList */]: this.prototype.writeNodeDefault,
2163
+ [141 /* TypeTranslation */]: this.prototype.writeTypeTranslation,
2164
+ [142 /* TextLiteralTranslation */]: this.prototype.writeNodeDefault,
2165
+ [143 /* TextTemplateLiteralTranslation */]: this.prototype.writeNodeDefault,
2166
+ [148 /* TagList */]: this.prototype.writeNodeDefault,
2167
+ [150 /* ModifierList */]: this.prototype.writeNodeDefault,
2168
+ [155 /* TypeArgumentList */]: this.prototype.writeNodeDefault,
2169
+ [157 /* TypeParameterList */]: this.prototype.writeNodeDefault,
2170
+ [158 /* TypeAnnotation */]: this.prototype.writeNodeDefault
2105
2171
  };
2106
2172
  return writeFunctions;
2107
2173
  }
@@ -2287,7 +2353,7 @@ var TranslationsGenerationService = class {
2287
2353
  return void 0;
2288
2354
  }
2289
2355
  let result;
2290
- if (tokenOrKeyword.isToken(63 /* Identifier */) && tokenOrKeyword.parent.kind === 139 /* TypeTranslation */ && tokenOrKeyword.value === tokenOrKeyword.parent.sourceName) {
2356
+ if (tokenOrKeyword.isToken(63 /* Identifier */) && tokenOrKeyword.parent.kind === 141 /* TypeTranslation */ && tokenOrKeyword.value === tokenOrKeyword.parent.sourceName) {
2291
2357
  const translationPackage = analyzer.getAnalyzedTranslationPackageIfTargetResolved(sourceFile.package);
2292
2358
  if (translationPackage !== void 0) {
2293
2359
  const generator = new TranslationsGenerator(
@@ -2299,7 +2365,7 @@ var TranslationsGenerationService = class {
2299
2365
  result = generator.generateMissingTypeMemberTranslations(tokenOrKeyword.parent);
2300
2366
  }
2301
2367
  }
2302
- if (result === void 0 && tokenOrKeyword.isKeyword(55 /* Translations */) && tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */) {
2368
+ if (result === void 0 && tokenOrKeyword.isKeyword(55 /* Translations */) && tokenOrKeyword.parent.kind === 23 /* TranslationsDeclaration */) {
2303
2369
  const translationPackage = analyzer.getAnalyzedTranslationPackageIfTargetResolved(sourceFile.package);
2304
2370
  if (translationPackage !== void 0) {
2305
2371
  const generator = new TranslationsGenerator(
@@ -2325,7 +2391,7 @@ var TranslationsGenerationService = class {
2325
2391
  if (tokenOrKeyword === void 0) {
2326
2392
  return false;
2327
2393
  }
2328
- if (!(tokenOrKeyword.isKeyword(55 /* Translations */) && tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */)) {
2394
+ if (!(tokenOrKeyword.isKeyword(55 /* Translations */) && tokenOrKeyword.parent.kind === 23 /* TranslationsDeclaration */)) {
2329
2395
  return false;
2330
2396
  }
2331
2397
  const translationPackage = analyzer.getAnalyzedTranslationPackageIfTargetResolved(sourceFile.package);
@@ -2333,7 +2399,7 @@ var TranslationsGenerationService = class {
2333
2399
  return false;
2334
2400
  }
2335
2401
  const generator = new TranslationsGenerator(analyzer, sourceFile, translationPackage, sourceFile.package.dialect);
2336
- return Query.from(tokenOrKeyword.parent.translationList.translationDeclarations).filter((t) => t.kind === 139 /* TypeTranslation */).mapAndFilter((t) => translationPackage.getTypeTranslationTarget(t).target).any((t) => generator.collectNotTranslatedTypeMembers(t).length > 0);
2402
+ return Query.from(tokenOrKeyword.parent.translationList.translationDeclarations).filter((t) => t.kind === 141 /* TypeTranslation */).mapAndFilter((t) => translationPackage.getTypeTranslationTarget(t).target).any((t) => generator.collectNotTranslatedTypeMembers(t).length > 0);
2337
2403
  }
2338
2404
  };
2339
2405
  var TranslationsGenerator = class _TranslationsGenerator {
@@ -2360,7 +2426,7 @@ var TranslationsGenerator = class _TranslationsGenerator {
2360
2426
  };
2361
2427
  const memberTranslationsCode = Query.from(memberEntities).mapAndFilter((m) => this.createPackageMemberTranslationNode(m)).uniqueWithComparator(compareNodes).map((n) => {
2362
2428
  const code = new SyntaxToCode(n, syntaxToCodeOptions).convert();
2363
- if (n.kind === 139 /* TypeTranslation */) {
2429
+ if (n.kind === 141 /* TypeTranslation */) {
2364
2430
  const startOffset = Math.max(code.indexOf(newLine), 0);
2365
2431
  return this.addNewLineBeforeArrowsInTranslation(
2366
2432
  code,
@@ -2392,7 +2458,7 @@ var TranslationsGenerator = class _TranslationsGenerator {
2392
2458
  generateMissingTranslationsForPartiallyTranslatedTypes(translationsDeclaration) {
2393
2459
  const result = new Array();
2394
2460
  for (const translation of translationsDeclaration.translationList.translationDeclarations) {
2395
- if (translation.kind === 139 /* TypeTranslation */) {
2461
+ if (translation.kind === 141 /* TypeTranslation */) {
2396
2462
  const edits = this.generateMissingTypeMemberTranslations(translation);
2397
2463
  if (edits !== void 0) {
2398
2464
  result.push(...edits);
@@ -2489,13 +2555,13 @@ var TranslationsGenerator = class _TranslationsGenerator {
2489
2555
  }
2490
2556
  detectIndentationStepForTypeMemberTranslations(node) {
2491
2557
  let indentationStepSize;
2492
- if (node.kind === 139 /* TypeTranslation */) {
2558
+ if (node.kind === 141 /* TypeTranslation */) {
2493
2559
  indentationStepSize = tryDetectIndentationStepSizeUsingTypeTranslation(node, this._sourceFile);
2494
2560
  }
2495
2561
  if (indentationStepSize === void 0) {
2496
- const translationsDeclarations = node.kind === 21 /* TranslationsDeclaration */ ? node : node.parent.parent;
2562
+ const translationsDeclarations = node.kind === 23 /* TranslationsDeclaration */ ? node : node.parent.parent;
2497
2563
  for (const member of translationsDeclarations.translationList.translationDeclarations) {
2498
- if (member.kind === 139 /* TypeTranslation */) {
2564
+ if (member.kind === 141 /* TypeTranslation */) {
2499
2565
  indentationStepSize = tryDetectIndentationStepSizeUsingTypeTranslation(member, this._sourceFile);
2500
2566
  if (indentationStepSize !== void 0) {
2501
2567
  break;
@@ -2776,13 +2842,13 @@ var ValueArgumentFactory = class _ValueArgumentFactory {
2776
2842
  var SignatureForNode = class _SignatureForNode {
2777
2843
  static getSignaturesForNode(analyzer, node) {
2778
2844
  switch (node.kind) {
2779
- case 69 /* CallExpression */:
2845
+ case 71 /* CallExpression */:
2780
2846
  return _SignatureForNode.getSignaturesForCallExpression(analyzer, node);
2781
- case 70 /* AutotypeCallExpression */:
2847
+ case 72 /* AutotypeCallExpression */:
2782
2848
  return _SignatureForNode.getSignaturesForAutotypeCallExpression(analyzer, node);
2783
- case 71 /* IndexedAccessExpression */:
2849
+ case 73 /* IndexedAccessExpression */:
2784
2850
  return _SignatureForNode.getSignaturesForIndexedAccessExpression(analyzer, node);
2785
- case 147 /* Tag */:
2851
+ case 149 /* Tag */:
2786
2852
  return _SignatureForNode.getSignaturesForTag(analyzer, node);
2787
2853
  default:
2788
2854
  Debug.never(node);
@@ -2920,7 +2986,7 @@ var SimplifiedOverloadResolver = class _SimplifiedOverloadResolver {
2920
2986
  result = false;
2921
2987
  break;
2922
2988
  }
2923
- if (argument.expression === void 0 || argument.expression.kind === 72 /* InvalidExpression */) {
2989
+ if (argument.expression === void 0 || argument.expression.kind === 74 /* InvalidExpression */) {
2924
2990
  continue;
2925
2991
  }
2926
2992
  const targetParameterType = targetParameter.getType();
@@ -3158,7 +3224,7 @@ var CompletionService = class {
3158
3224
  if (syntaxContext.isInComment || syntaxContext.isInStringOrChar) {
3159
3225
  return { kind: "none" };
3160
3226
  }
3161
- if (syntaxContext.isInQuotedIdentifier !== void 0 && (syntaxContext.isInQuotedIdentifier.parent.kind === 53 /* OperatorDeclaration */ || syntaxContext.isInQuotedIdentifier.parent.kind === 52 /* TypeMethodDeclaration */)) {
3227
+ if (syntaxContext.isInQuotedIdentifier !== void 0 && (syntaxContext.isInQuotedIdentifier.parent.kind === 55 /* OperatorDeclaration */ || syntaxContext.isInQuotedIdentifier.parent.kind === 54 /* TypeMethodDeclaration */)) {
3162
3228
  return new OperatorNameCompletionContext(syntaxContext.isInQuotedIdentifier);
3163
3229
  }
3164
3230
  const tokenOrKeyword = positionDescription.tokenOrKeyword;
@@ -3176,7 +3242,7 @@ var CompletionService = class {
3176
3242
  if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 6 /* PackageGroupImportDirective */ || this.tokenOrKeywordIsPackageImportListChild(tokenOrKeyword)) {
3177
3243
  return new PackageImportCompletionContext([], void 0);
3178
3244
  }
3179
- if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 78 /* PropertyAccessExpression */) {
3245
+ if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 80 /* PropertyAccessExpression */) {
3180
3246
  const propertyAccess = tokenOrKeyword.parent;
3181
3247
  {
3182
3248
  const info = this._analyzer.checkExpressionDenotesPackageNameSegment(propertyAccess.expression);
@@ -3217,7 +3283,7 @@ var CompletionService = class {
3217
3283
  typeExtensionLookup
3218
3284
  );
3219
3285
  }
3220
- if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 135 /* QualifiedName */ && tokenOrKeyword.parent.parent.kind === 10 /* NamedTypeSpecifier */) {
3286
+ if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 137 /* QualifiedName */ && tokenOrKeyword.parent.parent.kind === 10 /* NamedTypeSpecifier */) {
3221
3287
  const namedTypeSpecifier = tokenOrKeyword.parent.parent;
3222
3288
  const resolutionResult = this._analyzer.resolveNamedTypeSpecifier(namedTypeSpecifier);
3223
3289
  const segmentIndex = Math.floor(
@@ -3225,7 +3291,7 @@ var CompletionService = class {
3225
3291
  );
3226
3292
  if (segmentIndex < resolutionResult.resolvedQualifiers.length) {
3227
3293
  let completionInIsOrAsExpressionInfo;
3228
- if (namedTypeSpecifier.parent.kind === 73 /* IsExpression */ || namedTypeSpecifier.parent.kind === 65 /* AsExpression */) {
3294
+ if (namedTypeSpecifier.parent.kind === 75 /* IsExpression */ || namedTypeSpecifier.parent.kind === 67 /* AsExpression */) {
3229
3295
  completionInIsOrAsExpressionInfo = {
3230
3296
  expressionType: this._analyzer.type.ofExpression(namedTypeSpecifier.parent.expression)
3231
3297
  };
@@ -3259,7 +3325,7 @@ var CompletionService = class {
3259
3325
  }
3260
3326
  return { kind: "none" };
3261
3327
  }
3262
- if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 135 /* QualifiedName */ && tokenOrKeyword.parent.parent.kind === 147 /* Tag */) {
3328
+ if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 137 /* QualifiedName */ && tokenOrKeyword.parent.parent.kind === 149 /* Tag */) {
3263
3329
  const tag = tokenOrKeyword.parent.parent;
3264
3330
  const resolutionResult = this._analyzer.resolveTag(tag);
3265
3331
  const segmentIndex = Math.floor(
@@ -3297,7 +3363,7 @@ var CompletionService = class {
3297
3363
  }
3298
3364
  if (syntaxContext.isUnqualifiedTypeContext !== void 0) {
3299
3365
  let completionInIsOrAsExpressionInfo;
3300
- if (tokenOrKeyword.parent.kind === 73 /* IsExpression */ || tokenOrKeyword.parent.kind === 65 /* AsExpression */) {
3366
+ if (tokenOrKeyword.parent.kind === 75 /* IsExpression */ || tokenOrKeyword.parent.kind === 67 /* AsExpression */) {
3301
3367
  completionInIsOrAsExpressionInfo = {
3302
3368
  expressionType: this._analyzer.type.ofExpression(tokenOrKeyword.parent.expression)
3303
3369
  };
@@ -3352,17 +3418,17 @@ var CompletionService = class {
3352
3418
  translationKind = 0 /* Any */;
3353
3419
  hasPrecedingKeyword = false;
3354
3420
  }
3355
- if (tokenOrKeyword.isKeyword(18 /* Import */) && tokenOrKeyword.parent.kind === 134 /* PackageImportTranslation */) {
3421
+ if (tokenOrKeyword.isKeyword(18 /* Import */) && tokenOrKeyword.parent.kind === 136 /* PackageImportTranslation */) {
3356
3422
  translationsDeclaration = tokenOrKeyword.parent.parent.parent;
3357
3423
  translationKind = 1 /* PackageImport */;
3358
3424
  hasPrecedingKeyword = true;
3359
3425
  }
3360
- if (tokenOrKeyword.isKeyword(16 /* Type */) && (tokenOrKeyword.parent.kind === 139 /* TypeTranslation */ || tokenOrKeyword.parent.kind === 133 /* MethodTypeTranslation */)) {
3426
+ if (tokenOrKeyword.isKeyword(16 /* Type */) && (tokenOrKeyword.parent.kind === 141 /* TypeTranslation */ || tokenOrKeyword.parent.kind === 135 /* MethodTypeTranslation */)) {
3361
3427
  translationsDeclaration = tokenOrKeyword.parent.parent.parent;
3362
3428
  translationKind = 3 /* Type */;
3363
3429
  hasPrecedingKeyword = true;
3364
3430
  }
3365
- if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 131 /* PackageMethodTranslation */) {
3431
+ if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 133 /* PackageMethodTranslation */) {
3366
3432
  translationsDeclaration = tokenOrKeyword.parent.parent.parent;
3367
3433
  translationKind = 2 /* Method */;
3368
3434
  hasPrecedingKeyword = true;
@@ -3382,9 +3448,9 @@ var CompletionService = class {
3382
3448
  hasPrecedingKeyword
3383
3449
  );
3384
3450
  }
3385
- if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 135 /* QualifiedName */) {
3451
+ if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 137 /* QualifiedName */) {
3386
3452
  const qualifiedName = tokenOrKeyword.parent;
3387
- if (qualifiedName.parent.kind === 134 /* PackageImportTranslation */ && qualifiedName === qualifiedName.parent.sourceName) {
3453
+ if (qualifiedName.parent.kind === 136 /* PackageImportTranslation */ && qualifiedName === qualifiedName.parent.sourceName) {
3388
3454
  const precedingSegmentNames = qualifiedName.qualifiers.takeWhile((s) => s.rangeStart < tokenOrKeyword.value.rangeStart).map((p) => this._analyzer.createNameFromIdentifier(p)).toArray();
3389
3455
  const sourceLocale = translationPackage.getTranslatedPackage().getLocale();
3390
3456
  return new PackageImportCompletionContext(precedingSegmentNames, { sourceLocale });
@@ -3409,12 +3475,12 @@ var CompletionService = class {
3409
3475
  translationKind = 0 /* Any */;
3410
3476
  hasPrecedingKeyword = false;
3411
3477
  }
3412
- if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 132 /* TypeMethodTranslation */) {
3478
+ if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 134 /* TypeMethodTranslation */) {
3413
3479
  typeTranslation = tokenOrKeyword.parent.parent.parent;
3414
3480
  translationKind = 1 /* Method */;
3415
3481
  hasPrecedingKeyword = true;
3416
3482
  }
3417
- if (tokenOrKeyword.isKeyword(30 /* Creation */) && tokenOrKeyword.parent.kind === 126 /* ConstructorTranslation */) {
3483
+ if (tokenOrKeyword.isKeyword(30 /* Creation */) && tokenOrKeyword.parent.kind === 128 /* ConstructorTranslation */) {
3418
3484
  typeTranslation = tokenOrKeyword.parent.parent.parent;
3419
3485
  translationKind = 3 /* Constructor */;
3420
3486
  hasPrecedingKeyword = true;
@@ -3444,21 +3510,21 @@ var CompletionService = class {
3444
3510
  let signatures;
3445
3511
  let valueArguments;
3446
3512
  switch (role.argumentList.parent.kind) {
3447
- case 69 /* CallExpression */:
3513
+ case 71 /* CallExpression */:
3448
3514
  signatures = SignatureForNode.getSignaturesForCallExpression(this._analyzer, role.argumentList.parent);
3449
3515
  valueArguments = ValueArgumentFactory.createValueArgumentsOfCallExpression(role.argumentList.parent);
3450
3516
  break;
3451
- case 70 /* AutotypeCallExpression */:
3517
+ case 72 /* AutotypeCallExpression */:
3452
3518
  signatures = SignatureForNode.getSignaturesForAutotypeCallExpression(this._analyzer, role.argumentList.parent);
3453
3519
  valueArguments = ValueArgumentFactory.createValueArgumentsOfAutotypeCallExpression(
3454
3520
  role.argumentList.parent
3455
3521
  );
3456
3522
  break;
3457
- case 147 /* Tag */:
3523
+ case 149 /* Tag */:
3458
3524
  signatures = SignatureForNode.getSignaturesForTag(this._analyzer, role.argumentList.parent);
3459
3525
  valueArguments = ValueArgumentFactory.createValueArgumentsOfTag(role.argumentList.parent);
3460
3526
  break;
3461
- case 71 /* IndexedAccessExpression */:
3527
+ case 73 /* IndexedAccessExpression */:
3462
3528
  signatures = SignatureForNode.getSignaturesForIndexedAccessExpression(
3463
3529
  this._analyzer,
3464
3530
  role.argumentList.parent
@@ -3498,6 +3564,11 @@ var CompletionService = class {
3498
3564
  }
3499
3565
  return { targetTypes: void 0, targetSignaturesParameters: void 0 };
3500
3566
  }
3567
+ if (role.kind === "error-value") {
3568
+ const errorType = this._analyzer.standardTypes.error;
3569
+ const textType = this._analyzer.standardTypes.text;
3570
+ return { targetTypes: [errorType, textType], targetSignaturesParameters: void 0 };
3571
+ }
3501
3572
  if (role.kind === "function-block-expression") {
3502
3573
  const targetType = semanticContext.getContainingSubprogram()?.getReturnType();
3503
3574
  if (targetType !== void 0 && !targetType.equals(this._analyzer.standardTypes.none)) {
@@ -3603,7 +3674,7 @@ var CompletionService = class {
3603
3674
  kinds.add(30 /* Creation */).add(12 /* Function */).add(47 /* Destruction */).add(58 /* Get */).add(59 /* Set */);
3604
3675
  }
3605
3676
  if (syntaxContext.isStatementContext) {
3606
- kinds.add(7 /* Run */).add(34 /* For */).add(25 /* While */).add(26 /* Loop */).add(15 /* Return */).add(20 /* Error */).add(28 /* Yield */).add(32 /* BreakLoop */).add(33 /* ContinueLoop */).add(13 /* If */).add(44 /* Switch */).add(1 /* Let */).add(35 /* Const */).add(46 /* Dispose */).add(8 /* Try */).add(12 /* Function */).add(40 /* Async */);
3677
+ kinds.add(7 /* Run */).add(34 /* For */).add(25 /* While */).add(26 /* Loop */).add(15 /* Return */).add(20 /* Error */).add(19 /* Important */).add(28 /* Yield */).add(32 /* BreakLoop */).add(33 /* ContinueLoop */).add(13 /* If */).add(44 /* Switch */).add(1 /* Let */).add(35 /* Const */).add(46 /* Dispose */).add(8 /* Try */).add(12 /* Function */).add(40 /* Async */);
3607
3678
  }
3608
3679
  if (this.isFromKeywordContext(positionDescription)) {
3609
3680
  kinds.add(9 /* From */);
@@ -3650,7 +3721,7 @@ var CompletionService = class {
3650
3721
  if (syntaxContext.isUnqualifiedTypeContext?.allowsAnonymousTypes === true) {
3651
3722
  kinds.add(5 /* PlainObject */).add(4 /* Object */).add(6 /* Variant */).add(3 /* Aspect */).add(12 /* Function */).add(40 /* Async */);
3652
3723
  }
3653
- if (positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isKeyword(40 /* Async */) && (positionDescription.tokenOrKeyword.parent.kind === 58 /* NestedMethodDeclaration */ || positionDescription.tokenOrKeyword.parent.kind === 74 /* MethodLiteral */ || positionDescription.tokenOrKeyword.parent.kind === 29 /* MethodTypeDeclarationBody */)) {
3724
+ if (positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isKeyword(40 /* Async */) && (positionDescription.tokenOrKeyword.parent.kind === 60 /* NestedMethodDeclaration */ || positionDescription.tokenOrKeyword.parent.kind === 76 /* MethodLiteral */ || positionDescription.tokenOrKeyword.parent.kind === 31 /* MethodTypeDeclarationBody */)) {
3654
3725
  kinds.add(12 /* Function */);
3655
3726
  }
3656
3727
  return Query.from(kinds.values()).map(
@@ -3662,35 +3733,35 @@ var CompletionService = class {
3662
3733
  return false;
3663
3734
  }
3664
3735
  const tokenOrKeyword = positionDescription.tokenOrKeyword;
3665
- return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 116 /* LoopStatement */;
3736
+ return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 95 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 118 /* LoopStatement */;
3666
3737
  }
3667
3738
  isModifierLevelContext(positionDescription) {
3668
3739
  if (positionDescription.kind !== "after-token-or-keyword") {
3669
3740
  return false;
3670
3741
  }
3671
3742
  const tokenOrKeyword = positionDescription.tokenOrKeyword;
3672
- return tokenOrKeyword.isToken(44 /* OpenParenthesis */) && tokenOrKeyword.parent.kind === 149 /* Modifier */;
3743
+ return tokenOrKeyword.isToken(44 /* OpenParenthesis */) && tokenOrKeyword.parent.kind === 151 /* Modifier */;
3673
3744
  }
3674
3745
  isElseOrElseIfKeywordContext(positionDescription) {
3675
3746
  if (positionDescription.kind !== "after-token-or-keyword") {
3676
3747
  return false;
3677
3748
  }
3678
3749
  const tokenOrKeyword = positionDescription.tokenOrKeyword;
3679
- return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind === 109 /* IfStatement */ && tokenOrKeyword.parent === tokenOrKeyword.parent.parent.block || tokenOrKeyword.parent.parent.kind === 111 /* ElseIfClause */);
3750
+ return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 95 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind === 111 /* IfStatement */ && tokenOrKeyword.parent === tokenOrKeyword.parent.parent.block || tokenOrKeyword.parent.parent.kind === 113 /* ElseIfClause */);
3680
3751
  }
3681
3752
  isCatchKeywordContext(positionDescription) {
3682
3753
  if (positionDescription.kind !== "after-token-or-keyword") {
3683
3754
  return false;
3684
3755
  }
3685
3756
  const tokenOrKeyword = positionDescription.tokenOrKeyword;
3686
- return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 99 /* TryStatement */;
3757
+ return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 95 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 101 /* TryStatement */;
3687
3758
  }
3688
3759
  isFinallyKeywordContext(positionDescription) {
3689
3760
  if (positionDescription.kind !== "after-token-or-keyword") {
3690
3761
  return false;
3691
3762
  }
3692
3763
  const tokenOrKeyword = positionDescription.tokenOrKeyword;
3693
- return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind === 99 /* TryStatement */ || tokenOrKeyword.parent.parent.kind === 100 /* CatchClause */);
3764
+ return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 95 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind === 101 /* TryStatement */ || tokenOrKeyword.parent.parent.kind === 102 /* CatchClause */);
3694
3765
  }
3695
3766
  isTypeKindCompletionContext(positionDescription) {
3696
3767
  return positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isToken(57 /* Equals */) && NodeTypeUtils.isPackageTypeDeclaration(positionDescription.tokenOrKeyword.parent);
@@ -3700,17 +3771,17 @@ var CompletionService = class {
3700
3771
  return false;
3701
3772
  }
3702
3773
  const token = positionDescription.tokenOrKeyword.value;
3703
- return token.parent.kind === 60 /* EnumerationVariableDeclaration */ && (token.parent.parent.elements.length > 0 && token.parent.parent.elements[token.parent.parent.elements.length - 1] === token.parent || token.parent.parent.elements.length > 1 && token.parent.parent.elements[token.parent.parent.elements.length - 2] === token.parent);
3774
+ return token.parent.kind === 62 /* EnumerationVariableDeclaration */ && (token.parent.parent.elements.length > 0 && token.parent.parent.elements[token.parent.parent.elements.length - 1] === token.parent || token.parent.parent.elements.length > 1 && token.parent.parent.elements[token.parent.parent.elements.length - 2] === token.parent);
3704
3775
  }
3705
3776
  isCaseKeywordContext(positionDescription, syntaxContext) {
3706
3777
  if (positionDescription.kind !== "after-token-or-keyword") {
3707
3778
  return false;
3708
3779
  }
3709
3780
  const tokenOrKeyword = positionDescription.tokenOrKeyword;
3710
- if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 121 /* CaseClause */) {
3781
+ if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 95 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 123 /* CaseClause */) {
3711
3782
  return true;
3712
3783
  }
3713
- if (syntaxContext.precedingExpression !== void 0 && syntaxContext.precedingExpression.parent.kind === 119 /* SwitchStatement */) {
3784
+ if (syntaxContext.precedingExpression !== void 0 && syntaxContext.precedingExpression.parent.kind === 121 /* SwitchStatement */) {
3714
3785
  return true;
3715
3786
  }
3716
3787
  return false;
@@ -3730,7 +3801,7 @@ var CompletionService = class {
3730
3801
  return result;
3731
3802
  }
3732
3803
  prioritizeItemsFromUnionType(items, type) {
3733
- const constituentTypeEntities = Query.from(type.unaliasedFlattenedTypes).mapAndFilter((t) => this.getEntityFromType(t)).uniqueToSet();
3804
+ const constituentTypeEntities = Query.from(type.unaliasedFlattenedTypes).mapAndFilter((t) => t.getEntity()).uniqueToSet();
3734
3805
  for (const item of items) {
3735
3806
  if (item.kind === "named-type" && constituentTypeEntities.has(item.entity)) {
3736
3807
  item.prefix = "*";
@@ -3813,25 +3884,6 @@ var CompletionService = class {
3813
3884
  }
3814
3885
  return result;
3815
3886
  }
3816
- getEntityFromType(type) {
3817
- switch (type.kind) {
3818
- case "structured":
3819
- return type.getEntity();
3820
- case "variant":
3821
- return type.getEntity();
3822
- case "method":
3823
- return type.getEntity();
3824
- case "alias":
3825
- return type.getEntity();
3826
- case "parameter":
3827
- return type.getEntity();
3828
- case "unresolved":
3829
- case "union":
3830
- return void 0;
3831
- default:
3832
- Debug.never(type);
3833
- }
3834
- }
3835
3887
  getTypeCompletionItemInfosFromPackage(searchLocation) {
3836
3888
  return searchLocation.packageMemberLookup.getNamedMembers(searchLocation.hidingMatcher).map((m) => {
3837
3889
  if (m.value.kind === 2 /* Type */) {
@@ -4377,11 +4429,11 @@ function getRightmostChildExcludingValidEmptyNodes(node) {
4377
4429
  }
4378
4430
  function isInvalidNode(node) {
4379
4431
  switch (node.kind) {
4380
- case 72 /* InvalidExpression */:
4381
- case 43 /* InvalidPackageMemberDeclaration */:
4382
- case 113 /* InvalidStatement */:
4383
- case 57 /* InvalidTypeMemberDeclaration */:
4384
- case 16 /* InvalidTypeSpecifier */:
4432
+ case 74 /* InvalidExpression */:
4433
+ case 45 /* InvalidPackageMemberDeclaration */:
4434
+ case 115 /* InvalidStatement */:
4435
+ case 59 /* InvalidTypeMemberDeclaration */:
4436
+ case 18 /* InvalidTypeSpecifier */:
4385
4437
  return true;
4386
4438
  case 0 /* Token */:
4387
4439
  return node.isMissing;
@@ -4821,7 +4873,7 @@ var MergedOverloadedMethodCompletionItemInfo = class {
4821
4873
  return this.firstOverloadInfo.getCompletionItemKind();
4822
4874
  }
4823
4875
  getDetails() {
4824
- const overloadsWord = LocalizationHelper.localizeHelperPhrase(6 /* Overloads */, this.ctx.locale);
4876
+ const overloadsWord = LocalizationHelper.localizeHelperPhrase(7 /* Overloads */, this.ctx.locale);
4825
4877
  const overloadCountText = ` (+${overloadsWord}: ${this.overloadCount - 1})`;
4826
4878
  const originalDetails = this.firstOverloadInfo.getDetails();
4827
4879
  return originalDetails + overloadCountText;
@@ -5163,6 +5215,12 @@ var ExpressionRole_returnedValue = class {
5163
5215
  this.kind = "returned-value";
5164
5216
  }
5165
5217
  };
5218
+ var ExpressionRole_errorValue = class {
5219
+ constructor(errorStatement) {
5220
+ this.errorStatement = errorStatement;
5221
+ this.kind = "error-value";
5222
+ }
5223
+ };
5166
5224
  var ExpressionRole_functionBlockExpression = class {
5167
5225
  constructor(functionBlock) {
5168
5226
  this.functionBlock = functionBlock;
@@ -5205,7 +5263,7 @@ var SyntaxContextFactory = class {
5205
5263
  if (positionDescription.kind === "after-token-or-keyword") {
5206
5264
  isUnqualifiedTypeContext = this.isUnqualifiedTypeContext(positionDescription.tokenOrKeyword);
5207
5265
  }
5208
- const isUnqualifiedTagNameCompletionContext = positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isToken(35 /* HashSign */) && positionDescription.tokenOrKeyword.parent.kind === 147 /* Tag */;
5266
+ const isUnqualifiedTagNameCompletionContext = positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isToken(35 /* HashSign */) && positionDescription.tokenOrKeyword.parent.kind === 149 /* Tag */;
5209
5267
  let isTopLevelTranslationListContext;
5210
5268
  if (positionDescription.kind === "after-token-or-keyword") {
5211
5269
  isTopLevelTranslationListContext = this.isTopLevelTranslationListContext(positionDescription.tokenOrKeyword);
@@ -5231,52 +5289,52 @@ var SyntaxContextFactory = class {
5231
5289
  }
5232
5290
  static isExpressionOrStatementContext(tokenOrKeyword) {
5233
5291
  if (tokenOrKeyword.isToken(57 /* Equals */)) {
5234
- if (tokenOrKeyword.parent.kind === 91 /* AssignmentStatement */) {
5292
+ if (tokenOrKeyword.parent.kind === 93 /* AssignmentStatement */) {
5235
5293
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.right);
5236
5294
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5237
5295
  }
5238
- if (tokenOrKeyword.parent.kind === 59 /* LocalVariableDeclaration */) {
5296
+ if (tokenOrKeyword.parent.kind === 61 /* LocalVariableDeclaration */) {
5239
5297
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.initializer);
5240
5298
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5241
5299
  }
5242
- if (tokenOrKeyword.parent.kind === 35 /* PackageVariableDeclaration */) {
5300
+ if (tokenOrKeyword.parent.kind === 37 /* PackageVariableDeclaration */) {
5243
5301
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.initializer);
5244
5302
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5245
5303
  }
5246
- if (tokenOrKeyword.parent.kind === 54 /* TypeVariableDeclaration */) {
5304
+ if (tokenOrKeyword.parent.kind === 56 /* TypeVariableDeclaration */) {
5247
5305
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.initializer);
5248
5306
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5249
5307
  }
5250
- if (tokenOrKeyword.parent.kind === 144 /* ParameterDeclaration */) {
5308
+ if (tokenOrKeyword.parent.kind === 146 /* ParameterDeclaration */) {
5251
5309
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.defaultValue);
5252
5310
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5253
5311
  }
5254
- if (tokenOrKeyword.parent.kind === 145 /* Argument */) {
5312
+ if (tokenOrKeyword.parent.kind === 147 /* Argument */) {
5255
5313
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.value);
5256
5314
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5257
5315
  }
5258
- if (tokenOrKeyword.parent.kind === 142 /* VariantDeclaration */) {
5316
+ if (tokenOrKeyword.parent.kind === 144 /* VariantDeclaration */) {
5259
5317
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.value);
5260
5318
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5261
5319
  }
5262
5320
  }
5263
- if (tokenOrKeyword.parent.kind === 91 /* AssignmentStatement */) {
5321
+ if (tokenOrKeyword.parent.kind === 93 /* AssignmentStatement */) {
5264
5322
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.right);
5265
5323
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5266
5324
  }
5267
- if (tokenOrKeyword.parent.kind === 77 /* PrefixUnaryExpression */) {
5325
+ if (tokenOrKeyword.parent.kind === 79 /* PrefixUnaryExpression */) {
5268
5326
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.operand);
5269
5327
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5270
5328
  }
5271
- if (tokenOrKeyword.parent.kind === 66 /* BinaryExpression */) {
5329
+ if (tokenOrKeyword.parent.kind === 68 /* BinaryExpression */) {
5272
5330
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.right);
5273
5331
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5274
5332
  }
5275
- if (tokenOrKeyword.isToken(7 /* TextTemplateHead */) && tokenOrKeyword.parent.kind === 81 /* TextTemplateLiteral */) {
5333
+ if (tokenOrKeyword.isToken(7 /* TextTemplateHead */) && tokenOrKeyword.parent.kind === 83 /* TextTemplateLiteral */) {
5276
5334
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.spanList.spans.at(0)?.expression);
5277
5335
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5278
5336
  }
5279
- if (tokenOrKeyword.isToken(8 /* TextTemplatePart */) && tokenOrKeyword.parent.kind === 83 /* TextTemplateSpan */) {
5337
+ if (tokenOrKeyword.isToken(8 /* TextTemplatePart */) && tokenOrKeyword.parent.kind === 85 /* TextTemplateSpan */) {
5280
5338
  let expressionForTargetType;
5281
5339
  const spanList = tokenOrKeyword.parent.parent;
5282
5340
  const spanIndex = spanList.spans.indexOf(tokenOrKeyword.parent);
@@ -5288,12 +5346,12 @@ var SyntaxContextFactory = class {
5288
5346
  isStatementContext: false
5289
5347
  };
5290
5348
  }
5291
- if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */) {
5349
+ if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 95 /* StatementBlock */) {
5292
5350
  return { isExpressionContext: { expressionRole: new ExpressionRole_other(void 0) }, isStatementContext: true };
5293
5351
  }
5294
- if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 94 /* FunctionBlock */) {
5352
+ if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 96 /* FunctionBlock */) {
5295
5353
  const block = tokenOrKeyword.parent;
5296
- if (block.expressionOrStatementList.kind !== 92 /* StatementList */ || block.expressionOrStatementList.statements.count() === 0) {
5354
+ if (block.expressionOrStatementList.kind !== 94 /* StatementList */ || block.expressionOrStatementList.statements.count() === 0) {
5297
5355
  return {
5298
5356
  isExpressionContext: { expressionRole: new ExpressionRole_functionBlockExpression(block) },
5299
5357
  isStatementContext: true
@@ -5305,27 +5363,27 @@ var SyntaxContextFactory = class {
5305
5363
  };
5306
5364
  }
5307
5365
  }
5308
- if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 92 /* StatementList */) {
5366
+ if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 94 /* StatementList */) {
5309
5367
  return { isExpressionContext: { expressionRole: new ExpressionRole_other(void 0) }, isStatementContext: true };
5310
5368
  }
5311
5369
  if (tokenOrKeyword.isToken(44 /* OpenParenthesis */)) {
5312
- if (tokenOrKeyword.parent.kind === 75 /* ParenthesizedExpression */) {
5370
+ if (tokenOrKeyword.parent.kind === 77 /* ParenthesizedExpression */) {
5313
5371
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
5314
5372
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5315
5373
  }
5316
- if (tokenOrKeyword.parent.kind === 79 /* ReferenceExpression */) {
5374
+ if (tokenOrKeyword.parent.kind === 81 /* ReferenceExpression */) {
5317
5375
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
5318
5376
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5319
5377
  }
5320
- if (tokenOrKeyword.parent.kind === 69 /* CallExpression */) {
5378
+ if (tokenOrKeyword.parent.kind === 71 /* CallExpression */) {
5321
5379
  const expressionRole = new ExpressionRole_argument(tokenOrKeyword.parent.argumentList, 0);
5322
5380
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5323
5381
  }
5324
- if (tokenOrKeyword.parent.kind === 70 /* AutotypeCallExpression */) {
5382
+ if (tokenOrKeyword.parent.kind === 72 /* AutotypeCallExpression */) {
5325
5383
  const expressionRole = new ExpressionRole_argument(tokenOrKeyword.parent.argumentList, 0);
5326
5384
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5327
5385
  }
5328
- if (tokenOrKeyword.parent.kind === 147 /* Tag */) {
5386
+ if (tokenOrKeyword.parent.kind === 149 /* Tag */) {
5329
5387
  const argumentList = tokenOrKeyword.parent.argumentList;
5330
5388
  if (argumentList !== void 0) {
5331
5389
  const expressionRole = new ExpressionRole_argument(argumentList, 0);
@@ -5333,16 +5391,16 @@ var SyntaxContextFactory = class {
5333
5391
  }
5334
5392
  }
5335
5393
  }
5336
- if (tokenOrKeyword.isToken(45 /* OpenSquareBracket */) && tokenOrKeyword.parent.kind === 71 /* IndexedAccessExpression */) {
5394
+ if (tokenOrKeyword.isToken(45 /* OpenSquareBracket */) && tokenOrKeyword.parent.kind === 73 /* IndexedAccessExpression */) {
5337
5395
  const expressionRole = new ExpressionRole_argument(tokenOrKeyword.parent.argumentList, 0);
5338
5396
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5339
5397
  }
5340
- if (tokenOrKeyword.isToken(45 /* OpenSquareBracket */) && tokenOrKeyword.parent.kind === 61 /* ArrayLiteral */) {
5398
+ if (tokenOrKeyword.isToken(45 /* OpenSquareBracket */) && tokenOrKeyword.parent.kind === 63 /* ArrayLiteral */) {
5341
5399
  const expressionRole = new ExpressionRole_arrayElement(tokenOrKeyword.parent);
5342
5400
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5343
5401
  }
5344
5402
  if (tokenOrKeyword.isToken(24 /* Comma */)) {
5345
- if (tokenOrKeyword.parent.kind === 68 /* ArgumentList */) {
5403
+ if (tokenOrKeyword.parent.kind === 70 /* ArgumentList */) {
5346
5404
  const argumentList = tokenOrKeyword.parent;
5347
5405
  let index = 0;
5348
5406
  for (const element of argumentList.elements) {
@@ -5356,56 +5414,64 @@ var SyntaxContextFactory = class {
5356
5414
  const expressionRole = new ExpressionRole_argument(argumentList, index);
5357
5415
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5358
5416
  }
5359
- if (tokenOrKeyword.parent.kind === 120 /* MatchExpressionList */) {
5417
+ if (tokenOrKeyword.parent.kind === 122 /* MatchExpressionList */) {
5360
5418
  const expressionRole = new ExpressionRole_matchListElement(tokenOrKeyword.parent.parent.parent.parent);
5361
5419
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5362
5420
  }
5363
- if (tokenOrKeyword.parent.kind === 62 /* ArrayLiteralElementList */) {
5421
+ if (tokenOrKeyword.parent.kind === 64 /* ArrayLiteralElementList */) {
5364
5422
  const expressionRole = new ExpressionRole_arrayElement(tokenOrKeyword.parent.parent);
5365
5423
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5366
5424
  }
5367
5425
  }
5368
- if (tokenOrKeyword.isKeyword(45 /* Case */) && tokenOrKeyword.parent.kind === 121 /* CaseClause */) {
5426
+ if (tokenOrKeyword.isKeyword(45 /* Case */) && tokenOrKeyword.parent.kind === 123 /* CaseClause */) {
5369
5427
  const expressionRole = new ExpressionRole_matchListElement(tokenOrKeyword.parent.parent.parent);
5370
5428
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5371
5429
  }
5372
- if (tokenOrKeyword.isKeyword(15 /* Return */) && tokenOrKeyword.parent.kind === 117 /* ReturnStatement */) {
5430
+ if (tokenOrKeyword.isKeyword(15 /* Return */) && tokenOrKeyword.parent.kind === 119 /* ReturnStatement */) {
5373
5431
  const expressionRole = new ExpressionRole_returnedValue(tokenOrKeyword.parent);
5374
5432
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5375
5433
  }
5376
- if (tokenOrKeyword.isKeyword(44 /* Switch */) && tokenOrKeyword.parent.kind === 119 /* SwitchStatement */) {
5434
+ if (tokenOrKeyword.isKeyword(20 /* Error */) && tokenOrKeyword.parent.kind === 106 /* ErrorStatement */) {
5435
+ const expressionRole = new ExpressionRole_errorValue(tokenOrKeyword.parent);
5436
+ return { isExpressionContext: { expressionRole }, isStatementContext: false };
5437
+ }
5438
+ if (tokenOrKeyword.isKeyword(19 /* Important */) && tokenOrKeyword.parent.kind === 107 /* ImportantStatement */) {
5439
+ const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
5440
+ return { isExpressionContext: { expressionRole }, isStatementContext: false };
5441
+ }
5442
+ if (tokenOrKeyword.isKeyword(44 /* Switch */) && tokenOrKeyword.parent.kind === 121 /* SwitchStatement */) {
5377
5443
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
5378
5444
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5379
5445
  }
5380
- if (tokenOrKeyword.isKeyword(13 /* If */) && tokenOrKeyword.parent.kind === 109 /* IfStatement */) {
5446
+ if (tokenOrKeyword.isKeyword(13 /* If */) && tokenOrKeyword.parent.kind === 111 /* IfStatement */) {
5381
5447
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
5382
5448
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5383
5449
  }
5384
- if (tokenOrKeyword.isKeyword(11 /* ElseIf */) && tokenOrKeyword.parent.kind === 111 /* ElseIfClause */) {
5450
+ if (tokenOrKeyword.isKeyword(11 /* ElseIf */) && tokenOrKeyword.parent.kind === 113 /* ElseIfClause */) {
5385
5451
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
5386
5452
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5387
5453
  }
5388
- if (tokenOrKeyword.isKeyword(9 /* From */) && tokenOrKeyword.parent.kind === 108 /* ForStatement */) {
5454
+ if (tokenOrKeyword.isKeyword(9 /* From */) && tokenOrKeyword.parent.kind === 110 /* ForStatement */) {
5389
5455
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.enumeratedExpression);
5390
5456
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5391
5457
  }
5392
- if (tokenOrKeyword.isKeyword(25 /* While */) && tokenOrKeyword.parent.kind === 122 /* WhileStatement */) {
5458
+ if (tokenOrKeyword.isKeyword(25 /* While */) && tokenOrKeyword.parent.kind === 124 /* WhileStatement */) {
5393
5459
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
5394
5460
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5395
5461
  }
5396
- if (tokenOrKeyword.isKeyword(27 /* RepeatWhile */) && tokenOrKeyword.parent.kind === 116 /* LoopStatement */) {
5462
+ if (tokenOrKeyword.isKeyword(27 /* RepeatWhile */) && tokenOrKeyword.parent.kind === 118 /* LoopStatement */) {
5397
5463
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
5398
5464
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5399
5465
  }
5400
- if (tokenOrKeyword.isKeyword(28 /* Yield */) && tokenOrKeyword.parent.kind === 123 /* YieldStatement */) {
5466
+ if (tokenOrKeyword.isKeyword(28 /* Yield */) && tokenOrKeyword.parent.kind === 125 /* YieldStatement */) {
5401
5467
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
5402
5468
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5403
5469
  }
5404
- if (tokenOrKeyword.isKeyword(29 /* When */) && tokenOrKeyword.parent.kind === 76 /* WhenTernaryExpression */) {
5470
+ if (tokenOrKeyword.isKeyword(29 /* When */) && tokenOrKeyword.parent.kind === 78 /* WhenTernaryExpression */) {
5405
5471
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
5406
5472
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5407
5473
  }
5408
- if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind === 76 /* WhenTernaryExpression */) {
5474
+ if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind === 78 /* WhenTernaryExpression */) {
5409
5475
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.secondExpression);
5410
5476
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5411
5477
  }
@@ -5424,52 +5490,52 @@ var SyntaxContextFactory = class {
5424
5490
  if (tokenOrKeyword.isToken(51 /* Semicolon */) && (tokenOrKeyword.parent.kind === 2 /* PackageMemberDeclarationList */ || tokenOrKeyword.parent.kind === 4 /* PackageImportDirectiveList */)) {
5425
5491
  return true;
5426
5492
  }
5427
- if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 32 /* TypeMemberDeclarationBlock */ && (tokenOrKeyword.parent.parent.kind === 40 /* TypeExtensionDeclaration */ || tokenOrKeyword.parent.parent.parent.kind === 33 /* PackageStructuredTypeDeclaration */ || tokenOrKeyword.parent.parent.parent.kind === 38 /* PackageVariantTypeDeclaration */ || tokenOrKeyword.parent.parent.parent.kind === 22 /* PackageAliasTypeDeclaration */)) {
5493
+ if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 34 /* TypeMemberDeclarationBlock */ && (tokenOrKeyword.parent.parent.kind === 42 /* TypeExtensionDeclaration */ || tokenOrKeyword.parent.parent.parent.kind === 35 /* PackageStructuredTypeDeclaration */ || tokenOrKeyword.parent.parent.parent.kind === 40 /* PackageVariantTypeDeclaration */ || tokenOrKeyword.parent.parent.parent.kind === 24 /* PackageAliasTypeDeclaration */)) {
5428
5494
  return true;
5429
5495
  }
5430
- if (tokenOrKeyword.isToken(20 /* CloseBrace */) && (tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */ || tokenOrKeyword.parent.kind === 24 /* PackageMemberGroupDeclaration */ || tokenOrKeyword.parent.kind === 6 /* PackageGroupImportDirective */ || tokenOrKeyword.parent.kind === 94 /* FunctionBlock */ && (tokenOrKeyword.parent.parent.kind === 25 /* PackageConstructorDeclaration */ || tokenOrKeyword.parent.parent.kind === 26 /* PackageEntryPointDeclaration */ || tokenOrKeyword.parent.parent.kind === 27 /* PackageMethodDeclaration */))) {
5496
+ if (tokenOrKeyword.isToken(20 /* CloseBrace */) && (tokenOrKeyword.parent.kind === 23 /* TranslationsDeclaration */ || tokenOrKeyword.parent.kind === 26 /* PackageMemberGroupDeclaration */ || tokenOrKeyword.parent.kind === 6 /* PackageGroupImportDirective */ || tokenOrKeyword.parent.kind === 96 /* FunctionBlock */ && (tokenOrKeyword.parent.parent.kind === 27 /* PackageConstructorDeclaration */ || tokenOrKeyword.parent.parent.kind === 28 /* PackageEntryPointDeclaration */ || tokenOrKeyword.parent.parent.kind === 29 /* PackageMethodDeclaration */))) {
5431
5497
  return true;
5432
5498
  }
5433
- if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 24 /* PackageMemberGroupDeclaration */) {
5499
+ if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 26 /* PackageMemberGroupDeclaration */) {
5434
5500
  return true;
5435
5501
  }
5436
- if (SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 5 /* SinglePackageImportDirective */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 27 /* PackageMethodDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 28 /* PackageMethodTypeDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 22 /* PackageAliasTypeDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 35 /* PackageVariableDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
5502
+ if (SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 5 /* SinglePackageImportDirective */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 29 /* PackageMethodDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 30 /* PackageMethodTypeDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 24 /* PackageAliasTypeDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 37 /* PackageVariableDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
5437
5503
  tokenOrKeyword,
5438
- 36 /* PackageVariableGetterDeclaration */
5439
- ) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 37 /* PackageVariableSetterDeclaration */)) {
5504
+ 38 /* PackageVariableGetterDeclaration */
5505
+ ) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 39 /* PackageVariableSetterDeclaration */)) {
5440
5506
  return true;
5441
5507
  }
5442
- if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind === 149 /* Modifier */ && tokenOrKeyword.value === tokenOrKeyword.parent.value && tokenOrKeyword.parent.openParenthesisToken === void 0 && NodeTypeUtils.isPackageMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
5508
+ if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind === 151 /* Modifier */ && tokenOrKeyword.value === tokenOrKeyword.parent.value && tokenOrKeyword.parent.openParenthesisToken === void 0 && NodeTypeUtils.isPackageMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
5443
5509
  return true;
5444
5510
  }
5445
- if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind === 149 /* Modifier */ && NodeTypeUtils.isPackageMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
5511
+ if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind === 151 /* Modifier */ && NodeTypeUtils.isPackageMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
5446
5512
  return true;
5447
5513
  }
5448
5514
  return false;
5449
5515
  }
5450
5516
  static isTypeMemberDeclarationListContext(tokenOrKeyword) {
5451
- if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 31 /* TypeMemberDeclarationList */) {
5517
+ if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 33 /* TypeMemberDeclarationList */) {
5452
5518
  return true;
5453
5519
  }
5454
- if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 32 /* TypeMemberDeclarationBlock */) {
5520
+ if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 34 /* TypeMemberDeclarationBlock */) {
5455
5521
  return true;
5456
5522
  }
5457
- if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 44 /* TypeMemberGroupDeclaration */) {
5523
+ if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 46 /* TypeMemberGroupDeclaration */) {
5458
5524
  return true;
5459
5525
  }
5460
- if (SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 54 /* TypeVariableDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 55 /* TypeVariableGetterDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 56 /* TypeVariableSetterDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 47 /* TypeIndexedGetterDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 48 /* TypeIndexedSetterDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
5526
+ if (SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 56 /* TypeVariableDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 57 /* TypeVariableGetterDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 58 /* TypeVariableSetterDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 49 /* TypeIndexedGetterDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 50 /* TypeIndexedSetterDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
5461
5527
  tokenOrKeyword,
5462
- 50 /* TypeDereferencedVariableGetterDeclaration */
5528
+ 52 /* TypeDereferencedVariableGetterDeclaration */
5463
5529
  ) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
5464
5530
  tokenOrKeyword,
5465
- 51 /* TypeDereferencedVariableSetterDeclaration */
5466
- ) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 52 /* TypeMethodDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 53 /* OperatorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 45 /* TypeConstructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 46 /* TypeDestructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 142 /* VariantDeclaration */)) {
5531
+ 53 /* TypeDereferencedVariableSetterDeclaration */
5532
+ ) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 54 /* TypeMethodDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 55 /* OperatorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 47 /* TypeConstructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 48 /* TypeDestructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 144 /* VariantDeclaration */)) {
5467
5533
  return true;
5468
5534
  }
5469
- if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind === 149 /* Modifier */ && tokenOrKeyword.value === tokenOrKeyword.parent.value && tokenOrKeyword.parent.openParenthesisToken === void 0 && NodeTypeUtils.isTypeMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
5535
+ if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind === 151 /* Modifier */ && tokenOrKeyword.value === tokenOrKeyword.parent.value && tokenOrKeyword.parent.openParenthesisToken === void 0 && NodeTypeUtils.isTypeMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
5470
5536
  return true;
5471
5537
  }
5472
- if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind === 149 /* Modifier */ && NodeTypeUtils.isTypeMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
5538
+ if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind === 151 /* Modifier */ && NodeTypeUtils.isTypeMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
5473
5539
  return true;
5474
5540
  }
5475
5541
  return false;
@@ -5506,79 +5572,82 @@ var SyntaxContextFactory = class {
5506
5572
  return result;
5507
5573
  }
5508
5574
  static isUnqualifiedTypeContext(tokenOrKeyword) {
5509
- if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind === 156 /* TypeAnnotation */) {
5575
+ if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind === 158 /* TypeAnnotation */) {
5510
5576
  return { allowsAnonymousTypes: true };
5511
5577
  }
5512
- if ((tokenOrKeyword.isKeyword(4 /* Object */) || tokenOrKeyword.isKeyword(5 /* PlainObject */) || tokenOrKeyword.isKeyword(3 /* Aspect */)) && tokenOrKeyword.parent.kind === 34 /* StructuredTypeDeclarationBody */) {
5578
+ if ((tokenOrKeyword.isKeyword(4 /* Object */) || tokenOrKeyword.isKeyword(5 /* PlainObject */) || tokenOrKeyword.isKeyword(3 /* Aspect */)) && tokenOrKeyword.parent.kind === 36 /* StructuredTypeDeclarationBody */) {
5513
5579
  return { allowsAnonymousTypes: false };
5514
5580
  }
5515
- if (tokenOrKeyword.isKeyword(16 /* Type */) && (NodeTypeUtils.isPackageTypeDeclaration(tokenOrKeyword.parent) || tokenOrKeyword.parent.kind === 40 /* TypeExtensionDeclaration */)) {
5581
+ if (tokenOrKeyword.isKeyword(16 /* Type */) && (NodeTypeUtils.isPackageTypeDeclaration(tokenOrKeyword.parent) || tokenOrKeyword.parent.kind === 42 /* TypeExtensionDeclaration */)) {
5516
5582
  return { allowsAnonymousTypes: false };
5517
5583
  }
5518
- if (tokenOrKeyword.isToken(36 /* LessThan */) && tokenOrKeyword.parent.kind === 152 /* TypeArgumentClause */) {
5584
+ if (tokenOrKeyword.isToken(36 /* LessThan */) && tokenOrKeyword.parent.kind === 154 /* TypeArgumentClause */) {
5519
5585
  return { allowsAnonymousTypes: true };
5520
5586
  }
5521
- if (tokenOrKeyword.isToken(24 /* Comma */) && (tokenOrKeyword.parent.kind === 30 /* BaseTypeList */ || tokenOrKeyword.parent.kind === 153 /* TypeArgumentList */)) {
5522
- return { allowsAnonymousTypes: tokenOrKeyword.parent.kind === 153 /* TypeArgumentList */ };
5587
+ if (tokenOrKeyword.isToken(24 /* Comma */) && (tokenOrKeyword.parent.kind === 32 /* BaseTypeList */ || tokenOrKeyword.parent.kind === 155 /* TypeArgumentList */)) {
5588
+ return { allowsAnonymousTypes: tokenOrKeyword.parent.kind === 155 /* TypeArgumentList */ };
5523
5589
  }
5524
- if (tokenOrKeyword.isToken(35 /* HashSign */) && tokenOrKeyword.parent.kind === 147 /* Tag */) {
5590
+ if (tokenOrKeyword.isToken(35 /* HashSign */) && tokenOrKeyword.parent.kind === 149 /* Tag */) {
5525
5591
  return { allowsAnonymousTypes: false };
5526
5592
  }
5527
- if ((tokenOrKeyword.isToken(23 /* Colon */) || tokenOrKeyword.isToken(57 /* Equals */)) && tokenOrKeyword.parent.kind === 143 /* TypeParameterDeclaration */) {
5593
+ if ((tokenOrKeyword.isToken(23 /* Colon */) || tokenOrKeyword.isToken(57 /* Equals */)) && tokenOrKeyword.parent.kind === 145 /* TypeParameterDeclaration */) {
5528
5594
  return { allowsAnonymousTypes: false };
5529
5595
  }
5530
- if (tokenOrKeyword.isToken(57 /* Equals */) && tokenOrKeyword.parent.kind === 22 /* PackageAliasTypeDeclaration */) {
5596
+ if (tokenOrKeyword.isToken(57 /* Equals */) && tokenOrKeyword.parent.kind === 24 /* PackageAliasTypeDeclaration */) {
5531
5597
  return { allowsAnonymousTypes: false };
5532
5598
  }
5533
- if (tokenOrKeyword.isKeyword(14 /* Is */) && tokenOrKeyword.parent.kind === 73 /* IsExpression */) {
5599
+ if (tokenOrKeyword.isKeyword(14 /* Is */) && tokenOrKeyword.parent.kind === 75 /* IsExpression */) {
5534
5600
  return { allowsAnonymousTypes: true };
5535
5601
  }
5536
- if (tokenOrKeyword.isKeyword(42 /* As */) && tokenOrKeyword.parent.kind === 65 /* AsExpression */) {
5602
+ if (tokenOrKeyword.isKeyword(42 /* As */) && tokenOrKeyword.parent.kind === 67 /* AsExpression */) {
5537
5603
  return { allowsAnonymousTypes: true };
5538
5604
  }
5539
5605
  if (tokenOrKeyword.isToken(17 /* Bar */) && tokenOrKeyword.parent.kind === 12 /* UnionTypeSpecifierTypeList */) {
5540
5606
  return { allowsAnonymousTypes: false };
5541
5607
  }
5542
- if (tokenOrKeyword.isToken(44 /* OpenParenthesis */) && tokenOrKeyword.parent.kind === 13 /* ParenthesizedTypeSpecifier */) {
5608
+ if (tokenOrKeyword.isToken(10 /* Ampersand */) && tokenOrKeyword.parent.kind === 14 /* IntersectionTypeSpecifierTypeList */) {
5609
+ return { allowsAnonymousTypes: false };
5610
+ }
5611
+ if (tokenOrKeyword.isToken(44 /* OpenParenthesis */) && tokenOrKeyword.parent.kind === 15 /* ParenthesizedTypeSpecifier */) {
5543
5612
  return { allowsAnonymousTypes: true };
5544
5613
  }
5545
5614
  return void 0;
5546
5615
  }
5547
5616
  static isTopLevelTranslationListContext(tokenOrKeyword) {
5548
- if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 20 /* TopLevelTranslationList */) {
5617
+ if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 22 /* TopLevelTranslationList */) {
5549
5618
  return { translationsDeclaration: tokenOrKeyword.parent.parent };
5550
5619
  }
5551
- if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */) {
5620
+ if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 23 /* TranslationsDeclaration */) {
5552
5621
  return { translationsDeclaration: tokenOrKeyword.parent };
5553
5622
  }
5554
5623
  const packageImport = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5555
5624
  tokenOrKeyword,
5556
- 134 /* PackageImportTranslation */
5625
+ 136 /* PackageImportTranslation */
5557
5626
  );
5558
5627
  if (packageImport !== void 0) {
5559
5628
  return { translationsDeclaration: packageImport.parent.parent };
5560
5629
  }
5561
- const type = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 139 /* TypeTranslation */);
5630
+ const type = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 141 /* TypeTranslation */);
5562
5631
  if (type !== void 0) {
5563
5632
  return { translationsDeclaration: type.parent.parent };
5564
5633
  }
5565
5634
  const methodType = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5566
5635
  tokenOrKeyword,
5567
- 133 /* MethodTypeTranslation */
5636
+ 135 /* MethodTypeTranslation */
5568
5637
  );
5569
5638
  if (methodType !== void 0) {
5570
5639
  return { translationsDeclaration: methodType.parent.parent };
5571
5640
  }
5572
5641
  const variable = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5573
5642
  tokenOrKeyword,
5574
- 136 /* PackageVariableTranslation */
5643
+ 138 /* PackageVariableTranslation */
5575
5644
  );
5576
5645
  if (variable !== void 0) {
5577
5646
  return { translationsDeclaration: variable.parent.parent };
5578
5647
  }
5579
5648
  const method = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5580
5649
  tokenOrKeyword,
5581
- 131 /* PackageMethodTranslation */
5650
+ 133 /* PackageMethodTranslation */
5582
5651
  );
5583
5652
  if (method !== void 0) {
5584
5653
  return { translationsDeclaration: method.parent.parent };
@@ -5586,33 +5655,33 @@ var SyntaxContextFactory = class {
5586
5655
  return void 0;
5587
5656
  }
5588
5657
  static isTypeMemberTranslationListContext(tokenOrKeyword) {
5589
- if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 138 /* TypeMemberTranslationList */) {
5658
+ if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 140 /* TypeMemberTranslationList */) {
5590
5659
  return { typeTranslation: tokenOrKeyword.parent.parent };
5591
5660
  }
5592
- if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 139 /* TypeTranslation */) {
5661
+ if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 141 /* TypeTranslation */) {
5593
5662
  return { typeTranslation: tokenOrKeyword.parent };
5594
5663
  }
5595
- const indexer = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 128 /* IndexerTranslation */);
5664
+ const indexer = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 130 /* IndexerTranslation */);
5596
5665
  if (indexer !== void 0) {
5597
5666
  return { typeTranslation: indexer.parent.parent };
5598
5667
  }
5599
5668
  const constructor = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5600
5669
  tokenOrKeyword,
5601
- 126 /* ConstructorTranslation */
5670
+ 128 /* ConstructorTranslation */
5602
5671
  );
5603
5672
  if (constructor !== void 0) {
5604
5673
  return { typeTranslation: constructor.parent.parent };
5605
5674
  }
5606
5675
  const variableOrVariant = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5607
5676
  tokenOrKeyword,
5608
- 137 /* TypeVariableOrVariantTranslation */
5677
+ 139 /* TypeVariableOrVariantTranslation */
5609
5678
  );
5610
5679
  if (variableOrVariant !== void 0) {
5611
5680
  return { typeTranslation: variableOrVariant.parent.parent };
5612
5681
  }
5613
5682
  const method = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5614
5683
  tokenOrKeyword,
5615
- 132 /* TypeMethodTranslation */
5684
+ 134 /* TypeMethodTranslation */
5616
5685
  );
5617
5686
  if (method !== void 0) {
5618
5687
  return { typeTranslation: method.parent.parent };
@@ -5725,29 +5794,29 @@ var NodeSemanticInfoService = class {
5725
5794
  static ofTokenOrKeyword(analyzer, tokenOrKeyword, options6) {
5726
5795
  if (isIdentifier(tokenOrKeyword.value)) {
5727
5796
  return this.ofNonKeywordIdentifier(analyzer, tokenOrKeyword.value, options6);
5728
- } else if (tokenOrKeyword.isKeyword(2 /* Autotype */) && tokenOrKeyword.parent.kind === 70 /* AutotypeCallExpression */) {
5797
+ } else if (tokenOrKeyword.isKeyword(2 /* Autotype */) && tokenOrKeyword.parent.kind === 72 /* AutotypeCallExpression */) {
5729
5798
  return this.ofAutotypeCallExpression(analyzer, tokenOrKeyword.parent, options6);
5730
- } else if (tokenOrKeyword.parent.kind === 77 /* PrefixUnaryExpression */) {
5799
+ } else if (tokenOrKeyword.parent.kind === 79 /* PrefixUnaryExpression */) {
5731
5800
  return this.ofPrefixUnaryExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
5732
- } else if (tokenOrKeyword.parent.kind === 66 /* BinaryExpression */) {
5801
+ } else if (tokenOrKeyword.parent.kind === 68 /* BinaryExpression */) {
5733
5802
  return this.ofBinaryExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
5734
- } else if (tokenOrKeyword.isToken(19 /* Caret */) && (tokenOrKeyword.parent.kind === 50 /* TypeDereferencedVariableGetterDeclaration */ || tokenOrKeyword.parent.kind === 51 /* TypeDereferencedVariableSetterDeclaration */)) {
5803
+ } else if (tokenOrKeyword.isToken(19 /* Caret */) && (tokenOrKeyword.parent.kind === 52 /* TypeDereferencedVariableGetterDeclaration */ || tokenOrKeyword.parent.kind === 53 /* TypeDereferencedVariableSetterDeclaration */)) {
5735
5804
  return this.ofDereferenceOperatorDeclaration(analyzer, tokenOrKeyword.parent);
5736
- } else if (tokenOrKeyword.isToken(19 /* Caret */) && tokenOrKeyword.parent.kind === 80 /* DereferenceExpression */) {
5805
+ } else if (tokenOrKeyword.isToken(19 /* Caret */) && tokenOrKeyword.parent.kind === 82 /* DereferenceExpression */) {
5737
5806
  return this.ofDereferenceExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
5738
- } else if (tokenOrKeyword.parent.kind === 91 /* AssignmentStatement */) {
5807
+ } else if (tokenOrKeyword.parent.kind === 93 /* AssignmentStatement */) {
5739
5808
  return this.ofAssignmentStatementOperator(analyzer, tokenOrKeyword.parent, options6);
5740
- } else if (tokenOrKeyword.isKeyword(30 /* Creation */) && tokenOrKeyword.parent.kind === 45 /* TypeConstructorDeclaration */) {
5809
+ } else if (tokenOrKeyword.isKeyword(30 /* Creation */) && tokenOrKeyword.parent.kind === 47 /* TypeConstructorDeclaration */) {
5741
5810
  return this.ofTypeConstructorDeclaration(analyzer, tokenOrKeyword.parent);
5742
- } else if (tokenOrKeyword.isToken(13 /* Asterisk */) && tokenOrKeyword.parent.kind === 90 /* DefaultMatchExpression */) {
5811
+ } else if (tokenOrKeyword.isToken(13 /* Asterisk */) && tokenOrKeyword.parent.kind === 92 /* DefaultMatchExpression */) {
5743
5812
  return this.ofDefaultMatchExpression(analyzer, tokenOrKeyword.parent);
5744
- } else if (tokenOrKeyword.isKeyword(4 /* Object */) && tokenOrKeyword.parent.kind === 86 /* ObjectExpression */) {
5813
+ } else if (tokenOrKeyword.isKeyword(4 /* Object */) && tokenOrKeyword.parent.kind === 88 /* ObjectExpression */) {
5745
5814
  return this.ofObjectExpression(analyzer, tokenOrKeyword.parent, options6);
5746
- } else if (tokenOrKeyword.isKeyword(56 /* Base */) && tokenOrKeyword.parent.kind === 87 /* BaseExpression */) {
5815
+ } else if (tokenOrKeyword.isKeyword(56 /* Base */) && tokenOrKeyword.parent.kind === 89 /* BaseExpression */) {
5747
5816
  return this.ofBaseExpression(analyzer, tokenOrKeyword.parent, options6);
5748
- } else if ((tokenOrKeyword.isToken(45 /* OpenSquareBracket */) || tokenOrKeyword.isToken(22 /* CloseSquareBracket */)) && tokenOrKeyword.parent.kind === 49 /* TypeIndexerParameterClause */) {
5817
+ } else if ((tokenOrKeyword.isToken(45 /* OpenSquareBracket */) || tokenOrKeyword.isToken(22 /* CloseSquareBracket */)) && tokenOrKeyword.parent.kind === 51 /* TypeIndexerParameterClause */) {
5749
5818
  return this.ofTypeIndexerDeclaration(analyzer, tokenOrKeyword.parent.parent);
5750
- } else if ((tokenOrKeyword.isToken(45 /* OpenSquareBracket */) || tokenOrKeyword.isToken(22 /* CloseSquareBracket */)) && tokenOrKeyword.parent.kind === 71 /* IndexedAccessExpression */) {
5819
+ } else if ((tokenOrKeyword.isToken(45 /* OpenSquareBracket */) || tokenOrKeyword.isToken(22 /* CloseSquareBracket */)) && tokenOrKeyword.parent.kind === 73 /* IndexedAccessExpression */) {
5751
5820
  return this.ofIndexedAccessExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
5752
5821
  }
5753
5822
  return void 0;
@@ -5760,11 +5829,11 @@ var NodeSemanticInfoService = class {
5760
5829
  let result;
5761
5830
  const parent = node.parent;
5762
5831
  switch (parent.kind) {
5763
- case 129 /* TranslationTypeParameterList */:
5832
+ case 131 /* TranslationTypeParameterList */:
5764
5833
  break;
5765
- case 124 /* TranslationParameterList */:
5834
+ case 126 /* TranslationParameterList */:
5766
5835
  break;
5767
- case 145 /* Argument */: {
5836
+ case 147 /* Argument */: {
5768
5837
  const respectiveParameter = analyzer.getRespectiveParameter(parent);
5769
5838
  if (respectiveParameter !== void 0) {
5770
5839
  const target = new SimpleWithLocalization(
@@ -5778,43 +5847,43 @@ var NodeSemanticInfoService = class {
5778
5847
  }
5779
5848
  break;
5780
5849
  }
5781
- case 60 /* EnumerationVariableDeclaration */:
5850
+ case 62 /* EnumerationVariableDeclaration */:
5782
5851
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofEnumerationVariableDeclaration(parent));
5783
5852
  break;
5784
- case 101 /* ErrorVariableDeclaration */:
5853
+ case 103 /* ErrorVariableDeclaration */:
5785
5854
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofErrorVariableDeclaration(parent));
5786
5855
  break;
5787
- case 22 /* PackageAliasTypeDeclaration */:
5856
+ case 24 /* PackageAliasTypeDeclaration */:
5788
5857
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageAliasTypeDeclaration(parent));
5789
5858
  break;
5790
- case 27 /* PackageMethodDeclaration */:
5859
+ case 29 /* PackageMethodDeclaration */:
5791
5860
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageMethodDeclaration(parent));
5792
5861
  break;
5793
- case 28 /* PackageMethodTypeDeclaration */:
5862
+ case 30 /* PackageMethodTypeDeclaration */:
5794
5863
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageMethodTypeDeclaration(parent));
5795
5864
  break;
5796
- case 33 /* PackageStructuredTypeDeclaration */:
5865
+ case 35 /* PackageStructuredTypeDeclaration */:
5797
5866
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageStructuredTypeDeclaration(parent));
5798
5867
  break;
5799
- case 35 /* PackageVariableDeclaration */:
5868
+ case 37 /* PackageVariableDeclaration */:
5800
5869
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageVariableDeclaration(parent));
5801
5870
  break;
5802
- case 38 /* PackageVariantTypeDeclaration */:
5871
+ case 40 /* PackageVariantTypeDeclaration */:
5803
5872
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageVariantTypeDeclaration(parent));
5804
5873
  break;
5805
- case 88 /* IdentifierExpression */:
5874
+ case 90 /* IdentifierExpression */:
5806
5875
  result = this.ofIdentifierExpression(analyzer, parent, options6);
5807
5876
  break;
5808
- case 58 /* NestedMethodDeclaration */:
5877
+ case 60 /* NestedMethodDeclaration */:
5809
5878
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofNestedMethodDeclaration(parent));
5810
5879
  break;
5811
- case 59 /* LocalVariableDeclaration */:
5880
+ case 61 /* LocalVariableDeclaration */:
5812
5881
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofLocalVariableDeclaration(parent));
5813
5882
  break;
5814
- case 135 /* QualifiedName */:
5883
+ case 137 /* QualifiedName */:
5815
5884
  result = this.ofQualifiedNameQualifier(analyzer, parent, node, options6);
5816
5885
  break;
5817
- case 136 /* PackageVariableTranslation */: {
5886
+ case 138 /* PackageVariableTranslation */: {
5818
5887
  const translationPackage = this.getContainingTranslationPackage(analyzer, node);
5819
5888
  const getTargetResult = translationPackage?.getPackageVariableTranslationTarget(parent);
5820
5889
  if (translationPackage !== void 0 && getTargetResult?.target !== void 0) {
@@ -5834,7 +5903,7 @@ var NodeSemanticInfoService = class {
5834
5903
  }
5835
5904
  break;
5836
5905
  }
5837
- case 137 /* TypeVariableOrVariantTranslation */: {
5906
+ case 139 /* TypeVariableOrVariantTranslation */: {
5838
5907
  const translationPackage = this.getContainingTranslationPackage(analyzer, node);
5839
5908
  const getTargetsResult = translationPackage?.getTypeVariableOrVariantTranslationTargets(parent);
5840
5909
  if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
@@ -5858,7 +5927,7 @@ var NodeSemanticInfoService = class {
5858
5927
  }
5859
5928
  break;
5860
5929
  }
5861
- case 131 /* PackageMethodTranslation */: {
5930
+ case 133 /* PackageMethodTranslation */: {
5862
5931
  const translationPackage = this.getContainingTranslationPackage(analyzer, node);
5863
5932
  const getTargetsResult = translationPackage?.getPackageMethodTranslationTargets(parent);
5864
5933
  if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
@@ -5882,7 +5951,7 @@ var NodeSemanticInfoService = class {
5882
5951
  }
5883
5952
  break;
5884
5953
  }
5885
- case 132 /* TypeMethodTranslation */: {
5954
+ case 134 /* TypeMethodTranslation */: {
5886
5955
  const translationPackage = this.getContainingTranslationPackage(analyzer, node);
5887
5956
  const getTargetsResult = translationPackage?.getTypeMethodTranslationTargets(parent);
5888
5957
  if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
@@ -5906,7 +5975,7 @@ var NodeSemanticInfoService = class {
5906
5975
  }
5907
5976
  break;
5908
5977
  }
5909
- case 139 /* TypeTranslation */: {
5978
+ case 141 /* TypeTranslation */: {
5910
5979
  const translationPackage = this.getContainingTranslationPackage(analyzer, node);
5911
5980
  const getTargetResult = translationPackage?.getTypeTranslationTarget(parent);
5912
5981
  if (translationPackage !== void 0 && getTargetResult?.target !== void 0) {
@@ -5926,7 +5995,7 @@ var NodeSemanticInfoService = class {
5926
5995
  }
5927
5996
  break;
5928
5997
  }
5929
- case 133 /* MethodTypeTranslation */: {
5998
+ case 135 /* MethodTypeTranslation */: {
5930
5999
  const translationPackage = this.getContainingTranslationPackage(analyzer, node);
5931
6000
  const getTargetResult = translationPackage?.getMethodTypeTranslationTarget(parent);
5932
6001
  if (translationPackage !== void 0 && getTargetResult?.target !== void 0) {
@@ -5946,7 +6015,7 @@ var NodeSemanticInfoService = class {
5946
6015
  }
5947
6016
  break;
5948
6017
  }
5949
- case 144 /* ParameterDeclaration */:
6018
+ case 146 /* ParameterDeclaration */:
5950
6019
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofParameterDeclaration(parent));
5951
6020
  break;
5952
6021
  case 8 /* PackageImport */:
@@ -5955,30 +6024,30 @@ var NodeSemanticInfoService = class {
5955
6024
  case 9 /* PackagePath */:
5956
6025
  result = void 0;
5957
6026
  break;
5958
- case 78 /* PropertyAccessExpression */:
6027
+ case 80 /* PropertyAccessExpression */:
5959
6028
  result = this.ofProperty(analyzer, parent, options6);
5960
6029
  break;
5961
- case 52 /* TypeMethodDeclaration */:
6030
+ case 54 /* TypeMethodDeclaration */:
5962
6031
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofTypeMethodDeclaration(parent));
5963
6032
  break;
5964
- case 53 /* OperatorDeclaration */:
6033
+ case 55 /* OperatorDeclaration */:
5965
6034
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofOperatorDeclaration(parent));
5966
6035
  break;
5967
- case 54 /* TypeVariableDeclaration */:
6036
+ case 56 /* TypeVariableDeclaration */:
5968
6037
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofTypeVariableDeclaration(parent));
5969
6038
  break;
5970
- case 143 /* TypeParameterDeclaration */:
6039
+ case 145 /* TypeParameterDeclaration */:
5971
6040
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofTypeParameterDeclaration(parent));
5972
6041
  break;
5973
- case 142 /* VariantDeclaration */:
6042
+ case 144 /* VariantDeclaration */:
5974
6043
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofVariantDeclaration(parent));
5975
6044
  break;
5976
- case 36 /* PackageVariableGetterDeclaration */:
5977
- case 37 /* PackageVariableSetterDeclaration */:
6045
+ case 38 /* PackageVariableGetterDeclaration */:
6046
+ case 39 /* PackageVariableSetterDeclaration */:
5978
6047
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofComputedPackageVariableDeclaration(parent));
5979
6048
  break;
5980
- case 55 /* TypeVariableGetterDeclaration */:
5981
- case 56 /* TypeVariableSetterDeclaration */:
6049
+ case 57 /* TypeVariableGetterDeclaration */:
6050
+ case 58 /* TypeVariableSetterDeclaration */:
5982
6051
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofComputedTypeVariableDeclaration(parent));
5983
6052
  break;
5984
6053
  case 3 /* Keyword */:
@@ -6074,6 +6143,16 @@ var NodeSemanticInfoService = class {
6074
6143
  case "package-name-segment-access":
6075
6144
  result = this.ofPackageNameSegmentAccess(analyzer, meaning.packageTreeNode, node);
6076
6145
  break;
6146
+ case "mixed-ambiguous-access": {
6147
+ const targets = Query.from(meaning.entities).mapAndFilter((d) => {
6148
+ const target = new EntityReferenceTarget(d.value, 0 /* Get */);
6149
+ return new SimpleWithLocalization(target, d.localization);
6150
+ }).toArray();
6151
+ if (isNonEmptyArray(targets)) {
6152
+ result = new ReferenceNodeSemanticInfo(targets, true);
6153
+ }
6154
+ break;
6155
+ }
6077
6156
  case "unresolved":
6078
6157
  break;
6079
6158
  default:
@@ -6096,10 +6175,10 @@ var NodeSemanticInfoService = class {
6096
6175
  switch (node.parent.kind) {
6097
6176
  case 10 /* NamedTypeSpecifier */:
6098
6177
  return this.ofNamedTypeSpecifierNameQualifier(analyzer, node.parent, qualifier, options6);
6099
- case 147 /* Tag */:
6178
+ case 149 /* Tag */:
6100
6179
  return this.ofTagNameQualifier(analyzer, node.parent, qualifier, options6);
6101
- case 42 /* ExtendedTypeClause */:
6102
- case 134 /* PackageImportTranslation */:
6180
+ case 44 /* ExtendedTypeClause */:
6181
+ case 136 /* PackageImportTranslation */:
6103
6182
  return void 0;
6104
6183
  default:
6105
6184
  Debug.never(node.parent);
@@ -6143,6 +6222,20 @@ var NodeSemanticInfoService = class {
6143
6222
  } else {
6144
6223
  Debug.never(resolvedQualifier);
6145
6224
  }
6225
+ } else if (qualifierIndex === resolutionResult.resolvedQualifiers.length && resolutionResult.ambiguousDeclarations !== void 0) {
6226
+ const targets = resolutionResult.ambiguousDeclarations.map((d) => {
6227
+ switch (d.value.kind) {
6228
+ case "entity":
6229
+ return new SimpleWithLocalization(new EntityReferenceTarget(d.value.entity, 0 /* Get */), d.localization);
6230
+ case "node":
6231
+ return new SimpleWithLocalization(new PackageNameTreeNodeReferenceTarget(d.value.node), d.localization);
6232
+ default:
6233
+ Debug.never(d.value);
6234
+ }
6235
+ });
6236
+ if (isNonEmptyArray(targets)) {
6237
+ result = new ReferenceNodeSemanticInfo(targets, true);
6238
+ }
6146
6239
  }
6147
6240
  if (result !== void 0 && options6.includeBetterReferenceTargets) {
6148
6241
  result = this.getBetterReferenceTargetsOrPreserve(result);
@@ -6157,7 +6250,7 @@ var NodeSemanticInfoService = class {
6157
6250
  const resolvedQualifier = resolutionResult.resolvedQualifiers[qualifierIndex];
6158
6251
  switch (resolvedQualifier.kind) {
6159
6252
  case "type": {
6160
- if (options6.preferredTargetOfExplicitConstructorCall === "type-declaration") {
6253
+ if (options6.preferredTargetOfExplicitConstructorCall === "type-declaration" || resolutionResult.meaning.kind !== "tag-type") {
6161
6254
  if (resolvedQualifier.suitableTypes.length > 0) {
6162
6255
  const targets = resolvedQualifier.suitableTypes.map((t) => new SimpleWithLocalization(new EntityReferenceTarget(t.value, 0 /* Get */), t.localization));
6163
6256
  result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), targets.length > 1);
@@ -6166,14 +6259,12 @@ var NodeSemanticInfoService = class {
6166
6259
  result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
6167
6260
  }
6168
6261
  } else {
6169
- if (resolutionResult.meaning.kind === "tag-type") {
6170
- if (resolutionResult.meaning.suitableConstructors.length > 0) {
6171
- const targets = resolutionResult.meaning.suitableConstructors.map((t) => new SimpleWithLocalization(new TypeConstructorReferenceTarget(t.value), t.localization));
6172
- result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), targets.length > 1);
6173
- } else if (resolutionResult.meaning.candidates.length > 0) {
6174
- const targets = resolutionResult.meaning.candidates.map((t) => new SimpleWithLocalization(new TypeConstructorReferenceTarget(t.value), t.localization));
6175
- result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
6176
- }
6262
+ if (resolutionResult.meaning.suitableConstructors.length > 0) {
6263
+ const targets = resolutionResult.meaning.suitableConstructors.map((t) => new SimpleWithLocalization(new TypeConstructorReferenceTarget(t.value), t.localization));
6264
+ result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), targets.length > 1);
6265
+ } else if (resolutionResult.meaning.candidates.length > 0) {
6266
+ const targets = resolutionResult.meaning.candidates.map((t) => new SimpleWithLocalization(new TypeConstructorReferenceTarget(t.value), t.localization));
6267
+ result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
6177
6268
  }
6178
6269
  }
6179
6270
  break;
@@ -6215,6 +6306,20 @@ var NodeSemanticInfoService = class {
6215
6306
  default:
6216
6307
  Debug.never(resolvedQualifier);
6217
6308
  }
6309
+ } else if (qualifierIndex === resolutionResult.resolvedQualifiers.length && resolutionResult.ambiguousDeclarations !== void 0) {
6310
+ const targets = resolutionResult.ambiguousDeclarations.map((d) => {
6311
+ switch (d.value.kind) {
6312
+ case "entity":
6313
+ return new SimpleWithLocalization(new EntityReferenceTarget(d.value.entity, 0 /* Get */), d.localization);
6314
+ case "node":
6315
+ return new SimpleWithLocalization(new PackageNameTreeNodeReferenceTarget(d.value.node), d.localization);
6316
+ default:
6317
+ Debug.never(d.value);
6318
+ }
6319
+ });
6320
+ if (isNonEmptyArray(targets)) {
6321
+ result = new ReferenceNodeSemanticInfo(targets, true);
6322
+ }
6218
6323
  }
6219
6324
  if (result !== void 0 && options6.includeBetterReferenceTargets) {
6220
6325
  result = this.getBetterReferenceTargetsOrPreserve(result);
@@ -6284,7 +6389,7 @@ var NodeSemanticInfoService = class {
6284
6389
  break;
6285
6390
  }
6286
6391
  case "mixed-ambiguous-access": {
6287
- const targets = Query.from(meaning.declarations).mapAndFilter((d) => {
6392
+ const targets = meaning.declarations.map((d) => {
6288
6393
  let target;
6289
6394
  switch (d.value.kind) {
6290
6395
  case "method":
@@ -6300,15 +6405,13 @@ var NodeSemanticInfoService = class {
6300
6405
  target = new EntityReferenceTarget(d.value.value, 0 /* Get */);
6301
6406
  break;
6302
6407
  case "package-name-segment":
6303
- if (d.value.value.package !== void 0) {
6304
- target = new PackageReferenceTarget(d.value.value.package.value);
6305
- }
6408
+ target = new PackageNameTreeNodeReferenceTarget(d.value.value);
6306
6409
  break;
6307
6410
  default:
6308
6411
  Debug.never(d.value);
6309
6412
  }
6310
- return target !== void 0 ? new SimpleWithLocalization(target, d.localization) : void 0;
6311
- }).toArray();
6413
+ return new SimpleWithLocalization(target, d.localization);
6414
+ });
6312
6415
  if (isNonEmptyArray(targets)) {
6313
6416
  result = new ReferenceNodeSemanticInfo(targets, true);
6314
6417
  }
@@ -6538,7 +6641,7 @@ var NodeSemanticInfoService = class {
6538
6641
  }
6539
6642
  static ofPackageNameSegmentAccess(analyzer, packageTreeNode, node) {
6540
6643
  let parent = getParentSkippingParenthesizedExpressions(node);
6541
- while (parent.kind === 78 /* PropertyAccessExpression */) {
6644
+ while (parent.kind === 80 /* PropertyAccessExpression */) {
6542
6645
  const meaning = analyzer.resolvePropertyAccessExpression(parent).meaning;
6543
6646
  if (meaning.kind === "package-name-segment-access") {
6544
6647
  packageTreeNode = meaning.packageTreeNode;
@@ -6577,11 +6680,11 @@ var NodeSemanticInfoService = class {
6577
6680
  }
6578
6681
  const parent = getParentSkippingParenthesizedExpressions(typeAccessExpression);
6579
6682
  let parentCallExpression;
6580
- if (parent.kind === 69 /* CallExpression */) {
6683
+ if (parent.kind === 71 /* CallExpression */) {
6581
6684
  parentCallExpression = parent;
6582
- } else if (parent.kind === 89 /* GenericSpecializationExpression */) {
6685
+ } else if (parent.kind === 91 /* GenericSpecializationExpression */) {
6583
6686
  const grandParent = getParentSkippingParenthesizedExpressions(parent);
6584
- if (grandParent.kind === 69 /* CallExpression */) {
6687
+ if (grandParent.kind === 71 /* CallExpression */) {
6585
6688
  parentCallExpression = grandParent;
6586
6689
  }
6587
6690
  }
@@ -6741,6 +6844,12 @@ var PackageReferenceTarget = class {
6741
6844
  this.kind = "package";
6742
6845
  }
6743
6846
  };
6847
+ var PackageNameTreeNodeReferenceTarget = class {
6848
+ constructor(node) {
6849
+ this.node = node;
6850
+ this.kind = "package-name-tree-node";
6851
+ }
6852
+ };
6744
6853
  var TypeContextReferenceTarget = class {
6745
6854
  constructor(type, typeContextKind) {
6746
6855
  this.type = type;
@@ -6826,59 +6935,59 @@ function getEntitySourceLocations(analyzer, entity) {
6826
6935
  const node = definition.node;
6827
6936
  let range;
6828
6937
  switch (node.kind) {
6829
- case 17 /* AnonymousMethodTypeDeclaration */:
6830
- case 18 /* AnonymousStructuredTypeDeclaration */:
6831
- case 19 /* AnonymousVariantTypeDeclaration */:
6832
- case 67 /* MethodBlockLiteral */:
6833
- case 74 /* MethodLiteral */:
6938
+ case 19 /* AnonymousMethodTypeDeclaration */:
6939
+ case 20 /* AnonymousStructuredTypeDeclaration */:
6940
+ case 21 /* AnonymousVariantTypeDeclaration */:
6941
+ case 69 /* MethodBlockLiteral */:
6942
+ case 76 /* MethodLiteral */:
6834
6943
  range = node.rangeWithoutTrivia;
6835
6944
  break;
6836
- case 22 /* PackageAliasTypeDeclaration */:
6837
- case 27 /* PackageMethodDeclaration */:
6838
- case 28 /* PackageMethodTypeDeclaration */:
6839
- case 33 /* PackageStructuredTypeDeclaration */:
6840
- case 38 /* PackageVariantTypeDeclaration */:
6841
- case 58 /* NestedMethodDeclaration */:
6842
- case 52 /* TypeMethodDeclaration */:
6843
- case 143 /* TypeParameterDeclaration */:
6844
- case 53 /* OperatorDeclaration */:
6945
+ case 24 /* PackageAliasTypeDeclaration */:
6946
+ case 29 /* PackageMethodDeclaration */:
6947
+ case 30 /* PackageMethodTypeDeclaration */:
6948
+ case 35 /* PackageStructuredTypeDeclaration */:
6949
+ case 40 /* PackageVariantTypeDeclaration */:
6950
+ case 60 /* NestedMethodDeclaration */:
6951
+ case 54 /* TypeMethodDeclaration */:
6952
+ case 145 /* TypeParameterDeclaration */:
6953
+ case 55 /* OperatorDeclaration */:
6845
6954
  range = node.name.rangeWithoutTrivia;
6846
6955
  break;
6847
- case 45 /* TypeConstructorDeclaration */:
6956
+ case 47 /* TypeConstructorDeclaration */:
6848
6957
  range = node.creationKeyword.rangeWithoutTrivia;
6849
6958
  break;
6850
- case 46 /* TypeDestructorDeclaration */:
6959
+ case 48 /* TypeDestructorDeclaration */:
6851
6960
  range = node.destructionKeyword.rangeWithoutTrivia;
6852
6961
  break;
6853
6962
  case 8 /* PackageImport */:
6854
6963
  Debug.assertNotNull(node.alias);
6855
6964
  range = node.alias.rangeWithoutTrivia;
6856
6965
  break;
6857
- case 40 /* TypeExtensionDeclaration */:
6966
+ case 42 /* TypeExtensionDeclaration */:
6858
6967
  range = node.plusEqualsToken.rangeWithoutTrivia;
6859
6968
  break;
6860
- case 36 /* PackageVariableGetterDeclaration */:
6969
+ case 38 /* PackageVariableGetterDeclaration */:
6861
6970
  range = node.getKeyword.rangeWithoutTrivia;
6862
6971
  break;
6863
- case 37 /* PackageVariableSetterDeclaration */:
6972
+ case 39 /* PackageVariableSetterDeclaration */:
6864
6973
  range = node.setKeyword.rangeWithoutTrivia;
6865
6974
  break;
6866
- case 55 /* TypeVariableGetterDeclaration */:
6975
+ case 57 /* TypeVariableGetterDeclaration */:
6867
6976
  range = node.getKeyword.rangeWithoutTrivia;
6868
6977
  break;
6869
- case 56 /* TypeVariableSetterDeclaration */:
6978
+ case 58 /* TypeVariableSetterDeclaration */:
6870
6979
  range = node.setKeyword.rangeWithoutTrivia;
6871
6980
  break;
6872
- case 47 /* TypeIndexedGetterDeclaration */:
6981
+ case 49 /* TypeIndexedGetterDeclaration */:
6873
6982
  range = node.parameterClause.rangeWithoutTrivia;
6874
6983
  break;
6875
- case 48 /* TypeIndexedSetterDeclaration */:
6984
+ case 50 /* TypeIndexedSetterDeclaration */:
6876
6985
  range = node.parameterClause.rangeWithoutTrivia;
6877
6986
  break;
6878
- case 50 /* TypeDereferencedVariableGetterDeclaration */:
6987
+ case 52 /* TypeDereferencedVariableGetterDeclaration */:
6879
6988
  range = node.caretToken.rangeWithoutTrivia;
6880
6989
  break;
6881
- case 51 /* TypeDereferencedVariableSetterDeclaration */:
6990
+ case 53 /* TypeDereferencedVariableSetterDeclaration */:
6882
6991
  range = node.caretToken.rangeWithoutTrivia;
6883
6992
  break;
6884
6993
  default:
@@ -7000,9 +7109,13 @@ var DefinitionService = class {
7000
7109
  return getEntitySourceLocations(analyzer, target.parameter.entity);
7001
7110
  case "type-value-parameter":
7002
7111
  return getEntitySourceLocations(analyzer, target.parameter.getEntity());
7003
- case "package": {
7112
+ case "package":
7004
7113
  return [new SourceLocation(sourceFile, tokenOrKeyword.value.rangeWithoutTrivia)];
7005
- }
7114
+ case "package-name-tree-node":
7115
+ if (target.node.package !== void 0) {
7116
+ return [new SourceLocation(sourceFile, tokenOrKeyword.value.rangeWithoutTrivia)];
7117
+ }
7118
+ return void 0;
7006
7119
  case "type-context": {
7007
7120
  const entity = target.type.getEntity();
7008
7121
  if (entity !== void 0) {
@@ -7036,6 +7149,8 @@ var DefinitionService = class {
7036
7149
  return target.parameter.entity;
7037
7150
  case "package":
7038
7151
  return target.package_;
7152
+ case "package-name-tree-node":
7153
+ return target.node.package?.value;
7039
7154
  case "type-context":
7040
7155
  return target.type.getEntity();
7041
7156
  case "type-indexer":
@@ -7117,7 +7232,7 @@ var ReferencesService = class {
7117
7232
  }
7118
7233
  }
7119
7234
  if (!options6.onlyNamed) {
7120
- if (node.kind === 70 /* AutotypeCallExpression */ && restrictions.canBeAutotypeCall) {
7235
+ if (node.kind === 72 /* AutotypeCallExpression */ && restrictions.canBeAutotypeCall) {
7121
7236
  const semanticInfo = NodeSemanticInfoService.ofAutotypeCallExpression(analyzer, node, semanticInfoOptions);
7122
7237
  const referenceKind = this.ifReferenceToDefinitionThenKind(
7123
7238
  definition,
@@ -7129,7 +7244,7 @@ var ReferencesService = class {
7129
7244
  result.push(new Reference(sourceFile2, node.autotypeKeyword.rangeWithoutTrivia, referenceKind));
7130
7245
  }
7131
7246
  }
7132
- if (node.kind === 77 /* PrefixUnaryExpression */ && restrictions.canBePrefixUnaryOperator) {
7247
+ if (node.kind === 79 /* PrefixUnaryExpression */ && restrictions.canBePrefixUnaryOperator) {
7133
7248
  const semanticInfo = NodeSemanticInfoService.ofPrefixUnaryExpressionOperator(
7134
7249
  analyzer,
7135
7250
  node,
@@ -7145,7 +7260,7 @@ var ReferencesService = class {
7145
7260
  result.push(new Reference(sourceFile2, node.operator.rangeWithoutTrivia, referenceKind));
7146
7261
  }
7147
7262
  }
7148
- if (node.kind === 66 /* BinaryExpression */ && restrictions.canBeBinaryExpressionOperator) {
7263
+ if (node.kind === 68 /* BinaryExpression */ && restrictions.canBeBinaryExpressionOperator) {
7149
7264
  const semanticInfo = NodeSemanticInfoService.ofBinaryExpressionOperator(
7150
7265
  analyzer,
7151
7266
  node,
@@ -7161,7 +7276,7 @@ var ReferencesService = class {
7161
7276
  result.push(new Reference(sourceFile2, node.operator.rangeWithoutTrivia, referenceKind));
7162
7277
  }
7163
7278
  }
7164
- if ((node.kind === 50 /* TypeDereferencedVariableGetterDeclaration */ || node.kind === 51 /* TypeDereferencedVariableSetterDeclaration */) && restrictions.canBeDereferenceOperator) {
7279
+ if ((node.kind === 52 /* TypeDereferencedVariableGetterDeclaration */ || node.kind === 53 /* TypeDereferencedVariableSetterDeclaration */) && restrictions.canBeDereferenceOperator) {
7165
7280
  const semanticInfo = NodeSemanticInfoService.ofDereferenceOperatorDeclaration(analyzer, node);
7166
7281
  const referenceKind = this.ifReferenceToDefinitionThenKind(
7167
7282
  definition,
@@ -7173,7 +7288,7 @@ var ReferencesService = class {
7173
7288
  result.push(new Reference(sourceFile2, node.caretToken.rangeWithoutTrivia, referenceKind));
7174
7289
  }
7175
7290
  }
7176
- if (node.kind === 80 /* DereferenceExpression */ && restrictions.canBeDereferenceOperator) {
7291
+ if (node.kind === 82 /* DereferenceExpression */ && restrictions.canBeDereferenceOperator) {
7177
7292
  const semanticInfo = NodeSemanticInfoService.ofDereferenceExpressionOperator(
7178
7293
  analyzer,
7179
7294
  node,
@@ -7189,7 +7304,7 @@ var ReferencesService = class {
7189
7304
  result.push(new Reference(sourceFile2, node.caretToken.rangeWithoutTrivia, referenceKind));
7190
7305
  }
7191
7306
  }
7192
- if (node.kind === 91 /* AssignmentStatement */ && restrictions.canBeAssignmentStatementOperator) {
7307
+ if (node.kind === 93 /* AssignmentStatement */ && restrictions.canBeAssignmentStatementOperator) {
7193
7308
  const semanticInfo = NodeSemanticInfoService.ofAssignmentStatementOperator(
7194
7309
  analyzer,
7195
7310
  node,
@@ -7205,7 +7320,7 @@ var ReferencesService = class {
7205
7320
  result.push(new Reference(sourceFile2, node.operator.rangeWithoutTrivia, referenceKind));
7206
7321
  }
7207
7322
  }
7208
- if (node.kind === 45 /* TypeConstructorDeclaration */ && restrictions.canBeConstructorDeclaration) {
7323
+ if (node.kind === 47 /* TypeConstructorDeclaration */ && restrictions.canBeConstructorDeclaration) {
7209
7324
  const semanticInfo = NodeSemanticInfoService.ofTypeConstructorDeclaration(analyzer, node);
7210
7325
  const referenceKind = this.ifReferenceToDefinitionThenKind(
7211
7326
  definition,
@@ -7217,7 +7332,7 @@ var ReferencesService = class {
7217
7332
  result.push(new Reference(sourceFile2, node.creationKeyword.rangeWithoutTrivia, referenceKind));
7218
7333
  }
7219
7334
  }
7220
- if (node.kind === 86 /* ObjectExpression */ && restrictions.canBeObjectExpression) {
7335
+ if (node.kind === 88 /* ObjectExpression */ && restrictions.canBeObjectExpression) {
7221
7336
  const semanticInfo = NodeSemanticInfoService.ofObjectExpression(analyzer, node, semanticInfoOptions);
7222
7337
  const referenceKind = this.ifReferenceToDefinitionThenKind(
7223
7338
  definition,
@@ -7229,7 +7344,7 @@ var ReferencesService = class {
7229
7344
  result.push(new Reference(sourceFile2, node.keyword.rangeWithoutTrivia, referenceKind));
7230
7345
  }
7231
7346
  }
7232
- if (node.kind === 87 /* BaseExpression */ && restrictions.canBeBaseExpression) {
7347
+ if (node.kind === 89 /* BaseExpression */ && restrictions.canBeBaseExpression) {
7233
7348
  const semanticInfo = NodeSemanticInfoService.ofBaseExpression(analyzer, node, semanticInfoOptions);
7234
7349
  const referenceKind = this.ifReferenceToDefinitionThenKind(
7235
7350
  definition,
@@ -7241,7 +7356,7 @@ var ReferencesService = class {
7241
7356
  result.push(new Reference(sourceFile2, node.keyword.rangeWithoutTrivia, referenceKind));
7242
7357
  }
7243
7358
  }
7244
- if ((node.kind === 47 /* TypeIndexedGetterDeclaration */ || node.kind === 48 /* TypeIndexedSetterDeclaration */) && restrictions.canBeIndexer) {
7359
+ if ((node.kind === 49 /* TypeIndexedGetterDeclaration */ || node.kind === 50 /* TypeIndexedSetterDeclaration */) && restrictions.canBeIndexer) {
7245
7360
  const semanticInfo = NodeSemanticInfoService.ofTypeIndexerDeclaration(analyzer, node);
7246
7361
  const referenceKind = this.ifReferenceToDefinitionThenKind(
7247
7362
  definition,
@@ -7253,7 +7368,7 @@ var ReferencesService = class {
7253
7368
  result.push(new Reference(sourceFile2, node.parameterClause.rangeWithoutTrivia, referenceKind));
7254
7369
  }
7255
7370
  }
7256
- if (node.kind === 71 /* IndexedAccessExpression */ && restrictions.canBeIndexer) {
7371
+ if (node.kind === 73 /* IndexedAccessExpression */ && restrictions.canBeIndexer) {
7257
7372
  const semanticInfo = NodeSemanticInfoService.ofIndexedAccessExpressionOperator(
7258
7373
  analyzer,
7259
7374
  node,
@@ -7399,6 +7514,11 @@ var ReferencesService = class {
7399
7514
  target.localization,
7400
7515
  accessKindToReferenceKind(target.value.accessKind)
7401
7516
  );
7517
+ case "package-name-tree-node":
7518
+ if (target.value.node.package !== void 0) {
7519
+ return new DefinitionInfo(target.value.node.package.value, target.localization, 0 /* Read */);
7520
+ }
7521
+ return void 0;
7402
7522
  default:
7403
7523
  Debug.never(target.value);
7404
7524
  }
@@ -7630,9 +7750,9 @@ var EvaluatableExpressionService = class {
7630
7750
  getEvaluatableExpressionForIdentifier(node) {
7631
7751
  const parent = node.parent;
7632
7752
  switch (parent.kind) {
7633
- case 88 /* IdentifierExpression */:
7753
+ case 90 /* IdentifierExpression */:
7634
7754
  return parent;
7635
- case 78 /* PropertyAccessExpression */:
7755
+ case 80 /* PropertyAccessExpression */:
7636
7756
  if (this.isEvaluatableReceiver(parent.expression)) {
7637
7757
  return parent;
7638
7758
  }
@@ -7653,9 +7773,9 @@ var EvaluatableExpressionService = class {
7653
7773
  }
7654
7774
  isEvaluatableReceiver(expression) {
7655
7775
  switch (expression.kind) {
7656
- case 88 /* IdentifierExpression */:
7776
+ case 90 /* IdentifierExpression */:
7657
7777
  return true;
7658
- case 78 /* PropertyAccessExpression */:
7778
+ case 80 /* PropertyAccessExpression */:
7659
7779
  return this.isEvaluatableReceiver(expression.expression);
7660
7780
  default:
7661
7781
  return false;
@@ -7663,35 +7783,35 @@ var EvaluatableExpressionService = class {
7663
7783
  }
7664
7784
  isNamedDeclaration(node) {
7665
7785
  switch (node.kind) {
7666
- case 60 /* EnumerationVariableDeclaration */:
7786
+ case 62 /* EnumerationVariableDeclaration */:
7667
7787
  return { nameIdentifier: node.name };
7668
- case 22 /* PackageAliasTypeDeclaration */:
7788
+ case 24 /* PackageAliasTypeDeclaration */:
7669
7789
  return { nameIdentifier: node.name };
7670
- case 27 /* PackageMethodDeclaration */:
7790
+ case 29 /* PackageMethodDeclaration */:
7671
7791
  return { nameIdentifier: node.name };
7672
- case 28 /* PackageMethodTypeDeclaration */:
7792
+ case 30 /* PackageMethodTypeDeclaration */:
7673
7793
  return { nameIdentifier: node.name };
7674
- case 33 /* PackageStructuredTypeDeclaration */:
7794
+ case 35 /* PackageStructuredTypeDeclaration */:
7675
7795
  return { nameIdentifier: node.name };
7676
- case 35 /* PackageVariableDeclaration */:
7796
+ case 37 /* PackageVariableDeclaration */:
7677
7797
  return { nameIdentifier: node.name };
7678
- case 38 /* PackageVariantTypeDeclaration */:
7798
+ case 40 /* PackageVariantTypeDeclaration */:
7679
7799
  return { nameIdentifier: node.name };
7680
- case 58 /* NestedMethodDeclaration */:
7800
+ case 60 /* NestedMethodDeclaration */:
7681
7801
  return { nameIdentifier: node.name };
7682
- case 59 /* LocalVariableDeclaration */:
7802
+ case 61 /* LocalVariableDeclaration */:
7683
7803
  return { nameIdentifier: node.name };
7684
- case 144 /* ParameterDeclaration */:
7804
+ case 146 /* ParameterDeclaration */:
7685
7805
  return { nameIdentifier: node.name };
7686
- case 52 /* TypeMethodDeclaration */:
7806
+ case 54 /* TypeMethodDeclaration */:
7687
7807
  return { nameIdentifier: node.name };
7688
- case 54 /* TypeVariableDeclaration */:
7808
+ case 56 /* TypeVariableDeclaration */:
7689
7809
  return { nameIdentifier: node.name };
7690
- case 143 /* TypeParameterDeclaration */:
7810
+ case 145 /* TypeParameterDeclaration */:
7691
7811
  return { nameIdentifier: node.name };
7692
- case 142 /* VariantDeclaration */:
7812
+ case 144 /* VariantDeclaration */:
7693
7813
  return { nameIdentifier: node.name };
7694
- case 101 /* ErrorVariableDeclaration */:
7814
+ case 103 /* ErrorVariableDeclaration */:
7695
7815
  return { nameIdentifier: node.name };
7696
7816
  default:
7697
7817
  return void 0;
@@ -7863,6 +7983,8 @@ var HoverService = class {
7863
7983
  }
7864
7984
  case "package":
7865
7985
  return new Hover(this._displayService.displayPackage(firstTarget.value.package_), range);
7986
+ case "package-name-tree-node":
7987
+ return new Hover(this._displayService.displayPackageNameTreeNode(firstTarget.value.node), range);
7866
7988
  case "type-context": {
7867
7989
  if (firstTarget.value.typeContextKind === "object") {
7868
7990
  const keywordText = this._displayService.displayKeyword(4 /* Object */);
@@ -7948,7 +8070,7 @@ var SourceFileItemsService = class {
7948
8070
  }
7949
8071
  break;
7950
8072
  }
7951
- case 35 /* PackageVariableDeclaration */: {
8073
+ case 37 /* PackageVariableDeclaration */: {
7952
8074
  result.push(
7953
8075
  this.createItem(
7954
8076
  1 /* PackageVariable */,
@@ -7960,7 +8082,7 @@ var SourceFileItemsService = class {
7960
8082
  );
7961
8083
  break;
7962
8084
  }
7963
- case 36 /* PackageVariableGetterDeclaration */: {
8085
+ case 38 /* PackageVariableGetterDeclaration */: {
7964
8086
  result.push(
7965
8087
  this.createItem(
7966
8088
  2 /* PackageVariableGetter */,
@@ -7972,7 +8094,7 @@ var SourceFileItemsService = class {
7972
8094
  );
7973
8095
  break;
7974
8096
  }
7975
- case 37 /* PackageVariableSetterDeclaration */: {
8097
+ case 39 /* PackageVariableSetterDeclaration */: {
7976
8098
  result.push(
7977
8099
  this.createItem(
7978
8100
  3 /* PackageVariableSetter */,
@@ -7984,7 +8106,7 @@ var SourceFileItemsService = class {
7984
8106
  );
7985
8107
  break;
7986
8108
  }
7987
- case 27 /* PackageMethodDeclaration */: {
8109
+ case 29 /* PackageMethodDeclaration */: {
7988
8110
  result.push(
7989
8111
  this.createItem(
7990
8112
  4 /* PackageMethod */,
@@ -7996,7 +8118,7 @@ var SourceFileItemsService = class {
7996
8118
  );
7997
8119
  break;
7998
8120
  }
7999
- case 33 /* PackageStructuredTypeDeclaration */: {
8121
+ case 35 /* PackageStructuredTypeDeclaration */: {
8000
8122
  result.push(
8001
8123
  this.createItem(
8002
8124
  5 /* StructuredType */,
@@ -8008,7 +8130,7 @@ var SourceFileItemsService = class {
8008
8130
  );
8009
8131
  break;
8010
8132
  }
8011
- case 54 /* TypeVariableDeclaration */: {
8133
+ case 56 /* TypeVariableDeclaration */: {
8012
8134
  result.push(
8013
8135
  this.createItem(
8014
8136
  12 /* TypeVariable */,
@@ -8020,7 +8142,7 @@ var SourceFileItemsService = class {
8020
8142
  );
8021
8143
  break;
8022
8144
  }
8023
- case 55 /* TypeVariableGetterDeclaration */: {
8145
+ case 57 /* TypeVariableGetterDeclaration */: {
8024
8146
  result.push(
8025
8147
  this.createItem(
8026
8148
  13 /* TypeVariableGetter */,
@@ -8032,7 +8154,7 @@ var SourceFileItemsService = class {
8032
8154
  );
8033
8155
  break;
8034
8156
  }
8035
- case 56 /* TypeVariableSetterDeclaration */: {
8157
+ case 58 /* TypeVariableSetterDeclaration */: {
8036
8158
  result.push(
8037
8159
  this.createItem(
8038
8160
  14 /* TypeVariableSetter */,
@@ -8044,7 +8166,7 @@ var SourceFileItemsService = class {
8044
8166
  );
8045
8167
  break;
8046
8168
  }
8047
- case 52 /* TypeMethodDeclaration */: {
8169
+ case 54 /* TypeMethodDeclaration */: {
8048
8170
  result.push(
8049
8171
  this.createItem(
8050
8172
  15 /* TypeMethod */,
@@ -8056,7 +8178,7 @@ var SourceFileItemsService = class {
8056
8178
  );
8057
8179
  break;
8058
8180
  }
8059
- case 45 /* TypeConstructorDeclaration */: {
8181
+ case 47 /* TypeConstructorDeclaration */: {
8060
8182
  result.push(
8061
8183
  this.createItem(
8062
8184
  10 /* TypeConstructor */,
@@ -8068,7 +8190,7 @@ var SourceFileItemsService = class {
8068
8190
  );
8069
8191
  break;
8070
8192
  }
8071
- case 46 /* TypeDestructorDeclaration */: {
8193
+ case 48 /* TypeDestructorDeclaration */: {
8072
8194
  result.push(this.createItem(
8073
8195
  11 /* TypeDestructor */,
8074
8196
  void 0,
@@ -8078,7 +8200,7 @@ var SourceFileItemsService = class {
8078
8200
  ));
8079
8201
  break;
8080
8202
  }
8081
- case 47 /* TypeIndexedGetterDeclaration */: {
8203
+ case 49 /* TypeIndexedGetterDeclaration */: {
8082
8204
  result.push(
8083
8205
  this.createItem(
8084
8206
  16 /* TypeIndexedGetter */,
@@ -8090,7 +8212,7 @@ var SourceFileItemsService = class {
8090
8212
  );
8091
8213
  break;
8092
8214
  }
8093
- case 48 /* TypeIndexedSetterDeclaration */: {
8215
+ case 50 /* TypeIndexedSetterDeclaration */: {
8094
8216
  result.push(
8095
8217
  this.createItem(
8096
8218
  17 /* TypeIndexedSetter */,
@@ -8102,7 +8224,7 @@ var SourceFileItemsService = class {
8102
8224
  );
8103
8225
  break;
8104
8226
  }
8105
- case 28 /* PackageMethodTypeDeclaration */: {
8227
+ case 30 /* PackageMethodTypeDeclaration */: {
8106
8228
  result.push(
8107
8229
  this.createItem(
8108
8230
  6 /* MethodType */,
@@ -8114,7 +8236,7 @@ var SourceFileItemsService = class {
8114
8236
  );
8115
8237
  break;
8116
8238
  }
8117
- case 38 /* PackageVariantTypeDeclaration */: {
8239
+ case 40 /* PackageVariantTypeDeclaration */: {
8118
8240
  result.push(
8119
8241
  this.createItem(
8120
8242
  7 /* VariantType */,
@@ -8126,7 +8248,7 @@ var SourceFileItemsService = class {
8126
8248
  );
8127
8249
  break;
8128
8250
  }
8129
- case 142 /* VariantDeclaration */: {
8251
+ case 144 /* VariantDeclaration */: {
8130
8252
  result.push(
8131
8253
  this.createItem(
8132
8254
  9 /* Variant */,
@@ -8138,7 +8260,7 @@ var SourceFileItemsService = class {
8138
8260
  );
8139
8261
  break;
8140
8262
  }
8141
- case 143 /* TypeParameterDeclaration */: {
8263
+ case 145 /* TypeParameterDeclaration */: {
8142
8264
  result.push(
8143
8265
  this.createItem(
8144
8266
  18 /* TypeParameter */,
@@ -8150,7 +8272,7 @@ var SourceFileItemsService = class {
8150
8272
  );
8151
8273
  break;
8152
8274
  }
8153
- case 58 /* NestedMethodDeclaration */: {
8275
+ case 60 /* NestedMethodDeclaration */: {
8154
8276
  result.push(
8155
8277
  this.createItem(
8156
8278
  19 /* NestedMethod */,
@@ -8183,7 +8305,7 @@ var SourceFileItemsService = class {
8183
8305
  return name ?? `<${LocalizationHelper.localizeHelperPhrase(4 /* PackageAlias */, this.locale)}>`;
8184
8306
  case 1 /* PackageVariable */:
8185
8307
  case 12 /* TypeVariable */:
8186
- return name ?? `<${LocalizationHelper.localizeHelperPhrase(5 /* Variable */, this.locale)}>`;
8308
+ return name ?? `<${LocalizationHelper.localizeHelperPhrase(6 /* Variable */, this.locale)}>`;
8187
8309
  case 4 /* PackageMethod */:
8188
8310
  case 15 /* TypeMethod */:
8189
8311
  case 19 /* NestedMethod */:
@@ -8325,6 +8447,7 @@ var RenameService = class {
8325
8447
  case "package":
8326
8448
  case "type-context":
8327
8449
  case "type-indexer":
8450
+ case "package-name-tree-node":
8328
8451
  canBeRenamed = false;
8329
8452
  break;
8330
8453
  default:
@@ -8374,7 +8497,7 @@ var SelectionRangeService = class {
8374
8497
  if (!this.nodeShouldBeSkipped(child) && !child.rangeWithoutTrivia.equals(result.range)) {
8375
8498
  result = new SelectionRange(child.rangeWithoutTrivia, result);
8376
8499
  }
8377
- if (child.kind === 0 /* Token */ && (child.tokenKind === 6 /* TextLiteral */ || child.tokenKind === 7 /* TextTemplateHead */ || child.tokenKind === 8 /* TextTemplatePart */ || child.tokenKind === 9 /* TextTemplateTail */ || child.tokenKind === 5 /* CharLiteral */) || child.kind === 81 /* TextTemplateLiteral */) {
8500
+ if (child.kind === 0 /* Token */ && (child.tokenKind === 6 /* TextLiteral */ || child.tokenKind === 7 /* TextTemplateHead */ || child.tokenKind === 8 /* TextTemplatePart */ || child.tokenKind === 9 /* TextTemplateTail */ || child.tokenKind === 5 /* CharLiteral */) || child.kind === 83 /* TextTemplateLiteral */) {
8378
8501
  const textContentStart = child.rangeWithoutTrivia.start + 1;
8379
8502
  const textContentEnd = child.rangeWithoutTrivia.end - 1;
8380
8503
  if (offset >= textContentStart && offset < textContentEnd) {
@@ -8405,13 +8528,13 @@ var SelectionRangeService = class {
8405
8528
  }
8406
8529
  }
8407
8530
  switch (node.kind) {
8408
- case 156 /* TypeAnnotation */:
8409
- case 34 /* StructuredTypeDeclarationBody */:
8410
- case 39 /* VariantTypeDeclarationBody */:
8411
- case 23 /* AliasTypeDeclarationBody */:
8412
- case 29 /* MethodTypeDeclarationBody */:
8413
- case 83 /* TextTemplateSpan */:
8414
- case 82 /* TextTemplateSpanList */:
8531
+ case 158 /* TypeAnnotation */:
8532
+ case 36 /* StructuredTypeDeclarationBody */:
8533
+ case 41 /* VariantTypeDeclarationBody */:
8534
+ case 25 /* AliasTypeDeclarationBody */:
8535
+ case 31 /* MethodTypeDeclarationBody */:
8536
+ case 85 /* TextTemplateSpan */:
8537
+ case 84 /* TextTemplateSpanList */:
8415
8538
  return true;
8416
8539
  default:
8417
8540
  return false;
@@ -8449,7 +8572,7 @@ var SemanticTokensService = class {
8449
8572
  controller.stopChildrenTraverse();
8450
8573
  return;
8451
8574
  }
8452
- if (node.kind === 88 /* IdentifierExpression */) {
8575
+ if (node.kind === 90 /* IdentifierExpression */) {
8453
8576
  const meaning = analyzer.resolveIdentifierExpression(node).meaning;
8454
8577
  if (meaning.kind === "variable-access") {
8455
8578
  const variable = meaning.variable.value.getEntity();
@@ -8505,7 +8628,7 @@ var SemanticTokensService = class {
8505
8628
  ));
8506
8629
  }
8507
8630
  }
8508
- if (node.kind === 78 /* PropertyAccessExpression */) {
8631
+ if (node.kind === 80 /* PropertyAccessExpression */) {
8509
8632
  const meaning = analyzer.resolvePropertyAccessExpression(node).meaning;
8510
8633
  if (meaning.kind === "static-variable-access") {
8511
8634
  const entity = meaning.variable.value.getEntity();
@@ -8549,7 +8672,7 @@ var SemanticTokensService = class {
8549
8672
  ));
8550
8673
  }
8551
8674
  }
8552
- if (node.kind === 142 /* VariantDeclaration */) {
8675
+ if (node.kind === 144 /* VariantDeclaration */) {
8553
8676
  result.push(
8554
8677
  new SemanticToken(
8555
8678
  node.name.rangeWithoutTrivia,
@@ -8558,7 +8681,7 @@ var SemanticTokensService = class {
8558
8681
  )
8559
8682
  );
8560
8683
  }
8561
- if (node.kind === 27 /* PackageMethodDeclaration */) {
8684
+ if (node.kind === 29 /* PackageMethodDeclaration */) {
8562
8685
  result.push(
8563
8686
  new SemanticToken(
8564
8687
  node.name.rangeWithoutTrivia,
@@ -8567,17 +8690,17 @@ var SemanticTokensService = class {
8567
8690
  )
8568
8691
  );
8569
8692
  }
8570
- if (node.kind === 58 /* NestedMethodDeclaration */) {
8693
+ if (node.kind === 60 /* NestedMethodDeclaration */) {
8571
8694
  result.push(
8572
8695
  new SemanticToken(node.name.rangeWithoutTrivia, 5 /* NestedMethod */, new SemanticTokenModifiers().makeDeclaration().setCapitalized(this.isCapitalizedName(node.name.value)))
8573
8696
  );
8574
8697
  }
8575
- if (node.kind === 52 /* TypeMethodDeclaration */) {
8698
+ if (node.kind === 54 /* TypeMethodDeclaration */) {
8576
8699
  result.push(
8577
8700
  new SemanticToken(node.name.rangeWithoutTrivia, 6 /* TypeMethod */, new SemanticTokenModifiers().makeDeclaration().setCapitalized(this.isCapitalizedName(node.name.value)))
8578
8701
  );
8579
8702
  }
8580
- if (node.kind === 53 /* OperatorDeclaration */) {
8703
+ if (node.kind === 55 /* OperatorDeclaration */) {
8581
8704
  result.push(
8582
8705
  new SemanticToken(node.name.rangeWithoutTrivia, 7 /* Operator */, new SemanticTokenModifiers().makeDeclaration())
8583
8706
  );
@@ -8733,7 +8856,7 @@ var TypeParameterSignatureHelpProvider = class {
8733
8856
  }
8734
8857
  let node = token.parent;
8735
8858
  while (node !== void 0) {
8736
- if (node.kind === 152 /* TypeArgumentClause */ && this._offset >= node.lessThanToken.rangeWithoutTrivia.end && (node.greaterThanToken.rangeWithoutTrivia.isEmpty || this._offset <= node.greaterThanToken.rangeWithoutTrivia.start)) {
8859
+ if (node.kind === 154 /* TypeArgumentClause */ && this._offset >= node.lessThanToken.rangeWithoutTrivia.end && (node.greaterThanToken.rangeWithoutTrivia.isEmpty || this._offset <= node.greaterThanToken.rangeWithoutTrivia.start)) {
8737
8860
  const argumentIndex = this.getArgumentIndex(node.typeArgumentList, this._offset);
8738
8861
  const argumentCount = this.countArguments(node.typeArgumentList);
8739
8862
  return new NodeWithTypeArgumentsInfo(node.parent, argumentIndex, argumentCount);
@@ -8778,9 +8901,9 @@ var TypeParameterSignatureHelpProvider = class {
8778
8901
  switch (node.kind) {
8779
8902
  case 10 /* NamedTypeSpecifier */:
8780
8903
  return this.getSignaturesForNamedTypeSpecifier(node);
8781
- case 89 /* GenericSpecializationExpression */:
8904
+ case 91 /* GenericSpecializationExpression */:
8782
8905
  return this.getSignaturesForGenericSpecializationExpression(node);
8783
- case 147 /* Tag */:
8906
+ case 149 /* Tag */:
8784
8907
  return this.getSignaturesForTag(node);
8785
8908
  default:
8786
8909
  Debug.never(node);
@@ -8819,7 +8942,7 @@ var TypeParameterSignatureHelpProvider = class {
8819
8942
  }
8820
8943
  getSignaturesForGenericSpecializationExpression(node) {
8821
8944
  const expression = unwrapParenthesizedExpressions(node.expression);
8822
- if (expression.kind === 88 /* IdentifierExpression */) {
8945
+ if (expression.kind === 90 /* IdentifierExpression */) {
8823
8946
  const meaning = this._analyzer.resolveIdentifierExpression(expression).meaning;
8824
8947
  if (meaning.kind === "method-access") {
8825
8948
  return Query.from(meaning.candidates).mapAndFilter((o) => {
@@ -8834,7 +8957,7 @@ var TypeParameterSignatureHelpProvider = class {
8834
8957
  }
8835
8958
  return void 0;
8836
8959
  }
8837
- if (expression.kind === 78 /* PropertyAccessExpression */) {
8960
+ if (expression.kind === 80 /* PropertyAccessExpression */) {
8838
8961
  const meaning = this._analyzer.resolvePropertyAccessExpression(expression).meaning;
8839
8962
  let accessedMethods;
8840
8963
  if (meaning.kind === "instance-method-access") {
@@ -9087,7 +9210,7 @@ var ValueParametersSignatureHelpProvider = class {
9087
9210
  let node = token.parent;
9088
9211
  while (node !== void 0) {
9089
9212
  switch (node.kind) {
9090
- case 69 /* CallExpression */: {
9213
+ case 71 /* CallExpression */: {
9091
9214
  if (this._offset >= node.openParenthesisToken.rangeWithoutTrivia.end && (node.closeParenthesisToken.rangeWithoutTrivia.isEmpty || this._offset <= node.closeParenthesisToken.rangeWithoutTrivia.start)) {
9092
9215
  const valueArguments = ValueArgumentFactory.createValueArgumentsOfCallExpression(node);
9093
9216
  const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
@@ -9095,7 +9218,7 @@ var ValueParametersSignatureHelpProvider = class {
9095
9218
  }
9096
9219
  break;
9097
9220
  }
9098
- case 70 /* AutotypeCallExpression */: {
9221
+ case 72 /* AutotypeCallExpression */: {
9099
9222
  if (this._offset >= node.openParenthesisToken.rangeWithoutTrivia.end && (node.closeParenthesisToken.rangeWithoutTrivia.isEmpty || this._offset <= node.closeParenthesisToken.rangeWithoutTrivia.start)) {
9100
9223
  const valueArguments = ValueArgumentFactory.createValueArgumentsOfAutotypeCallExpression(node);
9101
9224
  const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
@@ -9103,7 +9226,7 @@ var ValueParametersSignatureHelpProvider = class {
9103
9226
  }
9104
9227
  break;
9105
9228
  }
9106
- case 71 /* IndexedAccessExpression */: {
9229
+ case 73 /* IndexedAccessExpression */: {
9107
9230
  if (this._offset >= node.openSquareBracketToken.rangeWithoutTrivia.end && (node.closeSquareBracketToken.rangeWithoutTrivia.isEmpty || this._offset <= node.closeSquareBracketToken.rangeWithoutTrivia.start)) {
9108
9231
  const valueArguments = ValueArgumentFactory.createValueArgumentsOfIndexedAccessExpression(node);
9109
9232
  const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
@@ -9111,7 +9234,7 @@ var ValueParametersSignatureHelpProvider = class {
9111
9234
  }
9112
9235
  break;
9113
9236
  }
9114
- case 147 /* Tag */: {
9237
+ case 149 /* Tag */: {
9115
9238
  if (node.openParenthesisToken !== void 0 && this._offset >= node.openParenthesisToken.rangeWithoutTrivia.end && node.argumentList !== void 0 && (node.closeParenthesisToken === void 0 || node.closeParenthesisToken.rangeWithoutTrivia.isEmpty || this._offset <= node.closeParenthesisToken.rangeWithoutTrivia.start)) {
9116
9239
  const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
9117
9240
  const valueArguments = ValueArgumentFactory.createValueArgumentsOfTag(node);
@@ -12029,6 +12152,8 @@ var EntityToSyntax = class {
12029
12152
  return this.convertParameterType(type);
12030
12153
  case "union":
12031
12154
  return this.convertUnionType(type);
12155
+ case "intersection":
12156
+ return this.convertIntersectionType(type);
12032
12157
  case "unresolved":
12033
12158
  return this.convertUnresolvedType(type);
12034
12159
  default:
@@ -12085,6 +12210,10 @@ var EntityToSyntax = class {
12085
12210
  const constituentTypes = type.originalTypes.map((t) => this.convertType(t));
12086
12211
  return SyntaxFactory.unionTypeSpecifier(constituentTypes);
12087
12212
  }
12213
+ convertIntersectionType(type) {
12214
+ const constituentTypes = type.originalTypes.map((t) => this.convertType(t));
12215
+ return SyntaxFactory.intersectionTypeSpecifier(constituentTypes);
12216
+ }
12088
12217
  convertUnresolvedType(_type) {
12089
12218
  return SyntaxFactory.namedTypeSpecifier("~\u041E\u0431\u044A\u0435\u043A\u0442");
12090
12219
  }
@@ -13269,7 +13398,7 @@ var LanguageServer = class {
13269
13398
  const sourceFileContext = yield this.getSourceFileContext(uri, token);
13270
13399
  if (sourceFileContext !== void 0) {
13271
13400
  const node = NodePath.parse(uri.fragment).getNode(sourceFileContext.sourceFile.getSyntaxNode());
13272
- if (node?.kind === 91 /* AssignmentStatement */) {
13401
+ if (node?.kind === 93 /* AssignmentStatement */) {
13273
13402
  const sourceFileEdit = this._addPropertyAssignmentService.createEditWithAssignment(
13274
13403
  sourceFileContext.sourceFile,
13275
13404
  node,
@@ -13306,7 +13435,7 @@ var LanguageServer = class {
13306
13435
  const node = NodePath.parse(uri.fragment).getNode(sourceFileContext.sourceFile.getSyntaxNode());
13307
13436
  if (node !== void 0) {
13308
13437
  let nodeForRange = node;
13309
- if (node.kind === 91 /* AssignmentStatement */) {
13438
+ if (node.kind === 93 /* AssignmentStatement */) {
13310
13439
  nodeForRange = node.right;
13311
13440
  }
13312
13441
  result = this.convertSourceFileRange(sourceFileContext.sourceFile, nodeForRange.rangeWithoutTrivia);