@artel/artc 0.6.25220 → 0.6.25222

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 (39) hide show
  1. package/build/Cli.js +3 -3
  2. package/build/api/Api.js +6 -4
  3. package/build/api/ApiNodeJS.js +3 -3
  4. package/build/api/ApiServices.js +394 -284
  5. package/build/{chunk-ASXPPFGP.js → chunk-MBMOAUK7.js} +3 -3
  6. package/build/{chunk-RHY36EE7.js → chunk-ODWG5ZXF.js} +4060 -2261
  7. package/build/{chunk-AUDD2JDS.js → chunk-UZK7JCND.js} +3 -3
  8. package/build/types/analysis/Analyzer.d.ts +53 -6
  9. package/build/types/analysis/ControlFlowGraphBuilder.d.ts +121 -0
  10. package/build/types/analysis/ControlFlowGraphVisualizer.d.ts +12 -0
  11. package/build/types/analysis/DiagnosticCollector.d.ts +3 -0
  12. package/build/types/analysis/NodeTypeUtils.d.ts +4 -1
  13. package/build/types/analysis/SemanticContext.d.ts +7 -0
  14. package/build/types/analysis/SemanticContextBuilder.d.ts +2 -0
  15. package/build/types/analysis/StatementBlockScopeBuilder.d.ts +19 -17
  16. package/build/types/analysis/TypeNarrower.d.ts +62 -0
  17. package/build/types/common/Range.d.ts +1 -0
  18. package/build/types/diagnostic/DiagnosticCode.d.ts +131 -123
  19. package/build/types/diagnostic/DiagnosticData.d.ts +2 -1
  20. package/build/types/emitter/IrBuilder.d.ts +3 -1
  21. package/build/types/emitter/IrToJs.d.ts +1 -0
  22. package/build/types/emitter/Transformer.d.ts +2 -0
  23. package/build/types/emitter/ir/Nodes.d.ts +86 -78
  24. package/build/types/emitter/ir/types.d.ts +2 -2
  25. package/build/types/parser/Scanner.d.ts +1 -0
  26. package/build/types/services/CompletionService.d.ts +2 -1
  27. package/build/types/services/DisplayService.d.ts +4 -2
  28. package/build/types/services/NodeSemanticInfo.d.ts +4 -2
  29. package/build/types/tree/KeywordKind.d.ts +41 -40
  30. package/build/types/tree/NodeKind.d.ts +63 -60
  31. package/build/types/tree/green/Nodes.d.ts +124 -86
  32. package/build/types/tree/green/SyntaxFactory.d.ts +12 -10
  33. package/build/types/tree/green/SyntaxToCode.d.ts +1 -0
  34. package/build/types/tree/green/Token.d.ts +1 -1
  35. package/build/types/tree/green/Utils.d.ts +1 -1
  36. package/build/types/tree/red/Nodes.d.ts +103 -63
  37. package/build/types/tree/red/Utils.d.ts +1 -1
  38. package/build/types/types/TypeFactory.d.ts +2 -1
  39. package/package.json +1 -1
