@artel/artc 0.6.25226 → 0.6.25228

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 (68) hide show
  1. package/build/Cli.js +3 -3
  2. package/build/api/Api.js +12 -56
  3. package/build/api/ApiNodeJS.js +3 -3
  4. package/build/api/ApiServices.js +204 -109
  5. package/build/{chunk-VRQPLLYS.js → chunk-5GSDYTF6.js} +6405 -5358
  6. package/build/{chunk-YNR2KYMJ.js → chunk-F5OW64UA.js} +3 -3
  7. package/build/{chunk-MHPX52MT.js → chunk-FHJJX7JY.js} +3 -3
  8. package/build/types/analysis/Analyzer.d.ts +32 -71
  9. package/build/types/analysis/AssignmentChecker.d.ts +11 -0
  10. package/build/types/analysis/CallExpressionMeaning.d.ts +2 -0
  11. package/build/types/analysis/DeclarationsUsageCounter.d.ts +8 -3
  12. package/build/types/analysis/DiagnosticCollector.d.ts +15 -5
  13. package/build/types/analysis/IdentifierExpressionMeaning.d.ts +6 -6
  14. package/build/types/analysis/IndexedAccessExpressionMeaning.d.ts +3 -3
  15. package/build/types/analysis/MemberAccessExpressionMeaning.d.ts +9 -9
  16. package/build/types/analysis/NamedTypeResolver.d.ts +3 -2
  17. package/build/types/analysis/NamedTypeSpecifierResolver.d.ts +3 -2
  18. package/build/types/analysis/NodeTypeUtils.d.ts +3 -2
  19. package/build/types/analysis/PackageMemberNameConflictsValidator.d.ts +24 -0
  20. package/build/types/analysis/SourceFileMembers.d.ts +6 -1
  21. package/build/types/analysis/SourcePackageMembersCreator.d.ts +2 -1
  22. package/build/types/analysis/TagMeaning.d.ts +3 -2
  23. package/build/types/analysis/TypeInferrer.d.ts +2 -0
  24. package/build/types/analysis/TypeMemberLookup.d.ts +11 -11
  25. package/build/types/analysis/TypeNarrower.d.ts +0 -69
  26. package/build/types/analysis/control-flow/GraphBuilder.d.ts +6 -2
  27. package/build/types/analysis/control-flow/NarrowableReference.d.ts +73 -0
  28. package/build/types/analysis/control-flow/Nodes.d.ts +9 -0
  29. package/build/types/analysis/control-flow/index.d.ts +1 -0
  30. package/build/types/analysis/semantic-context/Declarations.d.ts +117 -0
  31. package/build/types/analysis/semantic-context/FieldWithInitializerSemanticContext.d.ts +22 -0
  32. package/build/types/analysis/semantic-context/SemanticContext.d.ts +13 -0
  33. package/build/types/analysis/semantic-context/SemanticContextBase.d.ts +168 -0
  34. package/build/types/analysis/semantic-context/SemanticContextBasedEntityHidingMatcher.d.ts +14 -0
  35. package/build/types/analysis/semantic-context/SemanticContextBuilder.d.ts +84 -0
  36. package/build/types/analysis/semantic-context/SemanticContextValidatingNameConflicts.d.ts +45 -0
  37. package/build/types/analysis/semantic-context/SemanticContextWithParent.d.ts +9 -0
  38. package/build/types/analysis/semantic-context/SourceFileSemanticContext.d.ts +42 -0
  39. package/build/types/analysis/semantic-context/SpecialLocalDeclarationsBuilder.d.ts +23 -0
  40. package/build/types/analysis/semantic-context/SubprogramBodyAndParametersSemanticContext.d.ts +89 -0
  41. package/build/types/analysis/semantic-context/SubprogramSemanticContext.d.ts +114 -0
  42. package/build/types/analysis/semantic-context/TypeSemanticContext.d.ts +94 -0
  43. package/build/types/analysis/semantic-context/index.d.ts +10 -0
  44. package/build/types/api/Api.d.ts +3 -5
  45. package/build/types/common/Cached.d.ts +1 -0
  46. package/build/types/common/Errors.d.ts +2 -0
  47. package/build/types/common/Lazy.d.ts +4 -0
  48. package/build/types/common/Query.d.ts +2 -1
  49. package/build/types/common/WithDiagnostics.d.ts +4 -3
  50. package/build/types/common/index.d.ts +1 -0
  51. package/build/types/diagnostic/DiagnosticCode.d.ts +89 -68
  52. package/build/types/emitter/IrBuilder.d.ts +1 -1
  53. package/build/types/emitter/Transformer.d.ts +1 -1
  54. package/build/types/entities/FunctionEntity.d.ts +2 -2
  55. package/build/types/entities/VariableEntity.d.ts +48 -19
  56. package/build/types/entities/index.d.ts +4 -0
  57. package/build/types/services/DefinitionService.d.ts +3 -0
  58. package/build/types/tree/KeywordKind.d.ts +31 -30
  59. package/build/types/tree/NodeKind.d.ts +1 -1
  60. package/build/types/tree/green/Nodes.d.ts +33 -29
  61. package/build/types/tree/red/Nodes.d.ts +25 -24
  62. package/build/types/types/TypeFactory.d.ts +0 -2
  63. package/package.json +1 -1
  64. package/build/types/analysis/Lookup.d.ts +0 -28
  65. package/build/types/analysis/Scope.d.ts +0 -205
  66. package/build/types/analysis/SemanticContext.d.ts +0 -367
  67. package/build/types/analysis/SemanticContextBuilder.d.ts +0 -59
  68. package/build/types/analysis/StatementBlockScopeBuilder.d.ts +0 -26
@@ -182,7 +182,7 @@ import {
182
182
  unwrapParenthesizedExpressions,
183
183
  visitChildren,
184
184
  yieldExecution
185
- } from "../chunk-VRQPLLYS.js";
185
+ } from "../chunk-5GSDYTF6.js";
186
186
 
187
187
  // source/services/CustomCommand.ts
188
188
  import * as ls from "vscode-languageserver";
