@artel/artc 0.6.25222 → 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 (53) hide show
  1. package/build/Cli.js +3 -3
  2. package/build/api/Api.js +12 -2
  3. package/build/api/ApiNodeJS.js +3 -3
  4. package/build/api/ApiServices.js +635 -532
  5. package/build/{chunk-ODWG5ZXF.js → chunk-24QZJOMF.js} +4477 -3240
  6. package/build/{chunk-MBMOAUK7.js → chunk-62KHK23H.js} +2 -2
  7. package/build/{chunk-UZK7JCND.js → chunk-Y6DODJCG.js} +1 -1
  8. package/build/types/analysis/AnalyzedTranslationPackage.d.ts +1 -0
  9. package/build/types/analysis/Analyzer.d.ts +17 -11
  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/LocalizationContext.d.ts +2 -2
  13. package/build/types/analysis/Lookup.d.ts +4 -4
  14. package/build/types/analysis/NamedTypeResolver.d.ts +5 -1
  15. package/build/types/analysis/NamedTypeSpecifierResolver.d.ts +4 -1
  16. package/build/types/analysis/PropertyAccessExpressionMeaning.d.ts +9 -3
  17. package/build/types/analysis/Scope.d.ts +21 -44
  18. package/build/types/analysis/SemanticContext.d.ts +14 -1
  19. package/build/types/analysis/SemanticContextBuilder.d.ts +1 -0
  20. package/build/types/analysis/StatementBlockScopeBuilder.d.ts +1 -0
  21. package/build/types/analysis/TagMeaning.d.ts +4 -1
  22. package/build/types/analysis/TypeMemberLookup.d.ts +39 -11
  23. package/build/types/analysis/TypeNarrower.d.ts +49 -14
  24. package/build/types/analysis/Utils.d.ts +12 -0
  25. package/build/types/analysis/control-flow/GraphBuilder.d.ts +43 -0
  26. package/build/types/analysis/{ControlFlowGraphVisualizer.d.ts → control-flow/GraphVisualizer.d.ts} +3 -3
  27. package/build/types/analysis/control-flow/NarrowableExpression.d.ts +5 -0
  28. package/build/types/analysis/control-flow/Nodes.d.ts +91 -0
  29. package/build/types/analysis/control-flow/index.d.ts +4 -0
  30. package/build/types/common/HelperPhrases.d.ts +3 -2
  31. package/build/types/diagnostic/DiagnosticCode.d.ts +5 -5
  32. package/build/types/emitter/Entities.d.ts +5 -4
  33. package/build/types/emitter/ir/Nodes.d.ts +2 -2
  34. package/build/types/entities/index.d.ts +3 -0
  35. package/build/types/parser/Scanner.d.ts +1 -2
  36. package/build/types/services/CompletionService.d.ts +0 -1
  37. package/build/types/services/DisplayService.d.ts +11 -8
  38. package/build/types/services/NodeSemanticInfo.d.ts +11 -6
  39. package/build/types/services/source-generation/EntityToSyntax.d.ts +1 -0
  40. package/build/types/tree/NodeKind.d.ts +146 -144
  41. package/build/types/tree/green/Nodes.d.ts +28 -10
  42. package/build/types/tree/green/SyntaxFactory.d.ts +1 -0
  43. package/build/types/tree/green/SyntaxToCode.d.ts +5 -1
  44. package/build/types/tree/red/Nodes.d.ts +33 -8
  45. package/build/types/ts-interop/TsInteropContext.d.ts +1 -0
  46. package/build/types/types/IntersectionType.d.ts +20 -0
  47. package/build/types/types/ParameterType.d.ts +6 -3
  48. package/build/types/types/Type.d.ts +2 -1
  49. package/build/types/types/TypeFactory.d.ts +4 -1
  50. package/build/types/types/TypeMembers.d.ts +5 -0
  51. package/build/types/types/index.d.ts +1 -0
  52. package/package.json +1 -1
  53. package/build/types/analysis/ControlFlowGraphBuilder.d.ts +0 -121