@@ -27,6 +27,7 @@ import {
27
27
  Emitter,
28
28
  EntityLocalizationHelper,
29
29
  FileSystemTree,
30
+ FunctionBlock,
30
31
  GeneratedSourceFileScheme,
31
32
  GenericCancellationToken,
32
33
  InMemoryPackageScheme,
@@ -165,6 +166,7 @@ import {
165
166
  getParentSkippingParenthesizedExpressions,
166
167
  isComputedVariableEntity,
167
168
  isIdentifier,
169
+ isNarrowableReferenceExpression,
168
170
  isNonEmptyArray,
169
171
  isSourceOrConfigurationFileName,
170
172
  isTypeEntity,
@@ -180,7 +182,7 @@ import {
180
182
  unwrapParenthesizedExpressions,
181
183
  visitChildren,
182
184
  yieldExecution
183
- } from "../chunk-RHY36EE7.js";
185
+ } from "../chunk-ODWG5ZXF.js";
184
186
 
185
187
  // source/services/CustomCommand.ts
186
188
  import * as ls from "vscode-languageserver";
@@ -317,7 +319,7 @@ var AddPropertyAssignmentService = class {
317
319
  const reassignmentText = `${leftValueText} = ${value}`;
318
320
  const subprogramBody = this.ifShouldBeAssignedAtTheEndOfSubprogramThenBody(assignmentNode);
319
321
  if (subprogramBody !== void 0) {
320
- const lastStatement = subprogramBody.statementList.statements.last();
322
+ const lastStatement = subprogramBody.expression ?? subprogramBody.statementList?.statements.last();
321
323
  let editRangeStart;
322
324
  let indentationText;
323
325
  if (lastStatement !== void 0) {
@@ -368,18 +370,18 @@ var AddPropertyAssignmentService = class {
368
370
  case 74 /* MethodLiteral */:
369
371
  case 53 /* OperatorDeclaration */:
370
372
  return void 0;
371
- case 97 /* RunStatement */:
372
- return this.ifShouldBeAssignedAtTheEndOfSubprogramThenBody(parent);
373
- case 98 /* TryStatement */:
374
- case 99 /* CatchClause */:
375
- case 101 /* FinallyClause */:
376
- case 106 /* ForStatement */:
377
- case 107 /* IfStatement */:
378
- case 109 /* ElseIfClause */:
379
- case 113 /* LoopStatement */:
380
- case 118 /* SwitchStatementCaseClause */:
381
- case 119 /* WhileStatement */:
382
- return this.getContainingSubprogram(parent)?.body;
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 */:
384
+ return this.getContainingSubprogram(parent)?.block;
383
385
  default:
384
386
  Debug.never(parent);
385
387
  }
@@ -570,7 +572,7 @@ var SyntaxFactory = class {
570
572
  static packageVariableGetterDeclaration(tags, modifiers, name, typeSpecifier, body) {
571
573
  const tagList = new TagList(tags);
572
574
  const modifierList = new ModifierList(modifiers);
573
- const getKeyword = this.keyword(57 /* Get */);
575
+ const getKeyword = this.keyword(58 /* Get */);
574
576
  const nameIdentifier = this.createIdentifier(name);
575
577
  const typeAnnotation = this.typeAnnotation(typeSpecifier);
576
578
  return new PackageVariableGetterDeclaration(
@@ -585,7 +587,7 @@ var SyntaxFactory = class {
585
587
  static packageVariableSetterDeclaration(tags, modifiers, name, body) {
586
588
  const tagList = new TagList(tags);
587
589
  const modifierList = new ModifierList(modifiers);
588
- const setKeyword = this.keyword(58 /* Set */);
590
+ const setKeyword = this.keyword(59 /* Set */);
589
591
  const nameIdentifier = this.createIdentifier(name);
590
592
  return new PackageVariableSetterDeclaration(tagList, modifierList, setKeyword, nameIdentifier, body);
591
593
  }
@@ -632,7 +634,7 @@ var SyntaxFactory = class {
632
634
  static typeVariableGetterDeclaration(tags, modifiers, name, typeSpecifier, body) {
633
635
  const tagList = new TagList(tags);
634
636
  const modifierList = new ModifierList(modifiers);
635
- const getKeyword = this.keyword(57 /* Get */);
637
+ const getKeyword = this.keyword(58 /* Get */);
636
638
  const nameIdentifier = this.createIdentifier(name);
637
639
  const typeAnnotation = this.typeAnnotation(typeSpecifier);
638
640
  return new TypeVariableGetterDeclaration(
@@ -647,7 +649,7 @@ var SyntaxFactory = class {
647
649
  static typeVariableSetterDeclaration(tags, modifiers, name, body) {
648
650
  const tagList = new TagList(tags);
649
651
  const modifierList = new ModifierList(modifiers);
650
- const setKeyword = this.keyword(58 /* Set */);
652
+ const setKeyword = this.keyword(59 /* Set */);
651
653
  const nameIdentifier = this.createIdentifier(name);
652
654
  return new TypeVariableSetterDeclaration(tagList, modifierList, setKeyword, nameIdentifier, body);
653
655
  }
@@ -673,21 +675,21 @@ var SyntaxFactory = class {
673
675
  static typeConstructorDeclaration(tags, modifiers, parameters, body) {
674
676
  const tagList = new TagList(tags);
675
677
  const modifierList = new ModifierList(modifiers);
676
- const creationKeyword = this.keyword(29 /* Creation */);
678
+ const creationKeyword = this.keyword(30 /* Creation */);
677
679
  const parameterClause = this.parameterClause(parameters);
678
680
  return new TypeConstructorDeclaration(tagList, modifierList, creationKeyword, parameterClause, body);
679
681
  }
680
682
  static typeDestructorDeclaration(tags, modifiers, parameters, body) {
681
683
  const tagList = new TagList(tags);
682
684
  const modifierList = new ModifierList(modifiers);
683
- const destructionKeyword = this.keyword(46 /* Destruction */);
685
+ const destructionKeyword = this.keyword(47 /* Destruction */);
684
686
  const parameterClause = this.parameterClause(parameters);
685
687
  return new TypeDestructorDeclaration(tagList, modifierList, destructionKeyword, parameterClause, body);
686
688
  }
687
689
  static typeIndexedGetterDeclaration(tags, modifiers, parameters, typeSpecifier, body) {
688
690
  const tagList = new TagList(tags);
689
691
  const modifierList = new ModifierList(modifiers);
690
- const getKeyword = this.keyword(57 /* Get */);
692
+ const getKeyword = this.keyword(58 /* Get */);
691
693
  const parameterClause = this.indexerParameterClause(parameters);
692
694
  const typeAnnotation = this.typeAnnotation(typeSpecifier);
693
695
  return new TypeIndexedGetterDeclaration(
@@ -702,7 +704,7 @@ var SyntaxFactory = class {
702
704
  static typeIndexedSetterDeclaration(tags, modifiers, parameters, body) {
703
705
  const tagList = new TagList(tags);
704
706
  const modifierList = new ModifierList(modifiers);
705
- const getKeyword = this.keyword(58 /* Set */);
707
+ const getKeyword = this.keyword(59 /* Set */);
706
708
  const parameterClause = this.indexerParameterClause(parameters);
707
709
  return new TypeIndexedSetterDeclaration(tagList, modifierList, getKeyword, parameterClause, body);
708
710
  }
@@ -854,8 +856,19 @@ var SyntaxFactory = class {
854
856
  const closeBraceToken = this.token(20 /* CloseBrace */);
855
857
  return new StatementBlock(openBraceToken, statementList, closeBraceToken);
856
858
  }
859
+ static functionExpressionBlock(expression) {
860
+ const openBraceToken = this.token(43 /* OpenBrace */);
861
+ const closeBraceToken = this.token(20 /* CloseBrace */);
862
+ return new FunctionBlock(openBraceToken, expression, void 0, closeBraceToken);
863
+ }
864
+ static functionStatementBlock(statements) {
865
+ const openBraceToken = this.token(43 /* OpenBrace */);
866
+ const statementList = new StatementList(statements);
867
+ const closeBraceToken = this.token(20 /* CloseBrace */);
868
+ return new FunctionBlock(openBraceToken, void 0, statementList, closeBraceToken);
869
+ }
857
870
  static noneLiteral() {
858
- return new KeywordExpression(this.keyword(56 /* None */));
871
+ return new KeywordExpression(this.keyword(57 /* None */));
859
872
  }
860
873
  static integerLiteral(value) {
861
874
  return new TokenExpression(this.token(2 /* IntegerLiteral */, value.toString()));
@@ -863,7 +876,7 @@ var SyntaxFactory = class {
863
876
  static translationsDeclaration(translations) {
864
877
  const tagList = new TagList([]);
865
878
  const modifierList = new ModifierList([]);
866
- const translationsKeyword = this.keyword(54 /* Translations */);
879
+ const translationsKeyword = this.keyword(55 /* Translations */);
867
880
  const openBraceToken = this.token(43 /* OpenBrace */);
868
881
  const translationList = new TopLevelTranslationList(translations);
869
882
  const closeBraceToken = this.token(20 /* CloseBrace */);
@@ -980,7 +993,7 @@ var SyntaxFactory = class {
980
993
  );
981
994
  }
982
995
  static constructorTranslation(sourceParameters, translatedParameters) {
983
- const creationKeyword = this.keyword(29 /* Creation */);
996
+ const creationKeyword = this.keyword(30 /* Creation */);
984
997
  const sourceParameterClause = this.translationParameterClause(sourceParameters);
985
998
  const minusGreaterThanToken = this.token(42 /* MinusGreaterThan */);
986
999
  const translatedParameterClause = this.translationParameterClause(translatedParameters);
@@ -1151,8 +1164,8 @@ var SyntaxToCode = class _SyntaxToCode {
1151
1164
  this.writeWhitespace();
1152
1165
  this.writeToken(node.name);
1153
1166
  this.writeTypeAnnotation(node.typeAnnotation, false);
1154
- if (node.body !== void 0) {
1155
- this.writeDeclarationBody(node.body);
1167
+ if (node.block !== void 0) {
1168
+ this.writeDeclarationBody(node.block);
1156
1169
  }
1157
1170
  }
1158
1171
  writePackageVariableSetterDeclaration(node) {
@@ -1161,8 +1174,8 @@ var SyntaxToCode = class _SyntaxToCode {
1161
1174
  this.writeKeyword(node.setKeyword);
1162
1175
  this.writeWhitespace();
1163
1176
  this.writeToken(node.name);
1164
- if (node.body !== void 0) {
1165
- this.writeDeclarationBody(node.body);
1177
+ if (node.block !== void 0) {
1178
+ this.writeDeclarationBody(node.block);
1166
1179
  }
1167
1180
  }
1168
1181
  writePackageMethodDeclaration(node) {
@@ -1178,8 +1191,8 @@ var SyntaxToCode = class _SyntaxToCode {
1178
1191
  if (node.returnTypeAnnotation !== void 0) {
1179
1192
  this.writeTypeAnnotation(node.returnTypeAnnotation, true);
1180
1193
  }
1181
- if (node.body !== void 0) {
1182
- this.writeDeclarationBody(node.body);
1194
+ if (node.block !== void 0) {
1195
+ this.writeDeclarationBody(node.block);
1183
1196
  }
1184
1197
  }
1185
1198
  writePackageStructuredTypeDeclaration(node) {
@@ -1258,13 +1271,13 @@ var SyntaxToCode = class _SyntaxToCode {
1258
1271
  this.writeDeclarationTags(node.tagList);
1259
1272
  this.writeDeclarationModifiers(node.modifierList);
1260
1273
  this.writeKeyword(node.creationKeyword);
1261
- this.writeDeclarationBody(node.body);
1274
+ this.writeDeclarationBody(node.block);
1262
1275
  }
1263
1276
  writePackageEntryPointDeclaration(node) {
1264
1277
  this.writeDeclarationTags(node.tagList);
1265
1278
  this.writeDeclarationModifiers(node.modifierList);
1266
1279
  this.writeKeyword(node.runKeyword);
1267
- this.writeDeclarationBody(node.body);
1280
+ this.writeDeclarationBody(node.block);
1268
1281
  }
1269
1282
  writeStructuredTypeDeclarationBody(node) {
1270
1283
  this.writeKeyword(node.structuredTypeKindKeyword);
@@ -1328,8 +1341,8 @@ var SyntaxToCode = class _SyntaxToCode {
1328
1341
  this.writeWhitespace();
1329
1342
  this.writeToken(node.name);
1330
1343
  this.writeTypeAnnotation(node.typeAnnotation, false);
1331
- if (node.body !== void 0) {
1332
- this.writeDeclarationBody(node.body);
1344
+ if (node.block !== void 0) {
1345
+ this.writeDeclarationBody(node.block);
1333
1346
  }
1334
1347
  }
1335
1348
  writeTypeVariableSetterDeclaration(node) {
@@ -1338,8 +1351,8 @@ var SyntaxToCode = class _SyntaxToCode {
1338
1351
  this.writeKeyword(node.setKeyword);
1339
1352
  this.writeWhitespace();
1340
1353
  this.writeToken(node.name);
1341
- if (node.body !== void 0) {
1342
- this.writeDeclarationBody(node.body);
1354
+ if (node.block !== void 0) {
1355
+ this.writeDeclarationBody(node.block);
1343
1356
  }
1344
1357
  }
1345
1358
  writeTypeMethodDeclaration(node) {
@@ -1355,8 +1368,8 @@ var SyntaxToCode = class _SyntaxToCode {
1355
1368
  if (node.returnTypeAnnotation !== void 0) {
1356
1369
  this.writeTypeAnnotation(node.returnTypeAnnotation, true);
1357
1370
  }
1358
- if (node.body !== void 0) {
1359
- this.writeDeclarationBody(node.body);
1371
+ if (node.block !== void 0) {
1372
+ this.writeDeclarationBody(node.block);
1360
1373
  }
1361
1374
  }
1362
1375
  writeOperatorDeclaration(node) {
@@ -1369,8 +1382,8 @@ var SyntaxToCode = class _SyntaxToCode {
1369
1382
  if (node.returnTypeAnnotation !== void 0) {
1370
1383
  this.writeTypeAnnotation(node.returnTypeAnnotation, true);
1371
1384
  }
1372
- if (node.body !== void 0) {
1373
- this.writeDeclarationBody(node.body);
1385
+ if (node.block !== void 0) {
1386
+ this.writeDeclarationBody(node.block);
1374
1387
  }
1375
1388
  }
1376
1389
  writeTypeConstructorDeclaration(node) {
@@ -1378,8 +1391,8 @@ var SyntaxToCode = class _SyntaxToCode {
1378
1391
  this.writeDeclarationModifiers(node.modifierList);
1379
1392
  this.writeKeyword(node.creationKeyword);
1380
1393
  this.writeParameterClause(node.parameterClause);
1381
- if (node.body !== void 0) {
1382
- this.writeDeclarationBody(node.body);
1394
+ if (node.block !== void 0) {
1395
+ this.writeDeclarationBody(node.block);
1383
1396
  }
1384
1397
  }
1385
1398
  writeTypeDestructorDeclaration(node) {
@@ -1387,8 +1400,8 @@ var SyntaxToCode = class _SyntaxToCode {
1387
1400
  this.writeDeclarationModifiers(node.modifierList);
1388
1401
  this.writeKeyword(node.destructionKeyword);
1389
1402
  this.writeParameterClause(node.parameterClause);
1390
- if (node.body !== void 0) {
1391
- this.writeDeclarationBody(node.body);
1403
+ if (node.block !== void 0) {
1404
+ this.writeDeclarationBody(node.block);
1392
1405
  }
1393
1406
  }
1394
1407
  writeTypeIndexedGetterDeclaration(node) {
@@ -1400,8 +1413,8 @@ var SyntaxToCode = class _SyntaxToCode {
1400
1413
  this.writeParameterList(node.parameterClause.parameterList);
1401
1414
  this.writeToken(node.parameterClause.closeSquareBracketToken);
1402
1415
  this.writeTypeAnnotation(node.typeAnnotation, false);
1403
- if (node.body !== void 0) {
1404
- this.writeDeclarationBody(node.body);
1416
+ if (node.block !== void 0) {
1417
+ this.writeDeclarationBody(node.block);
1405
1418
  }
1406
1419
  }
1407
1420
  writeTypeIndexedSetterDeclaration(node) {
@@ -1412,8 +1425,8 @@ var SyntaxToCode = class _SyntaxToCode {
1412
1425
  this.writeToken(node.parameterClause.openSquareBracketToken);
1413
1426
  this.writeParameterList(node.parameterClause.parameterList);
1414
1427
  this.writeToken(node.parameterClause.closeSquareBracketToken);
1415
- if (node.body !== void 0) {
1416
- this.writeDeclarationBody(node.body);
1428
+ if (node.block !== void 0) {
1429
+ this.writeDeclarationBody(node.block);
1417
1430
  }
1418
1431
  }
1419
1432
  writeTypeDereferencedVariableGetterDeclaration(node) {
@@ -1423,8 +1436,8 @@ var SyntaxToCode = class _SyntaxToCode {
1423
1436
  this.writeWhitespace();
1424
1437
  this.writeToken(node.caretToken);
1425
1438
  this.writeTypeAnnotation(node.typeAnnotation, false);
1426
- if (node.body !== void 0) {
1427
- this.writeDeclarationBody(node.body);
1439
+ if (node.block !== void 0) {
1440
+ this.writeDeclarationBody(node.block);
1428
1441
  }
1429
1442
  }
1430
1443
  writeTypeDereferencedVariableSetterDeclaration(node) {
@@ -1433,8 +1446,8 @@ var SyntaxToCode = class _SyntaxToCode {
1433
1446
  this.writeKeyword(node.setKeyword);
1434
1447
  this.writeWhitespace();
1435
1448
  this.writeToken(node.caretToken);
1436
- if (node.body !== void 0) {
1437
- this.writeDeclarationBody(node.body);
1449
+ if (node.block !== void 0) {
1450
+ this.writeDeclarationBody(node.block);
1438
1451
  }
1439
1452
  }
1440
1453
  writeVariantDeclaration(node) {
@@ -1659,11 +1672,11 @@ var SyntaxToCode = class _SyntaxToCode {
1659
1672
  this.writeNodeDefault(node);
1660
1673
  }
1661
1674
  writeDeclarationBody(node, addLeadingNewLineOrWhitespace = true) {
1662
- if (node.statementList.elements.length === 0) {
1675
+ if (node.statementList === void 0 || node.statementList.elements.length === 0) {
1663
1676
  this.writeWhitespace();
1664
- this.writeStatementBlock(node, false);
1677
+ this.writeFunctionBlock(node, false);
1665
1678
  } else {
1666
- this.writeStatementBlock(node, true);
1679
+ this.writeFunctionBlock(node, true);
1667
1680
  }
1668
1681
  }
1669
1682
  writeStatementBlock(node, addLeadingNewLineOrWhitespace = true) {
@@ -1672,6 +1685,12 @@ var SyntaxToCode = class _SyntaxToCode {
1672
1685
  }
1673
1686
  this.writeNodeDefault(node);
1674
1687
  }
1688
+ writeFunctionBlock(node, addLeadingNewLineOrWhitespace = true) {
1689
+ if (addLeadingNewLineOrWhitespace) {
1690
+ this.writeNewLineOrWhitespace();
1691
+ }
1692
+ this.writeNodeDefault(node);
1693
+ }
1675
1694
  writeTranslationsDeclaration(node) {
1676
1695
  this.writeKeyword(node.translationsKeyword);
1677
1696
  this.writeNewLineOrWhitespace();
@@ -1995,17 +2014,18 @@ var SyntaxToCode = class _SyntaxToCode {
1995
2014
  [55 /* TypeVariableGetterDeclaration */]: this.prototype.writeTypeVariableGetterDeclaration,
1996
2015
  [56 /* TypeVariableSetterDeclaration */]: this.prototype.writeTypeVariableSetterDeclaration,
1997
2016
  [93 /* StatementBlock */]: this.prototype.writeStatementBlock,
1998
- [132 /* QualifiedName */]: this.prototype.writeQualifiedName,
1999
- [139 /* VariantDeclaration */]: this.prototype.writeVariantDeclaration,
2000
- [140 /* TypeParameterDeclaration */]: this.prototype.writeTypeParameterDeclaration,
2001
- [141 /* ParameterDeclaration */]: this.prototype.writeParameterDeclaration,
2002
- [142 /* Argument */]: this.prototype.writeArgument,
2003
- [144 /* Tag */]: this.prototype.writeTag,
2004
- [146 /* Modifier */]: this.prototype.writeModifier,
2005
- [147 /* ParameterClause */]: this.prototype.writeParameterClause,
2006
- [148 /* ParameterList */]: this.prototype.writeParameterList,
2007
- [149 /* TypeArgumentClause */]: this.prototype.writeTypeArgumentClause,
2008
- [151 /* TypeParameterClause */]: this.prototype.writeTypeParameterClause,
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,
2009
2029
  [17 /* AnonymousMethodTypeDeclaration */]: this.prototype.writeAnonymousMethodTypeDeclaration,
2010
2030
  [18 /* AnonymousStructuredTypeDeclaration */]: this.prototype.writeAnonymousStructuredTypeDeclaration,
2011
2031
  [19 /* AnonymousVariantTypeDeclaration */]: this.prototype.writeAnonymousVariantTypeDeclaration,
@@ -2058,55 +2078,57 @@ var SyntaxToCode = class _SyntaxToCode {
2058
2078
  [90 /* DefaultMatchExpression */]: this.prototype.writeNodeDefault,
2059
2079
  [91 /* AssignmentStatement */]: this.prototype.writeNodeDefault,
2060
2080
  [92 /* StatementList */]: this.prototype.writeNodeDefault,
2061
- [94 /* BreakLoopStatement */]: this.prototype.writeNodeDefault,
2062
- [95 /* ContinueLoopStatement */]: this.prototype.writeNodeDefault,
2063
- [96 /* DisposeStatement */]: this.prototype.writeNodeDefault,
2064
- [97 /* RunStatement */]: this.prototype.writeNodeDefault,
2065
- [98 /* TryStatement */]: this.prototype.writeNodeDefault,
2066
- [99 /* CatchClause */]: this.prototype.writeNodeDefault,
2067
- [100 /* ErrorVariableDeclaration */]: this.prototype.writeNodeDefault,
2068
- [101 /* FinallyClause */]: this.prototype.writeNodeDefault,
2069
- [102 /* EmptyStatement */]: this.prototype.writeNodeDefault,
2070
- [103 /* ErrorStatement */]: this.prototype.writeNodeDefault,
2071
- [104 /* ExpressionStatement */]: this.prototype.writeNodeDefault,
2072
- [105 /* EnumerationVariableList */]: this.prototype.writeNodeDefault,
2073
- [106 /* ForStatement */]: this.prototype.writeNodeDefault,
2074
- [107 /* IfStatement */]: this.prototype.writeNodeDefault,
2075
- [108 /* ElseIfClauseList */]: this.prototype.writeNodeDefault,
2076
- [109 /* ElseIfClause */]: this.prototype.writeNodeDefault,
2077
- [110 /* InvalidStatement */]: this.prototype.writeNodeDefault,
2078
- [111 /* NestedMethodDeclarationStatement */]: this.prototype.writeNodeDefault,
2079
- [112 /* LocalVariableDeclarationStatement */]: this.prototype.writeNodeDefault,
2080
- [113 /* LoopStatement */]: this.prototype.writeNodeDefault,
2081
- [114 /* ReturnStatement */]: this.prototype.writeNodeDefault,
2082
- [115 /* CaseClauseList */]: this.prototype.writeNodeDefault,
2083
- [116 /* SwitchStatement */]: this.prototype.writeNodeDefault,
2084
- [117 /* MatchExpressionList */]: this.prototype.writeNodeDefault,
2085
- [118 /* SwitchStatementCaseClause */]: this.prototype.writeNodeDefault,
2086
- [119 /* WhileStatement */]: this.prototype.writeNodeDefault,
2087
- [120 /* YieldStatement */]: this.prototype.writeNodeDefault,
2088
- [121 /* TranslationParameterList */]: this.prototype.writeNodeDefault,
2089
- [122 /* TranslationParameterClause */]: this.prototype.writeTranslationParameterClause,
2090
- [123 /* ConstructorTranslation */]: this.prototype.writeConstructorTranslation,
2091
- [124 /* IndexerTranslationParameterClause */]: this.prototype.writeIndexerTranslationParameterClause,
2092
- [125 /* IndexerTranslation */]: this.prototype.writeIndexerTranslation,
2093
- [126 /* TranslationTypeParameterList */]: this.prototype.writeNodeDefault,
2094
- [127 /* TranslationTypeParameterClause */]: this.prototype.writeTranslationTypeParameterClause,
2095
- [128 /* PackageMethodTranslation */]: this.prototype.writePackageMethodTranslation,
2096
- [129 /* TypeMethodTranslation */]: this.prototype.writeTypeMethodTranslation,
2097
- [130 /* MethodTypeTranslation */]: this.prototype.writeMethodTypeTranslation,
2098
- [131 /* PackageImportTranslation */]: this.prototype.writePackageImportTranslation,
2099
- [133 /* PackageVariableTranslation */]: this.prototype.writePackageVariableTranslation,
2100
- [134 /* TypeVariableOrVariantTranslation */]: this.prototype.writeTypeVariableOrVariantTranslation,
2101
- [135 /* TypeMemberTranslationList */]: this.prototype.writeNodeDefault,
2102
- [136 /* TypeTranslation */]: this.prototype.writeTypeTranslation,
2103
- [137 /* TextLiteralTranslation */]: this.prototype.writeNodeDefault,
2104
- [138 /* TextTemplateLiteralTranslation */]: this.prototype.writeNodeDefault,
2105
- [143 /* TagList */]: this.prototype.writeNodeDefault,
2106
- [145 /* ModifierList */]: this.prototype.writeNodeDefault,
2107
- [150 /* TypeArgumentList */]: this.prototype.writeNodeDefault,
2108
- [152 /* TypeParameterList */]: this.prototype.writeNodeDefault,
2109
- [153 /* TypeAnnotation */]: 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
2110
2132
  };
2111
2133
  return writeFunctions;
2112
2134
  }
@@ -2117,14 +2139,14 @@ var SyntaxToCode = class _SyntaxToCode {
2117
2139
  }
2118
2140
  };
2119
2141
  var modifierSortOrder = {
2120
- [35 /* Hidden */]: 0,
2121
- [40 /* Static */]: 1,
2142
+ [36 /* Hidden */]: 0,
2143
+ [41 /* Static */]: 1,
2122
2144
  [17 /* Basic */]: 2,
2123
- [37 /* Redefinable */]: 3,
2124
- [36 /* Abstract */]: 4,
2125
- [38 /* Redefined */]: 5,
2126
- [39 /* Async */]: 6,
2127
- [34 /* Const */]: 7
2145
+ [38 /* Redefinable */]: 3,
2146
+ [37 /* Abstract */]: 4,
2147
+ [39 /* Redefined */]: 5,
2148
+ [40 /* Async */]: 6,
2149
+ [35 /* Const */]: 7
2128
2150
  };
2129
2151
 
2130
2152
  // source/services/TreeUtils.ts
@@ -2292,7 +2314,7 @@ var TranslationsGenerationService = class {
2292
2314
  return void 0;
2293
2315
  }
2294
2316
  let result;
2295
- if (tokenOrKeyword.isToken(63 /* Identifier */) && tokenOrKeyword.parent.kind === 136 /* TypeTranslation */ && tokenOrKeyword.value === tokenOrKeyword.parent.sourceName) {
2317
+ if (tokenOrKeyword.isToken(63 /* Identifier */) && tokenOrKeyword.parent.kind === 139 /* TypeTranslation */ && tokenOrKeyword.value === tokenOrKeyword.parent.sourceName) {
2296
2318
  const translationPackage = analyzer.getAnalyzedTranslationPackageIfTargetResolved(sourceFile.package);
2297
2319
  if (translationPackage !== void 0) {
2298
2320
  const generator = new TranslationsGenerator(
@@ -2304,7 +2326,7 @@ var TranslationsGenerationService = class {
2304
2326
  result = generator.generateMissingTypeMemberTranslations(tokenOrKeyword.parent);
2305
2327
  }
2306
2328
  }
2307
- if (result === void 0 && tokenOrKeyword.isKeyword(54 /* Translations */) && tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */) {
2329
+ if (result === void 0 && tokenOrKeyword.isKeyword(55 /* Translations */) && tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */) {
2308
2330
  const translationPackage = analyzer.getAnalyzedTranslationPackageIfTargetResolved(sourceFile.package);
2309
2331
  if (translationPackage !== void 0) {
2310
2332
  const generator = new TranslationsGenerator(
@@ -2330,7 +2352,7 @@ var TranslationsGenerationService = class {
2330
2352
  if (tokenOrKeyword === void 0) {
2331
2353
  return false;
2332
2354
  }
2333
- if (!(tokenOrKeyword.isKeyword(54 /* Translations */) && tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */)) {
2355
+ if (!(tokenOrKeyword.isKeyword(55 /* Translations */) && tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */)) {
2334
2356
  return false;
2335
2357
  }
2336
2358
  const translationPackage = analyzer.getAnalyzedTranslationPackageIfTargetResolved(sourceFile.package);
@@ -2338,7 +2360,7 @@ var TranslationsGenerationService = class {
2338
2360
  return false;
2339
2361
  }
2340
2362
  const generator = new TranslationsGenerator(analyzer, sourceFile, translationPackage, sourceFile.package.dialect);
2341
- return Query.from(tokenOrKeyword.parent.translationList.translationDeclarations).filter((t) => t.kind === 136 /* TypeTranslation */).mapAndFilter((t) => translationPackage.getTypeTranslationTarget(t).target).any((t) => generator.collectNotTranslatedTypeMembers(t).length > 0);
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);
2342
2364
  }
2343
2365
  };
2344
2366
  var TranslationsGenerator = class _TranslationsGenerator {
@@ -2365,7 +2387,7 @@ var TranslationsGenerator = class _TranslationsGenerator {
2365
2387
  };
2366
2388
  const memberTranslationsCode = Query.from(memberEntities).mapAndFilter((m) => this.createPackageMemberTranslationNode(m)).uniqueWithComparator(compareNodes).map((n) => {
2367
2389
  const code = new SyntaxToCode(n, syntaxToCodeOptions).convert();
2368
- if (n.kind === 136 /* TypeTranslation */) {
2390
+ if (n.kind === 139 /* TypeTranslation */) {
2369
2391
  const startOffset = Math.max(code.indexOf(newLine), 0);
2370
2392
  return this.addNewLineBeforeArrowsInTranslation(
2371
2393
  code,
@@ -2397,7 +2419,7 @@ var TranslationsGenerator = class _TranslationsGenerator {
2397
2419
  generateMissingTranslationsForPartiallyTranslatedTypes(translationsDeclaration) {
2398
2420
  const result = new Array();
2399
2421
  for (const translation of translationsDeclaration.translationList.translationDeclarations) {
2400
- if (translation.kind === 136 /* TypeTranslation */) {
2422
+ if (translation.kind === 139 /* TypeTranslation */) {
2401
2423
  const edits = this.generateMissingTypeMemberTranslations(translation);
2402
2424
  if (edits !== void 0) {
2403
2425
  result.push(...edits);
@@ -2494,13 +2516,13 @@ var TranslationsGenerator = class _TranslationsGenerator {
2494
2516
  }
2495
2517
  detectIndentationStepForTypeMemberTranslations(node) {
2496
2518
  let indentationStepSize;
2497
- if (node.kind === 136 /* TypeTranslation */) {
2519
+ if (node.kind === 139 /* TypeTranslation */) {
2498
2520
  indentationStepSize = tryDetectIndentationStepSizeUsingTypeTranslation(node, this._sourceFile);
2499
2521
  }
2500
2522
  if (indentationStepSize === void 0) {
2501
2523
  const translationsDeclarations = node.kind === 21 /* TranslationsDeclaration */ ? node : node.parent.parent;
2502
2524
  for (const member of translationsDeclarations.translationList.translationDeclarations) {
2503
- if (member.kind === 136 /* TypeTranslation */) {
2525
+ if (member.kind === 139 /* TypeTranslation */) {
2504
2526
  indentationStepSize = tryDetectIndentationStepSizeUsingTypeTranslation(member, this._sourceFile);
2505
2527
  if (indentationStepSize !== void 0) {
2506
2528
  break;
@@ -2682,7 +2704,7 @@ var CodeActionsService = class {
2682
2704
  }
2683
2705
  const result = new Array();
2684
2706
  const diagnosticCodeSet = new Set(diagnosticCodes);
2685
- if (diagnosticCodeSet.has(104 /* TheFollowingDeclarationsAreNotTranslated0 */) || diagnosticCodeSet.has(105 /* TheFollowingDeclarationAreNotTranslated0And1More */)) {
2707
+ if (diagnosticCodeSet.has(109 /* TheFollowingDeclarationsAreNotTranslated0 */) || diagnosticCodeSet.has(110 /* TheFollowingDeclarationAreNotTranslated0And1More */)) {
2686
2708
  const data = { onlyTypeMembers: false };
2687
2709
  result.push(CodeAction.unresolved(
2688
2710
  "\u0421\u0433\u0435\u043D\u0435\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043D\u0435\u0434\u043E\u0441\u0442\u0430\u044E\u0449\u0438\u0435 \u043F\u0435\u0440\u0435\u0432\u043E\u0434\u044B.",
@@ -2787,7 +2809,7 @@ var SignatureForNode = class _SignatureForNode {
2787
2809
  return _SignatureForNode.getSignaturesForAutotypeCallExpression(analyzer, node);
2788
2810
  case 71 /* IndexedAccessExpression */:
2789
2811
  return _SignatureForNode.getSignaturesForIndexedAccessExpression(analyzer, node);
2790
- case 144 /* Tag */:
2812
+ case 147 /* Tag */:
2791
2813
  return _SignatureForNode.getSignaturesForTag(analyzer, node);
2792
2814
  default:
2793
2815
  Debug.never(node);
@@ -3222,7 +3244,7 @@ var CompletionService = class {
3222
3244
  typeExtensionLookup
3223
3245
  );
3224
3246
  }
3225
- if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 132 /* QualifiedName */ && tokenOrKeyword.parent.parent.kind === 10 /* NamedTypeSpecifier */) {
3247
+ if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 135 /* QualifiedName */ && tokenOrKeyword.parent.parent.kind === 10 /* NamedTypeSpecifier */) {
3226
3248
  const namedTypeSpecifier = tokenOrKeyword.parent.parent;
3227
3249
  const resolutionResult = this._analyzer.resolveNamedTypeSpecifier(namedTypeSpecifier);
3228
3250
  const segmentIndex = Math.floor(
@@ -3264,7 +3286,7 @@ var CompletionService = class {
3264
3286
  }
3265
3287
  return { kind: "none" };
3266
3288
  }
3267
- if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 132 /* QualifiedName */ && tokenOrKeyword.parent.parent.kind === 144 /* Tag */) {
3289
+ if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 135 /* QualifiedName */ && tokenOrKeyword.parent.parent.kind === 147 /* Tag */) {
3268
3290
  const tag = tokenOrKeyword.parent.parent;
3269
3291
  const resolutionResult = this._analyzer.resolveTag(tag);
3270
3292
  const segmentIndex = Math.floor(
@@ -3357,17 +3379,17 @@ var CompletionService = class {
3357
3379
  translationKind = 0 /* Any */;
3358
3380
  hasPrecedingKeyword = false;
3359
3381
  }
3360
- if (tokenOrKeyword.isKeyword(18 /* Import */) && tokenOrKeyword.parent.kind === 131 /* PackageImportTranslation */) {
3382
+ if (tokenOrKeyword.isKeyword(18 /* Import */) && tokenOrKeyword.parent.kind === 134 /* PackageImportTranslation */) {
3361
3383
  translationsDeclaration = tokenOrKeyword.parent.parent.parent;
3362
3384
  translationKind = 1 /* PackageImport */;
3363
3385
  hasPrecedingKeyword = true;
3364
3386
  }
3365
- if (tokenOrKeyword.isKeyword(16 /* Type */) && (tokenOrKeyword.parent.kind === 136 /* TypeTranslation */ || tokenOrKeyword.parent.kind === 130 /* MethodTypeTranslation */)) {
3387
+ if (tokenOrKeyword.isKeyword(16 /* Type */) && (tokenOrKeyword.parent.kind === 139 /* TypeTranslation */ || tokenOrKeyword.parent.kind === 133 /* MethodTypeTranslation */)) {
3366
3388
  translationsDeclaration = tokenOrKeyword.parent.parent.parent;
3367
3389
  translationKind = 3 /* Type */;
3368
3390
  hasPrecedingKeyword = true;
3369
3391
  }
3370
- if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 128 /* PackageMethodTranslation */) {
3392
+ if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 131 /* PackageMethodTranslation */) {
3371
3393
  translationsDeclaration = tokenOrKeyword.parent.parent.parent;
3372
3394
  translationKind = 2 /* Method */;
3373
3395
  hasPrecedingKeyword = true;
@@ -3387,9 +3409,9 @@ var CompletionService = class {
3387
3409
  hasPrecedingKeyword
3388
3410
  );
3389
3411
  }
3390
- if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 132 /* QualifiedName */) {
3412
+ if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 135 /* QualifiedName */) {
3391
3413
  const qualifiedName = tokenOrKeyword.parent;
3392
- if (qualifiedName.parent.kind === 131 /* PackageImportTranslation */ && qualifiedName === qualifiedName.parent.sourceName) {
3414
+ if (qualifiedName.parent.kind === 134 /* PackageImportTranslation */ && qualifiedName === qualifiedName.parent.sourceName) {
3393
3415
  const precedingSegmentNames = qualifiedName.qualifiers.takeWhile((s) => s.rangeStart < tokenOrKeyword.value.rangeStart).map((p) => this._analyzer.createNameFromIdentifier(p)).toArray();
3394
3416
  const sourceLocale = translationPackage.getTranslatedPackage().getLocale();
3395
3417
  return new PackageImportCompletionContext(precedingSegmentNames, { sourceLocale });
@@ -3414,12 +3436,12 @@ var CompletionService = class {
3414
3436
  translationKind = 0 /* Any */;
3415
3437
  hasPrecedingKeyword = false;
3416
3438
  }
3417
- if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 129 /* TypeMethodTranslation */) {
3439
+ if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 132 /* TypeMethodTranslation */) {
3418
3440
  typeTranslation = tokenOrKeyword.parent.parent.parent;
3419
3441
  translationKind = 1 /* Method */;
3420
3442
  hasPrecedingKeyword = true;
3421
3443
  }
3422
- if (tokenOrKeyword.isKeyword(29 /* Creation */) && tokenOrKeyword.parent.kind === 123 /* ConstructorTranslation */) {
3444
+ if (tokenOrKeyword.isKeyword(30 /* Creation */) && tokenOrKeyword.parent.kind === 126 /* ConstructorTranslation */) {
3423
3445
  typeTranslation = tokenOrKeyword.parent.parent.parent;
3424
3446
  translationKind = 3 /* Constructor */;
3425
3447
  hasPrecedingKeyword = true;
@@ -3459,7 +3481,7 @@ var CompletionService = class {
3459
3481
  role.argumentList.parent
3460
3482
  );
3461
3483
  break;
3462
- case 144 /* Tag */:
3484
+ case 147 /* Tag */:
3463
3485
  signatures = SignatureForNode.getSignaturesForTag(this._analyzer, role.argumentList.parent);
3464
3486
  valueArguments = ValueArgumentFactory.createValueArgumentsOfTag(role.argumentList.parent);
3465
3487
  break;
@@ -3503,6 +3525,13 @@ var CompletionService = class {
3503
3525
  }
3504
3526
  return { targetTypes: void 0, targetSignaturesParameters: void 0 };
3505
3527
  }
3528
+ if (role.kind === "function-block-expression") {
3529
+ const targetType = semanticContext.getContainingSubprogram()?.getReturnType();
3530
+ if (targetType !== void 0 && !targetType.equals(this._analyzer.standardTypes.none)) {
3531
+ return { targetTypes: [targetType], targetSignaturesParameters: void 0 };
3532
+ }
3533
+ return { targetTypes: void 0, targetSignaturesParameters: void 0 };
3534
+ }
3506
3535
  if (role.kind === "other") {
3507
3536
  if (role.expressionForTargetType !== void 0) {
3508
3537
  const targetType = this._analyzer.getTargetTypeOfExpression(role.expressionForTargetType);
@@ -3592,22 +3621,22 @@ var CompletionService = class {
3592
3621
  }
3593
3622
  const kinds = /* @__PURE__ */ new Set();
3594
3623
  if (syntaxContext.isPackageMemberDeclarationListContext) {
3595
- kinds.add(18 /* Import */).add(7 /* Run */).add(29 /* Creation */).add(12 /* Function */).add(17 /* Basic */).add(16 /* Type */).add(57 /* Get */).add(58 /* Set */).add(54 /* Translations */);
3624
+ kinds.add(18 /* Import */).add(7 /* Run */).add(30 /* Creation */).add(12 /* Function */).add(17 /* Basic */).add(16 /* Type */).add(58 /* Get */).add(59 /* Set */).add(55 /* Translations */);
3596
3625
  }
3597
3626
  if (syntaxContext.isPackageMemberDeclarationListContext || syntaxContext.isTypeMemberDeclarationListContext) {
3598
- kinds.add(35 /* Hidden */).add(40 /* Static */).add(37 /* Redefinable */).add(36 /* Abstract */).add(38 /* Redefined */).add(39 /* Async */).add(34 /* Const */);
3627
+ kinds.add(36 /* Hidden */).add(41 /* Static */).add(38 /* Redefinable */).add(37 /* Abstract */).add(39 /* Redefined */).add(40 /* Async */).add(35 /* Const */);
3599
3628
  }
3600
3629
  if (syntaxContext.isTypeMemberDeclarationListContext) {
3601
- kinds.add(29 /* Creation */).add(12 /* Function */).add(46 /* Destruction */).add(57 /* Get */).add(58 /* Set */);
3630
+ kinds.add(30 /* Creation */).add(12 /* Function */).add(47 /* Destruction */).add(58 /* Get */).add(59 /* Set */);
3602
3631
  }
3603
3632
  if (syntaxContext.isStatementContext) {
3604
- kinds.add(7 /* Run */).add(33 /* For */).add(24 /* While */).add(25 /* Loop */).add(15 /* Return */).add(19 /* Error */).add(27 /* Yield */).add(31 /* BreakLoop */).add(32 /* ContinueLoop */).add(13 /* If */).add(43 /* Switch */).add(1 /* Let */).add(34 /* Const */).add(45 /* Dispose */).add(12 /* Function */).add(39 /* Async */);
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 */);
3605
3634
  }
3606
3635
  if (this.isFromKeywordContext(positionDescription)) {
3607
3636
  kinds.add(9 /* From */);
3608
3637
  }
3609
3638
  if (syntaxContext.isExpressionContext !== void 0) {
3610
- kinds.add(42 /* Not */).add(51 /* Yes */).add(52 /* No */).add(56 /* None */).add(39 /* Async */).add(12 /* Function */).add(53 /* Reference */).add(2 /* Autotype */);
3639
+ kinds.add(43 /* Not */).add(52 /* Yes */).add(53 /* No */).add(57 /* None */).add(40 /* Async */).add(12 /* Function */).add(54 /* Reference */).add(2 /* Autotype */);
3611
3640
  if (positionDescription.kind === "after-token-or-keyword") {
3612
3641
  const container = semanticContext.getContainingTypeOrTypeExtension();
3613
3642
  if (container !== void 0) {
@@ -3615,37 +3644,40 @@ var CompletionService = class {
3615
3644
  if (container.kind === "type") {
3616
3645
  const typeEntity = container.value;
3617
3646
  if (typeEntity?.typeEntityKind === 1 /* Structured */ && typeEntity.getBaseObjectType() !== void 0 || typeEntity?.typeEntityKind === 3 /* Variant */ || typeEntity?.typeEntityKind === 4 /* Alias */) {
3618
- kinds.add(55 /* Base */);
3647
+ kinds.add(56 /* Base */);
3619
3648
  }
3620
3649
  }
3621
3650
  }
3622
3651
  }
3623
3652
  }
3624
3653
  if (this.isTypeKindCompletionContext(positionDescription)) {
3625
- kinds.add(4 /* Object */).add(5 /* PlainObject */).add(3 /* Aspect */).add(6 /* Variant */).add(12 /* Function */).add(39 /* Async */);
3654
+ kinds.add(4 /* Object */).add(5 /* PlainObject */).add(3 /* Aspect */).add(6 /* Variant */).add(12 /* Function */).add(40 /* Async */);
3626
3655
  }
3627
3656
  if (this.isCaseKeywordContext(positionDescription, syntaxContext)) {
3628
- kinds.add(44 /* Case */);
3657
+ kinds.add(45 /* Case */);
3658
+ }
3659
+ if (this.isCatchKeywordContext(positionDescription)) {
3660
+ kinds.add(31 /* Catch */);
3629
3661
  }
3630
- if (this.isRunStatementAccessorListContext(positionDescription)) {
3631
- kinds.add(30 /* Catch */).add(20 /* Finally */);
3662
+ if (this.isFinallyKeywordContext(positionDescription)) {
3663
+ kinds.add(21 /* Finally */);
3632
3664
  }
3633
3665
  if (this.isElseOrElseIfKeywordContext(positionDescription)) {
3634
3666
  kinds.add(10 /* Else */).add(11 /* ElseIf */);
3635
3667
  }
3636
3668
  if (syntaxContext.precedingExpression !== void 0) {
3637
- kinds.add(41 /* As */).add(14 /* Is */).add(21 /* And */).add(22 /* Or */).add(23 /* Xor */).add(28 /* When */);
3669
+ kinds.add(42 /* As */).add(14 /* Is */).add(22 /* And */).add(23 /* Or */).add(24 /* Xor */).add(29 /* When */);
3638
3670
  }
3639
3671
  if (this.isModifierLevelContext(positionDescription)) {
3640
- kinds.add(50 /* InType */).add(47 /* InHierarchy */).add(48 /* InFile */).add(49 /* InPackage */);
3672
+ kinds.add(51 /* InType */).add(48 /* InHierarchy */).add(49 /* InFile */).add(50 /* InPackage */);
3641
3673
  }
3642
3674
  if (this.isRepeatWhileKeywordContext(positionDescription)) {
3643
- kinds.add(26 /* RepeatWhile */);
3675
+ kinds.add(27 /* RepeatWhile */);
3644
3676
  }
3645
3677
  if (syntaxContext.isUnqualifiedTypeContext?.allowsAnonymousTypes === true) {
3646
- kinds.add(5 /* PlainObject */).add(4 /* Object */).add(6 /* Variant */).add(3 /* Aspect */).add(12 /* Function */).add(39 /* Async */);
3678
+ kinds.add(5 /* PlainObject */).add(4 /* Object */).add(6 /* Variant */).add(3 /* Aspect */).add(12 /* Function */).add(40 /* Async */);
3647
3679
  }
3648
- if (positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isKeyword(39 /* Async */) && (positionDescription.tokenOrKeyword.parent.kind === 58 /* NestedMethodDeclaration */ || positionDescription.tokenOrKeyword.parent.kind === 74 /* MethodLiteral */ || positionDescription.tokenOrKeyword.parent.kind === 29 /* MethodTypeDeclarationBody */)) {
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 */)) {
3649
3681
  kinds.add(12 /* Function */);
3650
3682
  }
3651
3683
  return Query.from(kinds.values()).map(
@@ -3657,28 +3689,35 @@ var CompletionService = class {
3657
3689
  return false;
3658
3690
  }
3659
3691
  const tokenOrKeyword = positionDescription.tokenOrKeyword;
3660
- return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 113 /* LoopStatement */;
3692
+ return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 116 /* LoopStatement */;
3661
3693
  }
3662
3694
  isModifierLevelContext(positionDescription) {
3663
3695
  if (positionDescription.kind !== "after-token-or-keyword") {
3664
3696
  return false;
3665
3697
  }
3666
3698
  const tokenOrKeyword = positionDescription.tokenOrKeyword;
3667
- return tokenOrKeyword.isToken(44 /* OpenParenthesis */) && tokenOrKeyword.parent.kind === 146 /* Modifier */;
3699
+ return tokenOrKeyword.isToken(44 /* OpenParenthesis */) && tokenOrKeyword.parent.kind === 149 /* Modifier */;
3668
3700
  }
3669
3701
  isElseOrElseIfKeywordContext(positionDescription) {
3670
3702
  if (positionDescription.kind !== "after-token-or-keyword") {
3671
3703
  return false;
3672
3704
  }
3673
3705
  const tokenOrKeyword = positionDescription.tokenOrKeyword;
3674
- return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind === 107 /* IfStatement */ && tokenOrKeyword.parent === tokenOrKeyword.parent.parent.thenBlock || tokenOrKeyword.parent.parent.kind === 109 /* ElseIfClause */);
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 */);
3675
3707
  }
3676
- isRunStatementAccessorListContext(positionDescription) {
3708
+ isCatchKeywordContext(positionDescription) {
3677
3709
  if (positionDescription.kind !== "after-token-or-keyword") {
3678
3710
  return false;
3679
3711
  }
3680
3712
  const tokenOrKeyword = positionDescription.tokenOrKeyword;
3681
- return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind === 97 /* RunStatement */ || tokenOrKeyword.parent.parent.kind === 99 /* CatchClause */ || tokenOrKeyword.parent.parent.kind === 101 /* FinallyClause */);
3713
+ return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 99 /* TryStatement */;
3714
+ }
3715
+ isFinallyKeywordContext(positionDescription) {
3716
+ if (positionDescription.kind !== "after-token-or-keyword") {
3717
+ return false;
3718
+ }
3719
+ 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 */);
3682
3721
  }
3683
3722
  isTypeKindCompletionContext(positionDescription) {
3684
3723
  return positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isToken(57 /* Equals */) && NodeTypeUtils.isPackageTypeDeclaration(positionDescription.tokenOrKeyword.parent);
@@ -3695,10 +3734,10 @@ var CompletionService = class {
3695
3734
  return false;
3696
3735
  }
3697
3736
  const tokenOrKeyword = positionDescription.tokenOrKeyword;
3698
- if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 118 /* SwitchStatementCaseClause */) {
3737
+ if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 121 /* CaseClause */) {
3699
3738
  return true;
3700
3739
  }
3701
- if (syntaxContext.precedingExpression !== void 0 && syntaxContext.precedingExpression.parent.kind === 116 /* SwitchStatement */) {
3740
+ if (syntaxContext.precedingExpression !== void 0 && syntaxContext.precedingExpression.parent.kind === 119 /* SwitchStatement */) {
3702
3741
  return true;
3703
3742
  }
3704
3743
  return false;
@@ -4203,7 +4242,7 @@ var CompletionService = class {
4203
4242
  if (!ctx.hasPrecedingKeyword) {
4204
4243
  const keywords = [
4205
4244
  12 /* Function */,
4206
- 29 /* Creation */
4245
+ 30 /* Creation */
4207
4246
  ];
4208
4247
  result = result.chain(
4209
4248
  Query.from(keywords).map(
@@ -4366,7 +4405,7 @@ function isInvalidNode(node) {
4366
4405
  switch (node.kind) {
4367
4406
  case 72 /* InvalidExpression */:
4368
4407
  case 43 /* InvalidPackageMemberDeclaration */:
4369
- case 110 /* InvalidStatement */:
4408
+ case 113 /* InvalidStatement */:
4370
4409
  case 57 /* InvalidTypeMemberDeclaration */:
4371
4410
  case 16 /* InvalidTypeSpecifier */:
4372
4411
  return true;
@@ -5058,7 +5097,7 @@ var AliasesSourceTypeConstructorCompletionItemInfo = class {
5058
5097
  Localization.Original.ofEntity(this.constructor_)
5059
5098
  );
5060
5099
  const displayParts = this.displayService.getConstructorDeclarationDisplayParts(constructorDeclaration);
5061
- const creationKeyword = this.displayService.displayKeyword(29 /* Creation */);
5100
+ const creationKeyword = this.displayService.displayKeyword(30 /* Creation */);
5062
5101
  return creationKeyword + displayParts.valueParametersStart + displayParts.valueParameters.map((p) => p.toString()).join(displayParts.valueParameterSeparator) + displayParts.valueParametersEnd;
5063
5102
  });
5064
5103
  }
@@ -5072,7 +5111,7 @@ var AliasesSourceTypeConstructorCompletionItemInfo = class {
5072
5111
  return this.label;
5073
5112
  }
5074
5113
  getInsertText() {
5075
- const creationKeyword = this.includeOnCreateKeyword ? this.displayService.displayKeyword(29 /* Creation */) : "";
5114
+ const creationKeyword = this.includeOnCreateKeyword ? this.displayService.displayKeyword(30 /* Creation */) : "";
5076
5115
  const parameters = this.constructor_.getValueParameters().map((p) => this.ctx.getInsertTextForName(p.getName(), true)).join(", ");
5077
5116
  return `${creationKeyword}(${parameters})`;
5078
5117
  }
@@ -5150,6 +5189,12 @@ var ExpressionRole_returnedValue = class {
5150
5189
  this.kind = "returned-value";
5151
5190
  }
5152
5191
  };
5192
+ var ExpressionRole_functionBlockExpression = class {
5193
+ constructor(functionBlock) {
5194
+ this.functionBlock = functionBlock;
5195
+ this.kind = "function-block-expression";
5196
+ }
5197
+ };
5153
5198
  var ExpressionRole_other = class {
5154
5199
  constructor(expressionForTargetType) {
5155
5200
  this.expressionForTargetType = expressionForTargetType;
@@ -5186,7 +5231,7 @@ var SyntaxContextFactory = class {
5186
5231
  if (positionDescription.kind === "after-token-or-keyword") {
5187
5232
  isUnqualifiedTypeContext = this.isUnqualifiedTypeContext(positionDescription.tokenOrKeyword);
5188
5233
  }
5189
- const isUnqualifiedTagNameCompletionContext = positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isToken(35 /* HashSign */) && positionDescription.tokenOrKeyword.parent.kind === 144 /* Tag */;
5234
+ const isUnqualifiedTagNameCompletionContext = positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isToken(35 /* HashSign */) && positionDescription.tokenOrKeyword.parent.kind === 147 /* Tag */;
5190
5235
  let isTopLevelTranslationListContext;
5191
5236
  if (positionDescription.kind === "after-token-or-keyword") {
5192
5237
  isTopLevelTranslationListContext = this.isTopLevelTranslationListContext(positionDescription.tokenOrKeyword);
@@ -5228,15 +5273,15 @@ var SyntaxContextFactory = class {
5228
5273
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.initializer);
5229
5274
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5230
5275
  }
5231
- if (tokenOrKeyword.parent.kind === 141 /* ParameterDeclaration */) {
5276
+ if (tokenOrKeyword.parent.kind === 144 /* ParameterDeclaration */) {
5232
5277
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.defaultValue);
5233
5278
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5234
5279
  }
5235
- if (tokenOrKeyword.parent.kind === 142 /* Argument */) {
5280
+ if (tokenOrKeyword.parent.kind === 145 /* Argument */) {
5236
5281
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.value);
5237
5282
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5238
5283
  }
5239
- if (tokenOrKeyword.parent.kind === 139 /* VariantDeclaration */) {
5284
+ if (tokenOrKeyword.parent.kind === 142 /* VariantDeclaration */) {
5240
5285
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.value);
5241
5286
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5242
5287
  }
@@ -5272,6 +5317,20 @@ var SyntaxContextFactory = class {
5272
5317
  if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */) {
5273
5318
  return { isExpressionContext: { expressionRole: new ExpressionRole_other(void 0) }, isStatementContext: true };
5274
5319
  }
5320
+ if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 94 /* FunctionBlock */) {
5321
+ const block = tokenOrKeyword.parent;
5322
+ if (block.expression !== void 0 || block.statementList?.statements.count() === 0) {
5323
+ return {
5324
+ isExpressionContext: { expressionRole: new ExpressionRole_functionBlockExpression(block) },
5325
+ isStatementContext: true
5326
+ };
5327
+ } else {
5328
+ return {
5329
+ isExpressionContext: { expressionRole: new ExpressionRole_other(void 0) },
5330
+ isStatementContext: true
5331
+ };
5332
+ }
5333
+ }
5275
5334
  if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 92 /* StatementList */) {
5276
5335
  return { isExpressionContext: { expressionRole: new ExpressionRole_other(void 0) }, isStatementContext: true };
5277
5336
  }
@@ -5292,7 +5351,7 @@ var SyntaxContextFactory = class {
5292
5351
  const expressionRole = new ExpressionRole_argument(tokenOrKeyword.parent.argumentList, 0);
5293
5352
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5294
5353
  }
5295
- if (tokenOrKeyword.parent.kind === 144 /* Tag */) {
5354
+ if (tokenOrKeyword.parent.kind === 147 /* Tag */) {
5296
5355
  const argumentList = tokenOrKeyword.parent.argumentList;
5297
5356
  if (argumentList !== void 0) {
5298
5357
  const expressionRole = new ExpressionRole_argument(argumentList, 0);
@@ -5323,7 +5382,7 @@ var SyntaxContextFactory = class {
5323
5382
  const expressionRole = new ExpressionRole_argument(argumentList, index);
5324
5383
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5325
5384
  }
5326
- if (tokenOrKeyword.parent.kind === 117 /* MatchExpressionList */) {
5385
+ if (tokenOrKeyword.parent.kind === 120 /* MatchExpressionList */) {
5327
5386
  const expressionRole = new ExpressionRole_matchListElement(tokenOrKeyword.parent.parent.parent.parent);
5328
5387
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5329
5388
  }
@@ -5332,43 +5391,43 @@ var SyntaxContextFactory = class {
5332
5391
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5333
5392
  }
5334
5393
  }
5335
- if (tokenOrKeyword.isKeyword(44 /* Case */) && tokenOrKeyword.parent.kind === 118 /* SwitchStatementCaseClause */) {
5394
+ if (tokenOrKeyword.isKeyword(45 /* Case */) && tokenOrKeyword.parent.kind === 121 /* CaseClause */) {
5336
5395
  const expressionRole = new ExpressionRole_matchListElement(tokenOrKeyword.parent.parent.parent);
5337
5396
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5338
5397
  }
5339
- if (tokenOrKeyword.isKeyword(15 /* Return */) && tokenOrKeyword.parent.kind === 114 /* ReturnStatement */) {
5398
+ if (tokenOrKeyword.isKeyword(15 /* Return */) && tokenOrKeyword.parent.kind === 117 /* ReturnStatement */) {
5340
5399
  const expressionRole = new ExpressionRole_returnedValue(tokenOrKeyword.parent);
5341
5400
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5342
5401
  }
5343
- if (tokenOrKeyword.isKeyword(43 /* Switch */) && tokenOrKeyword.parent.kind === 116 /* SwitchStatement */) {
5402
+ if (tokenOrKeyword.isKeyword(44 /* Switch */) && tokenOrKeyword.parent.kind === 119 /* SwitchStatement */) {
5344
5403
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
5345
5404
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5346
5405
  }
5347
- if (tokenOrKeyword.isKeyword(13 /* If */) && tokenOrKeyword.parent.kind === 107 /* IfStatement */) {
5406
+ if (tokenOrKeyword.isKeyword(13 /* If */) && tokenOrKeyword.parent.kind === 109 /* IfStatement */) {
5348
5407
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
5349
5408
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5350
5409
  }
5351
- if (tokenOrKeyword.isKeyword(11 /* ElseIf */) && tokenOrKeyword.parent.kind === 109 /* ElseIfClause */) {
5410
+ if (tokenOrKeyword.isKeyword(11 /* ElseIf */) && tokenOrKeyword.parent.kind === 111 /* ElseIfClause */) {
5352
5411
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
5353
5412
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5354
5413
  }
5355
- if (tokenOrKeyword.isKeyword(9 /* From */) && tokenOrKeyword.parent.kind === 106 /* ForStatement */) {
5414
+ if (tokenOrKeyword.isKeyword(9 /* From */) && tokenOrKeyword.parent.kind === 108 /* ForStatement */) {
5356
5415
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.enumeratedExpression);
5357
5416
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5358
5417
  }
5359
- if (tokenOrKeyword.isKeyword(24 /* While */) && tokenOrKeyword.parent.kind === 119 /* WhileStatement */) {
5418
+ if (tokenOrKeyword.isKeyword(25 /* While */) && tokenOrKeyword.parent.kind === 122 /* WhileStatement */) {
5360
5419
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
5361
5420
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5362
5421
  }
5363
- if (tokenOrKeyword.isKeyword(26 /* RepeatWhile */) && tokenOrKeyword.parent.kind === 113 /* LoopStatement */) {
5422
+ if (tokenOrKeyword.isKeyword(27 /* RepeatWhile */) && tokenOrKeyword.parent.kind === 116 /* LoopStatement */) {
5364
5423
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
5365
5424
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5366
5425
  }
5367
- if (tokenOrKeyword.isKeyword(27 /* Yield */) && tokenOrKeyword.parent.kind === 120 /* YieldStatement */) {
5426
+ if (tokenOrKeyword.isKeyword(28 /* Yield */) && tokenOrKeyword.parent.kind === 123 /* YieldStatement */) {
5368
5427
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
5369
5428
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5370
5429
  }
5371
- if (tokenOrKeyword.isKeyword(28 /* When */) && tokenOrKeyword.parent.kind === 76 /* WhenTernaryExpression */) {
5430
+ if (tokenOrKeyword.isKeyword(29 /* When */) && tokenOrKeyword.parent.kind === 76 /* WhenTernaryExpression */) {
5372
5431
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
5373
5432
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5374
5433
  }
@@ -5394,7 +5453,7 @@ var SyntaxContextFactory = class {
5394
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 */)) {
5395
5454
  return true;
5396
5455
  }
5397
- if (tokenOrKeyword.isToken(20 /* CloseBrace */) && (tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */ || tokenOrKeyword.parent.kind === 24 /* PackageMemberGroupDeclaration */ || tokenOrKeyword.parent.kind === 6 /* PackageGroupImportDirective */ || tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind === 25 /* PackageConstructorDeclaration */ || tokenOrKeyword.parent.parent.kind === 26 /* PackageEntryPointDeclaration */ || tokenOrKeyword.parent.parent.kind === 27 /* PackageMethodDeclaration */))) {
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 */))) {
5398
5457
  return true;
5399
5458
  }
5400
5459
  if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 24 /* PackageMemberGroupDeclaration */) {
@@ -5406,10 +5465,10 @@ var SyntaxContextFactory = class {
5406
5465
  ) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 37 /* PackageVariableSetterDeclaration */)) {
5407
5466
  return true;
5408
5467
  }
5409
- if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind === 146 /* Modifier */ && tokenOrKeyword.value === tokenOrKeyword.parent.value && tokenOrKeyword.parent.openParenthesisToken === void 0 && NodeTypeUtils.isPackageMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
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)) {
5410
5469
  return true;
5411
5470
  }
5412
- if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind === 146 /* Modifier */ && NodeTypeUtils.isPackageMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
5471
+ if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind === 149 /* Modifier */ && NodeTypeUtils.isPackageMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
5413
5472
  return true;
5414
5473
  }
5415
5474
  return false;
@@ -5430,13 +5489,13 @@ var SyntaxContextFactory = class {
5430
5489
  ) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
5431
5490
  tokenOrKeyword,
5432
5491
  51 /* TypeDereferencedVariableSetterDeclaration */
5433
- ) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 52 /* TypeMethodDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 53 /* OperatorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 45 /* TypeConstructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 46 /* TypeDestructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 139 /* VariantDeclaration */)) {
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 */)) {
5434
5493
  return true;
5435
5494
  }
5436
- if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind === 146 /* Modifier */ && tokenOrKeyword.value === tokenOrKeyword.parent.value && tokenOrKeyword.parent.openParenthesisToken === void 0 && NodeTypeUtils.isTypeMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
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)) {
5437
5496
  return true;
5438
5497
  }
5439
- if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind === 146 /* Modifier */ && NodeTypeUtils.isTypeMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
5498
+ if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind === 149 /* Modifier */ && NodeTypeUtils.isTypeMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
5440
5499
  return true;
5441
5500
  }
5442
5501
  return false;
@@ -5473,7 +5532,7 @@ var SyntaxContextFactory = class {
5473
5532
  return result;
5474
5533
  }
5475
5534
  static isUnqualifiedTypeContext(tokenOrKeyword) {
5476
- if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind === 153 /* TypeAnnotation */) {
5535
+ if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind === 156 /* TypeAnnotation */) {
5477
5536
  return { allowsAnonymousTypes: true };
5478
5537
  }
5479
5538
  if ((tokenOrKeyword.isKeyword(4 /* Object */) || tokenOrKeyword.isKeyword(5 /* PlainObject */) || tokenOrKeyword.isKeyword(3 /* Aspect */)) && tokenOrKeyword.parent.kind === 34 /* StructuredTypeDeclarationBody */) {
@@ -5482,16 +5541,16 @@ var SyntaxContextFactory = class {
5482
5541
  if (tokenOrKeyword.isKeyword(16 /* Type */) && (NodeTypeUtils.isPackageTypeDeclaration(tokenOrKeyword.parent) || tokenOrKeyword.parent.kind === 40 /* TypeExtensionDeclaration */)) {
5483
5542
  return { allowsAnonymousTypes: false };
5484
5543
  }
5485
- if (tokenOrKeyword.isToken(36 /* LessThan */) && tokenOrKeyword.parent.kind === 149 /* TypeArgumentClause */) {
5544
+ if (tokenOrKeyword.isToken(36 /* LessThan */) && tokenOrKeyword.parent.kind === 152 /* TypeArgumentClause */) {
5486
5545
  return { allowsAnonymousTypes: true };
5487
5546
  }
5488
- if (tokenOrKeyword.isToken(24 /* Comma */) && (tokenOrKeyword.parent.kind === 30 /* BaseTypeList */ || tokenOrKeyword.parent.kind === 150 /* TypeArgumentList */)) {
5489
- return { allowsAnonymousTypes: tokenOrKeyword.parent.kind === 150 /* TypeArgumentList */ };
5547
+ if (tokenOrKeyword.isToken(24 /* Comma */) && (tokenOrKeyword.parent.kind === 30 /* BaseTypeList */ || tokenOrKeyword.parent.kind === 153 /* TypeArgumentList */)) {
5548
+ return { allowsAnonymousTypes: tokenOrKeyword.parent.kind === 153 /* TypeArgumentList */ };
5490
5549
  }
5491
- if (tokenOrKeyword.isToken(35 /* HashSign */) && tokenOrKeyword.parent.kind === 144 /* Tag */) {
5550
+ if (tokenOrKeyword.isToken(35 /* HashSign */) && tokenOrKeyword.parent.kind === 147 /* Tag */) {
5492
5551
  return { allowsAnonymousTypes: false };
5493
5552
  }
5494
- if ((tokenOrKeyword.isToken(23 /* Colon */) || tokenOrKeyword.isToken(57 /* Equals */)) && tokenOrKeyword.parent.kind === 140 /* TypeParameterDeclaration */) {
5553
+ if ((tokenOrKeyword.isToken(23 /* Colon */) || tokenOrKeyword.isToken(57 /* Equals */)) && tokenOrKeyword.parent.kind === 143 /* TypeParameterDeclaration */) {
5495
5554
  return { allowsAnonymousTypes: false };
5496
5555
  }
5497
5556
  if (tokenOrKeyword.isToken(57 /* Equals */) && tokenOrKeyword.parent.kind === 22 /* PackageAliasTypeDeclaration */) {
@@ -5500,12 +5559,15 @@ var SyntaxContextFactory = class {
5500
5559
  if (tokenOrKeyword.isKeyword(14 /* Is */) && tokenOrKeyword.parent.kind === 73 /* IsExpression */) {
5501
5560
  return { allowsAnonymousTypes: true };
5502
5561
  }
5503
- if (tokenOrKeyword.isKeyword(41 /* As */) && tokenOrKeyword.parent.kind === 65 /* AsExpression */) {
5562
+ if (tokenOrKeyword.isKeyword(42 /* As */) && tokenOrKeyword.parent.kind === 65 /* AsExpression */) {
5504
5563
  return { allowsAnonymousTypes: true };
5505
5564
  }
5506
5565
  if (tokenOrKeyword.isToken(17 /* Bar */) && tokenOrKeyword.parent.kind === 12 /* UnionTypeSpecifierTypeList */) {
5507
5566
  return { allowsAnonymousTypes: false };
5508
5567
  }
5568
+ if (tokenOrKeyword.isToken(44 /* OpenParenthesis */) && tokenOrKeyword.parent.kind === 13 /* ParenthesizedTypeSpecifier */) {
5569
+ return { allowsAnonymousTypes: true };
5570
+ }
5509
5571
  return void 0;
5510
5572
  }
5511
5573
  static isTopLevelTranslationListContext(tokenOrKeyword) {
@@ -5517,32 +5579,32 @@ var SyntaxContextFactory = class {
5517
5579
  }
5518
5580
  const packageImport = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5519
5581
  tokenOrKeyword,
5520
- 131 /* PackageImportTranslation */
5582
+ 134 /* PackageImportTranslation */
5521
5583
  );
5522
5584
  if (packageImport !== void 0) {
5523
5585
  return { translationsDeclaration: packageImport.parent.parent };
5524
5586
  }
5525
- const type = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 136 /* TypeTranslation */);
5587
+ const type = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 139 /* TypeTranslation */);
5526
5588
  if (type !== void 0) {
5527
5589
  return { translationsDeclaration: type.parent.parent };
5528
5590
  }
5529
5591
  const methodType = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5530
5592
  tokenOrKeyword,
5531
- 130 /* MethodTypeTranslation */
5593
+ 133 /* MethodTypeTranslation */
5532
5594
  );
5533
5595
  if (methodType !== void 0) {
5534
5596
  return { translationsDeclaration: methodType.parent.parent };
5535
5597
  }
5536
5598
  const variable = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5537
5599
  tokenOrKeyword,
5538
- 133 /* PackageVariableTranslation */
5600
+ 136 /* PackageVariableTranslation */
5539
5601
  );
5540
5602
  if (variable !== void 0) {
5541
5603
  return { translationsDeclaration: variable.parent.parent };
5542
5604
  }
5543
5605
  const method = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5544
5606
  tokenOrKeyword,
5545
- 128 /* PackageMethodTranslation */
5607
+ 131 /* PackageMethodTranslation */
5546
5608
  );
5547
5609
  if (method !== void 0) {
5548
5610
  return { translationsDeclaration: method.parent.parent };
@@ -5550,33 +5612,33 @@ var SyntaxContextFactory = class {
5550
5612
  return void 0;
5551
5613
  }
5552
5614
  static isTypeMemberTranslationListContext(tokenOrKeyword) {
5553
- if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 135 /* TypeMemberTranslationList */) {
5615
+ if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 138 /* TypeMemberTranslationList */) {
5554
5616
  return { typeTranslation: tokenOrKeyword.parent.parent };
5555
5617
  }
5556
- if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 136 /* TypeTranslation */) {
5618
+ if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 139 /* TypeTranslation */) {
5557
5619
  return { typeTranslation: tokenOrKeyword.parent };
5558
5620
  }
5559
- const indexer = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 125 /* IndexerTranslation */);
5621
+ const indexer = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 128 /* IndexerTranslation */);
5560
5622
  if (indexer !== void 0) {
5561
5623
  return { typeTranslation: indexer.parent.parent };
5562
5624
  }
5563
5625
  const constructor = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5564
5626
  tokenOrKeyword,
5565
- 123 /* ConstructorTranslation */
5627
+ 126 /* ConstructorTranslation */
5566
5628
  );
5567
5629
  if (constructor !== void 0) {
5568
5630
  return { typeTranslation: constructor.parent.parent };
5569
5631
  }
5570
5632
  const variableOrVariant = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5571
5633
  tokenOrKeyword,
5572
- 134 /* TypeVariableOrVariantTranslation */
5634
+ 137 /* TypeVariableOrVariantTranslation */
5573
5635
  );
5574
5636
  if (variableOrVariant !== void 0) {
5575
5637
  return { typeTranslation: variableOrVariant.parent.parent };
5576
5638
  }
5577
5639
  const method = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
5578
5640
  tokenOrKeyword,
5579
- 129 /* TypeMethodTranslation */
5641
+ 132 /* TypeMethodTranslation */
5580
5642
  );
5581
5643
  if (method !== void 0) {
5582
5644
  return { typeTranslation: method.parent.parent };
@@ -5701,13 +5763,13 @@ var NodeSemanticInfoService = class {
5701
5763
  return this.ofDereferenceExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
5702
5764
  } else if (tokenOrKeyword.parent.kind === 91 /* AssignmentStatement */) {
5703
5765
  return this.ofAssignmentStatementOperator(analyzer, tokenOrKeyword.parent, options6);
5704
- } else if (tokenOrKeyword.isKeyword(29 /* Creation */) && tokenOrKeyword.parent.kind === 45 /* TypeConstructorDeclaration */) {
5766
+ } else if (tokenOrKeyword.isKeyword(30 /* Creation */) && tokenOrKeyword.parent.kind === 45 /* TypeConstructorDeclaration */) {
5705
5767
  return this.ofTypeConstructorDeclaration(analyzer, tokenOrKeyword.parent);
5706
5768
  } else if (tokenOrKeyword.isToken(13 /* Asterisk */) && tokenOrKeyword.parent.kind === 90 /* DefaultMatchExpression */) {
5707
5769
  return this.ofDefaultMatchExpression(analyzer, tokenOrKeyword.parent);
5708
5770
  } else if (tokenOrKeyword.isKeyword(4 /* Object */) && tokenOrKeyword.parent.kind === 86 /* ObjectExpression */) {
5709
5771
  return this.ofObjectExpression(analyzer, tokenOrKeyword.parent, options6);
5710
- } else if (tokenOrKeyword.isKeyword(55 /* Base */) && tokenOrKeyword.parent.kind === 87 /* BaseExpression */) {
5772
+ } else if (tokenOrKeyword.isKeyword(56 /* Base */) && tokenOrKeyword.parent.kind === 87 /* BaseExpression */) {
5711
5773
  return this.ofBaseExpression(analyzer, tokenOrKeyword.parent, options6);
5712
5774
  } else if ((tokenOrKeyword.isToken(45 /* OpenSquareBracket */) || tokenOrKeyword.isToken(22 /* CloseSquareBracket */)) && tokenOrKeyword.parent.kind === 49 /* TypeIndexerParameterClause */) {
5713
5775
  return this.ofTypeIndexerDeclaration(analyzer, tokenOrKeyword.parent.parent);
@@ -5724,11 +5786,11 @@ var NodeSemanticInfoService = class {
5724
5786
  let result;
5725
5787
  const parent = node.parent;
5726
5788
  switch (parent.kind) {
5727
- case 126 /* TranslationTypeParameterList */:
5789
+ case 129 /* TranslationTypeParameterList */:
5728
5790
  break;
5729
- case 121 /* TranslationParameterList */:
5791
+ case 124 /* TranslationParameterList */:
5730
5792
  break;
5731
- case 142 /* Argument */: {
5793
+ case 145 /* Argument */: {
5732
5794
  const respectiveParameter = analyzer.getRespectiveParameter(parent);
5733
5795
  if (respectiveParameter !== void 0) {
5734
5796
  const target = new SimpleWithLocalization(
@@ -5745,7 +5807,7 @@ var NodeSemanticInfoService = class {
5745
5807
  case 60 /* EnumerationVariableDeclaration */:
5746
5808
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofEnumerationVariableDeclaration(parent));
5747
5809
  break;
5748
- case 100 /* ErrorVariableDeclaration */:
5810
+ case 101 /* ErrorVariableDeclaration */:
5749
5811
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofErrorVariableDeclaration(parent));
5750
5812
  break;
5751
5813
  case 22 /* PackageAliasTypeDeclaration */:
@@ -5775,10 +5837,10 @@ var NodeSemanticInfoService = class {
5775
5837
  case 59 /* LocalVariableDeclaration */:
5776
5838
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofLocalVariableDeclaration(parent));
5777
5839
  break;
5778
- case 132 /* QualifiedName */:
5840
+ case 135 /* QualifiedName */:
5779
5841
  result = this.ofQualifiedNameQualifier(analyzer, parent, node, options6);
5780
5842
  break;
5781
- case 133 /* PackageVariableTranslation */: {
5843
+ case 136 /* PackageVariableTranslation */: {
5782
5844
  const translationPackage = this.getContainingTranslationPackage(analyzer, node);
5783
5845
  const getTargetResult = translationPackage?.getPackageVariableTranslationTarget(parent);
5784
5846
  if (translationPackage !== void 0 && getTargetResult?.target !== void 0) {
@@ -5798,7 +5860,7 @@ var NodeSemanticInfoService = class {
5798
5860
  }
5799
5861
  break;
5800
5862
  }
5801
- case 134 /* TypeVariableOrVariantTranslation */: {
5863
+ case 137 /* TypeVariableOrVariantTranslation */: {
5802
5864
  const translationPackage = this.getContainingTranslationPackage(analyzer, node);
5803
5865
  const getTargetsResult = translationPackage?.getTypeVariableOrVariantTranslationTargets(parent);
5804
5866
  if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
@@ -5822,7 +5884,7 @@ var NodeSemanticInfoService = class {
5822
5884
  }
5823
5885
  break;
5824
5886
  }
5825
- case 128 /* PackageMethodTranslation */: {
5887
+ case 131 /* PackageMethodTranslation */: {
5826
5888
  const translationPackage = this.getContainingTranslationPackage(analyzer, node);
5827
5889
  const getTargetsResult = translationPackage?.getPackageMethodTranslationTargets(parent);
5828
5890
  if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
@@ -5846,7 +5908,7 @@ var NodeSemanticInfoService = class {
5846
5908
  }
5847
5909
  break;
5848
5910
  }
5849
- case 129 /* TypeMethodTranslation */: {
5911
+ case 132 /* TypeMethodTranslation */: {
5850
5912
  const translationPackage = this.getContainingTranslationPackage(analyzer, node);
5851
5913
  const getTargetsResult = translationPackage?.getTypeMethodTranslationTargets(parent);
5852
5914
  if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
@@ -5870,7 +5932,7 @@ var NodeSemanticInfoService = class {
5870
5932
  }
5871
5933
  break;
5872
5934
  }
5873
- case 136 /* TypeTranslation */: {
5935
+ case 139 /* TypeTranslation */: {
5874
5936
  const translationPackage = this.getContainingTranslationPackage(analyzer, node);
5875
5937
  const getTargetResult = translationPackage?.getTypeTranslationTarget(parent);
5876
5938
  if (translationPackage !== void 0 && getTargetResult?.target !== void 0) {
@@ -5890,7 +5952,7 @@ var NodeSemanticInfoService = class {
5890
5952
  }
5891
5953
  break;
5892
5954
  }
5893
- case 130 /* MethodTypeTranslation */: {
5955
+ case 133 /* MethodTypeTranslation */: {
5894
5956
  const translationPackage = this.getContainingTranslationPackage(analyzer, node);
5895
5957
  const getTargetResult = translationPackage?.getMethodTypeTranslationTarget(parent);
5896
5958
  if (translationPackage !== void 0 && getTargetResult?.target !== void 0) {
@@ -5910,7 +5972,7 @@ var NodeSemanticInfoService = class {
5910
5972
  }
5911
5973
  break;
5912
5974
  }
5913
- case 141 /* ParameterDeclaration */:
5975
+ case 144 /* ParameterDeclaration */:
5914
5976
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofParameterDeclaration(parent));
5915
5977
  break;
5916
5978
  case 8 /* PackageImport */:
@@ -5931,10 +5993,10 @@ var NodeSemanticInfoService = class {
5931
5993
  case 54 /* TypeVariableDeclaration */:
5932
5994
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofTypeVariableDeclaration(parent));
5933
5995
  break;
5934
- case 140 /* TypeParameterDeclaration */:
5996
+ case 143 /* TypeParameterDeclaration */:
5935
5997
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofTypeParameterDeclaration(parent));
5936
5998
  break;
5937
- case 139 /* VariantDeclaration */:
5999
+ case 142 /* VariantDeclaration */:
5938
6000
  result = new DefinitionNodeSemanticInfo(analyzer.entity.ofVariantDeclaration(parent));
5939
6001
  break;
5940
6002
  case 36 /* PackageVariableGetterDeclaration */:
@@ -5958,25 +6020,40 @@ var NodeSemanticInfoService = class {
5958
6020
  const meaning = analyzer.resolvePropertyAccessExpression(node).meaning;
5959
6021
  switch (meaning.kind) {
5960
6022
  case "instance-variable-access": {
6023
+ let narrowedType;
6024
+ if (isNarrowableReferenceExpression(node)) {
6025
+ narrowedType = analyzer.type.ofExpression(node);
6026
+ }
5961
6027
  const target = new SimpleWithLocalization(new TypeVariableReferenceTarget(
5962
6028
  meaning.variable.value,
5963
- meaning.accessKind
6029
+ meaning.accessKind,
6030
+ narrowedType
5964
6031
  ), meaning.variable.localization);
5965
6032
  result = new ReferenceNodeSemanticInfo([target], false);
5966
6033
  break;
5967
6034
  }
5968
6035
  case "static-variable-access": {
6036
+ let narrowedType;
6037
+ if (isNarrowableReferenceExpression(node)) {
6038
+ narrowedType = analyzer.type.ofExpression(node);
6039
+ }
5969
6040
  const target = new SimpleWithLocalization(new TypeVariableReferenceTarget(
5970
6041
  meaning.variable.value,
5971
- meaning.accessKind
6042
+ meaning.accessKind,
6043
+ narrowedType
5972
6044
  ), meaning.variable.localization);
5973
6045
  result = new ReferenceNodeSemanticInfo([target], false);
5974
6046
  break;
5975
6047
  }
5976
6048
  case "package-variable-access": {
6049
+ let narrowedType;
6050
+ if (isNarrowableReferenceExpression(node)) {
6051
+ narrowedType = analyzer.type.ofExpression(node);
6052
+ }
5977
6053
  const target = new SimpleWithLocalization(new EntityReferenceTarget(
5978
6054
  meaning.variable.value,
5979
- meaning.accessKind
6055
+ meaning.accessKind,
6056
+ narrowedType
5980
6057
  ), meaning.variable.localization);
5981
6058
  result = new ReferenceNodeSemanticInfo([target], false);
5982
6059
  break;
@@ -6045,10 +6122,10 @@ var NodeSemanticInfoService = class {
6045
6122
  switch (node.parent.kind) {
6046
6123
  case 10 /* NamedTypeSpecifier */:
6047
6124
  return this.ofNamedTypeSpecifierNameQualifier(analyzer, node.parent, qualifier, options6);
6048
- case 144 /* Tag */:
6125
+ case 147 /* Tag */:
6049
6126
  return this.ofTagNameQualifier(analyzer, node.parent, qualifier, options6);
6050
6127
  case 42 /* ExtendedTypeClause */:
6051
- case 131 /* PackageImportTranslation */:
6128
+ case 134 /* PackageImportTranslation */:
6052
6129
  return void 0;
6053
6130
  default:
6054
6131
  Debug.never(node.parent);
@@ -6198,16 +6275,20 @@ var NodeSemanticInfoService = class {
6198
6275
  break;
6199
6276
  }
6200
6277
  case "variable-access": {
6278
+ let narrowedType;
6279
+ if (isNarrowableReferenceExpression(node)) {
6280
+ narrowedType = analyzer.type.ofExpression(node);
6281
+ }
6201
6282
  const variable = meaning.variable;
6202
6283
  if (variable.value.kind === "entity") {
6203
6284
  const target = new SimpleWithLocalization(
6204
- new EntityReferenceTarget(variable.value.value, meaning.accessKind),
6285
+ new EntityReferenceTarget(variable.value.value, meaning.accessKind, narrowedType),
6205
6286
  variable.localization
6206
6287
  );
6207
6288
  result = new ReferenceNodeSemanticInfo([target], false);
6208
6289
  } else if (variable.value.kind === "type-member") {
6209
6290
  const target = new SimpleWithLocalization(
6210
- new TypeVariableReferenceTarget(variable.value.value, meaning.accessKind),
6291
+ new TypeVariableReferenceTarget(variable.value.value, meaning.accessKind, narrowedType),
6211
6292
  variable.localization
6212
6293
  );
6213
6294
  result = new ReferenceNodeSemanticInfo([target], false);
@@ -6412,8 +6493,9 @@ var NodeSemanticInfoService = class {
6412
6493
  }
6413
6494
  case "object-access": {
6414
6495
  const locale = TreeQuery.fromNode(node).packageEntity(analyzer).getLocale();
6496
+ const type = analyzer.type.ofExpression(node);
6415
6497
  const target = new SimpleWithLocalization(
6416
- new TypeContextReferenceTarget(meaning.type, "object"),
6498
+ new TypeContextReferenceTarget(type, "object"),
6417
6499
  new Localization.Original(locale)
6418
6500
  );
6419
6501
  result = new ReferenceNodeSemanticInfo([target], false);
@@ -6625,16 +6707,18 @@ var ReferenceNodeSemanticInfo = class {
6625
6707
  }
6626
6708
  };
6627
6709
  var EntityReferenceTarget = class {
6628
- constructor(entity, accessKind) {
6710
+ constructor(entity, accessKind, narrowedType) {
6629
6711
  this.entity = entity;
6630
6712
  this.accessKind = accessKind;
6713
+ this.narrowedType = narrowedType;
6631
6714
  this.kind = "entity";
6632
6715
  }
6633
6716
  };
6634
6717
  var TypeVariableReferenceTarget = class {
6635
- constructor(variable, accessKind) {
6718
+ constructor(variable, accessKind, narrowedType) {
6636
6719
  this.variable = variable;
6637
6720
  this.accessKind = accessKind;
6721
+ this.narrowedType = narrowedType;
6638
6722
  this.kind = "type-variable";
6639
6723
  }
6640
6724
  };
@@ -6782,7 +6866,7 @@ function getEntitySourceLocations(analyzer, entity) {
6782
6866
  case 38 /* PackageVariantTypeDeclaration */:
6783
6867
  case 58 /* NestedMethodDeclaration */:
6784
6868
  case 52 /* TypeMethodDeclaration */:
6785
- case 140 /* TypeParameterDeclaration */:
6869
+ case 143 /* TypeParameterDeclaration */:
6786
6870
  case 53 /* OperatorDeclaration */:
6787
6871
  range = node.name.rangeWithoutTrivia;
6788
6872
  break;
@@ -7623,17 +7707,17 @@ var EvaluatableExpressionService = class {
7623
7707
  return { nameIdentifier: node.name };
7624
7708
  case 59 /* LocalVariableDeclaration */:
7625
7709
  return { nameIdentifier: node.name };
7626
- case 141 /* ParameterDeclaration */:
7710
+ case 144 /* ParameterDeclaration */:
7627
7711
  return { nameIdentifier: node.name };
7628
7712
  case 52 /* TypeMethodDeclaration */:
7629
7713
  return { nameIdentifier: node.name };
7630
7714
  case 54 /* TypeVariableDeclaration */:
7631
7715
  return { nameIdentifier: node.name };
7632
- case 140 /* TypeParameterDeclaration */:
7716
+ case 143 /* TypeParameterDeclaration */:
7633
7717
  return { nameIdentifier: node.name };
7634
- case 139 /* VariantDeclaration */:
7718
+ case 142 /* VariantDeclaration */:
7635
7719
  return { nameIdentifier: node.name };
7636
- case 100 /* ErrorVariableDeclaration */:
7720
+ case 101 /* ErrorVariableDeclaration */:
7637
7721
  return { nameIdentifier: node.name };
7638
7722
  default:
7639
7723
  return void 0;
@@ -7714,13 +7798,19 @@ var HoverService = class {
7714
7798
  );
7715
7799
  switch (semanticInfo.kind) {
7716
7800
  case "definition":
7717
- return this.createHoverForEntity(semanticInfo.entity, void 0, tokenOrKeyword.value.rangeWithoutTrivia);
7801
+ return this.createHoverForEntity(
7802
+ semanticInfo.entity,
7803
+ void 0,
7804
+ void 0,
7805
+ tokenOrKeyword.value.rangeWithoutTrivia
7806
+ );
7718
7807
  case "reference":
7719
7808
  return this.createHoverAtReference(semanticInfo, tokenOrKeyword.value.rangeWithoutTrivia);
7720
7809
  case "name-translation":
7721
7810
  return this.createHoverForEntity(
7722
7811
  semanticInfo.firstTarget,
7723
7812
  new Localization.Translated(semanticInfo.translation),
7813
+ void 0,
7724
7814
  tokenOrKeyword.value.rangeWithoutTrivia
7725
7815
  );
7726
7816
  case "default-switch-match":
@@ -7732,18 +7822,34 @@ var HoverService = class {
7732
7822
  Debug.never(semanticInfo);
7733
7823
  }
7734
7824
  }
7735
- createHoverForEntity(entity, localization, range) {
7736
- return new Hover(this._displayService.displayEntity(entity, localization), range);
7825
+ createHoverForEntity(entity, localization, narrowedType, range) {
7826
+ if (entity.kind === 0 /* Variable */) {
7827
+ localization ??= Localization.Original.ofEntity(entity);
7828
+ const declaration = new VariableDeclaration_entity(
7829
+ entity,
7830
+ localization,
7831
+ narrowedType
7832
+ );
7833
+ return new Hover(this._displayService.displayVariableDeclaration(declaration), range);
7834
+ } else {
7835
+ return new Hover(this._displayService.displayEntity(entity, localization), range);
7836
+ }
7737
7837
  }
7738
7838
  createHoverAtReference(reference, range) {
7739
7839
  const firstTarget = reference.firstTarget;
7740
7840
  switch (firstTarget.value.kind) {
7741
7841
  case "entity":
7742
- return this.createHoverForEntity(firstTarget.value.entity, firstTarget.localization, range);
7842
+ return this.createHoverForEntity(
7843
+ firstTarget.value.entity,
7844
+ firstTarget.localization,
7845
+ firstTarget.value.narrowedType,
7846
+ range
7847
+ );
7743
7848
  case "type-variable": {
7744
7849
  const declaration = new VariableDeclaration_typeMember(
7745
7850
  firstTarget.value.variable,
7746
- firstTarget.localization
7851
+ firstTarget.localization,
7852
+ firstTarget.value.narrowedType
7747
7853
  );
7748
7854
  return new Hover(this._displayService.displayVariableDeclaration(declaration), range);
7749
7855
  }
@@ -7789,7 +7895,7 @@ var HoverService = class {
7789
7895
  const typeText = this._displayService.displayType(firstTarget.value.type);
7790
7896
  return new Hover(`${keywordText}: ${typeText}`, range);
7791
7897
  } else if (firstTarget.value.typeContextKind === "base") {
7792
- const keywordText = this._displayService.displayKeyword(55 /* Base */);
7898
+ const keywordText = this._displayService.displayKeyword(56 /* Base */);
7793
7899
  const typeText = this._displayService.displayType(firstTarget.value.type);
7794
7900
  return new Hover(`${keywordText}: ${typeText}`, range);
7795
7901
  } else {
@@ -8046,7 +8152,7 @@ var SourceFileItemsService = class {
8046
8152
  );
8047
8153
  break;
8048
8154
  }
8049
- case 139 /* VariantDeclaration */: {
8155
+ case 142 /* VariantDeclaration */: {
8050
8156
  result.push(
8051
8157
  this.createItem(
8052
8158
  9 /* Variant */,
@@ -8058,7 +8164,7 @@ var SourceFileItemsService = class {
8058
8164
  );
8059
8165
  break;
8060
8166
  }
8061
- case 140 /* TypeParameterDeclaration */: {
8167
+ case 143 /* TypeParameterDeclaration */: {
8062
8168
  result.push(
8063
8169
  this.createItem(
8064
8170
  18 /* TypeParameter */,
@@ -8114,23 +8220,23 @@ var SourceFileItemsService = class {
8114
8220
  case 8 /* InvalidType */:
8115
8221
  return name ?? `<${LocalizationHelper.localizeKeywordAndTakeFirst(16 /* Type */, this.locale, this.dialect)}>`;
8116
8222
  case 10 /* TypeConstructor */:
8117
- return name ?? LocalizationHelper.localizeKeywordAndTakeFirst(29 /* Creation */, this.locale, this.dialect);
8223
+ return name ?? LocalizationHelper.localizeKeywordAndTakeFirst(30 /* Creation */, this.locale, this.dialect);
8118
8224
  case 11 /* TypeDestructor */:
8119
- return name ?? LocalizationHelper.localizeKeywordAndTakeFirst(46 /* Destruction */, this.locale, this.dialect);
8225
+ return name ?? LocalizationHelper.localizeKeywordAndTakeFirst(47 /* Destruction */, this.locale, this.dialect);
8120
8226
  case 9 /* Variant */:
8121
8227
  return name ?? `<${LocalizationHelper.localizeKeywordAndTakeFirst(6 /* Variant */, this.locale, this.dialect)}>`;
8122
8228
  case 18 /* TypeParameter */:
8123
8229
  return name ?? `<${LocalizationHelper.localizeHelperPhrase(2 /* TypeParameter */, this.locale)}>`;
8124
8230
  case 2 /* PackageVariableGetter */:
8125
8231
  case 13 /* TypeVariableGetter */:
8126
- return `${LocalizationHelper.localizeKeywordAndTakeFirst(57 /* Get */, this.locale, this.dialect)} ${name ?? ""}`;
8232
+ return `${LocalizationHelper.localizeKeywordAndTakeFirst(58 /* Get */, this.locale, this.dialect)} ${name ?? ""}`;
8127
8233
  case 3 /* PackageVariableSetter */:
8128
8234
  case 14 /* TypeVariableSetter */:
8129
- return `${LocalizationHelper.localizeKeywordAndTakeFirst(58 /* Set */, this.locale, this.dialect)} ${name ?? ""}`;
8235
+ return `${LocalizationHelper.localizeKeywordAndTakeFirst(59 /* Set */, this.locale, this.dialect)} ${name ?? ""}`;
8130
8236
  case 16 /* TypeIndexedGetter */:
8131
- return `${LocalizationHelper.localizeKeywordAndTakeFirst(57 /* Get */, this.locale, this.dialect)} []`;
8237
+ return `${LocalizationHelper.localizeKeywordAndTakeFirst(58 /* Get */, this.locale, this.dialect)} []`;
8132
8238
  case 17 /* TypeIndexedSetter */:
8133
- return `${LocalizationHelper.localizeKeywordAndTakeFirst(58 /* Set */, this.locale, this.dialect)} []`;
8239
+ return `${LocalizationHelper.localizeKeywordAndTakeFirst(59 /* Set */, this.locale, this.dialect)} []`;
8134
8240
  default:
8135
8241
  Debug.never(kind);
8136
8242
  }
@@ -8283,8 +8389,12 @@ var SelectionRangeService = class {
8283
8389
  let result = new SelectionRange(new Range(0, sourceFile.text.length), void 0);
8284
8390
  let nodeWithChildren = sourceFile.getSyntaxNode();
8285
8391
  while (true) {
8286
- const child = nodeWithChildren.children.find((c) => c !== void 0 && this.nodeContainsOffset(c, offset));
8392
+ const child = nodeWithChildren.children.find((c) => c !== void 0 && this.nodeContainsOffset(c, offset, false));
8287
8393
  if (child === void 0) {
8394
+ const trivia = getTriviaAtOffset(sourceFile.getSyntaxNode(), offset);
8395
+ if (trivia?.kind === 3 /* MultiLineComment */ || trivia?.kind === 2 /* SingleLineComment */) {
8396
+ result = new SelectionRange(trivia.range, result);
8397
+ }
8288
8398
  break;
8289
8399
  }
8290
8400
  if (!this.nodeShouldBeSkipped(child) && !child.rangeWithoutTrivia.equals(result.range)) {
@@ -8301,8 +8411,8 @@ var SelectionRangeService = class {
8301
8411
  }
8302
8412
  return result;
8303
8413
  }
8304
- nodeContainsOffset(node, offset) {
8305
- const range = node.rangeWithoutTrivia;
8414
+ nodeContainsOffset(node, offset, searchInTrivia) {
8415
+ const range = searchInTrivia ? node.rangeWithTrivia : node.rangeWithoutTrivia;
8306
8416
  if (node.kind === 0 /* Token */ && node.tokenKind === 63 /* Identifier */ || node.kind === 3 /* Keyword */) {
8307
8417
  return offset >= range.start && offset <= range.end;
8308
8418
  } else {
@@ -8321,7 +8431,7 @@ var SelectionRangeService = class {
8321
8431
  }
8322
8432
  }
8323
8433
  switch (node.kind) {
8324
- case 153 /* TypeAnnotation */:
8434
+ case 156 /* TypeAnnotation */:
8325
8435
  case 34 /* StructuredTypeDeclarationBody */:
8326
8436
  case 39 /* VariantTypeDeclarationBody */:
8327
8437
  case 23 /* AliasTypeDeclarationBody */:
@@ -8465,7 +8575,7 @@ var SemanticTokensService = class {
8465
8575
  ));
8466
8576
  }
8467
8577
  }
8468
- if (node.kind === 139 /* VariantDeclaration */) {
8578
+ if (node.kind === 142 /* VariantDeclaration */) {
8469
8579
  result.push(
8470
8580
  new SemanticToken(
8471
8581
  node.name.rangeWithoutTrivia,
@@ -8649,7 +8759,7 @@ var TypeParameterSignatureHelpProvider = class {
8649
8759
  }
8650
8760
  let node = token.parent;
8651
8761
  while (node !== void 0) {
8652
- if (node.kind === 149 /* TypeArgumentClause */ && this._offset >= node.lessThanToken.rangeWithoutTrivia.end && (node.greaterThanToken.rangeWithoutTrivia.isEmpty || this._offset <= node.greaterThanToken.rangeWithoutTrivia.start)) {
8762
+ if (node.kind === 152 /* TypeArgumentClause */ && this._offset >= node.lessThanToken.rangeWithoutTrivia.end && (node.greaterThanToken.rangeWithoutTrivia.isEmpty || this._offset <= node.greaterThanToken.rangeWithoutTrivia.start)) {
8653
8763
  const argumentIndex = this.getArgumentIndex(node.typeArgumentList, this._offset);
8654
8764
  const argumentCount = this.countArguments(node.typeArgumentList);
8655
8765
  return new NodeWithTypeArgumentsInfo(node.parent, argumentIndex, argumentCount);
@@ -8696,7 +8806,7 @@ var TypeParameterSignatureHelpProvider = class {
8696
8806
  return this.getSignaturesForNamedTypeSpecifier(node);
8697
8807
  case 89 /* GenericSpecializationExpression */:
8698
8808
  return this.getSignaturesForGenericSpecializationExpression(node);
8699
- case 144 /* Tag */:
8809
+ case 147 /* Tag */:
8700
8810
  return this.getSignaturesForTag(node);
8701
8811
  default:
8702
8812
  Debug.never(node);
@@ -9027,7 +9137,7 @@ var ValueParametersSignatureHelpProvider = class {
9027
9137
  }
9028
9138
  break;
9029
9139
  }
9030
- case 144 /* Tag */: {
9140
+ case 147 /* Tag */: {
9031
9141
  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)) {
9032
9142
  const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
9033
9143
  const valueArguments = ValueArgumentFactory.createValueArgumentsOfTag(node);
@@ -11564,7 +11674,7 @@ var EntityToSyntax = class {
11564
11674
  convertPackageVariable(entity) {
11565
11675
  const commonModifiers = new Array();
11566
11676
  if (entity.isConstant()) {
11567
- commonModifiers.push(SyntaxFactory.modifier(34 /* Const */));
11677
+ commonModifiers.push(SyntaxFactory.modifier(35 /* Const */));
11568
11678
  }
11569
11679
  const name = this.getEntityName(entity);
11570
11680
  const type = this.convertType(entity.getType());
@@ -11606,7 +11716,7 @@ var EntityToSyntax = class {
11606
11716
  const tags = this.convertTags(entity.getTags());
11607
11717
  const modifiers = new Array();
11608
11718
  if (entity.isAsync()) {
11609
- modifiers.push(SyntaxFactory.modifier(39 /* Async */));
11719
+ modifiers.push(SyntaxFactory.modifier(40 /* Async */));
11610
11720
  }
11611
11721
  const isHidden = entity.isHidden();
11612
11722
  if (isHidden !== void 0) {
@@ -11688,19 +11798,19 @@ var EntityToSyntax = class {
11688
11798
  }
11689
11799
  const commonModifiers = new Array();
11690
11800
  if (entity.isConstant()) {
11691
- commonModifiers.push(SyntaxFactory.modifier(34 /* Const */));
11801
+ commonModifiers.push(SyntaxFactory.modifier(35 /* Const */));
11692
11802
  }
11693
11803
  if (entity.isStatic()) {
11694
- commonModifiers.push(SyntaxFactory.modifier(40 /* Static */));
11804
+ commonModifiers.push(SyntaxFactory.modifier(41 /* Static */));
11695
11805
  }
11696
11806
  if (entity.isAbstract()) {
11697
- commonModifiers.push(SyntaxFactory.modifier(36 /* Abstract */));
11807
+ commonModifiers.push(SyntaxFactory.modifier(37 /* Abstract */));
11698
11808
  }
11699
11809
  if (entity.isRedefinable()) {
11700
- commonModifiers.push(SyntaxFactory.modifier(37 /* Redefinable */));
11810
+ commonModifiers.push(SyntaxFactory.modifier(38 /* Redefinable */));
11701
11811
  }
11702
11812
  if (entity.isRedefined()) {
11703
- commonModifiers.push(SyntaxFactory.modifier(38 /* Redefined */));
11813
+ commonModifiers.push(SyntaxFactory.modifier(39 /* Redefined */));
11704
11814
  }
11705
11815
  const name = this.getEntityName(entity);
11706
11816
  const type = this.convertType(entity.getType());
@@ -11746,16 +11856,16 @@ var EntityToSyntax = class {
11746
11856
  modifiers.push(this.createHidingModifier(isHidden));
11747
11857
  }
11748
11858
  if (entity.isStatic()) {
11749
- modifiers.push(SyntaxFactory.modifier(40 /* Static */));
11859
+ modifiers.push(SyntaxFactory.modifier(41 /* Static */));
11750
11860
  }
11751
11861
  if (entity.isAbstract()) {
11752
- modifiers.push(SyntaxFactory.modifier(36 /* Abstract */));
11862
+ modifiers.push(SyntaxFactory.modifier(37 /* Abstract */));
11753
11863
  }
11754
11864
  if (entity.isRedefinable()) {
11755
- modifiers.push(SyntaxFactory.modifier(37 /* Redefinable */));
11865
+ modifiers.push(SyntaxFactory.modifier(38 /* Redefinable */));
11756
11866
  }
11757
11867
  if (entity.isRedefined()) {
11758
- modifiers.push(SyntaxFactory.modifier(38 /* Redefined */));
11868
+ modifiers.push(SyntaxFactory.modifier(39 /* Redefined */));
11759
11869
  }
11760
11870
  const name = this.getEntityName(entity);
11761
11871
  const typeParameters = this.convertTypeParameters(entity.getTypeParameters());
@@ -11771,7 +11881,7 @@ var EntityToSyntax = class {
11771
11881
  modifiers.push(this.createHidingModifier(isHidden));
11772
11882
  }
11773
11883
  if (entity.isAbstract()) {
11774
- modifiers.push(SyntaxFactory.modifier(36 /* Abstract */));
11884
+ modifiers.push(SyntaxFactory.modifier(37 /* Abstract */));
11775
11885
  }
11776
11886
  const parameters = this.convertValueParameters(entity.getValueParameters());
11777
11887
  return SyntaxFactory.typeConstructorDeclaration(tags, modifiers, parameters, void 0);
@@ -11784,7 +11894,7 @@ var EntityToSyntax = class {
11784
11894
  modifiers.push(this.createHidingModifier(isHidden));
11785
11895
  }
11786
11896
  if (entity.isAbstract()) {
11787
- modifiers.push(SyntaxFactory.modifier(36 /* Abstract */));
11897
+ modifiers.push(SyntaxFactory.modifier(37 /* Abstract */));
11788
11898
  }
11789
11899
  const parameters = this.convertValueParameters(entity.getValueParameters());
11790
11900
  return SyntaxFactory.typeDestructorDeclaration(tags, modifiers, parameters, void 0);
@@ -11792,10 +11902,10 @@ var EntityToSyntax = class {
11792
11902
  convertTypeIndexer(entity) {
11793
11903
  const commonModifiers = new Array();
11794
11904
  if (entity.isStatic()) {
11795
- commonModifiers.push(SyntaxFactory.modifier(40 /* Static */));
11905
+ commonModifiers.push(SyntaxFactory.modifier(41 /* Static */));
11796
11906
  }
11797
11907
  if (entity.isAbstract()) {
11798
- commonModifiers.push(SyntaxFactory.modifier(36 /* Abstract */));
11908
+ commonModifiers.push(SyntaxFactory.modifier(37 /* Abstract */));
11799
11909
  }
11800
11910
  const parameters = this.convertValueParameters(entity.getValueParameters());
11801
11911
  const result = new Array();
@@ -11909,21 +12019,21 @@ var EntityToSyntax = class {
11909
12019
  let levelKeyword;
11910
12020
  switch (hiding.kind) {
11911
12021
  case "type":
11912
- levelKeyword = 50 /* InType */;
12022
+ levelKeyword = 51 /* InType */;
11913
12023
  break;
11914
12024
  case "type-hierarchy":
11915
- levelKeyword = 47 /* InHierarchy */;
12025
+ levelKeyword = 48 /* InHierarchy */;
11916
12026
  break;
11917
12027
  case "file":
11918
- levelKeyword = 48 /* InFile */;
12028
+ levelKeyword = 49 /* InFile */;
11919
12029
  break;
11920
12030
  case "package":
11921
- levelKeyword = 49 /* InPackage */;
12031
+ levelKeyword = 50 /* InPackage */;
11922
12032
  break;
11923
12033
  default:
11924
12034
  Debug.never(hiding);
11925
12035
  }
11926
- return SyntaxFactory.modifier(35 /* Hidden */, levelKeyword);
12036
+ return SyntaxFactory.modifier(36 /* Hidden */, levelKeyword);
11927
12037
  }
11928
12038
  convertTags(_entityTags) {
11929
12039
  return [];
@@ -13138,11 +13248,11 @@ var LanguageServer = class {
13138
13248
  Debug.never(diagnostic.data.kind);
13139
13249
  }
13140
13250
  let tags;
13141
- if ((diagnostic.data.flags & 1 /* Unused */) !== 0) {
13251
+ if ((diagnostic.data.flags & (1 /* Unused */ | 2 /* Unreachable */)) !== 0) {
13142
13252
  tags ??= [];
13143
13253
  tags.push(ls3.DiagnosticTag.Unnecessary);
13144
13254
  }
13145
- if ((diagnostic.data.flags & 2 /* Deprecated */) !== 0) {
13255
+ if ((diagnostic.data.flags & 4 /* Deprecated */) !== 0) {
13146
13256
  tags ??= [];
13147
13257
  tags.push(ls3.DiagnosticTag.Deprecated);
13148
13258
  }