@@ -545,7 +545,7 @@ var SyntaxFactory = class {
545
545
  static packageVariableGetterDeclaration(tags, modifiers, name, typeSpecifier, body) {
546
546
  const tagList = new TagList(tags);
547
547
  const modifierList = new ModifierList(modifiers);
548
- const getKeyword = this.keyword(58 /* Get */);
548
+ const getKeyword = this.keyword(59 /* Get */);
549
549
  const nameIdentifier = this.createIdentifier(name);
550
550
  const typeAnnotation = this.typeAnnotation(typeSpecifier);
551
551
  return new PackageVariableGetterDeclaration(
@@ -560,7 +560,7 @@ var SyntaxFactory = class {
560
560
  static packageVariableSetterDeclaration(tags, modifiers, name, body) {
561
561
  const tagList = new TagList(tags);
562
562
  const modifierList = new ModifierList(modifiers);
563
- const setKeyword = this.keyword(59 /* Set */);
563
+ const setKeyword = this.keyword(60 /* Set */);
564
564
  const nameIdentifier = this.createIdentifier(name);
565
565
  return new PackageVariableSetterDeclaration(tagList, modifierList, setKeyword, nameIdentifier, body);
566
566
  }
@@ -607,7 +607,7 @@ var SyntaxFactory = class {
607
607
  static fieldGetterDeclaration(tags, modifiers, name, typeSpecifier, body) {
608
608
  const tagList = new TagList(tags);
609
609
  const modifierList = new ModifierList(modifiers);
610
- const getKeyword = this.keyword(58 /* Get */);
610
+ const getKeyword = this.keyword(59 /* Get */);
611
611
  const nameIdentifier = this.createIdentifier(name);
612
612
  const typeAnnotation = this.typeAnnotation(typeSpecifier);
613
613
  return new FieldGetterDeclaration(
@@ -622,7 +622,7 @@ var SyntaxFactory = class {
622
622
  static fieldSetterDeclaration(tags, modifiers, name, body) {
623
623
  const tagList = new TagList(tags);
624
624
  const modifierList = new ModifierList(modifiers);
625
- const setKeyword = this.keyword(59 /* Set */);
625
+ const setKeyword = this.keyword(60 /* Set */);
626
626
  const nameIdentifier = this.createIdentifier(name);
627
627
  return new FieldSetterDeclaration(tagList, modifierList, setKeyword, nameIdentifier, body);
628
628
  }
@@ -648,21 +648,21 @@ var SyntaxFactory = class {
648
648
  static constructorDeclaration(tags, modifiers, parameters, body) {
649
649
  const tagList = new TagList(tags);
650
650
  const modifierList = new ModifierList(modifiers);
651
- const creationKeyword = this.keyword(30 /* Creation */);
651
+ const creationKeyword = this.keyword(31 /* Creation */);
652
652
  const parameterClause = this.parameterClause(parameters);
653
653
  return new ConstructorDeclaration(tagList, modifierList, creationKeyword, parameterClause, body);
654
654
  }
655
655
  static destructorDeclaration(tags, modifiers, parameters, body) {
656
656
  const tagList = new TagList(tags);
657
657
  const modifierList = new ModifierList(modifiers);
658
- const destructionKeyword = this.keyword(47 /* Destruction */);
658
+ const destructionKeyword = this.keyword(48 /* Destruction */);
659
659
  const parameterClause = this.parameterClause(parameters);
660
660
  return new DestructorDeclaration(tagList, modifierList, destructionKeyword, parameterClause, body);
661
661
  }
662
662
  static indexedElementGetterDeclaration(tags, modifiers, parameters, typeSpecifier, body) {
663
663
  const tagList = new TagList(tags);
664
664
  const modifierList = new ModifierList(modifiers);
665
- const getKeyword = this.keyword(58 /* Get */);
665
+ const getKeyword = this.keyword(59 /* Get */);
666
666
  const parameterClause = this.indexParameterClause(parameters);
667
667
  const typeAnnotation = this.typeAnnotation(typeSpecifier);
668
668
  return new IndexedElementGetterDeclaration(
@@ -677,7 +677,7 @@ var SyntaxFactory = class {
677
677
  static indexedElementSetterDeclaration(tags, modifiers, parameters, body) {
678
678
  const tagList = new TagList(tags);
679
679
  const modifierList = new ModifierList(modifiers);
680
- const getKeyword = this.keyword(59 /* Set */);
680
+ const getKeyword = this.keyword(60 /* Set */);
681
681
  const parameterClause = this.indexParameterClause(parameters);
682
682
  return new IndexedElementSetterDeclaration(tagList, modifierList, getKeyword, parameterClause, body);
683
683
  }
@@ -845,7 +845,7 @@ var SyntaxFactory = class {
845
845
  return new FunctionBlock(openBraceToken, statementList, closeBraceToken);
846
846
  }
847
847
  static noneLiteral() {
848
- return new KeywordExpression(this.keyword(57 /* None */));
848
+ return new KeywordExpression(this.keyword(58 /* None */));
849
849
  }
850
850
  static integerLiteral(value) {
851
851
  return new TokenExpression(this.token(2 /* IntegerLiteral */, value.toString()));
@@ -853,7 +853,7 @@ var SyntaxFactory = class {
853
853
  static translationsDeclaration(translations) {
854
854
  const tagList = new TagList([]);
855
855
  const modifierList = new ModifierList([]);
856
- const translationsKeyword = this.keyword(55 /* Translations */);
856
+ const translationsKeyword = this.keyword(56 /* Translations */);
857
857
  const openBraceToken = this.token(43 /* OpenBrace */);
858
858
  const translationList = new TopLevelTranslationList(translations);
859
859
  const closeBraceToken = this.token(20 /* CloseBrace */);
@@ -970,7 +970,7 @@ var SyntaxFactory = class {
970
970
  );
971
971
  }
972
972
  static constructorTranslation(sourceParameters, translatedParameters) {
973
- const creationKeyword = this.keyword(30 /* Creation */);
973
+ const creationKeyword = this.keyword(31 /* Creation */);
974
974
  const sourceParameterClause = this.translationParameterClause(sourceParameters);
975
975
  const minusGreaterThanToken = this.token(42 /* MinusGreaterThan */);
976
976
  const translatedParameterClause = this.translationParameterClause(translatedParameters);
@@ -2085,7 +2085,7 @@ var SyntaxToCode = class _SyntaxToCode {
2085
2085
  [73 /* IsExpression */]: this.prototype.writeNodeDefault,
2086
2086
  [74 /* FunctionLiteral */]: this.prototype.writeNodeDefault,
2087
2087
  [75 /* ParenthesizedExpression */]: this.prototype.writeNodeDefault,
2088
- [76 /* WhenTernaryExpression */]: this.prototype.writeNodeDefault,
2088
+ [76 /* ConditionalExpression */]: this.prototype.writeNodeDefault,
2089
2089
  [77 /* PrefixUnaryExpression */]: this.prototype.writeNodeDefault,
2090
2090
  [78 /* MemberAccessExpression */]: this.prototype.writeNodeDefault,
2091
2091
  [79 /* ReferenceExpression */]: this.prototype.writeNodeDefault,
@@ -2162,14 +2162,14 @@ var SyntaxToCode = class _SyntaxToCode {
2162
2162
  }
2163
2163
  };
2164
2164
  var modifierSortOrder = {
2165
- [36 /* Hidden */]: 0,
2166
- [41 /* Static */]: 1,
2165
+ [37 /* Hidden */]: 0,
2166
+ [42 /* Static */]: 1,
2167
2167
  [17 /* Basic */]: 2,
2168
- [38 /* Redefinable */]: 3,
2169
- [37 /* Abstract */]: 4,
2170
- [39 /* Redefined */]: 5,
2171
- [40 /* Async */]: 6,
2172
- [35 /* Const */]: 7
2168
+ [39 /* Redefinable */]: 3,
2169
+ [38 /* Abstract */]: 4,
2170
+ [40 /* Redefined */]: 5,
2171
+ [41 /* Async */]: 6,
2172
+ [36 /* Const */]: 7
2173
2173
  };
2174
2174
 
2175
2175
  // source/services/TreeUtils.ts
@@ -2349,7 +2349,7 @@ var TranslationsGenerationService = class {
2349
2349
  result = generator.generateMissingTypeMemberTranslations(tokenOrKeyword.parent);
2350
2350
  }
2351
2351
  }
2352
- if (result === void 0 && tokenOrKeyword.isKeyword(55 /* Translations */) && tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */) {
2352
+ if (result === void 0 && tokenOrKeyword.isKeyword(56 /* Translations */) && tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */) {
2353
2353
  const translationPackage = analyzer.getAnalyzedTranslationPackageIfTargetResolved(sourceFile.package);
2354
2354
  if (translationPackage !== void 0) {
2355
2355
  const generator = new TranslationsGenerator(
@@ -2375,7 +2375,7 @@ var TranslationsGenerationService = class {
2375
2375
  if (tokenOrKeyword === void 0) {
2376
2376
  return false;
2377
2377
  }
2378
- if (!(tokenOrKeyword.isKeyword(55 /* Translations */) && tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */)) {
2378
+ if (!(tokenOrKeyword.isKeyword(56 /* Translations */) && tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */)) {
2379
2379
  return false;
2380
2380
  }
2381
2381
  const translationPackage = analyzer.getAnalyzedTranslationPackageIfTargetResolved(sourceFile.package);
@@ -2727,7 +2727,7 @@ var CodeActionsService = class {
2727
2727
  }
2728
2728
  const result = new Array();
2729
2729
  const diagnosticCodeSet = new Set(diagnosticCodes);
2730
- if (diagnosticCodeSet.has(273 /* TheFollowingDeclarationsAreNotTranslated0 */) || diagnosticCodeSet.has(274 /* TheFollowingDeclarationAreNotTranslated0And1More */)) {
2730
+ if (diagnosticCodeSet.has(277 /* TheFollowingDeclarationsAreNotTranslated0 */) || diagnosticCodeSet.has(278 /* TheFollowingDeclarationAreNotTranslated0And1More */)) {
2731
2731
  const data = { onlyTypeMembers: false };
2732
2732
  result.push(CodeAction.unresolved(
2733
2733
  "\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.",
@@ -3258,13 +3258,12 @@ var CompletionService = class {
3258
3258
  const localizationContext = semanticContext.getLocalizationContext();
3259
3259
  const isStaticAccess = this._analyzer.checkExpressionDenotesType(propertyAccess.expression) !== void 0;
3260
3260
  const hidingMatcher = semanticContext.getHidingMatcher();
3261
- const typeExtensionLookup = semanticContext.getScopeLookup();
3262
3261
  return new TypeMemberCompletionContext(
3263
3262
  type,
3264
3263
  localizationContext,
3265
3264
  isStaticAccess,
3266
3265
  hidingMatcher,
3267
- typeExtensionLookup
3266
+ semanticContext
3268
3267
  );
3269
3268
  }
3270
3269
  if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 135 /* QualifiedName */ && tokenOrKeyword.parent.parent.kind === 10 /* NamedTypeSpecifier */) {
@@ -3352,20 +3351,22 @@ var CompletionService = class {
3352
3351
  expressionType: this._analyzer.type.ofExpression(tokenOrKeyword.parent.expression)
3353
3352
  };
3354
3353
  }
3355
- const lookup = semanticContext.getScopeLookup();
3356
- const typeSearchLocation = new ScopeTypeSearchLocation(lookup);
3354
+ const typeSearchLocation = new ScopeTypeSearchLocation(semanticContext);
3357
3355
  return new TypeCompletionContext(typeSearchLocation, completionInIsOrAsExpressionInfo);
3358
3356
  }
3359
3357
  if (syntaxContext.isUnqualifiedTagNameCompletionContext) {
3360
- const lookup = semanticContext.getScopeLookup();
3361
- const typeSearchLocation = new ScopeTypeSearchLocation(lookup);
3358
+ const typeSearchLocation = new ScopeTypeSearchLocation(semanticContext);
3362
3359
  return new TagCompletionContext(typeSearchLocation);
3363
3360
  }
3364
3361
  if (syntaxContext.isExpressionContext !== void 0) {
3365
- const lookup = semanticContext.getScopeLookup();
3366
3362
  const { targetTypes, targetSignaturesParameters } = this.getTargetTypesAndTargetSignaturesParameters(syntaxContext.isExpressionContext.expressionRole, semanticContext);
3367
3363
  const localizationContext = semanticContext.getLocalizationContext();
3368
- return new ExpressionCompletionContext(lookup, targetSignaturesParameters, targetTypes, localizationContext);
3364
+ return new ExpressionCompletionContext(
3365
+ semanticContext,
3366
+ targetSignaturesParameters,
3367
+ targetTypes,
3368
+ localizationContext
3369
+ );
3369
3370
  }
3370
3371
  const topLevelTranslationCompletionContext = this.tryGetTopLevelTranslationCompletionContext(
3371
3372
  syntaxContext,
@@ -3464,7 +3465,7 @@ var CompletionService = class {
3464
3465
  translationKind = 1 /* Method */;
3465
3466
  hasPrecedingKeyword = true;
3466
3467
  }
3467
- if (tokenOrKeyword.isKeyword(30 /* Creation */) && tokenOrKeyword.parent.kind === 126 /* ConstructorTranslation */) {
3468
+ if (tokenOrKeyword.isKeyword(31 /* Creation */) && tokenOrKeyword.parent.kind === 126 /* ConstructorTranslation */) {
3468
3469
  typeTranslation = tokenOrKeyword.parent.parent.parent;
3469
3470
  translationKind = 3 /* Constructor */;
3470
3471
  hasPrecedingKeyword = true;
@@ -3649,22 +3650,22 @@ var CompletionService = class {
3649
3650
  }
3650
3651
  const kinds = /* @__PURE__ */ new Set();
3651
3652
  if (syntaxContext.isPackageMemberDeclarationListContext) {
3652
- 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 */);
3653
+ kinds.add(18 /* Import */).add(7 /* Run */).add(31 /* Creation */).add(12 /* Function */).add(17 /* Basic */).add(16 /* Type */).add(59 /* Get */).add(60 /* Set */).add(56 /* Translations */);
3653
3654
  }
3654
3655
  if (syntaxContext.isPackageMemberDeclarationListContext || syntaxContext.isTypeMemberDeclarationListContext) {
3655
- kinds.add(36 /* Hidden */).add(41 /* Static */).add(38 /* Redefinable */).add(37 /* Abstract */).add(39 /* Redefined */).add(40 /* Async */).add(35 /* Const */);
3656
+ kinds.add(37 /* Hidden */).add(42 /* Static */).add(39 /* Redefinable */).add(38 /* Abstract */).add(40 /* Redefined */).add(41 /* Async */).add(36 /* Const */);
3656
3657
  }
3657
3658
  if (syntaxContext.isTypeMemberDeclarationListContext) {
3658
- kinds.add(30 /* Creation */).add(12 /* Function */).add(47 /* Destruction */).add(58 /* Get */).add(59 /* Set */);
3659
+ kinds.add(31 /* Creation */).add(12 /* Function */).add(48 /* Destruction */).add(59 /* Get */).add(60 /* Set */);
3659
3660
  }
3660
3661
  if (syntaxContext.isStatementContext) {
3661
- kinds.add(7 /* Run */).add(34 /* For */).add(25 /* While */).add(26 /* Loop */).add(15 /* Return */).add(20 /* Error */).add(19 /* Important */).add(28 /* Yield */).add(32 /* BreakLoop */).add(33 /* ContinueLoop */).add(13 /* If */).add(44 /* Switch */).add(1 /* Let */).add(35 /* Const */).add(46 /* Dispose */).add(8 /* Try */).add(12 /* Function */).add(40 /* Async */);
3662
+ kinds.add(7 /* Run */).add(35 /* For */).add(25 /* While */).add(26 /* Loop */).add(15 /* Return */).add(20 /* Error */).add(19 /* Important */).add(28 /* Yield */).add(33 /* BreakLoop */).add(34 /* ContinueLoop */).add(13 /* If */).add(45 /* Switch */).add(1 /* Let */).add(36 /* Const */).add(47 /* Dispose */).add(8 /* Try */).add(12 /* Function */).add(41 /* Async */);
3662
3663
  }
3663
3664
  if (this.isFromKeywordContext(positionDescription)) {
3664
3665
  kinds.add(9 /* From */);
3665
3666
  }
3666
3667
  if (syntaxContext.isExpressionContext !== void 0) {
3667
- 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 */);
3668
+ kinds.add(44 /* Not */).add(53 /* Yes */).add(54 /* No */).add(58 /* None */).add(41 /* Async */).add(12 /* Function */).add(55 /* Reference */).add(2 /* Autotype */).add(30 /* Cond */);
3668
3669
  if (positionDescription.kind === "after-token-or-keyword") {
3669
3670
  const container = semanticContext.getContainingTypeOrTypeExtension();
3670
3671
  if (container !== void 0) {
@@ -3672,20 +3673,20 @@ var CompletionService = class {
3672
3673
  if (container.kind === "type") {
3673
3674
  const typeEntity = container.value;
3674
3675
  if (typeEntity?.typeEntityKind === 1 /* Structured */ && typeEntity.getBaseObjectType() !== void 0 || typeEntity?.typeEntityKind === 3 /* Variant */ || typeEntity?.typeEntityKind === 4 /* Alias */) {
3675
- kinds.add(56 /* Base */);
3676
+ kinds.add(57 /* Base */);
3676
3677
  }
3677
3678
  }
3678
3679
  }
3679
3680
  }
3680
3681
  }
3681
3682
  if (this.isTypeKindCompletionContext(positionDescription)) {
3682
- kinds.add(4 /* Object */).add(5 /* PlainObject */).add(3 /* Aspect */).add(6 /* Variant */).add(12 /* Function */).add(40 /* Async */);
3683
+ kinds.add(4 /* Object */).add(5 /* PlainObject */).add(3 /* Aspect */).add(6 /* Variant */).add(12 /* Function */).add(41 /* Async */);
3683
3684
  }
3684
3685
  if (this.isCaseKeywordContext(positionDescription, syntaxContext)) {
3685
- kinds.add(45 /* Case */);
3686
+ kinds.add(46 /* Case */);
3686
3687
  }
3687
3688
  if (this.isCatchKeywordContext(positionDescription)) {
3688
- kinds.add(31 /* Catch */);
3689
+ kinds.add(32 /* Catch */);
3689
3690
  }
3690
3691
  if (this.isFinallyKeywordContext(positionDescription)) {
3691
3692
  kinds.add(21 /* Finally */);
@@ -3694,18 +3695,18 @@ var CompletionService = class {
3694
3695
  kinds.add(10 /* Else */).add(11 /* ElseIf */);
3695
3696
  }
3696
3697
  if (syntaxContext.precedingExpression !== void 0) {
3697
- kinds.add(42 /* As */).add(14 /* Is */).add(22 /* And */).add(23 /* Or */).add(24 /* Xor */).add(29 /* When */);
3698
+ kinds.add(43 /* As */).add(14 /* Is */).add(22 /* And */).add(23 /* Or */).add(24 /* Xor */).add(29 /* When */);
3698
3699
  }
3699
3700
  if (this.isModifierLevelContext(positionDescription)) {
3700
- kinds.add(51 /* InType */).add(48 /* InHierarchy */).add(49 /* InFile */).add(50 /* InPackage */);
3701
+ kinds.add(52 /* InType */).add(49 /* InHierarchy */).add(50 /* InFile */).add(51 /* InPackage */);
3701
3702
  }
3702
3703
  if (this.isRepeatWhileKeywordContext(positionDescription)) {
3703
3704
  kinds.add(27 /* RepeatWhile */);
3704
3705
  }
3705
3706
  if (syntaxContext.isUnqualifiedTypeContext?.allowsAnonymousTypes === true) {
3706
- kinds.add(5 /* PlainObject */).add(4 /* Object */).add(6 /* Variant */).add(3 /* Aspect */).add(12 /* Function */).add(40 /* Async */);
3707
+ kinds.add(5 /* PlainObject */).add(4 /* Object */).add(6 /* Variant */).add(3 /* Aspect */).add(12 /* Function */).add(41 /* Async */);
3707
3708
  }
3708
- if (positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isKeyword(40 /* Async */) && (positionDescription.tokenOrKeyword.parent.kind === 58 /* NestedFunctionDeclaration */ || positionDescription.tokenOrKeyword.parent.kind === 74 /* FunctionLiteral */ || positionDescription.tokenOrKeyword.parent.kind === 29 /* FunctionTypeDeclarationBody */)) {
3709
+ if (positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isKeyword(41 /* Async */) && (positionDescription.tokenOrKeyword.parent.kind === 58 /* NestedFunctionDeclaration */ || positionDescription.tokenOrKeyword.parent.kind === 74 /* FunctionLiteral */ || positionDescription.tokenOrKeyword.parent.kind === 29 /* FunctionTypeDeclarationBody */)) {
3709
3710
  kinds.add(12 /* Function */);
3710
3711
  }
3711
3712
  return Query.from(kinds.values()).map(
@@ -3771,7 +3772,7 @@ var CompletionService = class {
3771
3772
  return false;
3772
3773
  }
3773
3774
  getExpressionCompletionItemInfos(ctx) {
3774
- let query = this.getScopeCompletionItemInfos(ctx.lookup);
3775
+ let query = this.getScopeCompletionItemInfos(ctx.semanticContext);
3775
3776
  if (ctx.targetSignaturesValueParameters !== void 0) {
3776
3777
  query = query.chain(this.getCompletionItemInfosForTargetSignaturesValueParameters(ctx.targetSignaturesValueParameters));
3777
3778
  }
@@ -3796,8 +3797,8 @@ var CompletionService = class {
3796
3797
  getCompletionItemInfosForTargetSignaturesValueParameters(valueParameters) {
3797
3798
  return valueParameters.map((p) => new TargetSignatureValueParameterCompletionItemInfo(this.completionItemInfoContext, p));
3798
3799
  }
3799
- getScopeCompletionItemInfos(lookup) {
3800
- return Query.from(lookup.getNamedDeclarations()).map((d) => {
3800
+ getScopeCompletionItemInfos(semanticContext) {
3801
+ return Query.from(semanticContext.getNamedDeclarations()).map((d) => {
3801
3802
  switch (d.value.kind) {
3802
3803
  case "variable": {
3803
3804
  if (d.value.value.kind === "entity") {
@@ -3844,7 +3845,7 @@ var CompletionService = class {
3844
3845
  Debug.never(d.value);
3845
3846
  }
3846
3847
  }).chain(
3847
- Query.from(lookup.getOperators()).map((o) => new OperatorCompletionItemInfo(this.completionItemInfoContext, o.value, o.localization))
3848
+ Query.from(semanticContext.getOperators()).map((o) => new OperatorCompletionItemInfo(this.completionItemInfoContext, o.value, o.localization))
3848
3849
  );
3849
3850
  }
3850
3851
  getTypeCompletionItemInfos(ctx) {
@@ -3902,7 +3903,7 @@ var CompletionService = class {
3902
3903
  return query.toArray();
3903
3904
  }
3904
3905
  getTypeCompletionItemInfosFromScope(searchLocation) {
3905
- return searchLocation.lookup.getTypesOrContainersWithTypes().map((d) => {
3906
+ return searchLocation.semanticContext.getTypesOrContainersWithTypes().map((d) => {
3906
3907
  switch (d.value.kind) {
3907
3908
  case "type": {
3908
3909
  return new NamedTypeCompletionItemInfo(
@@ -3984,7 +3985,7 @@ var CompletionService = class {
3984
3985
  return query.toArray();
3985
3986
  }
3986
3987
  getTagCompletionItemInfosFromScope(searchLocation) {
3987
- return searchLocation.lookup.getNamedDeclarations().map((d) => {
3988
+ return searchLocation.semanticContext.getNamedDeclarations().map((d) => {
3988
3989
  switch (d.value.kind) {
3989
3990
  case "type":
3990
3991
  return new NamedTypeCompletionItemInfo(
@@ -4059,8 +4060,8 @@ var CompletionService = class {
4059
4060
  getTypeMemberCompletionItemInfos(ctx) {
4060
4061
  const type = this._analyzer.excludeNoneFromType(ctx.type);
4061
4062
  const memberLookup = TypeMemberLookup.ofType(this._analyzer, type, ctx.localizationContext);
4062
- const options6 = ctx.isStaticAccess ? 2 /* OnlyStaticMembers */ : 0 /* None */;
4063
- return memberLookup.getNamedMembers(options6, ctx.hidingMatcher, ctx.typeExtensionsLookup).map((m) => {
4063
+ const options6 = ctx.isStaticAccess ? 2 /* OnlyStaticMembers */ : 1 /* OnlyInstanceMembers */;
4064
+ return memberLookup.getNamedMembers(options6, ctx.hidingMatcher, ctx.typeExtensionLookup).map((m) => {
4064
4065
  switch (m.value.kind) {
4065
4066
  case "method":
4066
4067
  return new MethodCompletionItemInfo(
@@ -4079,7 +4080,7 @@ var CompletionService = class {
4079
4080
  default:
4080
4081
  Debug.never(m.value);
4081
4082
  }
4082
- }).concat(memberLookup.getOperators(options6, ctx.hidingMatcher, ctx.typeExtensionsLookup).map((o) => new OperatorCompletionItemInfo(this.completionItemInfoContext, o.value, o.localization)));
4083
+ }).concat(memberLookup.getOperators(options6, ctx.hidingMatcher, ctx.typeExtensionLookup).map((o) => new OperatorCompletionItemInfo(this.completionItemInfoContext, o.value, o.localization)));
4083
4084
  }
4084
4085
  getPackageImportCompletionItemInfos(ctx) {
4085
4086
  const result = this._analyzer.packageImports.getPackagesAvailableForImport(this._sourceFile.package).map((p) => p.getImportName()).filter((n) => {
@@ -4252,7 +4253,7 @@ var CompletionService = class {
4252
4253
  if (!ctx.hasPrecedingKeyword) {
4253
4254
  const keywords = [
4254
4255
  12 /* Function */,
4255
- 30 /* Creation */
4256
+ 31 /* Creation */
4256
4257
  ];
4257
4258
  result = result.chain(
4258
4259
  Query.from(keywords).map(
@@ -4435,12 +4436,12 @@ var PackageImportCompletionContext = class {
4435
4436
  }
4436
4437
  };
4437
4438
  var TypeMemberCompletionContext = class {
4438
- constructor(type, localizationContext, isStaticAccess, hidingMatcher, typeExtensionsLookup) {
4439
+ constructor(type, localizationContext, isStaticAccess, hidingMatcher, typeExtensionLookup) {
4439
4440
  this.type = type;
4440
4441
  this.localizationContext = localizationContext;
4441
4442
  this.isStaticAccess = isStaticAccess;
4442
4443
  this.hidingMatcher = hidingMatcher;
4443
- this.typeExtensionsLookup = typeExtensionsLookup;
4444
+ this.typeExtensionLookup = typeExtensionLookup;
4444
4445
  this.kind = "type-member";
4445
4446
  }
4446
4447
  };
@@ -4479,8 +4480,8 @@ var OperatorNameCompletionContext = class {
4479
4480
  }
4480
4481
  };
4481
4482
  var ScopeTypeSearchLocation = class {
4482
- constructor(lookup) {
4483
- this.lookup = lookup;
4483
+ constructor(semanticContext) {
4484
+ this.semanticContext = semanticContext;
4484
4485
  this.kind = "scope";
4485
4486
  }
4486
4487
  };
@@ -4500,8 +4501,8 @@ var PackageNameSegmentTypeSearchLocation = class {
4500
4501
  }
4501
4502
  };
4502
4503
  var ExpressionCompletionContext = class {
4503
- constructor(lookup, targetSignaturesValueParameters, targetTypes, localizationContext) {
4504
- this.lookup = lookup;
4504
+ constructor(semanticContext, targetSignaturesValueParameters, targetTypes, localizationContext) {
4505
+ this.semanticContext = semanticContext;
4505
4506
  this.targetSignaturesValueParameters = targetSignaturesValueParameters;
4506
4507
  this.targetTypes = targetTypes;
4507
4508
  this.localizationContext = localizationContext;
@@ -5107,7 +5108,7 @@ var AliasesSourceConstructorCompletionItemInfo = class {
5107
5108
  Localization.Original.ofEntity(this.constructor_)
5108
5109
  );
5109
5110
  const displayParts = this.displayService.getConstructorDeclarationDisplayParts(constructorDeclaration);
5110
- const creationKeyword = this.displayService.displayKeyword(30 /* Creation */);
5111
+ const creationKeyword = this.displayService.displayKeyword(31 /* Creation */);
5111
5112
  return creationKeyword + displayParts.valueParametersStart + displayParts.valueParameters.map((p) => p.toString()).join(displayParts.valueParameterSeparator) + displayParts.valueParametersEnd;
5112
5113
  });
5113
5114
  }
@@ -5121,7 +5122,7 @@ var AliasesSourceConstructorCompletionItemInfo = class {
5121
5122
  return this.label;
5122
5123
  }
5123
5124
  getInsertText() {
5124
- const creationKeyword = this.includeOnCreateKeyword ? this.displayService.displayKeyword(30 /* Creation */) : "";
5125
+ const creationKeyword = this.includeOnCreateKeyword ? this.displayService.displayKeyword(31 /* Creation */) : "";
5125
5126
  const parameters = this.constructor_.getValueParameters().map((p) => this.ctx.getInsertTextForName(p.getName(), true)).join(", ");
5126
5127
  return `${creationKeyword}(${parameters})`;
5127
5128
  }
@@ -5374,6 +5375,10 @@ var SyntaxContextFactory = class {
5374
5375
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5375
5376
  }
5376
5377
  }
5378
+ if (tokenOrKeyword.parent.kind === 76 /* ConditionalExpression */) {
5379
+ const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
5380
+ return { isExpressionContext: { expressionRole }, isStatementContext: false };
5381
+ }
5377
5382
  }
5378
5383
  if (tokenOrKeyword.isToken(45 /* OpenSquareBracket */) && tokenOrKeyword.parent.kind === 71 /* IndexedAccessExpression */) {
5379
5384
  const expressionRole = new ExpressionRole_argument(tokenOrKeyword.parent.argumentList, 0);
@@ -5406,8 +5411,19 @@ var SyntaxContextFactory = class {
5406
5411
  const expressionRole = new ExpressionRole_arrayElement(tokenOrKeyword.parent.parent);
5407
5412
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5408
5413
  }
5414
+ if (tokenOrKeyword.parent.kind === 76 /* ConditionalExpression */) {
5415
+ if (tokenOrKeyword.value === tokenOrKeyword.parent.firstComma) {
5416
+ const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.firstExpression);
5417
+ return { isExpressionContext: { expressionRole }, isStatementContext: false };
5418
+ }
5419
+ if (tokenOrKeyword.value === tokenOrKeyword.parent.secondComma) {
5420
+ const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.secondExpression);
5421
+ return { isExpressionContext: { expressionRole }, isStatementContext: false };
5422
+ }
5423
+ return { isExpressionContext: void 0, isStatementContext: false };
5424
+ }
5409
5425
  }
5410
- if (tokenOrKeyword.isKeyword(45 /* Case */) && tokenOrKeyword.parent.kind === 121 /* CaseClause */) {
5426
+ if (tokenOrKeyword.isKeyword(46 /* Case */) && tokenOrKeyword.parent.kind === 121 /* CaseClause */) {
5411
5427
  const expressionRole = new ExpressionRole_matchListElement(tokenOrKeyword.parent.parent.parent);
5412
5428
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5413
5429
  }
@@ -5423,7 +5439,7 @@ var SyntaxContextFactory = class {
5423
5439
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
5424
5440
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5425
5441
  }
5426
- if (tokenOrKeyword.isKeyword(44 /* Switch */) && tokenOrKeyword.parent.kind === 119 /* SwitchStatement */) {
5442
+ if (tokenOrKeyword.isKeyword(45 /* Switch */) && tokenOrKeyword.parent.kind === 119 /* SwitchStatement */) {
5427
5443
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
5428
5444
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5429
5445
  }
@@ -5451,14 +5467,10 @@ var SyntaxContextFactory = class {
5451
5467
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
5452
5468
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5453
5469
  }
5454
- if (tokenOrKeyword.isKeyword(29 /* When */) && tokenOrKeyword.parent.kind === 76 /* WhenTernaryExpression */) {
5470
+ if (tokenOrKeyword.isKeyword(30 /* Cond */) && tokenOrKeyword.parent.kind === 76 /* ConditionalExpression */) {
5455
5471
  const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
5456
5472
  return { isExpressionContext: { expressionRole }, isStatementContext: false };
5457
5473
  }
5458
- if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind === 76 /* WhenTernaryExpression */) {
5459
- const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.secondExpression);
5460
- return { isExpressionContext: { expressionRole }, isStatementContext: false };
5461
- }
5462
5474
  {
5463
5475
  const checkResult = SyntaxContextUtils.tokenOrKeywordIsValidEndOfStatement(tokenOrKeyword);
5464
5476
  if (checkResult !== void 0) {
@@ -5495,6 +5507,10 @@ var SyntaxContextFactory = class {
5495
5507
  if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind === 149 /* Modifier */ && NodeTypeUtils.isPackageMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
5496
5508
  return true;
5497
5509
  }
5510
+ const tag = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 147 /* Tag */);
5511
+ if (tag !== void 0 && NodeTypeUtils.isPackageMemberDeclaration(tag.parent.parent)) {
5512
+ return true;
5513
+ }
5498
5514
  return false;
5499
5515
  }
5500
5516
  static isTypeMemberDeclarationListContext(tokenOrKeyword) {
@@ -5528,6 +5544,10 @@ var SyntaxContextFactory = class {
5528
5544
  if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind === 149 /* Modifier */ && NodeTypeUtils.isTypeMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
5529
5545
  return true;
5530
5546
  }
5547
+ const tag = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 147 /* Tag */);
5548
+ if (tag !== void 0 && NodeTypeUtils.isTypeMemberDeclaration(tag.parent.parent)) {
5549
+ return true;
5550
+ }
5531
5551
  return false;
5532
5552
  }
5533
5553
  static isInComment(sourceFile, offset) {
@@ -5589,7 +5609,7 @@ var SyntaxContextFactory = class {
5589
5609
  if (tokenOrKeyword.isKeyword(14 /* Is */) && tokenOrKeyword.parent.kind === 73 /* IsExpression */) {
5590
5610
  return { allowsAnonymousTypes: true };
5591
5611
  }
5592
- if (tokenOrKeyword.isKeyword(42 /* As */) && tokenOrKeyword.parent.kind === 65 /* AsExpression */) {
5612
+ if (tokenOrKeyword.isKeyword(43 /* As */) && tokenOrKeyword.parent.kind === 65 /* AsExpression */) {
5593
5613
  return { allowsAnonymousTypes: true };
5594
5614
  }
5595
5615
  if (tokenOrKeyword.isToken(17 /* Bar */) && tokenOrKeyword.parent.kind === 11 /* UnionTypeSpecifier */) {
@@ -5796,13 +5816,13 @@ var NodeSemanticInfoService = class {
5796
5816
  return this.ofDereferenceExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
5797
5817
  } else if (tokenOrKeyword.parent.kind === 91 /* AssignmentStatement */) {
5798
5818
  return this.ofAssignmentStatementOperator(analyzer, tokenOrKeyword.parent, options6);
5799
- } else if (tokenOrKeyword.isKeyword(30 /* Creation */) && tokenOrKeyword.parent.kind === 45 /* ConstructorDeclaration */) {
5819
+ } else if (tokenOrKeyword.isKeyword(31 /* Creation */) && tokenOrKeyword.parent.kind === 45 /* ConstructorDeclaration */) {
5800
5820
  return this.ofConstructorDeclaration(analyzer, tokenOrKeyword.parent);
5801
5821
  } else if (tokenOrKeyword.isToken(13 /* Asterisk */) && tokenOrKeyword.parent.kind === 90 /* DefaultMatchExpression */) {
5802
5822
  return this.ofDefaultMatchExpression(analyzer, tokenOrKeyword.parent);
5803
5823
  } else if (tokenOrKeyword.isKeyword(4 /* Object */) && tokenOrKeyword.parent.kind === 86 /* ObjectExpression */) {
5804
5824
  return this.ofObjectExpression(analyzer, tokenOrKeyword.parent, options6);
5805
- } else if (tokenOrKeyword.isKeyword(56 /* Base */) && tokenOrKeyword.parent.kind === 87 /* BaseExpression */) {
5825
+ } else if (tokenOrKeyword.isKeyword(57 /* Base */) && tokenOrKeyword.parent.kind === 87 /* BaseExpression */) {
5806
5826
  return this.ofBaseExpression(analyzer, tokenOrKeyword.parent, options6);
5807
5827
  } else if ((tokenOrKeyword.isToken(45 /* OpenSquareBracket */) || tokenOrKeyword.isToken(22 /* CloseSquareBracket */)) && tokenOrKeyword.parent.kind === 49 /* IndexParameterClause */) {
5808
5828
  return this.ofIndexedElementAccessorDeclaration(analyzer, tokenOrKeyword.parent.parent);
@@ -6052,7 +6072,7 @@ var NodeSemanticInfoService = class {
6052
6072
  let result;
6053
6073
  const meaning = analyzer.resolveMemberAccessExpression(node).meaning;
6054
6074
  switch (meaning.kind) {
6055
- case "instance-variable-access": {
6075
+ case "instance-field-access": {
6056
6076
  let narrowedType;
6057
6077
  if (isNarrowableReferenceExpression(node)) {
6058
6078
  narrowedType = analyzer.type.ofExpression(node);
@@ -6065,7 +6085,7 @@ var NodeSemanticInfoService = class {
6065
6085
  result = new ReferenceNodeSemanticInfo([target], false);
6066
6086
  break;
6067
6087
  }
6068
- case "static-variable-access": {
6088
+ case "static-field-access": {
6069
6089
  let narrowedType;
6070
6090
  if (isNarrowableReferenceExpression(node)) {
6071
6091
  narrowedType = analyzer.type.ofExpression(node);
@@ -6928,8 +6948,6 @@ function getEntitySourceLocations(analyzer, entity) {
6928
6948
  case 17 /* AnonymousFunctionTypeDeclaration */:
6929
6949
  case 18 /* AnonymousStructuredTypeDeclaration */:
6930
6950
  case 19 /* AnonymousVariantTypeDeclaration */:
6931
- case 67 /* FunctionBlockLiteral */:
6932
- case 74 /* FunctionLiteral */:
6933
6951
  range = node.rangeWithoutTrivia;
6934
6952
  break;
6935
6953
  case 22 /* PackageAliasTypeDeclaration */:
@@ -7084,9 +7102,12 @@ var DefinitionService = class {
7084
7102
  getReferenceTargetSourceLocation(analyzer, target, tokenOrKeyword, sourceFile) {
7085
7103
  switch (target.kind) {
7086
7104
  case "entity":
7105
+ if (target.entity.kind === 0 /* Variable */) {
7106
+ return this.getSourceLocationsOfVariableEntity(analyzer, target.entity);
7107
+ }
7087
7108
  return getEntitySourceLocations(analyzer, target.entity);
7088
7109
  case "type-variable":
7089
- return getEntitySourceLocations(analyzer, target.variable.getEntity());
7110
+ return this.getSourceLocationsOfVariableEntity(analyzer, target.variable.getEntity());
7090
7111
  case "type-constructor":
7091
7112
  return getEntitySourceLocations(analyzer, target.constructor_.getEntity());
7092
7113
  case "accessed-function":
@@ -7096,9 +7117,9 @@ var DefinitionService = class {
7096
7117
  case "type-dereference-operator":
7097
7118
  return getEntitySourceLocations(analyzer, target.operator.getEntity());
7098
7119
  case "match-result-value-parameter":
7099
- return getEntitySourceLocations(analyzer, target.parameter.entity);
7120
+ return this.getSourceLocationsOfVariableEntity(analyzer, target.parameter.entity);
7100
7121
  case "type-value-parameter":
7101
- return getEntitySourceLocations(analyzer, target.parameter.getEntity());
7122
+ return this.getSourceLocationsOfVariableEntity(analyzer, target.parameter.getEntity());
7102
7123
  case "package":
7103
7124
  return [new SourceLocation(sourceFile, tokenOrKeyword.value.rangeWithoutTrivia)];
7104
7125
  case "package-name-tree-node":
@@ -7158,6 +7179,80 @@ var DefinitionService = class {
7158
7179
  }
7159
7180
  return new LocalizationContext(translationPackages, referenceContext.originalLocale);
7160
7181
  }
7182
+ getSourceLocationsOfVariableEntity(analyzer, entity) {
7183
+ let result = getEntitySourceLocations(analyzer, entity);
7184
+ if (result === void 0 && entity.kind === 0 /* Variable */) {
7185
+ const specialVariableInfo = entity.isSpecial();
7186
+ if (specialVariableInfo !== void 0) {
7187
+ result = this.getSourceLocationsOfSpecialVariable(analyzer, specialVariableInfo);
7188
+ }
7189
+ }
7190
+ return result;
7191
+ }
7192
+ getSourceLocationsOfSpecialVariable(analyzer, info) {
7193
+ switch (info.kind) {
7194
+ case "result":
7195
+ return [this.getSourceLocationOfSubprogramNode(analyzer, info.subprogramNode)];
7196
+ case "value":
7197
+ return [this.getSourceLocationOfSubprogramNode(analyzer, info.setterDeclaration)];
7198
+ case "implicit-function-block-parameter":
7199
+ return [this.getSourceLocationOfSubprogramNode(analyzer, info.functionBlockLiteral)];
7200
+ case "backing":
7201
+ return void 0;
7202
+ default:
7203
+ Debug.never(info);
7204
+ }
7205
+ }
7206
+ getSourceLocationOfSubprogramNode(analyzer, node) {
7207
+ let range;
7208
+ switch (node.kind) {
7209
+ case 27 /* PackageFunctionDeclaration */:
7210
+ case 36 /* PackageVariableGetterDeclaration */:
7211
+ case 37 /* PackageVariableSetterDeclaration */:
7212
+ case 52 /* MethodDeclaration */:
7213
+ case 55 /* FieldGetterDeclaration */:
7214
+ case 56 /* FieldSetterDeclaration */:
7215
+ case 58 /* NestedFunctionDeclaration */:
7216
+ range = node.name.rangeWithoutTrivia;
7217
+ break;
7218
+ case 25 /* PackageConstructorDeclaration */:
7219
+ range = node.creationKeyword.rangeWithoutTrivia;
7220
+ break;
7221
+ case 26 /* PackageEntryPointDeclaration */:
7222
+ range = node.runKeyword.rangeWithoutTrivia;
7223
+ break;
7224
+ case 45 /* ConstructorDeclaration */:
7225
+ range = node.creationKeyword.rangeWithoutTrivia;
7226
+ break;
7227
+ case 46 /* DestructorDeclaration */:
7228
+ range = node.destructionKeyword.rangeWithoutTrivia;
7229
+ break;
7230
+ case 47 /* IndexedElementGetterDeclaration */:
7231
+ case 48 /* IndexedElementSetterDeclaration */:
7232
+ range = node.parameterClause.rangeWithoutTrivia;
7233
+ break;
7234
+ case 50 /* DereferencedVariableGetterDeclaration */:
7235
+ case 51 /* DereferencedVariableSetterDeclaration */:
7236
+ range = node.caretToken.rangeWithoutTrivia;
7237
+ break;
7238
+ case 53 /* OperatorDeclaration */:
7239
+ range = node.name.rangeWithoutTrivia;
7240
+ break;
7241
+ case 67 /* FunctionBlockLiteral */:
7242
+ range = node.block.openBraceToken.rangeWithoutTrivia;
7243
+ break;
7244
+ case 74 /* FunctionLiteral */: {
7245
+ const rangeStart = node.functionKeyword.rangeWithoutTrivia.start;
7246
+ const rangeEnd = node.parameterClause.rangeWithoutTrivia.end;
7247
+ range = new Range(rangeStart, rangeEnd);
7248
+ break;
7249
+ }
7250
+ default:
7251
+ Debug.never(node);
7252
+ }
7253
+ const sourceFile = TreeQuery.fromNode(node).projectSourceFile(analyzer);
7254
+ return new SourceLocation(sourceFile, range);
7255
+ }
7161
7256
  };
7162
7257
  var DefinitionsAndReferenceInfo = class {
7163
7258
  constructor(definitionLocations, referenceRange) {
@@ -7981,7 +8076,7 @@ var HoverService = class {
7981
8076
  const typeText = this._displayService.displayType(firstTarget.value.type);
7982
8077
  return new Hover(`${keywordText}: ${typeText}`, range);
7983
8078
  } else if (firstTarget.value.typeContextKind === "base") {
7984
- const keywordText = this._displayService.displayKeyword(56 /* Base */);
8079
+ const keywordText = this._displayService.displayKeyword(57 /* Base */);
7985
8080
  const typeText = this._displayService.displayType(firstTarget.value.type);
7986
8081
  return new Hover(`${keywordText}: ${typeText}`, range);
7987
8082
  } else {
@@ -8306,23 +8401,23 @@ var SourceFileItemsService = class {
8306
8401
  case 8 /* InvalidType */:
8307
8402
  return name ?? `<${LocalizationHelper.localizeKeywordAndTakeFirst(16 /* Type */, this.locale, this.dialect)}>`;
8308
8403
  case 10 /* Constructor */:
8309
- return name ?? LocalizationHelper.localizeKeywordAndTakeFirst(30 /* Creation */, this.locale, this.dialect);
8404
+ return name ?? LocalizationHelper.localizeKeywordAndTakeFirst(31 /* Creation */, this.locale, this.dialect);
8310
8405
  case 11 /* Destructor */:
8311
- return name ?? LocalizationHelper.localizeKeywordAndTakeFirst(47 /* Destruction */, this.locale, this.dialect);
8406
+ return name ?? LocalizationHelper.localizeKeywordAndTakeFirst(48 /* Destruction */, this.locale, this.dialect);
8312
8407
  case 9 /* Variant */:
8313
8408
  return name ?? `<${LocalizationHelper.localizeKeywordAndTakeFirst(6 /* Variant */, this.locale, this.dialect)}>`;
8314
8409
  case 18 /* TypeParameter */:
8315
8410
  return name ?? `<${LocalizationHelper.localizeHelperPhrase(2 /* TypeParameter */, this.locale)}>`;
8316
8411
  case 2 /* PackageVariableGetter */:
8317
8412
  case 13 /* FieldGetter */:
8318
- return `${LocalizationHelper.localizeKeywordAndTakeFirst(58 /* Get */, this.locale, this.dialect)} ${name ?? ""}`;
8413
+ return `${LocalizationHelper.localizeKeywordAndTakeFirst(59 /* Get */, this.locale, this.dialect)} ${name ?? ""}`;
8319
8414
  case 3 /* PackageVariableSetter */:
8320
8415
  case 14 /* FieldSetter */:
8321
- return `${LocalizationHelper.localizeKeywordAndTakeFirst(59 /* Set */, this.locale, this.dialect)} ${name ?? ""}`;
8416
+ return `${LocalizationHelper.localizeKeywordAndTakeFirst(60 /* Set */, this.locale, this.dialect)} ${name ?? ""}`;
8322
8417
  case 16 /* IndexedElementGetter */:
8323
- return `${LocalizationHelper.localizeKeywordAndTakeFirst(58 /* Get */, this.locale, this.dialect)} []`;
8418
+ return `${LocalizationHelper.localizeKeywordAndTakeFirst(59 /* Get */, this.locale, this.dialect)} []`;
8324
8419
  case 17 /* IndexedElementSetter */:
8325
- return `${LocalizationHelper.localizeKeywordAndTakeFirst(59 /* Set */, this.locale, this.dialect)} []`;
8420
+ return `${LocalizationHelper.localizeKeywordAndTakeFirst(60 /* Set */, this.locale, this.dialect)} []`;
8326
8421
  default:
8327
8422
  Debug.never(kind);
8328
8423
  }
@@ -8620,7 +8715,7 @@ var SemanticTokensService = class {
8620
8715
  }
8621
8716
  if (node.kind === 78 /* MemberAccessExpression */) {
8622
8717
  const meaning = analyzer.resolveMemberAccessExpression(node).meaning;
8623
- if (meaning.kind === "static-variable-access") {
8718
+ if (meaning.kind === "static-field-access") {
8624
8719
  const entity = meaning.variable.value.getEntity();
8625
8720
  if (entity.subkind === "field" && entity.isVariant()) {
8626
8721
  result.push(
@@ -11765,7 +11860,7 @@ var EntityToSyntax = class {
11765
11860
  convertPackageVariable(entity) {
11766
11861
  const commonModifiers = new Array();
11767
11862
  if (entity.isConstant()) {
11768
- commonModifiers.push(SyntaxFactory.modifier(35 /* Const */));
11863
+ commonModifiers.push(SyntaxFactory.modifier(36 /* Const */));
11769
11864
  }
11770
11865
  const name = this.getEntityName(entity);
11771
11866
  const type = this.convertType(entity.getType());
@@ -11807,7 +11902,7 @@ var EntityToSyntax = class {
11807
11902
  const tags = this.convertTags(entity.getTags());
11808
11903
  const modifiers = new Array();
11809
11904
  if (entity.isAsync()) {
11810
- modifiers.push(SyntaxFactory.modifier(40 /* Async */));
11905
+ modifiers.push(SyntaxFactory.modifier(41 /* Async */));
11811
11906
  }
11812
11907
  const isHidden = entity.isHidden();
11813
11908
  if (isHidden !== void 0) {
@@ -11889,19 +11984,19 @@ var EntityToSyntax = class {
11889
11984
  }
11890
11985
  const commonModifiers = new Array();
11891
11986
  if (entity.isConstant()) {
11892
- commonModifiers.push(SyntaxFactory.modifier(35 /* Const */));
11987
+ commonModifiers.push(SyntaxFactory.modifier(36 /* Const */));
11893
11988
  }
11894
11989
  if (entity.isStatic()) {
11895
- commonModifiers.push(SyntaxFactory.modifier(41 /* Static */));
11990
+ commonModifiers.push(SyntaxFactory.modifier(42 /* Static */));
11896
11991
  }
11897
11992
  if (entity.isAbstract()) {
11898
- commonModifiers.push(SyntaxFactory.modifier(37 /* Abstract */));
11993
+ commonModifiers.push(SyntaxFactory.modifier(38 /* Abstract */));
11899
11994
  }
11900
11995
  if (entity.isRedefinable()) {
11901
- commonModifiers.push(SyntaxFactory.modifier(38 /* Redefinable */));
11996
+ commonModifiers.push(SyntaxFactory.modifier(39 /* Redefinable */));
11902
11997
  }
11903
11998
  if (entity.isRedefined()) {
11904
- commonModifiers.push(SyntaxFactory.modifier(39 /* Redefined */));
11999
+ commonModifiers.push(SyntaxFactory.modifier(40 /* Redefined */));
11905
12000
  }
11906
12001
  const name = this.getEntityName(entity);
11907
12002
  const type = this.convertType(entity.getType());
@@ -11947,16 +12042,16 @@ var EntityToSyntax = class {
11947
12042
  modifiers.push(this.createHidingModifier(isHidden));
11948
12043
  }
11949
12044
  if (entity.isStatic()) {
11950
- modifiers.push(SyntaxFactory.modifier(41 /* Static */));
12045
+ modifiers.push(SyntaxFactory.modifier(42 /* Static */));
11951
12046
  }
11952
12047
  if (entity.isAbstract()) {
11953
- modifiers.push(SyntaxFactory.modifier(37 /* Abstract */));
12048
+ modifiers.push(SyntaxFactory.modifier(38 /* Abstract */));
11954
12049
  }
11955
12050
  if (entity.isRedefinable()) {
11956
- modifiers.push(SyntaxFactory.modifier(38 /* Redefinable */));
12051
+ modifiers.push(SyntaxFactory.modifier(39 /* Redefinable */));
11957
12052
  }
11958
12053
  if (entity.isRedefined()) {
11959
- modifiers.push(SyntaxFactory.modifier(39 /* Redefined */));
12054
+ modifiers.push(SyntaxFactory.modifier(40 /* Redefined */));
11960
12055
  }
11961
12056
  const name = this.getEntityName(entity);
11962
12057
  const typeParameters = this.convertTypeParameters(entity.getTypeParameters());
@@ -11972,7 +12067,7 @@ var EntityToSyntax = class {
11972
12067
  modifiers.push(this.createHidingModifier(isHidden));
11973
12068
  }
11974
12069
  if (entity.isAbstract()) {
11975
- modifiers.push(SyntaxFactory.modifier(37 /* Abstract */));
12070
+ modifiers.push(SyntaxFactory.modifier(38 /* Abstract */));
11976
12071
  }
11977
12072
  const parameters = this.convertValueParameters(entity.getValueParameters());
11978
12073
  return SyntaxFactory.constructorDeclaration(tags, modifiers, parameters, void 0);
@@ -11985,7 +12080,7 @@ var EntityToSyntax = class {
11985
12080
  modifiers.push(this.createHidingModifier(isHidden));
11986
12081
  }
11987
12082
  if (entity.isAbstract()) {
11988
- modifiers.push(SyntaxFactory.modifier(37 /* Abstract */));
12083
+ modifiers.push(SyntaxFactory.modifier(38 /* Abstract */));
11989
12084
  }
11990
12085
  const parameters = this.convertValueParameters(entity.getValueParameters());
11991
12086
  return SyntaxFactory.destructorDeclaration(tags, modifiers, parameters, void 0);
@@ -11993,10 +12088,10 @@ var EntityToSyntax = class {
11993
12088
  convertIndexer(entity) {
11994
12089
  const commonModifiers = new Array();
11995
12090
  if (entity.isStatic()) {
11996
- commonModifiers.push(SyntaxFactory.modifier(41 /* Static */));
12091
+ commonModifiers.push(SyntaxFactory.modifier(42 /* Static */));
11997
12092
  }
11998
12093
  if (entity.isAbstract()) {
11999
- commonModifiers.push(SyntaxFactory.modifier(37 /* Abstract */));
12094
+ commonModifiers.push(SyntaxFactory.modifier(38 /* Abstract */));
12000
12095
  }
12001
12096
  const parameters = this.convertValueParameters(entity.getValueParameters());
12002
12097
  const result = new Array();
@@ -12110,21 +12205,21 @@ var EntityToSyntax = class {
12110
12205
  let levelKeyword;
12111
12206
  switch (hiding.kind) {
12112
12207
  case "type":
12113
- levelKeyword = 51 /* InType */;
12208
+ levelKeyword = 52 /* InType */;
12114
12209
  break;
12115
12210
  case "type-hierarchy":
12116
- levelKeyword = 48 /* InHierarchy */;
12211
+ levelKeyword = 49 /* InHierarchy */;
12117
12212
  break;
12118
12213
  case "file":
12119
- levelKeyword = 49 /* InFile */;
12214
+ levelKeyword = 50 /* InFile */;
12120
12215
  break;
12121
12216
  case "package":
12122
- levelKeyword = 50 /* InPackage */;
12217
+ levelKeyword = 51 /* InPackage */;
12123
12218
  break;
12124
12219
  default:
12125
12220
  Debug.never(hiding);
12126
12221
  }
12127
- return SyntaxFactory.modifier(36 /* Hidden */, levelKeyword);
12222
+ return SyntaxFactory.modifier(37 /* Hidden */, levelKeyword);
12128
12223
  }
12129
12224
  convertTags(_entityTags) {
12130
12225
  return [];
@@ -12835,7 +12930,7 @@ var LanguageServer = class {
12835
12930
  Logger.info("\u041D\u0430\u0447\u0430\u0442\u0430 \u0438\u043D\u0438\u0446\u0438\u0430\u043B\u0438\u0437\u0430\u0446\u0438\u044F \u0441\u0435\u0440\u0432\u0438\u0441\u043E\u0432.");
12836
12931
  const initializeStartTime = performance.now();
12837
12932
  this._clientCapabilities = params.capabilities;
12838
- setUserLocale(params.initializationOptions?.localeOverride ?? params.locale ?? "en");
12933
+ setUserLocale("ru");
12839
12934
  let workspaceFolderUris;
12840
12935
  if (params.initializationOptions?.workspaceFoldersOverride !== void 0) {
12841
12936
  workspaceFolderUris = params.initializationOptions.workspaceFoldersOverride.map((f) => this.convertVscodeUriToUri(URI2.parse(f.uri)));