@@ -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-ODWG5ZXF.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.expression ?? subprogramBody.statementList?.statements.last();
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) {
@@ -349,39 +351,12 @@ var AddPropertyAssignmentService = class {
349
351
  * расположить сразу после. Иначе присваивание необходимо расположить в конце подпрограммы (после всех ветвлений).
350
352
  */
351
353
  ifShouldBeAssignedAtTheEndOfSubprogramThenBody(node) {
352
- const parent = node.parent.parent.parent;
354
+ const parent = node.parent.parent;
353
355
  switch (parent.kind) {
354
- case 25 /* PackageConstructorDeclaration */:
355
- case 26 /* PackageEntryPointDeclaration */:
356
- case 27 /* PackageMethodDeclaration */:
357
- case 36 /* PackageVariableGetterDeclaration */:
358
- case 37 /* PackageVariableSetterDeclaration */:
359
- case 45 /* TypeConstructorDeclaration */:
360
- case 46 /* TypeDestructorDeclaration */:
361
- case 47 /* TypeIndexedGetterDeclaration */:
362
- case 48 /* TypeIndexedSetterDeclaration */:
363
- case 50 /* TypeDereferencedVariableGetterDeclaration */:
364
- case 51 /* TypeDereferencedVariableSetterDeclaration */:
365
- case 52 /* TypeMethodDeclaration */:
366
- case 55 /* TypeVariableGetterDeclaration */:
367
- case 56 /* TypeVariableSetterDeclaration */:
368
- case 58 /* NestedMethodDeclaration */:
369
- case 67 /* MethodBlockLiteral */:
370
- case 74 /* MethodLiteral */:
371
- case 53 /* OperatorDeclaration */:
372
- return void 0;
373
- case 98 /* RunStatement */:
374
- case 99 /* TryStatement */:
375
- case 100 /* CatchClause */:
376
- case 102 /* FinallyClause */:
377
- case 108 /* ForStatement */:
378
- case 109 /* IfStatement */:
379
- case 111 /* ElseIfClause */:
380
- case 112 /* ElseClause */:
381
- case 116 /* LoopStatement */:
382
- case 121 /* CaseClause */:
383
- case 122 /* WhileStatement */:
356
+ case 95 /* StatementBlock */:
384
357
  return this.getContainingSubprogram(parent)?.block;
358
+ case 96 /* FunctionBlock */:
359
+ return void 0;
385
360
  default:
386
361
  Debug.never(parent);
387
362
  }
@@ -399,23 +374,23 @@ var AddPropertyAssignmentService = class {
399
374
  };
400
375
  function isSubprogramDeclaration(node) {
401
376
  switch (node.kind) {
402
- case 25 /* PackageConstructorDeclaration */:
403
- case 26 /* PackageEntryPointDeclaration */:
404
- case 27 /* PackageMethodDeclaration */:
405
- case 36 /* PackageVariableGetterDeclaration */:
406
- case 37 /* PackageVariableSetterDeclaration */:
407
- case 45 /* TypeConstructorDeclaration */:
408
- case 46 /* TypeDestructorDeclaration */:
409
- case 47 /* TypeIndexedGetterDeclaration */:
410
- case 48 /* TypeIndexedSetterDeclaration */:
411
- case 50 /* TypeDereferencedVariableGetterDeclaration */:
412
- case 51 /* TypeDereferencedVariableSetterDeclaration */:
413
- case 52 /* TypeMethodDeclaration */:
414
- case 55 /* TypeVariableGetterDeclaration */:
415
- case 56 /* TypeVariableSetterDeclaration */:
416
- case 58 /* NestedMethodDeclaration */:
417
- case 67 /* MethodBlockLiteral */:
418
- 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 */:
419
394
  return true;
420
395
  default:
421
396
  Debug.typeIsAssignableTo();
@@ -761,6 +736,14 @@ var SyntaxFactory = class {
761
736
  new UnionTypeSpecifierTypeList(this.createTokenSeparatedElements(typeSpecifiers, 17 /* Bar */))
762
737
  );
763
738
  }
739
+ static intersectionTypeSpecifier(typeSpecifiers) {
740
+ return new IntersectionTypeSpecifier(
741
+ new IntersectionTypeSpecifierTypeList(this.createTokenSeparatedElements(
742
+ typeSpecifiers,
743
+ 10 /* Ampersand */
744
+ ))
745
+ );
746
+ }
764
747
  static nullableTypeSpecifier(typeSpecifier) {
765
748
  const questionToken = this.token(49 /* Question */);
766
749
  return new NullableTypeSpecifier(typeSpecifier, questionToken);
@@ -859,13 +842,13 @@ var SyntaxFactory = class {
859
842
  static functionExpressionBlock(expression) {
860
843
  const openBraceToken = this.token(43 /* OpenBrace */);
861
844
  const closeBraceToken = this.token(20 /* CloseBrace */);
862
- return new FunctionBlock(openBraceToken, expression, void 0, closeBraceToken);
845
+ return new FunctionBlock(openBraceToken, expression, closeBraceToken);
863
846
  }
864
847
  static functionStatementBlock(statements) {
865
848
  const openBraceToken = this.token(43 /* OpenBrace */);
866
849
  const statementList = new StatementList(statements);
867
850
  const closeBraceToken = this.token(20 /* CloseBrace */);
868
- return new FunctionBlock(openBraceToken, void 0, statementList, closeBraceToken);
851
+ return new FunctionBlock(openBraceToken, statementList, closeBraceToken);
869
852
  }
870
853
  static noneLiteral() {
871
854
  return new KeywordExpression(this.keyword(57 /* None */));
@@ -1579,8 +1562,11 @@ var SyntaxToCode = class _SyntaxToCode {
1579
1562
  this.writeVariantTypeDeclarationBody(node.body);
1580
1563
  }
1581
1564
  writeUnionTypeSpecifier(node) {
1582
- for (let i = 0; i < node.typeList.elements.length; i++) {
1583
- 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];
1584
1570
  if (element.kind === 0 /* Token */) {
1585
1571
  this.writeWhitespace();
1586
1572
  this.writeToken(element);
@@ -1588,7 +1574,31 @@ var SyntaxToCode = class _SyntaxToCode {
1588
1574
  if (i > 0) {
1589
1575
  this.writeWhitespace();
1590
1576
  }
1591
- const areParenthesisRequired = this.doesConstituentTypeRequireParenthesis(element);
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];
1594
+ if (element.kind === 0 /* Token */) {
1595
+ this.writeWhitespace();
1596
+ this.writeToken(element);
1597
+ } else {
1598
+ if (i > 0) {
1599
+ this.writeWhitespace();
1600
+ }
1601
+ const areParenthesisRequired = this.doesIntersectionTypeElementRequireParenthesis(element);
1592
1602
  if (areParenthesisRequired) {
1593
1603
  this.writeCode("(");
1594
1604
  }
@@ -1615,25 +1625,51 @@ var SyntaxToCode = class _SyntaxToCode {
1615
1625
  }
1616
1626
  this.writeToken(node.questionToken);
1617
1627
  }
1618
- doesConstituentTypeRequireParenthesis(node) {
1628
+ doesUnionTypeElementRequireParenthesis(node) {
1619
1629
  switch (node.kind) {
1620
1630
  case 11 /* UnionTypeSpecifier */:
1621
1631
  return true;
1622
- case 15 /* AnonymousTypeSpecifier */: {
1632
+ case 17 /* AnonymousTypeSpecifier */: {
1623
1633
  switch (node.typeDeclaration.body.kind) {
1624
- case 29 /* MethodTypeDeclarationBody */:
1634
+ case 31 /* MethodTypeDeclarationBody */:
1625
1635
  return true;
1626
- case 34 /* StructuredTypeDeclarationBody */:
1627
- case 39 /* VariantTypeDeclarationBody */:
1636
+ case 36 /* StructuredTypeDeclarationBody */:
1637
+ case 41 /* VariantTypeDeclarationBody */:
1628
1638
  return false;
1629
1639
  default:
1630
1640
  Debug.never(node.typeDeclaration.body);
1631
1641
  }
1632
1642
  }
1633
1643
  case 10 /* NamedTypeSpecifier */:
1634
- case 13 /* ParenthesizedTypeSpecifier */:
1635
- case 14 /* NullableTypeSpecifier */:
1636
- case 16 /* InvalidTypeSpecifier */:
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) {
1654
+ switch (node.kind) {
1655
+ case 11 /* UnionTypeSpecifier */:
1656
+ case 13 /* IntersectionTypeSpecifier */:
1657
+ return true;
1658
+ case 17 /* AnonymousTypeSpecifier */: {
1659
+ switch (node.typeDeclaration.body.kind) {
1660
+ case 31 /* MethodTypeDeclarationBody */:
1661
+ return true;
1662
+ case 36 /* StructuredTypeDeclarationBody */:
1663
+ case 41 /* VariantTypeDeclarationBody */:
1664
+ return false;
1665
+ default:
1666
+ Debug.never(node.typeDeclaration.body);
1667
+ }
1668
+ }
1669
+ case 10 /* NamedTypeSpecifier */:
1670
+ case 15 /* ParenthesizedTypeSpecifier */:
1671
+ case 16 /* NullableTypeSpecifier */:
1672
+ case 18 /* InvalidTypeSpecifier */:
1637
1673
  return false;
1638
1674
  default:
1639
1675
  Debug.never(node);
@@ -1642,12 +1678,13 @@ var SyntaxToCode = class _SyntaxToCode {
1642
1678
  doesTypeMadeNullableRequireParenthesis(node) {
1643
1679
  switch (node.kind) {
1644
1680
  case 11 /* UnionTypeSpecifier */:
1645
- case 15 /* AnonymousTypeSpecifier */:
1681
+ case 13 /* IntersectionTypeSpecifier */:
1682
+ case 17 /* AnonymousTypeSpecifier */:
1646
1683
  return true;
1647
1684
  case 10 /* NamedTypeSpecifier */:
1648
- case 13 /* ParenthesizedTypeSpecifier */:
1649
- case 14 /* NullableTypeSpecifier */:
1650
- case 16 /* InvalidTypeSpecifier */:
1685
+ case 15 /* ParenthesizedTypeSpecifier */:
1686
+ case 16 /* NullableTypeSpecifier */:
1687
+ case 18 /* InvalidTypeSpecifier */:
1651
1688
  return false;
1652
1689
  default:
1653
1690
  Debug.never(node);
@@ -1672,7 +1709,7 @@ var SyntaxToCode = class _SyntaxToCode {
1672
1709
  this.writeNodeDefault(node);
1673
1710
  }
1674
1711
  writeDeclarationBody(node, addLeadingNewLineOrWhitespace = true) {
1675
- if (node.statementList === void 0 || node.statementList.elements.length === 0) {
1712
+ if (node.expressionOrStatementList.kind !== 94 /* StatementList */ || node.expressionOrStatementList.elements.length === 0) {
1676
1713
  this.writeWhitespace();
1677
1714
  this.writeFunctionBlock(node, false);
1678
1715
  } else {
@@ -1982,153 +2019,155 @@ var SyntaxToCode = class _SyntaxToCode {
1982
2019
  [9 /* PackagePath */]: this.prototype.writePackagePath,
1983
2020
  [10 /* NamedTypeSpecifier */]: this.prototype.writeNamedTypeSpecifier,
1984
2021
  [11 /* UnionTypeSpecifier */]: this.prototype.writeUnionTypeSpecifier,
1985
- [13 /* ParenthesizedTypeSpecifier */]: this.prototype.writeParenthesizedTypeSpecifier,
1986
- [14 /* NullableTypeSpecifier */]: this.prototype.writeNullableTypeSpecifier,
1987
- [15 /* AnonymousTypeSpecifier */]: this.prototype.writeAnonymousTypeSpecifier,
1988
- [22 /* PackageAliasTypeDeclaration */]: this.prototype.writePackageAliasTypeDeclaration,
1989
- [24 /* PackageMemberGroupDeclaration */]: this.prototype.writePackageMemberGroupDeclaration,
1990
- [25 /* PackageConstructorDeclaration */]: this.prototype.writePackageConstructorDeclaration,
1991
- [26 /* PackageEntryPointDeclaration */]: this.prototype.writePackageEntryPointDeclaration,
1992
- [27 /* PackageMethodDeclaration */]: this.prototype.writePackageMethodDeclaration,
1993
- [28 /* PackageMethodTypeDeclaration */]: this.prototype.writePackageMethodTypeDeclaration,
1994
- [29 /* MethodTypeDeclarationBody */]: this.prototype.writeMethodTypeDeclarationBody,
1995
- [30 /* BaseTypeList */]: this.prototype.writeBaseTypeList,
1996
- [32 /* TypeMemberDeclarationBlock */]: this.prototype.writeTypeMemberDeclarationBlock,
1997
- [33 /* PackageStructuredTypeDeclaration */]: this.prototype.writePackageStructuredTypeDeclaration,
1998
- [34 /* StructuredTypeDeclarationBody */]: this.prototype.writeStructuredTypeDeclarationBody,
1999
- [35 /* PackageVariableDeclaration */]: this.prototype.writePackageVariableDeclaration,
2000
- [36 /* PackageVariableGetterDeclaration */]: this.prototype.writePackageVariableGetterDeclaration,
2001
- [37 /* PackageVariableSetterDeclaration */]: this.prototype.writePackageVariableSetterDeclaration,
2002
- [38 /* PackageVariantTypeDeclaration */]: this.prototype.writePackageVariantTypeDeclaration,
2003
- [39 /* VariantTypeDeclarationBody */]: this.prototype.writeVariantTypeDeclarationBody,
2004
- [44 /* TypeMemberGroupDeclaration */]: this.prototype.writeTypeMemberGroupDeclaration,
2005
- [45 /* TypeConstructorDeclaration */]: this.prototype.writeTypeConstructorDeclaration,
2006
- [46 /* TypeDestructorDeclaration */]: this.prototype.writeTypeDestructorDeclaration,
2007
- [47 /* TypeIndexedGetterDeclaration */]: this.prototype.writeTypeIndexedGetterDeclaration,
2008
- [48 /* TypeIndexedSetterDeclaration */]: this.prototype.writeTypeIndexedSetterDeclaration,
2009
- [50 /* TypeDereferencedVariableGetterDeclaration */]: this.prototype.writeTypeDereferencedVariableGetterDeclaration,
2010
- [51 /* TypeDereferencedVariableSetterDeclaration */]: this.prototype.writeTypeDereferencedVariableSetterDeclaration,
2011
- [52 /* TypeMethodDeclaration */]: this.prototype.writeTypeMethodDeclaration,
2012
- [53 /* OperatorDeclaration */]: this.prototype.writeOperatorDeclaration,
2013
- [54 /* TypeVariableDeclaration */]: this.prototype.writeTypeVariableDeclaration,
2014
- [55 /* TypeVariableGetterDeclaration */]: this.prototype.writeTypeVariableGetterDeclaration,
2015
- [56 /* TypeVariableSetterDeclaration */]: this.prototype.writeTypeVariableSetterDeclaration,
2016
- [93 /* StatementBlock */]: this.prototype.writeStatementBlock,
2017
- [94 /* FunctionBlock */]: this.prototype.writeFunctionBlock,
2018
- [135 /* QualifiedName */]: this.prototype.writeQualifiedName,
2019
- [142 /* VariantDeclaration */]: this.prototype.writeVariantDeclaration,
2020
- [143 /* TypeParameterDeclaration */]: this.prototype.writeTypeParameterDeclaration,
2021
- [144 /* ParameterDeclaration */]: this.prototype.writeParameterDeclaration,
2022
- [145 /* Argument */]: this.prototype.writeArgument,
2023
- [147 /* Tag */]: this.prototype.writeTag,
2024
- [149 /* Modifier */]: this.prototype.writeModifier,
2025
- [150 /* ParameterClause */]: this.prototype.writeParameterClause,
2026
- [151 /* ParameterList */]: this.prototype.writeParameterList,
2027
- [152 /* TypeArgumentClause */]: this.prototype.writeTypeArgumentClause,
2028
- [154 /* TypeParameterClause */]: this.prototype.writeTypeParameterClause,
2029
- [17 /* AnonymousMethodTypeDeclaration */]: this.prototype.writeAnonymousMethodTypeDeclaration,
2030
- [18 /* AnonymousStructuredTypeDeclaration */]: this.prototype.writeAnonymousStructuredTypeDeclaration,
2031
- [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,
2032
2070
  [6 /* PackageGroupImportDirective */]: this.prototype.writeNodeDefault,
2033
2071
  [7 /* PackageImportList */]: this.prototype.writeNodeDefault,
2034
- [12 /* UnionTypeSpecifierTypeList */]: this.prototype.writeNodeDefault,
2035
- [16 /* InvalidTypeSpecifier */]: this.prototype.writeNodeDefault,
2036
- [20 /* TopLevelTranslationList */]: this.prototype.writeNodeDefault,
2037
- [21 /* TranslationsDeclaration */]: this.prototype.writeTranslationsDeclaration,
2038
- [23 /* AliasTypeDeclarationBody */]: this.prototype.writeNodeDefault,
2039
- [31 /* TypeMemberDeclarationList */]: this.prototype.writeNodeDefault,
2040
- [40 /* TypeExtensionDeclaration */]: this.prototype.writeNodeDefault,
2041
- [41 /* ExtendedTypeClauseCommaList */]: this.prototype.writeNodeDefault,
2042
- [42 /* ExtendedTypeClause */]: this.prototype.writeNodeDefault,
2043
- [43 /* InvalidPackageMemberDeclaration */]: this.prototype.writeNodeDefault,
2044
- [49 /* TypeIndexerParameterClause */]: this.prototype.writeNodeDefault,
2045
- [57 /* InvalidTypeMemberDeclaration */]: this.prototype.writeNodeDefault,
2046
- [58 /* NestedMethodDeclaration */]: this.prototype.writeNodeDefault,
2047
- [59 /* LocalVariableDeclaration */]: this.prototype.writeNodeDefault,
2048
- [60 /* EnumerationVariableDeclaration */]: this.prototype.writeNodeDefault,
2049
- [61 /* ArrayLiteral */]: this.prototype.writeNodeDefault,
2050
- [62 /* ArrayLiteralElementList */]: this.prototype.writeNodeDefault,
2051
- [63 /* AssertionExpression */]: this.prototype.writeNodeDefault,
2052
- [64 /* AssumptionExpression */]: this.prototype.writeNodeDefault,
2053
- [65 /* AsExpression */]: this.prototype.writeNodeDefault,
2054
- [66 /* BinaryExpression */]: this.prototype.writeNodeDefault,
2055
- [67 /* MethodBlockLiteral */]: this.prototype.writeNodeDefault,
2056
- [68 /* ArgumentList */]: this.prototype.writeNodeDefault,
2057
- [69 /* CallExpression */]: this.prototype.writeNodeDefault,
2058
- [70 /* AutotypeCallExpression */]: this.prototype.writeNodeDefault,
2059
- [71 /* IndexedAccessExpression */]: this.prototype.writeNodeDefault,
2060
- [72 /* InvalidExpression */]: this.prototype.writeNodeDefault,
2061
- [73 /* IsExpression */]: this.prototype.writeNodeDefault,
2062
- [74 /* MethodLiteral */]: this.prototype.writeNodeDefault,
2063
- [75 /* ParenthesizedExpression */]: this.prototype.writeNodeDefault,
2064
- [76 /* WhenTernaryExpression */]: this.prototype.writeNodeDefault,
2065
- [77 /* PrefixUnaryExpression */]: this.prototype.writeNodeDefault,
2066
- [78 /* PropertyAccessExpression */]: this.prototype.writeNodeDefault,
2067
- [79 /* ReferenceExpression */]: this.prototype.writeNodeDefault,
2068
- [80 /* DereferenceExpression */]: this.prototype.writeNodeDefault,
2069
- [81 /* TextTemplateLiteral */]: this.prototype.writeNodeDefault,
2070
- [82 /* TextTemplateSpanList */]: this.prototype.writeNodeDefault,
2071
- [83 /* TextTemplateSpan */]: this.prototype.writeNodeDefault,
2072
- [84 /* TokenExpression */]: this.prototype.writeNodeDefault,
2073
- [85 /* KeywordExpression */]: this.prototype.writeNodeDefault,
2074
- [86 /* ObjectExpression */]: this.prototype.writeNodeDefault,
2075
- [87 /* BaseExpression */]: this.prototype.writeNodeDefault,
2076
- [88 /* IdentifierExpression */]: this.prototype.writeNodeDefault,
2077
- [89 /* GenericSpecializationExpression */]: this.prototype.writeNodeDefault,
2078
- [90 /* DefaultMatchExpression */]: this.prototype.writeNodeDefault,
2079
- [91 /* AssignmentStatement */]: this.prototype.writeNodeDefault,
2080
- [92 /* StatementList */]: this.prototype.writeNodeDefault,
2081
- [95 /* BreakLoopStatement */]: this.prototype.writeNodeDefault,
2082
- [96 /* ContinueLoopStatement */]: this.prototype.writeNodeDefault,
2083
- [97 /* DisposeStatement */]: this.prototype.writeNodeDefault,
2084
- [98 /* RunStatement */]: this.prototype.writeNodeDefault,
2085
- [99 /* TryStatement */]: this.prototype.writeNodeDefault,
2086
- [100 /* CatchClause */]: this.prototype.writeNodeDefault,
2087
- [101 /* ErrorVariableDeclaration */]: this.prototype.writeNodeDefault,
2088
- [102 /* FinallyClause */]: this.prototype.writeNodeDefault,
2089
- [103 /* EmptyStatement */]: this.prototype.writeNodeDefault,
2090
- [104 /* ErrorStatement */]: this.prototype.writeNodeDefault,
2091
- [105 /* ImportantStatement */]: this.prototype.writeNodeDefault,
2092
- [106 /* ExpressionStatement */]: this.prototype.writeNodeDefault,
2093
- [107 /* EnumerationVariableList */]: this.prototype.writeNodeDefault,
2094
- [108 /* ForStatement */]: this.prototype.writeNodeDefault,
2095
- [109 /* IfStatement */]: this.prototype.writeNodeDefault,
2096
- [110 /* ElseIfClauseList */]: this.prototype.writeNodeDefault,
2097
- [111 /* ElseIfClause */]: this.prototype.writeNodeDefault,
2098
- [112 /* ElseClause */]: this.prototype.writeNodeDefault,
2099
- [113 /* InvalidStatement */]: this.prototype.writeNodeDefault,
2100
- [114 /* NestedMethodDeclarationStatement */]: this.prototype.writeNodeDefault,
2101
- [115 /* LocalVariableDeclarationStatement */]: this.prototype.writeNodeDefault,
2102
- [116 /* LoopStatement */]: this.prototype.writeNodeDefault,
2103
- [117 /* ReturnStatement */]: this.prototype.writeNodeDefault,
2104
- [118 /* CaseClauseList */]: this.prototype.writeNodeDefault,
2105
- [119 /* SwitchStatement */]: this.prototype.writeNodeDefault,
2106
- [120 /* MatchExpressionList */]: this.prototype.writeNodeDefault,
2107
- [121 /* CaseClause */]: this.prototype.writeNodeDefault,
2108
- [122 /* WhileStatement */]: this.prototype.writeNodeDefault,
2109
- [123 /* YieldStatement */]: this.prototype.writeNodeDefault,
2110
- [124 /* TranslationParameterList */]: this.prototype.writeNodeDefault,
2111
- [125 /* TranslationParameterClause */]: this.prototype.writeTranslationParameterClause,
2112
- [126 /* ConstructorTranslation */]: this.prototype.writeConstructorTranslation,
2113
- [127 /* IndexerTranslationParameterClause */]: this.prototype.writeIndexerTranslationParameterClause,
2114
- [128 /* IndexerTranslation */]: this.prototype.writeIndexerTranslation,
2115
- [129 /* TranslationTypeParameterList */]: this.prototype.writeNodeDefault,
2116
- [130 /* TranslationTypeParameterClause */]: this.prototype.writeTranslationTypeParameterClause,
2117
- [131 /* PackageMethodTranslation */]: this.prototype.writePackageMethodTranslation,
2118
- [132 /* TypeMethodTranslation */]: this.prototype.writeTypeMethodTranslation,
2119
- [133 /* MethodTypeTranslation */]: this.prototype.writeMethodTypeTranslation,
2120
- [134 /* PackageImportTranslation */]: this.prototype.writePackageImportTranslation,
2121
- [136 /* PackageVariableTranslation */]: this.prototype.writePackageVariableTranslation,
2122
- [137 /* TypeVariableOrVariantTranslation */]: this.prototype.writeTypeVariableOrVariantTranslation,
2123
- [138 /* TypeMemberTranslationList */]: this.prototype.writeNodeDefault,
2124
- [139 /* TypeTranslation */]: this.prototype.writeTypeTranslation,
2125
- [140 /* TextLiteralTranslation */]: this.prototype.writeNodeDefault,
2126
- [141 /* TextTemplateLiteralTranslation */]: this.prototype.writeNodeDefault,
2127
- [146 /* TagList */]: this.prototype.writeNodeDefault,
2128
- [148 /* ModifierList */]: this.prototype.writeNodeDefault,
2129
- [153 /* TypeArgumentList */]: this.prototype.writeNodeDefault,
2130
- [155 /* TypeParameterList */]: this.prototype.writeNodeDefault,
2131
- [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
2132
2171
  };
2133
2172
  return writeFunctions;
2134
2173
  }
@@ -2314,7 +2353,7 @@ var TranslationsGenerationService = class {
2314
2353
  return void 0;
2315
2354
  }
2316
2355
  let result;
2317
- 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) {
2318
2357
  const translationPackage = analyzer.getAnalyzedTranslationPackageIfTargetResolved(sourceFile.package);
2319
2358
  if (translationPackage !== void 0) {
2320
2359
  const generator = new TranslationsGenerator(
@@ -2326,7 +2365,7 @@ var TranslationsGenerationService = class {
2326
2365
  result = generator.generateMissingTypeMemberTranslations(tokenOrKeyword.parent);
2327
2366
  }
2328
2367
  }
2329
- 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 */) {
2330
2369
  const translationPackage = analyzer.getAnalyzedTranslationPackageIfTargetResolved(sourceFile.package);
2331
2370
  if (translationPackage !== void 0) {
2332
2371
  const generator = new TranslationsGenerator(
@@ -2352,7 +2391,7 @@ var TranslationsGenerationService = class {
2352
2391
  if (tokenOrKeyword === void 0) {
2353
2392
  return false;
2354
2393
  }
2355
- if (!(tokenOrKeyword.isKeyword(55 /* Translations */) && tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */)) {
2394
+ if (!(tokenOrKeyword.isKeyword(55 /* Translations */) && tokenOrKeyword.parent.kind === 23 /* TranslationsDeclaration */)) {
2356
2395
  return false;
2357
2396
  }
2358
2397
  const translationPackage = analyzer.getAnalyzedTranslationPackageIfTargetResolved(sourceFile.package);
@@ -2360,7 +2399,7 @@ var TranslationsGenerationService = class {
2360
2399
  return false;
2361
2400
  }
2362
2401
  const generator = new TranslationsGenerator(analyzer, sourceFile, translationPackage, sourceFile.package.dialect);
2363
- 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);
2364
2403
  }
2365
2404
  };
2366
2405
  var TranslationsGenerator = class _TranslationsGenerator {
@@ -2387,7 +2426,7 @@ var TranslationsGenerator = class _TranslationsGenerator {
2387
2426
  };
2388
2427
  const memberTranslationsCode = Query.from(memberEntities).mapAndFilter((m) => this.createPackageMemberTranslationNode(m)).uniqueWithComparator(compareNodes).map((n) => {
2389
2428
  const code = new SyntaxToCode(n, syntaxToCodeOptions).convert();
2390
- if (n.kind === 139 /* TypeTranslation */) {
2429
+ if (n.kind === 141 /* TypeTranslation */) {
2391
2430
  const startOffset = Math.max(code.indexOf(newLine), 0);
2392
2431
  return this.addNewLineBeforeArrowsInTranslation(
2393
2432
  code,
@@ -2419,7 +2458,7 @@ var TranslationsGenerator = class _TranslationsGenerator {
2419
2458
  generateMissingTranslationsForPartiallyTranslatedTypes(translationsDeclaration) {
2420
2459
  const result = new Array();
2421
2460
  for (const translation of translationsDeclaration.translationList.translationDeclarations) {
2422
- if (translation.kind === 139 /* TypeTranslation */) {
2461
+ if (translation.kind === 141 /* TypeTranslation */) {
2423
2462
  const edits = this.generateMissingTypeMemberTranslations(translation);
2424
2463
  if (edits !== void 0) {
2425
2464
  result.push(...edits);
@@ -2516,13 +2555,13 @@ var TranslationsGenerator = class _TranslationsGenerator {
2516
2555
  }
2517
2556
  detectIndentationStepForTypeMemberTranslations(node) {
2518
2557
  let indentationStepSize;
2519
- if (node.kind === 139 /* TypeTranslation */) {
2558
+ if (node.kind === 141 /* TypeTranslation */) {
2520
2559
  indentationStepSize = tryDetectIndentationStepSizeUsingTypeTranslation(node, this._sourceFile);
2521
2560
  }
2522
2561
  if (indentationStepSize === void 0) {
2523
- const translationsDeclarations = node.kind === 21 /* TranslationsDeclaration */ ? node : node.parent.parent;
2562
+ const translationsDeclarations = node.kind === 23 /* TranslationsDeclaration */ ? node : node.parent.parent;
2524
2563
  for (const member of translationsDeclarations.translationList.translationDeclarations) {
2525
- if (member.kind === 139 /* TypeTranslation */) {
2564
+ if (member.kind === 141 /* TypeTranslation */) {
2526
2565
  indentationStepSize = tryDetectIndentationStepSizeUsingTypeTranslation(member, this._sourceFile);
2527
2566
  if (indentationStepSize !== void 0) {
2528
2567
  break;
@@ -2803,13 +2842,13 @@ var ValueArgumentFactory = class _ValueArgumentFactory {
2803
2842
  var SignatureForNode = class _SignatureForNode {
2804
2843
  static getSignaturesForNode(analyzer, node) {
2805
2844
  switch (node.kind) {
2806
- case 69 /* CallExpression */:
2845
+ case 71 /* CallExpression */:
2807
2846
  return _SignatureForNode.getSignaturesForCallExpression(analyzer, node);
2808
- case 70 /* AutotypeCallExpression */:
2847
+ case 72 /* AutotypeCallExpression */:
2809
2848
  return _SignatureForNode.getSignaturesForAutotypeCallExpression(analyzer, node);
2810
- case 71 /* IndexedAccessExpression */:
2849
+ case 73 /* IndexedAccessExpression */:
2811
2850
  return _SignatureForNode.getSignaturesForIndexedAccessExpression(analyzer, node);
2812
- case 147 /* Tag */:
2851
+ case 149 /* Tag */:
2813
2852
  return _SignatureForNode.getSignaturesForTag(analyzer, node);
2814
2853
  default:
2815
2854
  Debug.never(node);
@@ -2947,7 +2986,7 @@ var SimplifiedOverloadResolver = class _SimplifiedOverloadResolver {
2947
2986
  result = false;
2948
2987
  break;
2949
2988
  }
2950
- if (argument.expression === void 0 || argument.expression.kind === 72 /* InvalidExpression */) {
2989
+ if (argument.expression === void 0 || argument.expression.kind === 74 /* InvalidExpression */) {
2951
2990
  continue;
2952
2991
  }
2953
2992
  const targetParameterType = targetParameter.getType();
@@ -3185,7 +3224,7 @@ var CompletionService = class {
3185
3224
  if (syntaxContext.isInComment || syntaxContext.isInStringOrChar) {
3186
3225
  return { kind: "none" };
3187
3226
  }
3188
- 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 */)) {
3189
3228
  return new OperatorNameCompletionContext(syntaxContext.isInQuotedIdentifier);
3190
3229
  }
3191
3230
  const tokenOrKeyword = positionDescription.tokenOrKeyword;
@@ -3203,7 +3242,7 @@ var CompletionService = class {
3203
3242
  if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 6 /* PackageGroupImportDirective */ || this.tokenOrKeywordIsPackageImportListChild(tokenOrKeyword)) {
3204
3243
  return new PackageImportCompletionContext([], void 0);
3205
3244
  }
3206
- if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 78 /* PropertyAccessExpression */) {
3245
+ if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 80 /* PropertyAccessExpression */) {
3207
3246
  const propertyAccess = tokenOrKeyword.parent;
3208
3247
  {
3209
3248
  const info = this._analyzer.checkExpressionDenotesPackageNameSegment(propertyAccess.expression);
@@ -3244,7 +3283,7 @@ var CompletionService = class {
3244
3283
  typeExtensionLookup
3245
3284
  );
3246
3285
  }
3247
- 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 */) {
3248
3287
  const namedTypeSpecifier = tokenOrKeyword.parent.parent;
3249
3288
  const resolutionResult = this._analyzer.resolveNamedTypeSpecifier(namedTypeSpecifier);
3250
3289
  const segmentIndex = Math.floor(
@@ -3252,7 +3291,7 @@ var CompletionService = class {
3252
3291
  );
3253
3292
  if (segmentIndex < resolutionResult.resolvedQualifiers.length) {
3254
3293
  let completionInIsOrAsExpressionInfo;
3255
- if (namedTypeSpecifier.parent.kind === 73 /* IsExpression */ || namedTypeSpecifier.parent.kind === 65 /* AsExpression */) {
3294
+ if (namedTypeSpecifier.parent.kind === 75 /* IsExpression */ || namedTypeSpecifier.parent.kind === 67 /* AsExpression */) {
3256
3295
  completionInIsOrAsExpressionInfo = {
3257
3296
  expressionType: this._analyzer.type.ofExpression(namedTypeSpecifier.parent.expression)
3258
3297
  };
@@ -3286,7 +3325,7 @@ var CompletionService = class {
3286
3325
  }
3287
3326
  return { kind: "none" };
3288
3327
  }
3289
- 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 */) {
3290
3329
  const tag = tokenOrKeyword.parent.parent;
3291
3330
  const resolutionResult = this._analyzer.resolveTag(tag);
3292
3331
  const segmentIndex = Math.floor(
@@ -3324,7 +3363,7 @@ var CompletionService = class {
3324
3363
  }
3325
3364
  if (syntaxContext.isUnqualifiedTypeContext !== void 0) {
3326
3365
  let completionInIsOrAsExpressionInfo;
3327
- if (tokenOrKeyword.parent.kind === 73 /* IsExpression */ || tokenOrKeyword.parent.kind === 65 /* AsExpression */) {
3366
+ if (tokenOrKeyword.parent.kind === 75 /* IsExpression */ || tokenOrKeyword.parent.kind === 67 /* AsExpression */) {
3328
3367
  completionInIsOrAsExpressionInfo = {
3329
3368
  expressionType: this._analyzer.type.ofExpression(tokenOrKeyword.parent.expression)
3330
3369
  };
@@ -3379,17 +3418,17 @@ var CompletionService = class {
3379
3418
  translationKind = 0 /* Any */;
3380
3419
  hasPrecedingKeyword = false;
3381
3420
  }
3382
- if (tokenOrKeyword.isKeyword(18 /* Import */) && tokenOrKeyword.parent.kind === 134 /* PackageImportTranslation */) {
3421
+ if (tokenOrKeyword.isKeyword(18 /* Import */) && tokenOrKeyword.parent.kind === 136 /* PackageImportTranslation */) {
3383
3422
  translationsDeclaration = tokenOrKeyword.parent.parent.parent;
3384
3423
  translationKind = 1 /* PackageImport */;
3385
3424
  hasPrecedingKeyword = true;
3386
3425
  }
3387
- 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 */)) {
3388
3427
  translationsDeclaration = tokenOrKeyword.parent.parent.parent;
3389
3428
  translationKind = 3 /* Type */;
3390
3429
  hasPrecedingKeyword = true;
3391
3430
  }
3392
- if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 131 /* PackageMethodTranslation */) {
3431
+ if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 133 /* PackageMethodTranslation */) {
3393
3432
  translationsDeclaration = tokenOrKeyword.parent.parent.parent;
3394
3433
  translationKind = 2 /* Method */;
3395
3434
  hasPrecedingKeyword = true;
@@ -3409,9 +3448,9 @@ var CompletionService = class {
3409
3448
  hasPrecedingKeyword
3410
3449
  );
3411
3450
  }
3412
- if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 135 /* QualifiedName */) {
3451
+ if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 137 /* QualifiedName */) {
3413
3452
  const qualifiedName = tokenOrKeyword.parent;
3414
- if (qualifiedName.parent.kind === 134 /* PackageImportTranslation */ && qualifiedName === qualifiedName.parent.sourceName) {
3453
+ if (qualifiedName.parent.kind === 136 /* PackageImportTranslation */ && qualifiedName === qualifiedName.parent.sourceName) {
3415
3454
  const precedingSegmentNames = qualifiedName.qualifiers.takeWhile((s) => s.rangeStart < tokenOrKeyword.value.rangeStart).map((p) => this._analyzer.createNameFromIdentifier(p)).toArray();
3416
3455
  const sourceLocale = translationPackage.getTranslatedPackage().getLocale();
3417
3456
  return new PackageImportCompletionContext(precedingSegmentNames, { sourceLocale });
@@ -3436,12 +3475,12 @@ var CompletionService = class {
3436
3475
  translationKind = 0 /* Any */;
3437
3476
  hasPrecedingKeyword = false;
3438
3477
  }
3439
- if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 132 /* TypeMethodTranslation */) {
3478
+ if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 134 /* TypeMethodTranslation */) {
3440
3479
  typeTranslation = tokenOrKeyword.parent.parent.parent;
3441
3480
  translationKind = 1 /* Method */;
3442
3481
  hasPrecedingKeyword = true;
3443
3482
  }
3444
- if (tokenOrKeyword.isKeyword(30 /* Creation */) && tokenOrKeyword.parent.kind === 126 /* ConstructorTranslation */) {
3483
+ if (tokenOrKeyword.isKeyword(30 /* Creation */) && tokenOrKeyword.parent.kind === 128 /* ConstructorTranslation */) {
3445
3484
  typeTranslation = tokenOrKeyword.parent.parent.parent;
3446
3485
  translationKind = 3 /* Constructor */;
3447
3486
  hasPrecedingKeyword = true;
@@ -3471,21 +3510,21 @@ var CompletionService = class {
3471
3510
  let signatures;
3472
3511
  let valueArguments;
3473
3512
  switch (role.argumentList.parent.kind) {
3474
- case 69 /* CallExpression */:
3513
+ case 71 /* CallExpression */:
3475
3514
  signatures = SignatureForNode.getSignaturesForCallExpression(this._analyzer, role.argumentList.parent);
3476
3515
  valueArguments = ValueArgumentFactory.createValueArgumentsOfCallExpression(role.argumentList.parent);
3477
3516
  break;
3478
- case 70 /* AutotypeCallExpression */:
3517
+ case 72 /* AutotypeCallExpression */:
3479
3518
  signatures = SignatureForNode.getSignaturesForAutotypeCallExpression(this._analyzer, role.argumentList.parent);
3480
3519
  valueArguments = ValueArgumentFactory.createValueArgumentsOfAutotypeCallExpression(
3481
3520
  role.argumentList.parent
3482
3521
  );
3483
3522
  break;
3484
- case 147 /* Tag */:
3523
+ case 149 /* Tag */:
3485
3524
  signatures = SignatureForNode.getSignaturesForTag(this._analyzer, role.argumentList.parent);
3486
3525
  valueArguments = ValueArgumentFactory.createValueArgumentsOfTag(role.argumentList.parent);
3487
3526
  break;
3488
- case 71 /* IndexedAccessExpression */:
3527
+ case 73 /* IndexedAccessExpression */:
3489
3528
  signatures = SignatureForNode.getSignaturesForIndexedAccessExpression(
3490
3529
  this._analyzer,
3491
3530
  role.argumentList.parent
@@ -3525,6 +3564,11 @@ var CompletionService = class {
3525
3564
  }
3526
3565
  return { targetTypes: void 0, targetSignaturesParameters: void 0 };
3527
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
+ }
3528
3572
  if (role.kind === "function-block-expression") {
3529
3573
  const targetType = semanticContext.getContainingSubprogram()?.getReturnType();
3530
3574
  if (targetType !== void 0 && !targetType.equals(this._analyzer.standardTypes.none)) {
@@ -3630,7 +3674,7 @@ var CompletionService = class {
3630
3674
  kinds.add(30 /* Creation */).add(12 /* Function */).add(47 /* Destruction */).add(58 /* Get */).add(59 /* Set */);
3631
3675
  }
3632
3676
  if (syntaxContext.isStatementContext) {
3633
- 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 */);
3634
3678
  }
3635
3679
  if (this.isFromKeywordContext(positionDescription)) {
3636
3680
  kinds.add(9 /* From */);
@@ -3677,7 +3721,7 @@ var CompletionService = class {
3677
3721
  if (syntaxContext.isUnqualifiedTypeContext?.allowsAnonymousTypes === true) {
3678
3722
  kinds.add(5 /* PlainObject */).add(4 /* Object */).add(6 /* Variant */).add(3 /* Aspect */).add(12 /* Function */).add(40 /* Async */);
3679
3723
  }
3680
- 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 */)) {
3681
3725
  kinds.add(12 /* Function */);
3682
3726
  }
3683
3727
  return Query.from(kinds.values()).map(
@@ -3689,35 +3733,35 @@ var CompletionService = class {
3689
3733
  return false;
3690
3734
  }
3691
3735
  const tokenOrKeyword = positionDescription.tokenOrKeyword;
3692
- 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 */;
3693
3737
  }
3694
3738
  isModifierLevelContext(positionDescription) {
3695
3739
  if (positionDescription.kind !== "after-token-or-keyword") {
3696
3740
  return false;
3697
3741
  }
3698
3742
  const tokenOrKeyword = positionDescription.tokenOrKeyword;
3699
- return tokenOrKeyword.isToken(44 /* OpenParenthesis */) && tokenOrKeyword.parent.kind === 149 /* Modifier */;
3743
+ return tokenOrKeyword.isToken(44 /* OpenParenthesis */) && tokenOrKeyword.parent.kind === 151 /* Modifier */;
3700
3744
  }
3701
3745
  isElseOrElseIfKeywordContext(positionDescription) {
3702
3746
  if (positionDescription.kind !== "after-token-or-keyword") {
3703
3747
  return false;
3704
3748
  }
3705
3749
  const tokenOrKeyword = positionDescription.tokenOrKeyword;
3706
- 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 */);
3707
3751
  }
3708
3752
  isCatchKeywordContext(positionDescription) {
3709
3753
  if (positionDescription.kind !== "after-token-or-keyword") {
3710
3754
  return false;
3711
3755
  }
3712
3756
  const tokenOrKeyword = positionDescription.tokenOrKeyword;
3713
- 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 */;
3714
3758
  }
3715
3759
  isFinallyKeywordContext(positionDescription) {
3716
3760
  if (positionDescription.kind !== "after-token-or-keyword") {
3717
3761
  return false;
3718
3762
  }
3719
3763
  const tokenOrKeyword = positionDescription.tokenOrKeyword;
3720
- 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 */);
3721
3765
  }
3722
3766
  isTypeKindCompletionContext(positionDescription) {
3723
3767
  return positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isToken(57 /* Equals */) && NodeTypeUtils.isPackageTypeDeclaration(positionDescription.tokenOrKeyword.parent);
@@ -3727,17 +3771,17 @@ var CompletionService = class {
3727
3771
  return false;
3728
3772
  }
3729
3773
  const token = positionDescription.tokenOrKeyword.value;
3730
- 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);
3731
3775
  }
3732
3776
  isCaseKeywordContext(positionDescription, syntaxContext) {
3733
3777
  if (positionDescription.kind !== "after-token-or-keyword") {
3734
3778
  return false;
3735
3779
  }
3736
3780
  const tokenOrKeyword = positionDescription.tokenOrKeyword;
3737
- 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 */) {
3738
3782
  return true;
3739
3783
  }
3740
- if (syntaxContext.precedingExpression !== void 0 && syntaxContext.precedingExpression.parent.kind === 119 /* SwitchStatement */) {
3784
+ if (syntaxContext.precedingExpression !== void 0 && syntaxContext.precedingExpression.parent.kind === 121 /* SwitchStatement */) {
3741
3785
  return true;
3742
3786
  }
3743
3787
  return false;
@@ -3757,7 +3801,7 @@ var CompletionService = class {
3757
3801
  return result;
3758
3802
  }
3759
3803
  prioritizeItemsFromUnionType(items, type) {
3760
- const constituentTypeEntities = Query.from(type.unaliasedFlattenedTypes).mapAndFilter((t) => this.getEntityFromType(t)).uniqueToSet();
3804
+ const constituentTypeEntities = Query.from(type.unaliasedFlattenedTypes).mapAndFilter((t) => t.getEntity()).uniqueToSet();
3761
3805
  for (const item of items) {
3762
3806
  if (item.kind === "named-type" && constituentTypeEntities.has(item.entity)) {
3763
3807
  item.prefix = "*";
@@ -3840,25 +3884,6 @@ var CompletionService = class {
3840
3884
  }
3841
3885
  return result;
3842
3886
  }
3843
- getEntityFromType(type) {
3844
- switch (type.kind) {
3845
- case "structured":
3846
- return type.getEntity();
3847
- case "variant":
3848
- return type.getEntity();
3849
- case "method":
3850
- return type.getEntity();
3851
- case "alias":
3852
- return type.getEntity();
3853
- case "parameter":
3854
- return type.getEntity();
3855
- case "unresolved":
3856
- case "union":
3857
- return void 0;
3858
- default:
3859
- Debug.never(type);
3860
- }
3861
- }
3862
3887
  getTypeCompletionItemInfosFromPackage(searchLocation) {
3863
3888
  return searchLocation.packageMemberLookup.getNamedMembers(searchLocation.hidingMatcher).map((m) => {
3864
3889
  if (m.value.kind === 2 /* Type */) {
@@ -4049,8 +4074,9 @@ var CompletionService = class {
4049
4074
  }
4050
4075
  getTypeMemberCompletionItemInfos(ctx) {
4051
4076
  const type = this._analyzer.excludeNoneFromType(ctx.type);
4052
- const memberLookup = new TypeMemberLookup(this._analyzer, type, ctx.localizationContext);
4053
- return memberLookup.getNamedMembers(ctx.hidingMatcher, ctx.typeExtensionsLookup).filter((m) => m.value.isStatic() === ctx.isStaticAccess).map((m) => {
4077
+ const memberLookup = TypeMemberLookup.ofType(this._analyzer, type, ctx.localizationContext);
4078
+ const options6 = ctx.isStaticAccess ? 2 /* OnlyStaticMembers */ : 0 /* None */;
4079
+ return memberLookup.getNamedMembers(options6, ctx.hidingMatcher, ctx.typeExtensionsLookup).map((m) => {
4054
4080
  switch (m.value.kind) {
4055
4081
  case "method":
4056
4082
  return new TypeMethodCompletionItemInfo(
@@ -4069,7 +4095,7 @@ var CompletionService = class {
4069
4095
  default:
4070
4096
  Debug.never(m.value);
4071
4097
  }
4072
- }).concat(memberLookup.getOperators(ctx.hidingMatcher, ctx.typeExtensionsLookup).filter((m) => m.value.isStatic() === ctx.isStaticAccess).map((o) => new OperatorCompletionItemInfo(this.completionItemInfoContext, o.value, o.localization)));
4098
+ }).concat(memberLookup.getOperators(options6, ctx.hidingMatcher, ctx.typeExtensionsLookup).map((o) => new OperatorCompletionItemInfo(this.completionItemInfoContext, o.value, o.localization)));
4073
4099
  }
4074
4100
  getPackageImportCompletionItemInfos(ctx) {
4075
4101
  const result = this._analyzer.packageImports.getPackagesAvailableForImport(this._sourceFile.package).map((p) => p.getImportName()).filter((n) => {
@@ -4403,11 +4429,11 @@ function getRightmostChildExcludingValidEmptyNodes(node) {
4403
4429
  }
4404
4430
  function isInvalidNode(node) {
4405
4431
  switch (node.kind) {
4406
- case 72 /* InvalidExpression */:
4407
- case 43 /* InvalidPackageMemberDeclaration */:
4408
- case 113 /* InvalidStatement */:
4409
- case 57 /* InvalidTypeMemberDeclaration */:
4410
- case 16 /* InvalidTypeSpecifier */:
4432
+ case 74 /* InvalidExpression */:
4433
+ case 45 /* InvalidPackageMemberDeclaration */:
4434
+ case 115 /* InvalidStatement */:
4435
+ case 59 /* InvalidTypeMemberDeclaration */:
4436
+ case 18 /* InvalidTypeSpecifier */:
4411
4437
  return true;
4412
4438
  case 0 /* Token */:
4413
4439
  return node.isMissing;
@@ -4847,7 +4873,7 @@ var MergedOverloadedMethodCompletionItemInfo = class {
4847
4873
  return this.firstOverloadInfo.getCompletionItemKind();
4848
4874
  }
4849
4875
  getDetails() {
4850
- const overloadsWord = LocalizationHelper.localizeHelperPhrase(6 /* Overloads */, this.ctx.locale);
4876
+ const overloadsWord = LocalizationHelper.localizeHelperPhrase(7 /* Overloads */, this.ctx.locale);
4851
4877
  const overloadCountText = ` (+${overloadsWord}: ${this.overloadCount - 1})`;
4852
4878
  const originalDetails = this.firstOverloadInfo.getDetails();
4853
4879
  return originalDetails + overloadCountText;
@@ -5189,6 +5215,12 @@ var ExpressionRole_returnedValue = class {
5189
5215
  this.kind = "returned-value";
5190
5216
  }
5191
5217
  };
5218
+ var ExpressionRole_errorValue = class {
5219
+ constructor(errorStatement) {
5220
+ this.errorStatement = errorStatement;
5221
+ this.kind = "error-value";
5222
+ }
5223
+ };
5192
5224
  var ExpressionRole_functionBlockExpression = class {
5193
5225
  constructor(functionBlock) {
5194
5226
  this.functionBlock = functionBlock;
@@ -5231,7 +5263,7 @@ var SyntaxContextFactory = class {
5231
5263
  if (positionDescription.kind === "after-token-or-keyword") {
5232
5264
  isUnqualifiedTypeContext = this.isUnqualifiedTypeContext(positionDescription.tokenOrKeyword);
5233
5265
  }
5234
- 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 */;
5235
5267
  let isTopLevelTranslationListContext;
5236
5268
  if (positionDescription.kind === "after-token-or-keyword") {
5237
5269
  isTopLevelTranslationListContext = this.isTopLevelTranslationListContext(positionDescription.tokenOrKeyword);
@@ -5257,52 +5289,52 @@ var SyntaxContextFactory = class {
5257
5289
  }
5258
5290
  static isExpressionOrStatementContext(tokenOrKeyword) {
5259
5291
  if (tokenOrKeyword.isToken(57 /* Equals */)) {
5260
- if (tokenOrKeyword.parent.kind === 91 /* AssignmentStatement */) {
5292
+ if (tokenOrKeyword.parent.kind === 93 /* AssignmentStatement */) {
5261
5293
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.right);
5262
5294
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5263
5295
  }
5264
- if (tokenOrKeyword.parent.kind === 59 /* LocalVariableDeclaration */) {
5296
+ if (tokenOrKeyword.parent.kind === 61 /* LocalVariableDeclaration */) {
5265
5297
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.initializer);
5266
5298
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5267
5299
  }
5268
- if (tokenOrKeyword.parent.kind === 35 /* PackageVariableDeclaration */) {
5300
+ if (tokenOrKeyword.parent.kind === 37 /* PackageVariableDeclaration */) {
5269
5301
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.initializer);
5270
5302
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5271
5303
  }
5272
- if (tokenOrKeyword.parent.kind === 54 /* TypeVariableDeclaration */) {
5304
+ if (tokenOrKeyword.parent.kind === 56 /* TypeVariableDeclaration */) {
5273
5305
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.initializer);
5274
5306
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5275
5307
  }
5276
- if (tokenOrKeyword.parent.kind === 144 /* ParameterDeclaration */) {
5308
+ if (tokenOrKeyword.parent.kind === 146 /* ParameterDeclaration */) {
5277
5309
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.defaultValue);
5278
5310
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5279
5311
  }
5280
- if (tokenOrKeyword.parent.kind === 145 /* Argument */) {
5312
+ if (tokenOrKeyword.parent.kind === 147 /* Argument */) {
5281
5313
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.value);
5282
5314
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5283
5315
  }
5284
- if (tokenOrKeyword.parent.kind === 142 /* VariantDeclaration */) {
5316
+ if (tokenOrKeyword.parent.kind === 144 /* VariantDeclaration */) {
5285
5317
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.value);
5286
5318
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5287
5319
  }
5288
5320
  }
5289
- if (tokenOrKeyword.parent.kind === 91 /* AssignmentStatement */) {
5321
+ if (tokenOrKeyword.parent.kind === 93 /* AssignmentStatement */) {
5290
5322
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.right);
5291
5323
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5292
5324
  }
5293
- if (tokenOrKeyword.parent.kind === 77 /* PrefixUnaryExpression */) {
5325
+ if (tokenOrKeyword.parent.kind === 79 /* PrefixUnaryExpression */) {
5294
5326
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.operand);
5295
5327
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5296
5328
  }
5297
- if (tokenOrKeyword.parent.kind === 66 /* BinaryExpression */) {
5329
+ if (tokenOrKeyword.parent.kind === 68 /* BinaryExpression */) {
5298
5330
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.right);
5299
5331
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5300
5332
  }
5301
- if (tokenOrKeyword.isToken(7 /* TextTemplateHead */) && tokenOrKeyword.parent.kind === 81 /* TextTemplateLiteral */) {
5333
+ if (tokenOrKeyword.isToken(7 /* TextTemplateHead */) && tokenOrKeyword.parent.kind === 83 /* TextTemplateLiteral */) {
5302
5334
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.spanList.spans.at(0)?.expression);
5303
5335
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5304
5336
  }
5305
- if (tokenOrKeyword.isToken(8 /* TextTemplatePart */) && tokenOrKeyword.parent.kind === 83 /* TextTemplateSpan */) {
5337
+ if (tokenOrKeyword.isToken(8 /* TextTemplatePart */) && tokenOrKeyword.parent.kind === 85 /* TextTemplateSpan */) {
5306
5338
  let expressionForTargetType;
5307
5339
  const spanList = tokenOrKeyword.parent.parent;
5308
5340
  const spanIndex = spanList.spans.indexOf(tokenOrKeyword.parent);
@@ -5314,12 +5346,12 @@ var SyntaxContextFactory = class {
5314
5346
  isStatementContext: false
5315
5347
  };
5316
5348
  }
5317
- if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */) {
5349
+ if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 95 /* StatementBlock */) {
5318
5350
  return { isExpressionContext: { expressionRole: new ExpressionRole_other(void 0) }, isStatementContext: true };
5319
5351
  }
5320
- if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 94 /* FunctionBlock */) {
5352
+ if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 96 /* FunctionBlock */) {
5321
5353
  const block = tokenOrKeyword.parent;
5322
- if (block.expression !== void 0 || block.statementList?.statements.count() === 0) {
5354
+ if (block.expressionOrStatementList.kind !== 94 /* StatementList */ || block.expressionOrStatementList.statements.count() === 0) {
5323
5355
  return {
5324
5356
  isExpressionContext: { expressionRole: new ExpressionRole_functionBlockExpression(block) },
5325
5357
  isStatementContext: true
@@ -5331,27 +5363,27 @@ var SyntaxContextFactory = class {
5331
5363
  };
5332
5364
  }
5333
5365
  }
5334
- if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 92 /* StatementList */) {
5366
+ if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 94 /* StatementList */) {
5335
5367
  return { isExpressionContext: { expressionRole: new ExpressionRole_other(void 0) }, isStatementContext: true };
5336
5368
  }
5337
5369
  if (tokenOrKeyword.isToken(44 /* OpenParenthesis */)) {
5338
- if (tokenOrKeyword.parent.kind === 75 /* ParenthesizedExpression */) {
5370
+ if (tokenOrKeyword.parent.kind === 77 /* ParenthesizedExpression */) {
5339
5371
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
5340
5372
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5341
5373
  }
5342
- if (tokenOrKeyword.parent.kind === 79 /* ReferenceExpression */) {
5374
+ if (tokenOrKeyword.parent.kind === 81 /* ReferenceExpression */) {
5343
5375
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
5344
5376
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5345
5377
  }
5346
- if (tokenOrKeyword.parent.kind === 69 /* CallExpression */) {
5378
+ if (tokenOrKeyword.parent.kind === 71 /* CallExpression */) {
5347
5379
  const expressionRole = new ExpressionRole_argument(tokenOrKeyword.parent.argumentList, 0);
5348
5380
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5349
5381
  }
5350
- if (tokenOrKeyword.parent.kind === 70 /* AutotypeCallExpression */) {
5382
+ if (tokenOrKeyword.parent.kind === 72 /* AutotypeCallExpression */) {
5351
5383
  const expressionRole = new ExpressionRole_argument(tokenOrKeyword.parent.argumentList, 0);
5352
5384
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5353
5385
  }
5354
- if (tokenOrKeyword.parent.kind === 147 /* Tag */) {
5386
+ if (tokenOrKeyword.parent.kind === 149 /* Tag */) {
5355
5387
  const argumentList = tokenOrKeyword.parent.argumentList;
5356
5388
  if (argumentList !== void 0) {
5357
5389
  const expressionRole = new ExpressionRole_argument(argumentList, 0);
@@ -5359,16 +5391,16 @@ var SyntaxContextFactory = class {
5359
5391
  }
5360
5392
  }
5361
5393
  }
5362
- if (tokenOrKeyword.isToken(45 /* OpenSquareBracket */) && tokenOrKeyword.parent.kind === 71 /* IndexedAccessExpression */) {
5394
+ if (tokenOrKeyword.isToken(45 /* OpenSquareBracket */) && tokenOrKeyword.parent.kind === 73 /* IndexedAccessExpression */) {
5363
5395
  const expressionRole = new ExpressionRole_argument(tokenOrKeyword.parent.argumentList, 0);
5364
5396
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5365
5397
  }
5366
- if (tokenOrKeyword.isToken(45 /* OpenSquareBracket */) && tokenOrKeyword.parent.kind === 61 /* ArrayLiteral */) {
5398
+ if (tokenOrKeyword.isToken(45 /* OpenSquareBracket */) && tokenOrKeyword.parent.kind === 63 /* ArrayLiteral */) {
5367
5399
  const expressionRole = new ExpressionRole_arrayElement(tokenOrKeyword.parent);
5368
5400
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5369
5401
  }
5370
5402
  if (tokenOrKeyword.isToken(24 /* Comma */)) {
5371
- if (tokenOrKeyword.parent.kind === 68 /* ArgumentList */) {
5403
+ if (tokenOrKeyword.parent.kind === 70 /* ArgumentList */) {
5372
5404
  const argumentList = tokenOrKeyword.parent;
5373
5405
  let index = 0;
5374
5406
  for (const element of argumentList.elements) {
@@ -5382,56 +5414,64 @@ var SyntaxContextFactory = class {
5382
5414
  const expressionRole = new ExpressionRole_argument(argumentList, index);
5383
5415
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5384
5416
  }
5385
- if (tokenOrKeyword.parent.kind === 120 /* MatchExpressionList */) {
5417
+ if (tokenOrKeyword.parent.kind === 122 /* MatchExpressionList */) {
5386
5418
  const expressionRole = new ExpressionRole_matchListElement(tokenOrKeyword.parent.parent.parent.parent);
5387
5419
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5388
5420
  }
5389
- if (tokenOrKeyword.parent.kind === 62 /* ArrayLiteralElementList */) {
5421
+ if (tokenOrKeyword.parent.kind === 64 /* ArrayLiteralElementList */) {
5390
5422
  const expressionRole = new ExpressionRole_arrayElement(tokenOrKeyword.parent.parent);
5391
5423
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5392
5424
  }
5393
5425
  }
5394
- if (tokenOrKeyword.isKeyword(45 /* Case */) && tokenOrKeyword.parent.kind === 121 /* CaseClause */) {
5426
+ if (tokenOrKeyword.isKeyword(45 /* Case */) && tokenOrKeyword.parent.kind === 123 /* CaseClause */) {
5395
5427
  const expressionRole = new ExpressionRole_matchListElement(tokenOrKeyword.parent.parent.parent);
5396
5428
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5397
5429
  }
5398
- if (tokenOrKeyword.isKeyword(15 /* Return */) && tokenOrKeyword.parent.kind === 117 /* ReturnStatement */) {
5430
+ if (tokenOrKeyword.isKeyword(15 /* Return */) && tokenOrKeyword.parent.kind === 119 /* ReturnStatement */) {
5399
5431
  const expressionRole = new ExpressionRole_returnedValue(tokenOrKeyword.parent);
5400
5432
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5401
5433
  }
5402
- 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 */) {
5403
5443
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
5404
5444
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5405
5445
  }
5406
- if (tokenOrKeyword.isKeyword(13 /* If */) && tokenOrKeyword.parent.kind === 109 /* IfStatement */) {
5446
+ if (tokenOrKeyword.isKeyword(13 /* If */) && tokenOrKeyword.parent.kind === 111 /* IfStatement */) {
5407
5447
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
5408
5448
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5409
5449
  }
5410
- if (tokenOrKeyword.isKeyword(11 /* ElseIf */) && tokenOrKeyword.parent.kind === 111 /* ElseIfClause */) {
5450
+ if (tokenOrKeyword.isKeyword(11 /* ElseIf */) && tokenOrKeyword.parent.kind === 113 /* ElseIfClause */) {
5411
5451
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
5412
5452
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5413
5453
  }
5414
- if (tokenOrKeyword.isKeyword(9 /* From */) && tokenOrKeyword.parent.kind === 108 /* ForStatement */) {
5454
+ if (tokenOrKeyword.isKeyword(9 /* From */) && tokenOrKeyword.parent.kind === 110 /* ForStatement */) {
5415
5455
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.enumeratedExpression);
5416
5456
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5417
5457
  }
5418
- if (tokenOrKeyword.isKeyword(25 /* While */) && tokenOrKeyword.parent.kind === 122 /* WhileStatement */) {
5458
+ if (tokenOrKeyword.isKeyword(25 /* While */) && tokenOrKeyword.parent.kind === 124 /* WhileStatement */) {
5419
5459
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
5420
5460
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5421
5461
  }
5422
- if (tokenOrKeyword.isKeyword(27 /* RepeatWhile */) && tokenOrKeyword.parent.kind === 116 /* LoopStatement */) {
5462
+ if (tokenOrKeyword.isKeyword(27 /* RepeatWhile */) && tokenOrKeyword.parent.kind === 118 /* LoopStatement */) {
5423
5463
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
5424
5464
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5425
5465
  }
5426
- if (tokenOrKeyword.isKeyword(28 /* Yield */) && tokenOrKeyword.parent.kind === 123 /* YieldStatement */) {
5466
+ if (tokenOrKeyword.isKeyword(28 /* Yield */) && tokenOrKeyword.parent.kind === 125 /* YieldStatement */) {
5427
5467
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
5428
5468
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5429
5469
  }
5430
- if (tokenOrKeyword.isKeyword(29 /* When */) && tokenOrKeyword.parent.kind === 76 /* WhenTernaryExpression */) {
5470
+ if (tokenOrKeyword.isKeyword(29 /* When */) && tokenOrKeyword.parent.kind === 78 /* WhenTernaryExpression */) {
5431
5471
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
5432
5472
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5433
5473
  }
5434
- if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind === 76 /* WhenTernaryExpression */) {
5474
+ if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind === 78 /* WhenTernaryExpression */) {
5435
5475
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.secondExpression);
5436
5476
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5437
5477
  }
@@ -5450,52 +5490,52 @@ var SyntaxContextFactory = class {
5450
5490
  if (tokenOrKeyword.isToken(51 /* Semicolon */) && (tokenOrKeyword.parent.kind === 2 /* PackageMemberDeclarationList */ || tokenOrKeyword.parent.kind === 4 /* PackageImportDirectiveList */)) {
5451
5491
  return true;
5452
5492
  }
5453
- 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 */)) {
5454
5494
  return true;
5455
5495
  }
5456
- 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 */))) {
5457
5497
  return true;
5458
5498
  }
5459
- if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 24 /* PackageMemberGroupDeclaration */) {
5499
+ if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 26 /* PackageMemberGroupDeclaration */) {
5460
5500
  return true;
5461
5501
  }
5462
- 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(
5463
5503
  tokenOrKeyword,
5464
- 36 /* PackageVariableGetterDeclaration */
5465
- ) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 37 /* PackageVariableSetterDeclaration */)) {
5504
+ 38 /* PackageVariableGetterDeclaration */
5505
+ ) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 39 /* PackageVariableSetterDeclaration */)) {
5466
5506
  return true;
5467
5507
  }
5468
- 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)) {
5469
5509
  return true;
5470
5510
  }
5471
- 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)) {
5472
5512
  return true;
5473
5513
  }
5474
5514
  return false;
5475
5515
  }
5476
5516
  static isTypeMemberDeclarationListContext(tokenOrKeyword) {
5477
- if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 31 /* TypeMemberDeclarationList */) {
5517
+ if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 33 /* TypeMemberDeclarationList */) {
5478
5518
  return true;
5479
5519
  }
5480
- if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 32 /* TypeMemberDeclarationBlock */) {
5520
+ if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 34 /* TypeMemberDeclarationBlock */) {
5481
5521
  return true;
5482
5522
  }
5483
- if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 44 /* TypeMemberGroupDeclaration */) {
5523
+ if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 46 /* TypeMemberGroupDeclaration */) {
5484
5524
  return true;
5485
5525
  }
5486
- 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(
5487
5527
  tokenOrKeyword,
5488
- 50 /* TypeDereferencedVariableGetterDeclaration */
5528
+ 52 /* TypeDereferencedVariableGetterDeclaration */
5489
5529
  ) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
5490
5530
  tokenOrKeyword,
5491
- 51 /* TypeDereferencedVariableSetterDeclaration */
5492
- ) || 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 */)) {
5493
5533
  return true;
5494
5534
  }
5495
- 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)) {
5496
5536
  return true;
5497
5537
  }
5498
- 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)) {
5499
5539
  return true;
5500
5540
  }
5501
5541
  return false;
@@ -5532,79 +5572,82 @@ var SyntaxContextFactory = class {
5532
5572
  return result;
5533
5573
  }
5534
5574
  static isUnqualifiedTypeContext(tokenOrKeyword) {
5535
- if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind === 156 /* TypeAnnotation */) {
5575
+ if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind === 158 /* TypeAnnotation */) {
5536
5576
  return { allowsAnonymousTypes: true };
5537
5577
  }
5538
- 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 */) {
5539
5579
  return { allowsAnonymousTypes: false };
5540
5580
  }
5541
- 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 */)) {
5542
5582
  return { allowsAnonymousTypes: false };
5543
5583
  }
5544
- if (tokenOrKeyword.isToken(36 /* LessThan */) && tokenOrKeyword.parent.kind === 152 /* TypeArgumentClause */) {
5584
+ if (tokenOrKeyword.isToken(36 /* LessThan */) && tokenOrKeyword.parent.kind === 154 /* TypeArgumentClause */) {
5545
5585
  return { allowsAnonymousTypes: true };
5546
5586
  }
5547
- if (tokenOrKeyword.isToken(24 /* Comma */) && (tokenOrKeyword.parent.kind === 30 /* BaseTypeList */ || tokenOrKeyword.parent.kind === 153 /* TypeArgumentList */)) {
5548
- 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 */ };
5549
5589
  }
5550
- if (tokenOrKeyword.isToken(35 /* HashSign */) && tokenOrKeyword.parent.kind === 147 /* Tag */) {
5590
+ if (tokenOrKeyword.isToken(35 /* HashSign */) && tokenOrKeyword.parent.kind === 149 /* Tag */) {
5551
5591
  return { allowsAnonymousTypes: false };
5552
5592
  }
5553
- 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 */) {
5554
5594
  return { allowsAnonymousTypes: false };
5555
5595
  }
5556
- if (tokenOrKeyword.isToken(57 /* Equals */) && tokenOrKeyword.parent.kind === 22 /* PackageAliasTypeDeclaration */) {
5596
+ if (tokenOrKeyword.isToken(57 /* Equals */) && tokenOrKeyword.parent.kind === 24 /* PackageAliasTypeDeclaration */) {
5557
5597
  return { allowsAnonymousTypes: false };
5558
5598
  }
5559
- if (tokenOrKeyword.isKeyword(14 /* Is */) && tokenOrKeyword.parent.kind === 73 /* IsExpression */) {
5599
+ if (tokenOrKeyword.isKeyword(14 /* Is */) && tokenOrKeyword.parent.kind === 75 /* IsExpression */) {
5560
5600
  return { allowsAnonymousTypes: true };
5561
5601
  }
5562
- if (tokenOrKeyword.isKeyword(42 /* As */) && tokenOrKeyword.parent.kind === 65 /* AsExpression */) {
5602
+ if (tokenOrKeyword.isKeyword(42 /* As */) && tokenOrKeyword.parent.kind === 67 /* AsExpression */) {
5563
5603
  return { allowsAnonymousTypes: true };
5564
5604
  }
5565
5605
  if (tokenOrKeyword.isToken(17 /* Bar */) && tokenOrKeyword.parent.kind === 12 /* UnionTypeSpecifierTypeList */) {
5566
5606
  return { allowsAnonymousTypes: false };
5567
5607
  }
5568
- 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 */) {
5569
5612
  return { allowsAnonymousTypes: true };
5570
5613
  }
5571
5614
  return void 0;
5572
5615
  }
5573
5616
  static isTopLevelTranslationListContext(tokenOrKeyword) {
5574
- if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 20 /* TopLevelTranslationList */) {
5617
+ if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 22 /* TopLevelTranslationList */) {
5575
5618
  return { translationsDeclaration: tokenOrKeyword.parent.parent };
5576
5619
  }
5577
- if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */) {
5620
+ if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 23 /* TranslationsDeclaration */) {
5578
5621
  return { translationsDeclaration: tokenOrKeyword.parent };
5579
5622
  }
5580
5623
  const packageImport = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5581
5624
  tokenOrKeyword,
5582
- 134 /* PackageImportTranslation */
5625
+ 136 /* PackageImportTranslation */
5583
5626
  );
5584
5627
  if (packageImport !== void 0) {
5585
5628
  return { translationsDeclaration: packageImport.parent.parent };
5586
5629
  }
5587
- const type = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 139 /* TypeTranslation */);
5630
+ const type = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 141 /* TypeTranslation */);
5588
5631
  if (type !== void 0) {
5589
5632
  return { translationsDeclaration: type.parent.parent };
5590
5633
  }
5591
5634
  const methodType = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5592
5635
  tokenOrKeyword,
5593
- 133 /* MethodTypeTranslation */
5636
+ 135 /* MethodTypeTranslation */
5594
5637
  );
5595
5638
  if (methodType !== void 0) {
5596
5639
  return { translationsDeclaration: methodType.parent.parent };
5597
5640
  }
5598
5641
  const variable = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5599
5642
  tokenOrKeyword,
5600
- 136 /* PackageVariableTranslation */
5643
+ 138 /* PackageVariableTranslation */
5601
5644
  );
5602
5645
  if (variable !== void 0) {
5603
5646
  return { translationsDeclaration: variable.parent.parent };
5604
5647
  }
5605
5648
  const method = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5606
5649
  tokenOrKeyword,
5607
- 131 /* PackageMethodTranslation */
5650
+ 133 /* PackageMethodTranslation */
5608
5651
  );
5609
5652
  if (method !== void 0) {
5610
5653
  return { translationsDeclaration: method.parent.parent };
@@ -5612,33 +5655,33 @@ var SyntaxContextFactory = class {
5612
5655
  return void 0;
5613
5656
  }
5614
5657
  static isTypeMemberTranslationListContext(tokenOrKeyword) {
5615
- if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 138 /* TypeMemberTranslationList */) {
5658
+ if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 140 /* TypeMemberTranslationList */) {
5616
5659
  return { typeTranslation: tokenOrKeyword.parent.parent };
5617
5660
  }
5618
- if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 139 /* TypeTranslation */) {
5661
+ if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 141 /* TypeTranslation */) {
5619
5662
  return { typeTranslation: tokenOrKeyword.parent };
5620
5663
  }
5621
- const indexer = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 128 /* IndexerTranslation */);
5664
+ const indexer = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 130 /* IndexerTranslation */);
5622
5665
  if (indexer !== void 0) {
5623
5666
  return { typeTranslation: indexer.parent.parent };
5624
5667
  }
5625
5668
  const constructor = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5626
5669
  tokenOrKeyword,
5627
- 126 /* ConstructorTranslation */
5670
+ 128 /* ConstructorTranslation */
5628
5671
  );
5629
5672
  if (constructor !== void 0) {
5630
5673
  return { typeTranslation: constructor.parent.parent };
5631
5674
  }
5632
5675
  const variableOrVariant = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5633
5676
  tokenOrKeyword,
5634
- 137 /* TypeVariableOrVariantTranslation */
5677
+ 139 /* TypeVariableOrVariantTranslation */
5635
5678
  );
5636
5679
  if (variableOrVariant !== void 0) {
5637
5680
  return { typeTranslation: variableOrVariant.parent.parent };
5638
5681
  }
5639
5682
  const method = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5640
5683
  tokenOrKeyword,
5641
- 132 /* TypeMethodTranslation */
5684
+ 134 /* TypeMethodTranslation */
5642
5685
  );
5643
5686
  if (method !== void 0) {
5644
5687
  return { typeTranslation: method.parent.parent };
@@ -5751,29 +5794,29 @@ var NodeSemanticInfoService = class {
5751
5794
  static ofTokenOrKeyword(analyzer, tokenOrKeyword, options6) {
5752
5795
  if (isIdentifier(tokenOrKeyword.value)) {
5753
5796
  return this.ofNonKeywordIdentifier(analyzer, tokenOrKeyword.value, options6);
5754
- } else if (tokenOrKeyword.isKeyword(2 /* Autotype */) && tokenOrKeyword.parent.kind === 70 /* AutotypeCallExpression */) {
5797
+ } else if (tokenOrKeyword.isKeyword(2 /* Autotype */) && tokenOrKeyword.parent.kind === 72 /* AutotypeCallExpression */) {
5755
5798
  return this.ofAutotypeCallExpression(analyzer, tokenOrKeyword.parent, options6);
5756
- } else if (tokenOrKeyword.parent.kind === 77 /* PrefixUnaryExpression */) {
5799
+ } else if (tokenOrKeyword.parent.kind === 79 /* PrefixUnaryExpression */) {
5757
5800
  return this.ofPrefixUnaryExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
5758
- } else if (tokenOrKeyword.parent.kind === 66 /* BinaryExpression */) {
5801
+ } else if (tokenOrKeyword.parent.kind === 68 /* BinaryExpression */) {
5759
5802
  return this.ofBinaryExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
5760
- } 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 */)) {
5761
5804
  return this.ofDereferenceOperatorDeclaration(analyzer, tokenOrKeyword.parent);
5762
- } else if (tokenOrKeyword.isToken(19 /* Caret */) && tokenOrKeyword.parent.kind === 80 /* DereferenceExpression */) {
5805
+ } else if (tokenOrKeyword.isToken(19 /* Caret */) && tokenOrKeyword.parent.kind === 82 /* DereferenceExpression */) {
5763
5806
  return this.ofDereferenceExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
5764
- } else if (tokenOrKeyword.parent.kind === 91 /* AssignmentStatement */) {
5807
+ } else if (tokenOrKeyword.parent.kind === 93 /* AssignmentStatement */) {
5765
5808
  return this.ofAssignmentStatementOperator(analyzer, tokenOrKeyword.parent, options6);
5766
- } else if (tokenOrKeyword.isKeyword(30 /* Creation */) && tokenOrKeyword.parent.kind === 45 /* TypeConstructorDeclaration */) {
5809
+ } else if (tokenOrKeyword.isKeyword(30 /* Creation */) && tokenOrKeyword.parent.kind === 47 /* TypeConstructorDeclaration */) {
5767
5810
  return this.ofTypeConstructorDeclaration(analyzer, tokenOrKeyword.parent);
5768
- } else if (tokenOrKeyword.isToken(13 /* Asterisk */) && tokenOrKeyword.parent.kind === 90 /* DefaultMatchExpression */) {
5811
+ } else if (tokenOrKeyword.isToken(13 /* Asterisk */) && tokenOrKeyword.parent.kind === 92 /* DefaultMatchExpression */) {
5769
5812
  return this.ofDefaultMatchExpression(analyzer, tokenOrKeyword.parent);
5770
- } else if (tokenOrKeyword.isKeyword(4 /* Object */) && tokenOrKeyword.parent.kind === 86 /* ObjectExpression */) {
5813
+ } else if (tokenOrKeyword.isKeyword(4 /* Object */) && tokenOrKeyword.parent.kind === 88 /* ObjectExpression */) {
5771
5814
  return this.ofObjectExpression(analyzer, tokenOrKeyword.parent, options6);
5772
- } else if (tokenOrKeyword.isKeyword(56 /* Base */) && tokenOrKeyword.parent.kind === 87 /* BaseExpression */) {
5815
+ } else if (tokenOrKeyword.isKeyword(56 /* Base */) && tokenOrKeyword.parent.kind === 89 /* BaseExpression */) {
5773
5816
  return this.ofBaseExpression(analyzer, tokenOrKeyword.parent, options6);
5774
- } 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 */) {
5775
5818
  return this.ofTypeIndexerDeclaration(analyzer, tokenOrKeyword.parent.parent);
5776
- } 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 */) {
5777
5820
  return this.ofIndexedAccessExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
5778
5821
  }
5779
5822
  return void 0;
@@ -5786,11 +5829,11 @@ var NodeSemanticInfoService = class {
5786
5829
  let result;
5787
5830
  const parent = node.parent;
5788
5831
  switch (parent.kind) {
5789
- case 129 /* TranslationTypeParameterList */:
5832
+ case 131 /* TranslationTypeParameterList */:
5790
5833
  break;
5791
- case 124 /* TranslationParameterList */:
5834
+ case 126 /* TranslationParameterList */:
5792
5835
  break;
5793
- case 145 /* Argument */: {
5836
+ case 147 /* Argument */: {
5794
5837
  const respectiveParameter = analyzer.getRespectiveParameter(parent);
5795
5838
  if (respectiveParameter !== void 0) {
5796
5839
  const target = new SimpleWithLocalization(
@@ -5804,43 +5847,43 @@ var NodeSemanticInfoService = class {
5804
5847
  }
5805
5848
  break;
5806
5849
  }
5807
- case 60 /* EnumerationVariableDeclaration */:
5850
+ case 62 /* EnumerationVariableDeclaration */:
5808
5851
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofEnumerationVariableDeclaration(parent));
5809
5852
  break;
5810
- case 101 /* ErrorVariableDeclaration */:
5853
+ case 103 /* ErrorVariableDeclaration */:
5811
5854
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofErrorVariableDeclaration(parent));
5812
5855
  break;
5813
- case 22 /* PackageAliasTypeDeclaration */:
5856
+ case 24 /* PackageAliasTypeDeclaration */:
5814
5857
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageAliasTypeDeclaration(parent));
5815
5858
  break;
5816
- case 27 /* PackageMethodDeclaration */:
5859
+ case 29 /* PackageMethodDeclaration */:
5817
5860
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageMethodDeclaration(parent));
5818
5861
  break;
5819
- case 28 /* PackageMethodTypeDeclaration */:
5862
+ case 30 /* PackageMethodTypeDeclaration */:
5820
5863
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageMethodTypeDeclaration(parent));
5821
5864
  break;
5822
- case 33 /* PackageStructuredTypeDeclaration */:
5865
+ case 35 /* PackageStructuredTypeDeclaration */:
5823
5866
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageStructuredTypeDeclaration(parent));
5824
5867
  break;
5825
- case 35 /* PackageVariableDeclaration */:
5868
+ case 37 /* PackageVariableDeclaration */:
5826
5869
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageVariableDeclaration(parent));
5827
5870
  break;
5828
- case 38 /* PackageVariantTypeDeclaration */:
5871
+ case 40 /* PackageVariantTypeDeclaration */:
5829
5872
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageVariantTypeDeclaration(parent));
5830
5873
  break;
5831
- case 88 /* IdentifierExpression */:
5874
+ case 90 /* IdentifierExpression */:
5832
5875
  result = this.ofIdentifierExpression(analyzer, parent, options6);
5833
5876
  break;
5834
- case 58 /* NestedMethodDeclaration */:
5877
+ case 60 /* NestedMethodDeclaration */:
5835
5878
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofNestedMethodDeclaration(parent));
5836
5879
  break;
5837
- case 59 /* LocalVariableDeclaration */:
5880
+ case 61 /* LocalVariableDeclaration */:
5838
5881
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofLocalVariableDeclaration(parent));
5839
5882
  break;
5840
- case 135 /* QualifiedName */:
5883
+ case 137 /* QualifiedName */:
5841
5884
  result = this.ofQualifiedNameQualifier(analyzer, parent, node, options6);
5842
5885
  break;
5843
- case 136 /* PackageVariableTranslation */: {
5886
+ case 138 /* PackageVariableTranslation */: {
5844
5887
  const translationPackage = this.getContainingTranslationPackage(analyzer, node);
5845
5888
  const getTargetResult = translationPackage?.getPackageVariableTranslationTarget(parent);
5846
5889
  if (translationPackage !== void 0 && getTargetResult?.target !== void 0) {
@@ -5860,7 +5903,7 @@ var NodeSemanticInfoService = class {
5860
5903
  }
5861
5904
  break;
5862
5905
  }
5863
- case 137 /* TypeVariableOrVariantTranslation */: {
5906
+ case 139 /* TypeVariableOrVariantTranslation */: {
5864
5907
  const translationPackage = this.getContainingTranslationPackage(analyzer, node);
5865
5908
  const getTargetsResult = translationPackage?.getTypeVariableOrVariantTranslationTargets(parent);
5866
5909
  if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
@@ -5884,7 +5927,7 @@ var NodeSemanticInfoService = class {
5884
5927
  }
5885
5928
  break;
5886
5929
  }
5887
- case 131 /* PackageMethodTranslation */: {
5930
+ case 133 /* PackageMethodTranslation */: {
5888
5931
  const translationPackage = this.getContainingTranslationPackage(analyzer, node);
5889
5932
  const getTargetsResult = translationPackage?.getPackageMethodTranslationTargets(parent);
5890
5933
  if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
@@ -5908,7 +5951,7 @@ var NodeSemanticInfoService = class {
5908
5951
  }
5909
5952
  break;
5910
5953
  }
5911
- case 132 /* TypeMethodTranslation */: {
5954
+ case 134 /* TypeMethodTranslation */: {
5912
5955
  const translationPackage = this.getContainingTranslationPackage(analyzer, node);
5913
5956
  const getTargetsResult = translationPackage?.getTypeMethodTranslationTargets(parent);
5914
5957
  if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
@@ -5932,7 +5975,7 @@ var NodeSemanticInfoService = class {
5932
5975
  }
5933
5976
  break;
5934
5977
  }
5935
- case 139 /* TypeTranslation */: {
5978
+ case 141 /* TypeTranslation */: {
5936
5979
  const translationPackage = this.getContainingTranslationPackage(analyzer, node);
5937
5980
  const getTargetResult = translationPackage?.getTypeTranslationTarget(parent);
5938
5981
  if (translationPackage !== void 0 && getTargetResult?.target !== void 0) {
@@ -5952,7 +5995,7 @@ var NodeSemanticInfoService = class {
5952
5995
  }
5953
5996
  break;
5954
5997
  }
5955
- case 133 /* MethodTypeTranslation */: {
5998
+ case 135 /* MethodTypeTranslation */: {
5956
5999
  const translationPackage = this.getContainingTranslationPackage(analyzer, node);
5957
6000
  const getTargetResult = translationPackage?.getMethodTypeTranslationTarget(parent);
5958
6001
  if (translationPackage !== void 0 && getTargetResult?.target !== void 0) {
@@ -5972,7 +6015,7 @@ var NodeSemanticInfoService = class {
5972
6015
  }
5973
6016
  break;
5974
6017
  }
5975
- case 144 /* ParameterDeclaration */:
6018
+ case 146 /* ParameterDeclaration */:
5976
6019
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofParameterDeclaration(parent));
5977
6020
  break;
5978
6021
  case 8 /* PackageImport */:
@@ -5981,30 +6024,30 @@ var NodeSemanticInfoService = class {
5981
6024
  case 9 /* PackagePath */:
5982
6025
  result = void 0;
5983
6026
  break;
5984
- case 78 /* PropertyAccessExpression */:
6027
+ case 80 /* PropertyAccessExpression */:
5985
6028
  result = this.ofProperty(analyzer, parent, options6);
5986
6029
  break;
5987
- case 52 /* TypeMethodDeclaration */:
6030
+ case 54 /* TypeMethodDeclaration */:
5988
6031
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofTypeMethodDeclaration(parent));
5989
6032
  break;
5990
- case 53 /* OperatorDeclaration */:
6033
+ case 55 /* OperatorDeclaration */:
5991
6034
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofOperatorDeclaration(parent));
5992
6035
  break;
5993
- case 54 /* TypeVariableDeclaration */:
6036
+ case 56 /* TypeVariableDeclaration */:
5994
6037
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofTypeVariableDeclaration(parent));
5995
6038
  break;
5996
- case 143 /* TypeParameterDeclaration */:
6039
+ case 145 /* TypeParameterDeclaration */:
5997
6040
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofTypeParameterDeclaration(parent));
5998
6041
  break;
5999
- case 142 /* VariantDeclaration */:
6042
+ case 144 /* VariantDeclaration */:
6000
6043
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofVariantDeclaration(parent));
6001
6044
  break;
6002
- case 36 /* PackageVariableGetterDeclaration */:
6003
- case 37 /* PackageVariableSetterDeclaration */:
6045
+ case 38 /* PackageVariableGetterDeclaration */:
6046
+ case 39 /* PackageVariableSetterDeclaration */:
6004
6047
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofComputedPackageVariableDeclaration(parent));
6005
6048
  break;
6006
- case 55 /* TypeVariableGetterDeclaration */:
6007
- case 56 /* TypeVariableSetterDeclaration */:
6049
+ case 57 /* TypeVariableGetterDeclaration */:
6050
+ case 58 /* TypeVariableSetterDeclaration */:
6008
6051
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofComputedTypeVariableDeclaration(parent));
6009
6052
  break;
6010
6053
  case 3 /* Keyword */:
@@ -6100,6 +6143,16 @@ var NodeSemanticInfoService = class {
6100
6143
  case "package-name-segment-access":
6101
6144
  result = this.ofPackageNameSegmentAccess(analyzer, meaning.packageTreeNode, node);
6102
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
+ }
6103
6156
  case "unresolved":
6104
6157
  break;
6105
6158
  default:
@@ -6122,10 +6175,10 @@ var NodeSemanticInfoService = class {
6122
6175
  switch (node.parent.kind) {
6123
6176
  case 10 /* NamedTypeSpecifier */:
6124
6177
  return this.ofNamedTypeSpecifierNameQualifier(analyzer, node.parent, qualifier, options6);
6125
- case 147 /* Tag */:
6178
+ case 149 /* Tag */:
6126
6179
  return this.ofTagNameQualifier(analyzer, node.parent, qualifier, options6);
6127
- case 42 /* ExtendedTypeClause */:
6128
- case 134 /* PackageImportTranslation */:
6180
+ case 44 /* ExtendedTypeClause */:
6181
+ case 136 /* PackageImportTranslation */:
6129
6182
  return void 0;
6130
6183
  default:
6131
6184
  Debug.never(node.parent);
@@ -6169,6 +6222,20 @@ var NodeSemanticInfoService = class {
6169
6222
  } else {
6170
6223
  Debug.never(resolvedQualifier);
6171
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
+ }
6172
6239
  }
6173
6240
  if (result !== void 0 && options6.includeBetterReferenceTargets) {
6174
6241
  result = this.getBetterReferenceTargetsOrPreserve(result);
@@ -6183,7 +6250,7 @@ var NodeSemanticInfoService = class {
6183
6250
  const resolvedQualifier = resolutionResult.resolvedQualifiers[qualifierIndex];
6184
6251
  switch (resolvedQualifier.kind) {
6185
6252
  case "type": {
6186
- if (options6.preferredTargetOfExplicitConstructorCall === "type-declaration") {
6253
+ if (options6.preferredTargetOfExplicitConstructorCall === "type-declaration" || resolutionResult.meaning.kind !== "tag-type") {
6187
6254
  if (resolvedQualifier.suitableTypes.length > 0) {
6188
6255
  const targets = resolvedQualifier.suitableTypes.map((t) => new SimpleWithLocalization(new EntityReferenceTarget(t.value, 0 /* Get */), t.localization));
6189
6256
  result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), targets.length > 1);
@@ -6192,14 +6259,12 @@ var NodeSemanticInfoService = class {
6192
6259
  result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
6193
6260
  }
6194
6261
  } else {
6195
- if (resolutionResult.meaning.kind === "tag-type") {
6196
- if (resolutionResult.meaning.suitableConstructors.length > 0) {
6197
- const targets = resolutionResult.meaning.suitableConstructors.map((t) => new SimpleWithLocalization(new TypeConstructorReferenceTarget(t.value), t.localization));
6198
- result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), targets.length > 1);
6199
- } else if (resolutionResult.meaning.candidates.length > 0) {
6200
- const targets = resolutionResult.meaning.candidates.map((t) => new SimpleWithLocalization(new TypeConstructorReferenceTarget(t.value), t.localization));
6201
- result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
6202
- }
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);
6203
6268
  }
6204
6269
  }
6205
6270
  break;
@@ -6241,6 +6306,20 @@ var NodeSemanticInfoService = class {
6241
6306
  default:
6242
6307
  Debug.never(resolvedQualifier);
6243
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
+ }
6244
6323
  }
6245
6324
  if (result !== void 0 && options6.includeBetterReferenceTargets) {
6246
6325
  result = this.getBetterReferenceTargetsOrPreserve(result);
@@ -6310,7 +6389,7 @@ var NodeSemanticInfoService = class {
6310
6389
  break;
6311
6390
  }
6312
6391
  case "mixed-ambiguous-access": {
6313
- const targets = Query.from(meaning.declarations).mapAndFilter((d) => {
6392
+ const targets = meaning.declarations.map((d) => {
6314
6393
  let target;
6315
6394
  switch (d.value.kind) {
6316
6395
  case "method":
@@ -6326,15 +6405,13 @@ var NodeSemanticInfoService = class {
6326
6405
  target = new EntityReferenceTarget(d.value.value, 0 /* Get */);
6327
6406
  break;
6328
6407
  case "package-name-segment":
6329
- if (d.value.value.package !== void 0) {
6330
- target = new PackageReferenceTarget(d.value.value.package.value);
6331
- }
6408
+ target = new PackageNameTreeNodeReferenceTarget(d.value.value);
6332
6409
  break;
6333
6410
  default:
6334
6411
  Debug.never(d.value);
6335
6412
  }
6336
- return target !== void 0 ? new SimpleWithLocalization(target, d.localization) : void 0;
6337
- }).toArray();
6413
+ return new SimpleWithLocalization(target, d.localization);
6414
+ });
6338
6415
  if (isNonEmptyArray(targets)) {
6339
6416
  result = new ReferenceNodeSemanticInfo(targets, true);
6340
6417
  }
@@ -6564,7 +6641,7 @@ var NodeSemanticInfoService = class {
6564
6641
  }
6565
6642
  static ofPackageNameSegmentAccess(analyzer, packageTreeNode, node) {
6566
6643
  let parent = getParentSkippingParenthesizedExpressions(node);
6567
- while (parent.kind === 78 /* PropertyAccessExpression */) {
6644
+ while (parent.kind === 80 /* PropertyAccessExpression */) {
6568
6645
  const meaning = analyzer.resolvePropertyAccessExpression(parent).meaning;
6569
6646
  if (meaning.kind === "package-name-segment-access") {
6570
6647
  packageTreeNode = meaning.packageTreeNode;
@@ -6603,11 +6680,11 @@ var NodeSemanticInfoService = class {
6603
6680
  }
6604
6681
  const parent = getParentSkippingParenthesizedExpressions(typeAccessExpression);
6605
6682
  let parentCallExpression;
6606
- if (parent.kind === 69 /* CallExpression */) {
6683
+ if (parent.kind === 71 /* CallExpression */) {
6607
6684
  parentCallExpression = parent;
6608
- } else if (parent.kind === 89 /* GenericSpecializationExpression */) {
6685
+ } else if (parent.kind === 91 /* GenericSpecializationExpression */) {
6609
6686
  const grandParent = getParentSkippingParenthesizedExpressions(parent);
6610
- if (grandParent.kind === 69 /* CallExpression */) {
6687
+ if (grandParent.kind === 71 /* CallExpression */) {
6611
6688
  parentCallExpression = grandParent;
6612
6689
  }
6613
6690
  }
@@ -6767,6 +6844,12 @@ var PackageReferenceTarget = class {
6767
6844
  this.kind = "package";
6768
6845
  }
6769
6846
  };
6847
+ var PackageNameTreeNodeReferenceTarget = class {
6848
+ constructor(node) {
6849
+ this.node = node;
6850
+ this.kind = "package-name-tree-node";
6851
+ }
6852
+ };
6770
6853
  var TypeContextReferenceTarget = class {
6771
6854
  constructor(type, typeContextKind) {
6772
6855
  this.type = type;
@@ -6852,59 +6935,59 @@ function getEntitySourceLocations(analyzer, entity) {
6852
6935
  const node = definition.node;
6853
6936
  let range;
6854
6937
  switch (node.kind) {
6855
- case 17 /* AnonymousMethodTypeDeclaration */:
6856
- case 18 /* AnonymousStructuredTypeDeclaration */:
6857
- case 19 /* AnonymousVariantTypeDeclaration */:
6858
- case 67 /* MethodBlockLiteral */:
6859
- case 74 /* MethodLiteral */:
6938
+ case 19 /* AnonymousMethodTypeDeclaration */:
6939
+ case 20 /* AnonymousStructuredTypeDeclaration */:
6940
+ case 21 /* AnonymousVariantTypeDeclaration */:
6941
+ case 69 /* MethodBlockLiteral */:
6942
+ case 76 /* MethodLiteral */:
6860
6943
  range = node.rangeWithoutTrivia;
6861
6944
  break;
6862
- case 22 /* PackageAliasTypeDeclaration */:
6863
- case 27 /* PackageMethodDeclaration */:
6864
- case 28 /* PackageMethodTypeDeclaration */:
6865
- case 33 /* PackageStructuredTypeDeclaration */:
6866
- case 38 /* PackageVariantTypeDeclaration */:
6867
- case 58 /* NestedMethodDeclaration */:
6868
- case 52 /* TypeMethodDeclaration */:
6869
- case 143 /* TypeParameterDeclaration */:
6870
- 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 */:
6871
6954
  range = node.name.rangeWithoutTrivia;
6872
6955
  break;
6873
- case 45 /* TypeConstructorDeclaration */:
6956
+ case 47 /* TypeConstructorDeclaration */:
6874
6957
  range = node.creationKeyword.rangeWithoutTrivia;
6875
6958
  break;
6876
- case 46 /* TypeDestructorDeclaration */:
6959
+ case 48 /* TypeDestructorDeclaration */:
6877
6960
  range = node.destructionKeyword.rangeWithoutTrivia;
6878
6961
  break;
6879
6962
  case 8 /* PackageImport */:
6880
6963
  Debug.assertNotNull(node.alias);
6881
6964
  range = node.alias.rangeWithoutTrivia;
6882
6965
  break;
6883
- case 40 /* TypeExtensionDeclaration */:
6966
+ case 42 /* TypeExtensionDeclaration */:
6884
6967
  range = node.plusEqualsToken.rangeWithoutTrivia;
6885
6968
  break;
6886
- case 36 /* PackageVariableGetterDeclaration */:
6969
+ case 38 /* PackageVariableGetterDeclaration */:
6887
6970
  range = node.getKeyword.rangeWithoutTrivia;
6888
6971
  break;
6889
- case 37 /* PackageVariableSetterDeclaration */:
6972
+ case 39 /* PackageVariableSetterDeclaration */:
6890
6973
  range = node.setKeyword.rangeWithoutTrivia;
6891
6974
  break;
6892
- case 55 /* TypeVariableGetterDeclaration */:
6975
+ case 57 /* TypeVariableGetterDeclaration */:
6893
6976
  range = node.getKeyword.rangeWithoutTrivia;
6894
6977
  break;
6895
- case 56 /* TypeVariableSetterDeclaration */:
6978
+ case 58 /* TypeVariableSetterDeclaration */:
6896
6979
  range = node.setKeyword.rangeWithoutTrivia;
6897
6980
  break;
6898
- case 47 /* TypeIndexedGetterDeclaration */:
6981
+ case 49 /* TypeIndexedGetterDeclaration */:
6899
6982
  range = node.parameterClause.rangeWithoutTrivia;
6900
6983
  break;
6901
- case 48 /* TypeIndexedSetterDeclaration */:
6984
+ case 50 /* TypeIndexedSetterDeclaration */:
6902
6985
  range = node.parameterClause.rangeWithoutTrivia;
6903
6986
  break;
6904
- case 50 /* TypeDereferencedVariableGetterDeclaration */:
6987
+ case 52 /* TypeDereferencedVariableGetterDeclaration */:
6905
6988
  range = node.caretToken.rangeWithoutTrivia;
6906
6989
  break;
6907
- case 51 /* TypeDereferencedVariableSetterDeclaration */:
6990
+ case 53 /* TypeDereferencedVariableSetterDeclaration */:
6908
6991
  range = node.caretToken.rangeWithoutTrivia;
6909
6992
  break;
6910
6993
  default:
@@ -7026,9 +7109,13 @@ var DefinitionService = class {
7026
7109
  return getEntitySourceLocations(analyzer, target.parameter.entity);
7027
7110
  case "type-value-parameter":
7028
7111
  return getEntitySourceLocations(analyzer, target.parameter.getEntity());
7029
- case "package": {
7112
+ case "package":
7030
7113
  return [new SourceLocation(sourceFile, tokenOrKeyword.value.rangeWithoutTrivia)];
7031
- }
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;
7032
7119
  case "type-context": {
7033
7120
  const entity = target.type.getEntity();
7034
7121
  if (entity !== void 0) {
@@ -7062,6 +7149,8 @@ var DefinitionService = class {
7062
7149
  return target.parameter.entity;
7063
7150
  case "package":
7064
7151
  return target.package_;
7152
+ case "package-name-tree-node":
7153
+ return target.node.package?.value;
7065
7154
  case "type-context":
7066
7155
  return target.type.getEntity();
7067
7156
  case "type-indexer":
@@ -7143,7 +7232,7 @@ var ReferencesService = class {
7143
7232
  }
7144
7233
  }
7145
7234
  if (!options6.onlyNamed) {
7146
- if (node.kind === 70 /* AutotypeCallExpression */ && restrictions.canBeAutotypeCall) {
7235
+ if (node.kind === 72 /* AutotypeCallExpression */ && restrictions.canBeAutotypeCall) {
7147
7236
  const semanticInfo = NodeSemanticInfoService.ofAutotypeCallExpression(analyzer, node, semanticInfoOptions);
7148
7237
  const referenceKind = this.ifReferenceToDefinitionThenKind(
7149
7238
  definition,
@@ -7155,7 +7244,7 @@ var ReferencesService = class {
7155
7244
  result.push(new Reference(sourceFile2, node.autotypeKeyword.rangeWithoutTrivia, referenceKind));
7156
7245
  }
7157
7246
  }
7158
- if (node.kind === 77 /* PrefixUnaryExpression */ && restrictions.canBePrefixUnaryOperator) {
7247
+ if (node.kind === 79 /* PrefixUnaryExpression */ && restrictions.canBePrefixUnaryOperator) {
7159
7248
  const semanticInfo = NodeSemanticInfoService.ofPrefixUnaryExpressionOperator(
7160
7249
  analyzer,
7161
7250
  node,
@@ -7171,7 +7260,7 @@ var ReferencesService = class {
7171
7260
  result.push(new Reference(sourceFile2, node.operator.rangeWithoutTrivia, referenceKind));
7172
7261
  }
7173
7262
  }
7174
- if (node.kind === 66 /* BinaryExpression */ && restrictions.canBeBinaryExpressionOperator) {
7263
+ if (node.kind === 68 /* BinaryExpression */ && restrictions.canBeBinaryExpressionOperator) {
7175
7264
  const semanticInfo = NodeSemanticInfoService.ofBinaryExpressionOperator(
7176
7265
  analyzer,
7177
7266
  node,
@@ -7187,7 +7276,7 @@ var ReferencesService = class {
7187
7276
  result.push(new Reference(sourceFile2, node.operator.rangeWithoutTrivia, referenceKind));
7188
7277
  }
7189
7278
  }
7190
- if ((node.kind === 50 /* TypeDereferencedVariableGetterDeclaration */ || node.kind === 51 /* TypeDereferencedVariableSetterDeclaration */) && restrictions.canBeDereferenceOperator) {
7279
+ if ((node.kind === 52 /* TypeDereferencedVariableGetterDeclaration */ || node.kind === 53 /* TypeDereferencedVariableSetterDeclaration */) && restrictions.canBeDereferenceOperator) {
7191
7280
  const semanticInfo = NodeSemanticInfoService.ofDereferenceOperatorDeclaration(analyzer, node);
7192
7281
  const referenceKind = this.ifReferenceToDefinitionThenKind(
7193
7282
  definition,
@@ -7199,7 +7288,7 @@ var ReferencesService = class {
7199
7288
  result.push(new Reference(sourceFile2, node.caretToken.rangeWithoutTrivia, referenceKind));
7200
7289
  }
7201
7290
  }
7202
- if (node.kind === 80 /* DereferenceExpression */ && restrictions.canBeDereferenceOperator) {
7291
+ if (node.kind === 82 /* DereferenceExpression */ && restrictions.canBeDereferenceOperator) {
7203
7292
  const semanticInfo = NodeSemanticInfoService.ofDereferenceExpressionOperator(
7204
7293
  analyzer,
7205
7294
  node,
@@ -7215,7 +7304,7 @@ var ReferencesService = class {
7215
7304
  result.push(new Reference(sourceFile2, node.caretToken.rangeWithoutTrivia, referenceKind));
7216
7305
  }
7217
7306
  }
7218
- if (node.kind === 91 /* AssignmentStatement */ && restrictions.canBeAssignmentStatementOperator) {
7307
+ if (node.kind === 93 /* AssignmentStatement */ && restrictions.canBeAssignmentStatementOperator) {
7219
7308
  const semanticInfo = NodeSemanticInfoService.ofAssignmentStatementOperator(
7220
7309
  analyzer,
7221
7310
  node,
@@ -7231,7 +7320,7 @@ var ReferencesService = class {
7231
7320
  result.push(new Reference(sourceFile2, node.operator.rangeWithoutTrivia, referenceKind));
7232
7321
  }
7233
7322
  }
7234
- if (node.kind === 45 /* TypeConstructorDeclaration */ && restrictions.canBeConstructorDeclaration) {
7323
+ if (node.kind === 47 /* TypeConstructorDeclaration */ && restrictions.canBeConstructorDeclaration) {
7235
7324
  const semanticInfo = NodeSemanticInfoService.ofTypeConstructorDeclaration(analyzer, node);
7236
7325
  const referenceKind = this.ifReferenceToDefinitionThenKind(
7237
7326
  definition,
@@ -7243,7 +7332,7 @@ var ReferencesService = class {
7243
7332
  result.push(new Reference(sourceFile2, node.creationKeyword.rangeWithoutTrivia, referenceKind));
7244
7333
  }
7245
7334
  }
7246
- if (node.kind === 86 /* ObjectExpression */ && restrictions.canBeObjectExpression) {
7335
+ if (node.kind === 88 /* ObjectExpression */ && restrictions.canBeObjectExpression) {
7247
7336
  const semanticInfo = NodeSemanticInfoService.ofObjectExpression(analyzer, node, semanticInfoOptions);
7248
7337
  const referenceKind = this.ifReferenceToDefinitionThenKind(
7249
7338
  definition,
@@ -7255,7 +7344,7 @@ var ReferencesService = class {
7255
7344
  result.push(new Reference(sourceFile2, node.keyword.rangeWithoutTrivia, referenceKind));
7256
7345
  }
7257
7346
  }
7258
- if (node.kind === 87 /* BaseExpression */ && restrictions.canBeBaseExpression) {
7347
+ if (node.kind === 89 /* BaseExpression */ && restrictions.canBeBaseExpression) {
7259
7348
  const semanticInfo = NodeSemanticInfoService.ofBaseExpression(analyzer, node, semanticInfoOptions);
7260
7349
  const referenceKind = this.ifReferenceToDefinitionThenKind(
7261
7350
  definition,
@@ -7267,7 +7356,7 @@ var ReferencesService = class {
7267
7356
  result.push(new Reference(sourceFile2, node.keyword.rangeWithoutTrivia, referenceKind));
7268
7357
  }
7269
7358
  }
7270
- if ((node.kind === 47 /* TypeIndexedGetterDeclaration */ || node.kind === 48 /* TypeIndexedSetterDeclaration */) && restrictions.canBeIndexer) {
7359
+ if ((node.kind === 49 /* TypeIndexedGetterDeclaration */ || node.kind === 50 /* TypeIndexedSetterDeclaration */) && restrictions.canBeIndexer) {
7271
7360
  const semanticInfo = NodeSemanticInfoService.ofTypeIndexerDeclaration(analyzer, node);
7272
7361
  const referenceKind = this.ifReferenceToDefinitionThenKind(
7273
7362
  definition,
@@ -7279,7 +7368,7 @@ var ReferencesService = class {
7279
7368
  result.push(new Reference(sourceFile2, node.parameterClause.rangeWithoutTrivia, referenceKind));
7280
7369
  }
7281
7370
  }
7282
- if (node.kind === 71 /* IndexedAccessExpression */ && restrictions.canBeIndexer) {
7371
+ if (node.kind === 73 /* IndexedAccessExpression */ && restrictions.canBeIndexer) {
7283
7372
  const semanticInfo = NodeSemanticInfoService.ofIndexedAccessExpressionOperator(
7284
7373
  analyzer,
7285
7374
  node,
@@ -7425,6 +7514,11 @@ var ReferencesService = class {
7425
7514
  target.localization,
7426
7515
  accessKindToReferenceKind(target.value.accessKind)
7427
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;
7428
7522
  default:
7429
7523
  Debug.never(target.value);
7430
7524
  }
@@ -7656,9 +7750,9 @@ var EvaluatableExpressionService = class {
7656
7750
  getEvaluatableExpressionForIdentifier(node) {
7657
7751
  const parent = node.parent;
7658
7752
  switch (parent.kind) {
7659
- case 88 /* IdentifierExpression */:
7753
+ case 90 /* IdentifierExpression */:
7660
7754
  return parent;
7661
- case 78 /* PropertyAccessExpression */:
7755
+ case 80 /* PropertyAccessExpression */:
7662
7756
  if (this.isEvaluatableReceiver(parent.expression)) {
7663
7757
  return parent;
7664
7758
  }
@@ -7679,9 +7773,9 @@ var EvaluatableExpressionService = class {
7679
7773
  }
7680
7774
  isEvaluatableReceiver(expression) {
7681
7775
  switch (expression.kind) {
7682
- case 88 /* IdentifierExpression */:
7776
+ case 90 /* IdentifierExpression */:
7683
7777
  return true;
7684
- case 78 /* PropertyAccessExpression */:
7778
+ case 80 /* PropertyAccessExpression */:
7685
7779
  return this.isEvaluatableReceiver(expression.expression);
7686
7780
  default:
7687
7781
  return false;
@@ -7689,35 +7783,35 @@ var EvaluatableExpressionService = class {
7689
7783
  }
7690
7784
  isNamedDeclaration(node) {
7691
7785
  switch (node.kind) {
7692
- case 60 /* EnumerationVariableDeclaration */:
7786
+ case 62 /* EnumerationVariableDeclaration */:
7693
7787
  return { nameIdentifier: node.name };
7694
- case 22 /* PackageAliasTypeDeclaration */:
7788
+ case 24 /* PackageAliasTypeDeclaration */:
7695
7789
  return { nameIdentifier: node.name };
7696
- case 27 /* PackageMethodDeclaration */:
7790
+ case 29 /* PackageMethodDeclaration */:
7697
7791
  return { nameIdentifier: node.name };
7698
- case 28 /* PackageMethodTypeDeclaration */:
7792
+ case 30 /* PackageMethodTypeDeclaration */:
7699
7793
  return { nameIdentifier: node.name };
7700
- case 33 /* PackageStructuredTypeDeclaration */:
7794
+ case 35 /* PackageStructuredTypeDeclaration */:
7701
7795
  return { nameIdentifier: node.name };
7702
- case 35 /* PackageVariableDeclaration */:
7796
+ case 37 /* PackageVariableDeclaration */:
7703
7797
  return { nameIdentifier: node.name };
7704
- case 38 /* PackageVariantTypeDeclaration */:
7798
+ case 40 /* PackageVariantTypeDeclaration */:
7705
7799
  return { nameIdentifier: node.name };
7706
- case 58 /* NestedMethodDeclaration */:
7800
+ case 60 /* NestedMethodDeclaration */:
7707
7801
  return { nameIdentifier: node.name };
7708
- case 59 /* LocalVariableDeclaration */:
7802
+ case 61 /* LocalVariableDeclaration */:
7709
7803
  return { nameIdentifier: node.name };
7710
- case 144 /* ParameterDeclaration */:
7804
+ case 146 /* ParameterDeclaration */:
7711
7805
  return { nameIdentifier: node.name };
7712
- case 52 /* TypeMethodDeclaration */:
7806
+ case 54 /* TypeMethodDeclaration */:
7713
7807
  return { nameIdentifier: node.name };
7714
- case 54 /* TypeVariableDeclaration */:
7808
+ case 56 /* TypeVariableDeclaration */:
7715
7809
  return { nameIdentifier: node.name };
7716
- case 143 /* TypeParameterDeclaration */:
7810
+ case 145 /* TypeParameterDeclaration */:
7717
7811
  return { nameIdentifier: node.name };
7718
- case 142 /* VariantDeclaration */:
7812
+ case 144 /* VariantDeclaration */:
7719
7813
  return { nameIdentifier: node.name };
7720
- case 101 /* ErrorVariableDeclaration */:
7814
+ case 103 /* ErrorVariableDeclaration */:
7721
7815
  return { nameIdentifier: node.name };
7722
7816
  default:
7723
7817
  return void 0;
@@ -7889,6 +7983,8 @@ var HoverService = class {
7889
7983
  }
7890
7984
  case "package":
7891
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);
7892
7988
  case "type-context": {
7893
7989
  if (firstTarget.value.typeContextKind === "object") {
7894
7990
  const keywordText = this._displayService.displayKeyword(4 /* Object */);
@@ -7974,7 +8070,7 @@ var SourceFileItemsService = class {
7974
8070
  }
7975
8071
  break;
7976
8072
  }
7977
- case 35 /* PackageVariableDeclaration */: {
8073
+ case 37 /* PackageVariableDeclaration */: {
7978
8074
  result.push(
7979
8075
  this.createItem(
7980
8076
  1 /* PackageVariable */,
@@ -7986,7 +8082,7 @@ var SourceFileItemsService = class {
7986
8082
  );
7987
8083
  break;
7988
8084
  }
7989
- case 36 /* PackageVariableGetterDeclaration */: {
8085
+ case 38 /* PackageVariableGetterDeclaration */: {
7990
8086
  result.push(
7991
8087
  this.createItem(
7992
8088
  2 /* PackageVariableGetter */,
@@ -7998,7 +8094,7 @@ var SourceFileItemsService = class {
7998
8094
  );
7999
8095
  break;
8000
8096
  }
8001
- case 37 /* PackageVariableSetterDeclaration */: {
8097
+ case 39 /* PackageVariableSetterDeclaration */: {
8002
8098
  result.push(
8003
8099
  this.createItem(
8004
8100
  3 /* PackageVariableSetter */,
@@ -8010,7 +8106,7 @@ var SourceFileItemsService = class {
8010
8106
  );
8011
8107
  break;
8012
8108
  }
8013
- case 27 /* PackageMethodDeclaration */: {
8109
+ case 29 /* PackageMethodDeclaration */: {
8014
8110
  result.push(
8015
8111
  this.createItem(
8016
8112
  4 /* PackageMethod */,
@@ -8022,7 +8118,7 @@ var SourceFileItemsService = class {
8022
8118
  );
8023
8119
  break;
8024
8120
  }
8025
- case 33 /* PackageStructuredTypeDeclaration */: {
8121
+ case 35 /* PackageStructuredTypeDeclaration */: {
8026
8122
  result.push(
8027
8123
  this.createItem(
8028
8124
  5 /* StructuredType */,
@@ -8034,7 +8130,7 @@ var SourceFileItemsService = class {
8034
8130
  );
8035
8131
  break;
8036
8132
  }
8037
- case 54 /* TypeVariableDeclaration */: {
8133
+ case 56 /* TypeVariableDeclaration */: {
8038
8134
  result.push(
8039
8135
  this.createItem(
8040
8136
  12 /* TypeVariable */,
@@ -8046,7 +8142,7 @@ var SourceFileItemsService = class {
8046
8142
  );
8047
8143
  break;
8048
8144
  }
8049
- case 55 /* TypeVariableGetterDeclaration */: {
8145
+ case 57 /* TypeVariableGetterDeclaration */: {
8050
8146
  result.push(
8051
8147
  this.createItem(
8052
8148
  13 /* TypeVariableGetter */,
@@ -8058,7 +8154,7 @@ var SourceFileItemsService = class {
8058
8154
  );
8059
8155
  break;
8060
8156
  }
8061
- case 56 /* TypeVariableSetterDeclaration */: {
8157
+ case 58 /* TypeVariableSetterDeclaration */: {
8062
8158
  result.push(
8063
8159
  this.createItem(
8064
8160
  14 /* TypeVariableSetter */,
@@ -8070,7 +8166,7 @@ var SourceFileItemsService = class {
8070
8166
  );
8071
8167
  break;
8072
8168
  }
8073
- case 52 /* TypeMethodDeclaration */: {
8169
+ case 54 /* TypeMethodDeclaration */: {
8074
8170
  result.push(
8075
8171
  this.createItem(
8076
8172
  15 /* TypeMethod */,
@@ -8082,7 +8178,7 @@ var SourceFileItemsService = class {
8082
8178
  );
8083
8179
  break;
8084
8180
  }
8085
- case 45 /* TypeConstructorDeclaration */: {
8181
+ case 47 /* TypeConstructorDeclaration */: {
8086
8182
  result.push(
8087
8183
  this.createItem(
8088
8184
  10 /* TypeConstructor */,
@@ -8094,7 +8190,7 @@ var SourceFileItemsService = class {
8094
8190
  );
8095
8191
  break;
8096
8192
  }
8097
- case 46 /* TypeDestructorDeclaration */: {
8193
+ case 48 /* TypeDestructorDeclaration */: {
8098
8194
  result.push(this.createItem(
8099
8195
  11 /* TypeDestructor */,
8100
8196
  void 0,
@@ -8104,7 +8200,7 @@ var SourceFileItemsService = class {
8104
8200
  ));
8105
8201
  break;
8106
8202
  }
8107
- case 47 /* TypeIndexedGetterDeclaration */: {
8203
+ case 49 /* TypeIndexedGetterDeclaration */: {
8108
8204
  result.push(
8109
8205
  this.createItem(
8110
8206
  16 /* TypeIndexedGetter */,
@@ -8116,7 +8212,7 @@ var SourceFileItemsService = class {
8116
8212
  );
8117
8213
  break;
8118
8214
  }
8119
- case 48 /* TypeIndexedSetterDeclaration */: {
8215
+ case 50 /* TypeIndexedSetterDeclaration */: {
8120
8216
  result.push(
8121
8217
  this.createItem(
8122
8218
  17 /* TypeIndexedSetter */,
@@ -8128,7 +8224,7 @@ var SourceFileItemsService = class {
8128
8224
  );
8129
8225
  break;
8130
8226
  }
8131
- case 28 /* PackageMethodTypeDeclaration */: {
8227
+ case 30 /* PackageMethodTypeDeclaration */: {
8132
8228
  result.push(
8133
8229
  this.createItem(
8134
8230
  6 /* MethodType */,
@@ -8140,7 +8236,7 @@ var SourceFileItemsService = class {
8140
8236
  );
8141
8237
  break;
8142
8238
  }
8143
- case 38 /* PackageVariantTypeDeclaration */: {
8239
+ case 40 /* PackageVariantTypeDeclaration */: {
8144
8240
  result.push(
8145
8241
  this.createItem(
8146
8242
  7 /* VariantType */,
@@ -8152,7 +8248,7 @@ var SourceFileItemsService = class {
8152
8248
  );
8153
8249
  break;
8154
8250
  }
8155
- case 142 /* VariantDeclaration */: {
8251
+ case 144 /* VariantDeclaration */: {
8156
8252
  result.push(
8157
8253
  this.createItem(
8158
8254
  9 /* Variant */,
@@ -8164,7 +8260,7 @@ var SourceFileItemsService = class {
8164
8260
  );
8165
8261
  break;
8166
8262
  }
8167
- case 143 /* TypeParameterDeclaration */: {
8263
+ case 145 /* TypeParameterDeclaration */: {
8168
8264
  result.push(
8169
8265
  this.createItem(
8170
8266
  18 /* TypeParameter */,
@@ -8176,7 +8272,7 @@ var SourceFileItemsService = class {
8176
8272
  );
8177
8273
  break;
8178
8274
  }
8179
- case 58 /* NestedMethodDeclaration */: {
8275
+ case 60 /* NestedMethodDeclaration */: {
8180
8276
  result.push(
8181
8277
  this.createItem(
8182
8278
  19 /* NestedMethod */,
@@ -8209,7 +8305,7 @@ var SourceFileItemsService = class {
8209
8305
  return name ?? `<${LocalizationHelper.localizeHelperPhrase(4 /* PackageAlias */, this.locale)}>`;
8210
8306
  case 1 /* PackageVariable */:
8211
8307
  case 12 /* TypeVariable */:
8212
- return name ?? `<${LocalizationHelper.localizeHelperPhrase(5 /* Variable */, this.locale)}>`;
8308
+ return name ?? `<${LocalizationHelper.localizeHelperPhrase(6 /* Variable */, this.locale)}>`;
8213
8309
  case 4 /* PackageMethod */:
8214
8310
  case 15 /* TypeMethod */:
8215
8311
  case 19 /* NestedMethod */:
@@ -8351,6 +8447,7 @@ var RenameService = class {
8351
8447
  case "package":
8352
8448
  case "type-context":
8353
8449
  case "type-indexer":
8450
+ case "package-name-tree-node":
8354
8451
  canBeRenamed = false;
8355
8452
  break;
8356
8453
  default:
@@ -8400,7 +8497,7 @@ var SelectionRangeService = class {
8400
8497
  if (!this.nodeShouldBeSkipped(child) && !child.rangeWithoutTrivia.equals(result.range)) {
8401
8498
  result = new SelectionRange(child.rangeWithoutTrivia, result);
8402
8499
  }
8403
- 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 */) {
8404
8501
  const textContentStart = child.rangeWithoutTrivia.start + 1;
8405
8502
  const textContentEnd = child.rangeWithoutTrivia.end - 1;
8406
8503
  if (offset >= textContentStart && offset < textContentEnd) {
@@ -8431,13 +8528,13 @@ var SelectionRangeService = class {
8431
8528
  }
8432
8529
  }
8433
8530
  switch (node.kind) {
8434
- case 156 /* TypeAnnotation */:
8435
- case 34 /* StructuredTypeDeclarationBody */:
8436
- case 39 /* VariantTypeDeclarationBody */:
8437
- case 23 /* AliasTypeDeclarationBody */:
8438
- case 29 /* MethodTypeDeclarationBody */:
8439
- case 83 /* TextTemplateSpan */:
8440
- 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 */:
8441
8538
  return true;
8442
8539
  default:
8443
8540
  return false;
@@ -8475,7 +8572,7 @@ var SemanticTokensService = class {
8475
8572
  controller.stopChildrenTraverse();
8476
8573
  return;
8477
8574
  }
8478
- if (node.kind === 88 /* IdentifierExpression */) {
8575
+ if (node.kind === 90 /* IdentifierExpression */) {
8479
8576
  const meaning = analyzer.resolveIdentifierExpression(node).meaning;
8480
8577
  if (meaning.kind === "variable-access") {
8481
8578
  const variable = meaning.variable.value.getEntity();
@@ -8531,7 +8628,7 @@ var SemanticTokensService = class {
8531
8628
  ));
8532
8629
  }
8533
8630
  }
8534
- if (node.kind === 78 /* PropertyAccessExpression */) {
8631
+ if (node.kind === 80 /* PropertyAccessExpression */) {
8535
8632
  const meaning = analyzer.resolvePropertyAccessExpression(node).meaning;
8536
8633
  if (meaning.kind === "static-variable-access") {
8537
8634
  const entity = meaning.variable.value.getEntity();
@@ -8575,7 +8672,7 @@ var SemanticTokensService = class {
8575
8672
  ));
8576
8673
  }
8577
8674
  }
8578
- if (node.kind === 142 /* VariantDeclaration */) {
8675
+ if (node.kind === 144 /* VariantDeclaration */) {
8579
8676
  result.push(
8580
8677
  new SemanticToken(
8581
8678
  node.name.rangeWithoutTrivia,
@@ -8584,7 +8681,7 @@ var SemanticTokensService = class {
8584
8681
  )
8585
8682
  );
8586
8683
  }
8587
- if (node.kind === 27 /* PackageMethodDeclaration */) {
8684
+ if (node.kind === 29 /* PackageMethodDeclaration */) {
8588
8685
  result.push(
8589
8686
  new SemanticToken(
8590
8687
  node.name.rangeWithoutTrivia,
@@ -8593,17 +8690,17 @@ var SemanticTokensService = class {
8593
8690
  )
8594
8691
  );
8595
8692
  }
8596
- if (node.kind === 58 /* NestedMethodDeclaration */) {
8693
+ if (node.kind === 60 /* NestedMethodDeclaration */) {
8597
8694
  result.push(
8598
8695
  new SemanticToken(node.name.rangeWithoutTrivia, 5 /* NestedMethod */, new SemanticTokenModifiers().makeDeclaration().setCapitalized(this.isCapitalizedName(node.name.value)))
8599
8696
  );
8600
8697
  }
8601
- if (node.kind === 52 /* TypeMethodDeclaration */) {
8698
+ if (node.kind === 54 /* TypeMethodDeclaration */) {
8602
8699
  result.push(
8603
8700
  new SemanticToken(node.name.rangeWithoutTrivia, 6 /* TypeMethod */, new SemanticTokenModifiers().makeDeclaration().setCapitalized(this.isCapitalizedName(node.name.value)))
8604
8701
  );
8605
8702
  }
8606
- if (node.kind === 53 /* OperatorDeclaration */) {
8703
+ if (node.kind === 55 /* OperatorDeclaration */) {
8607
8704
  result.push(
8608
8705
  new SemanticToken(node.name.rangeWithoutTrivia, 7 /* Operator */, new SemanticTokenModifiers().makeDeclaration())
8609
8706
  );
@@ -8759,7 +8856,7 @@ var TypeParameterSignatureHelpProvider = class {
8759
8856
  }
8760
8857
  let node = token.parent;
8761
8858
  while (node !== void 0) {
8762
- 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)) {
8763
8860
  const argumentIndex = this.getArgumentIndex(node.typeArgumentList, this._offset);
8764
8861
  const argumentCount = this.countArguments(node.typeArgumentList);
8765
8862
  return new NodeWithTypeArgumentsInfo(node.parent, argumentIndex, argumentCount);
@@ -8804,9 +8901,9 @@ var TypeParameterSignatureHelpProvider = class {
8804
8901
  switch (node.kind) {
8805
8902
  case 10 /* NamedTypeSpecifier */:
8806
8903
  return this.getSignaturesForNamedTypeSpecifier(node);
8807
- case 89 /* GenericSpecializationExpression */:
8904
+ case 91 /* GenericSpecializationExpression */:
8808
8905
  return this.getSignaturesForGenericSpecializationExpression(node);
8809
- case 147 /* Tag */:
8906
+ case 149 /* Tag */:
8810
8907
  return this.getSignaturesForTag(node);
8811
8908
  default:
8812
8909
  Debug.never(node);
@@ -8845,7 +8942,7 @@ var TypeParameterSignatureHelpProvider = class {
8845
8942
  }
8846
8943
  getSignaturesForGenericSpecializationExpression(node) {
8847
8944
  const expression = unwrapParenthesizedExpressions(node.expression);
8848
- if (expression.kind === 88 /* IdentifierExpression */) {
8945
+ if (expression.kind === 90 /* IdentifierExpression */) {
8849
8946
  const meaning = this._analyzer.resolveIdentifierExpression(expression).meaning;
8850
8947
  if (meaning.kind === "method-access") {
8851
8948
  return Query.from(meaning.candidates).mapAndFilter((o) => {
@@ -8860,7 +8957,7 @@ var TypeParameterSignatureHelpProvider = class {
8860
8957
  }
8861
8958
  return void 0;
8862
8959
  }
8863
- if (expression.kind === 78 /* PropertyAccessExpression */) {
8960
+ if (expression.kind === 80 /* PropertyAccessExpression */) {
8864
8961
  const meaning = this._analyzer.resolvePropertyAccessExpression(expression).meaning;
8865
8962
  let accessedMethods;
8866
8963
  if (meaning.kind === "instance-method-access") {
@@ -9113,7 +9210,7 @@ var ValueParametersSignatureHelpProvider = class {
9113
9210
  let node = token.parent;
9114
9211
  while (node !== void 0) {
9115
9212
  switch (node.kind) {
9116
- case 69 /* CallExpression */: {
9213
+ case 71 /* CallExpression */: {
9117
9214
  if (this._offset >= node.openParenthesisToken.rangeWithoutTrivia.end && (node.closeParenthesisToken.rangeWithoutTrivia.isEmpty || this._offset <= node.closeParenthesisToken.rangeWithoutTrivia.start)) {
9118
9215
  const valueArguments = ValueArgumentFactory.createValueArgumentsOfCallExpression(node);
9119
9216
  const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
@@ -9121,7 +9218,7 @@ var ValueParametersSignatureHelpProvider = class {
9121
9218
  }
9122
9219
  break;
9123
9220
  }
9124
- case 70 /* AutotypeCallExpression */: {
9221
+ case 72 /* AutotypeCallExpression */: {
9125
9222
  if (this._offset >= node.openParenthesisToken.rangeWithoutTrivia.end && (node.closeParenthesisToken.rangeWithoutTrivia.isEmpty || this._offset <= node.closeParenthesisToken.rangeWithoutTrivia.start)) {
9126
9223
  const valueArguments = ValueArgumentFactory.createValueArgumentsOfAutotypeCallExpression(node);
9127
9224
  const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
@@ -9129,7 +9226,7 @@ var ValueParametersSignatureHelpProvider = class {
9129
9226
  }
9130
9227
  break;
9131
9228
  }
9132
- case 71 /* IndexedAccessExpression */: {
9229
+ case 73 /* IndexedAccessExpression */: {
9133
9230
  if (this._offset >= node.openSquareBracketToken.rangeWithoutTrivia.end && (node.closeSquareBracketToken.rangeWithoutTrivia.isEmpty || this._offset <= node.closeSquareBracketToken.rangeWithoutTrivia.start)) {
9134
9231
  const valueArguments = ValueArgumentFactory.createValueArgumentsOfIndexedAccessExpression(node);
9135
9232
  const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
@@ -9137,7 +9234,7 @@ var ValueParametersSignatureHelpProvider = class {
9137
9234
  }
9138
9235
  break;
9139
9236
  }
9140
- case 147 /* Tag */: {
9237
+ case 149 /* Tag */: {
9141
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)) {
9142
9239
  const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
9143
9240
  const valueArguments = ValueArgumentFactory.createValueArgumentsOfTag(node);
@@ -12055,6 +12152,8 @@ var EntityToSyntax = class {
12055
12152
  return this.convertParameterType(type);
12056
12153
  case "union":
12057
12154
  return this.convertUnionType(type);
12155
+ case "intersection":
12156
+ return this.convertIntersectionType(type);
12058
12157
  case "unresolved":
12059
12158
  return this.convertUnresolvedType(type);
12060
12159
  default:
@@ -12111,6 +12210,10 @@ var EntityToSyntax = class {
12111
12210
  const constituentTypes = type.originalTypes.map((t) => this.convertType(t));
12112
12211
  return SyntaxFactory.unionTypeSpecifier(constituentTypes);
12113
12212
  }
12213
+ convertIntersectionType(type) {
12214
+ const constituentTypes = type.originalTypes.map((t) => this.convertType(t));
12215
+ return SyntaxFactory.intersectionTypeSpecifier(constituentTypes);
12216
+ }
12114
12217
  convertUnresolvedType(_type) {
12115
12218
  return SyntaxFactory.namedTypeSpecifier("~\u041E\u0431\u044A\u0435\u043A\u0442");
12116
12219
  }
@@ -13295,7 +13398,7 @@ var LanguageServer = class {
13295
13398
  const sourceFileContext = yield this.getSourceFileContext(uri, token);
13296
13399
  if (sourceFileContext !== void 0) {
13297
13400
  const node = NodePath.parse(uri.fragment).getNode(sourceFileContext.sourceFile.getSyntaxNode());
13298
- if (node?.kind === 91 /* AssignmentStatement */) {
13401
+ if (node?.kind === 93 /* AssignmentStatement */) {
13299
13402
  const sourceFileEdit = this._addPropertyAssignmentService.createEditWithAssignment(
13300
13403
  sourceFileContext.sourceFile,
13301
13404
  node,
@@ -13332,7 +13435,7 @@ var LanguageServer = class {
13332
13435
  const node = NodePath.parse(uri.fragment).getNode(sourceFileContext.sourceFile.getSyntaxNode());
13333
13436
  if (node !== void 0) {
13334
13437
  let nodeForRange = node;
13335
- if (node.kind === 91 /* AssignmentStatement */) {
13438
+ if (node.kind === 93 /* AssignmentStatement */) {
13336
13439
  nodeForRange = node.right;
13337
13440
  }
13338
13441
  result = this.convertSourceFileRange(sourceFileContext.sourceFile, nodeForRange.rangeWithoutTrivia);