@artel/artc 0.6.25217 → 0.6.25218
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/Cli.js +3 -3
- package/build/api/Api.js +10 -62
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +1044 -1001
- package/build/{chunk-HN3XZZQX.js → chunk-FI6LW2RD.js} +5 -4
- package/build/{chunk-TXAEJ2GI.js → chunk-SK7ZBC3X.js} +15375 -15317
- package/build/{chunk-CMPXXHBQ.js → chunk-TQDMVKTN.js} +13 -5
- package/build/types/analysis/AnalyzedTranslationPackage.d.ts +4 -26
- package/build/types/analysis/Analyzer.d.ts +27 -69
- package/build/types/analysis/{CallArgumentToParameterMatchResult.d.ts → ArgumentToParameterMatchResult.d.ts} +4 -4
- package/build/types/analysis/{CallArgumentsToParametersMatcher.d.ts → ArgumentsToParametersMatcher.d.ts} +14 -14
- package/build/types/analysis/ConstructorOverloadResolver.d.ts +1 -1
- package/build/types/analysis/DereferenceExpressionMeaning.d.ts +3 -3
- package/build/types/analysis/DiagnosticCollector.d.ts +2 -0
- package/build/types/analysis/FindModifier.d.ts +2 -0
- package/build/types/analysis/IdentifierExpressionMeaning.d.ts +14 -12
- package/build/types/analysis/LocalizationContext.d.ts +4 -5
- package/build/types/analysis/Lookup.d.ts +8 -7
- package/build/types/analysis/ModifierFlags.d.ts +16 -0
- package/build/types/analysis/NamedTypeSpecifierResolver.d.ts +0 -1
- package/build/types/analysis/NodeTypeUtils.d.ts +1 -0
- package/build/types/analysis/OperationOverloadResolver.d.ts +2 -2
- package/build/types/analysis/OverloadResolver.d.ts +4 -4
- package/build/types/analysis/PackageMemberLookup.d.ts +5 -6
- package/build/types/analysis/PropertyAccessExpressionMeaning.d.ts +18 -16
- package/build/types/analysis/Scope.d.ts +21 -116
- package/build/types/analysis/SemanticContext.d.ts +16 -6
- package/build/types/analysis/SemanticContextBuilder.d.ts +1 -1
- package/build/types/analysis/SourceFileMembers.d.ts +12 -99
- package/build/types/analysis/TagMeaning.d.ts +57 -9
- package/build/types/analysis/Tags.d.ts +2 -2
- package/build/types/analysis/TypeMemberLookup.d.ts +15 -15
- package/build/types/analysis/TypeOverloadResolver.d.ts +1 -1
- package/build/types/analysis/WellKnownDeclarations.d.ts +1 -0
- package/build/types/analysis/index.d.ts +1 -1
- package/build/types/api/Api.d.ts +2 -6
- package/build/types/diagnostic/DiagnosticCode.d.ts +20 -16
- package/build/types/emitter/{EmitterGeneratedDeclarationKind.d.ts → EmitPhaseName.d.ts} +1 -44
- package/build/types/emitter/EmitterContext.d.ts +4 -1
- package/build/types/emitter/Entities.d.ts +52 -16
- package/build/types/emitter/EntityMap.d.ts +1 -3
- package/build/types/emitter/IrBuilder.d.ts +6 -2
- package/build/types/emitter/IrToJs.d.ts +5 -4
- package/build/types/emitter/Transformer.d.ts +18 -10
- package/build/types/emitter/ir/EmitOptions.d.ts +163 -0
- package/build/types/emitter/ir/Nodes.d.ts +206 -167
- package/build/types/emitter/ir/index.d.ts +1 -2
- package/build/types/emitter/ir/types.d.ts +3 -3
- package/build/types/entities/AliasTypeEntity.d.ts +8 -4
- package/build/types/entities/ConstructorEntity.d.ts +2 -0
- package/build/types/entities/DereferenceOperatorEntity.d.ts +5 -3
- package/build/types/entities/DestructorEntity.d.ts +2 -0
- package/build/types/entities/GetterEntity.d.ts +8 -0
- package/build/types/entities/IndexerEntity.d.ts +5 -3
- package/build/types/entities/MethodEntity.d.ts +9 -5
- package/build/types/entities/MethodTypeEntity.d.ts +10 -5
- package/build/types/entities/OperatorEntity.d.ts +5 -3
- package/build/types/entities/PackageEntity.d.ts +3 -3
- package/build/types/entities/PackageMembers.d.ts +4 -90
- package/build/types/entities/SetterEntity.d.ts +8 -0
- package/build/types/entities/StructuredTypeEntity.d.ts +11 -6
- package/build/types/entities/TypeEntity.d.ts +15 -0
- package/build/types/entities/TypeExtensionEntity.d.ts +2 -0
- package/build/types/entities/TypeParameterEntity.d.ts +11 -6
- package/build/types/entities/VariableEntity.d.ts +50 -41
- package/build/types/entities/VariantTypeEntity.d.ts +10 -11
- package/build/types/entities/index.d.ts +17 -25
- package/build/types/executor/Compiler.d.ts +1 -0
- package/build/types/executor/NodeCompiler.d.ts +1 -0
- package/build/types/parser/CharacterCodes.d.ts +8 -0
- package/build/types/parser/ReservedIdentifierDictionary.d.ts +1 -2
- package/build/types/project/FileSystemTree.d.ts +2 -2
- package/build/types/services/CompletionService.d.ts +4 -1
- package/build/types/services/DisplayService.d.ts +18 -2
- package/build/types/services/NodeSemanticInfo.d.ts +7 -5
- package/build/types/services/signature-help/SignatureWithValueParameters.d.ts +7 -21
- package/build/types/services/signature-help/TypeParameterSignatureHelpProvider.d.ts +1 -0
- package/build/types/services/source-generation/EntityToSyntax.d.ts +1 -1
- package/build/types/services/source-generation/SourceGenerationService.d.ts +2 -2
- package/build/types/services/workspace/ClientTrackedSourceFiles.d.ts +5 -5
- package/build/types/services/workspace/CompilationController.d.ts +3 -3
- package/build/types/services/workspace/FileSystemTreeProviderBasedOnWatchedFileSystem.d.ts +4 -4
- package/build/types/services/workspace/ManuallyUpdatedFileSystemTreeProvider.d.ts +4 -4
- package/build/types/services/workspace/Workspace.d.ts +3 -3
- package/build/types/services/workspace/WorkspaceFiles.d.ts +7 -7
- package/build/types/tree/KeywordKind.d.ts +37 -37
- package/build/types/tree/NodeKind.d.ts +57 -58
- package/build/types/tree/green/Nodes.d.ts +57 -71
- package/build/types/tree/green/SyntaxFactory.d.ts +4 -5
- package/build/types/tree/green/SyntaxToCode.d.ts +1 -2
- package/build/types/tree/red/Nodes.d.ts +65 -79
- package/build/types/ts-interop/Entities.d.ts +51 -28
- package/build/types/ts-interop/TsPackageMembersCreator.d.ts +0 -1
- package/build/types/types/TypeMembers.d.ts +9 -0
- package/package.json +2 -2
- package/build/types/analysis/DereferencedVariableAccess.d.ts +0 -14
- package/build/types/analysis/IndexedAccess.d.ts +0 -14
- package/build/types/analysis/VariableAccess.d.ts +0 -14
- package/build/types/analysis/VariantLookup.d.ts +0 -20
- package/build/types/emitter/ir/LoweringOptions.d.ts +0 -36
- package/build/types/emitter/ir/LoweringState.d.ts +0 -49
- package/build/types/entities/VariantEntity.d.ts +0 -31
- package/build/types/entities/Variants.d.ts +0 -10
package/build/api/ApiServices.js
CHANGED
@@ -6,9 +6,9 @@ import {
|
|
6
6
|
AnonymousStructuredTypeDeclaration,
|
7
7
|
AnonymousTypeSpecifier,
|
8
8
|
AnonymousVariantTypeDeclaration,
|
9
|
+
ArgumentList,
|
9
10
|
BaseTypeList,
|
10
11
|
Cached,
|
11
|
-
CallArgumentList,
|
12
12
|
CancelledError,
|
13
13
|
CompilationLoader,
|
14
14
|
ConfigurationConverter,
|
@@ -44,6 +44,7 @@ import {
|
|
44
44
|
LocalizationContext,
|
45
45
|
LocalizationHelper,
|
46
46
|
Logger,
|
47
|
+
MethodDeclaration_accessedMethod,
|
47
48
|
MethodDeclaration_entity,
|
48
49
|
MethodDeclaration_substitutedMethod,
|
49
50
|
MethodDeclaration_typeMember,
|
@@ -88,8 +89,6 @@ import {
|
|
88
89
|
Query,
|
89
90
|
Range,
|
90
91
|
Scanner,
|
91
|
-
SetterParameterClause,
|
92
|
-
SetterParameterDeclaration,
|
93
92
|
SinglePackageImportDirective,
|
94
93
|
SourceFile,
|
95
94
|
SourcePackageDependencyGraph,
|
@@ -153,7 +152,6 @@ import {
|
|
153
152
|
VariableDeclaration_entity,
|
154
153
|
VariableDeclaration_typeMember,
|
155
154
|
VariantDeclaration,
|
156
|
-
VariantLookup,
|
157
155
|
VariantTypeDeclarationBody,
|
158
156
|
WellKnownDeclarationsLoadError,
|
159
157
|
__async,
|
@@ -182,7 +180,7 @@ import {
|
|
182
180
|
unwrapParenthesizedExpressions,
|
183
181
|
visitChildren,
|
184
182
|
yieldExecution
|
185
|
-
} from "../chunk-
|
183
|
+
} from "../chunk-SK7ZBC3X.js";
|
186
184
|
|
187
185
|
// source/services/CustomCommand.ts
|
188
186
|
import * as ls from "vscode-languageserver";
|
@@ -267,7 +265,7 @@ function cast(value) {
|
|
267
265
|
}
|
268
266
|
|
269
267
|
// source/services/LanguageServer.ts
|
270
|
-
import {
|
268
|
+
import { atomicBlock as atomicBlock6, atomicRun as atomicRun3 } from "reactronic";
|
271
269
|
import * as ls3 from "vscode-languageserver";
|
272
270
|
import { TextDocument } from "vscode-languageserver-textdocument";
|
273
271
|
import { URI as URI2 } from "vscode-uri";
|
@@ -372,14 +370,15 @@ var AddPropertyAssignmentService = class {
|
|
372
370
|
return void 0;
|
373
371
|
case 98 /* RunStatement */:
|
374
372
|
return this.ifShouldBeAssignedAtTheEndOfSubprogramThenBody(parent);
|
375
|
-
case 99 /*
|
376
|
-
case
|
377
|
-
case
|
378
|
-
case 107 /*
|
379
|
-
case
|
380
|
-
case
|
381
|
-
case
|
382
|
-
case 119 /*
|
373
|
+
case 99 /* TryStatement */:
|
374
|
+
case 100 /* CatchClause */:
|
375
|
+
case 102 /* FinallyClause */:
|
376
|
+
case 107 /* ForStatement */:
|
377
|
+
case 108 /* IfStatement */:
|
378
|
+
case 110 /* ElseIfClause */:
|
379
|
+
case 114 /* LoopStatement */:
|
380
|
+
case 119 /* SwitchStatementCaseClause */:
|
381
|
+
case 120 /* WhileStatement */:
|
383
382
|
return this.getContainingSubprogram(parent)?.body;
|
384
383
|
default:
|
385
384
|
Debug.never(parent);
|
@@ -440,7 +439,7 @@ var SyntaxFactory = class {
|
|
440
439
|
}
|
441
440
|
const packagePath = this.packagePath(pathSegments);
|
442
441
|
const packageImport = new PackageImport(aliasIdentifier, equalsToken, packagePath);
|
443
|
-
const importKeyword = this.keyword(
|
442
|
+
const importKeyword = this.keyword(18 /* Import */);
|
444
443
|
return new SinglePackageImportDirective(importKeyword, packageImport);
|
445
444
|
}
|
446
445
|
static packagePath(segments) {
|
@@ -451,7 +450,7 @@ var SyntaxFactory = class {
|
|
451
450
|
static packageAliasTypeDeclaration(tags, modifiers, name, typeParameters, body) {
|
452
451
|
const tagList = new TagList(tags);
|
453
452
|
const modifierList = new ModifierList(modifiers);
|
454
|
-
const typeKeyword = this.keyword(
|
453
|
+
const typeKeyword = this.keyword(16 /* Type */);
|
455
454
|
const nameIdentifier = this.createIdentifier(name);
|
456
455
|
const typeParameterClause = this.createTypeParameterClause(typeParameters);
|
457
456
|
const equalsToken = this.token(57 /* Equals */);
|
@@ -484,7 +483,7 @@ var SyntaxFactory = class {
|
|
484
483
|
static packageMethodDeclaration(tags, modifiers, name, typeParameters, parameters, returnTypeSpecifier, body) {
|
485
484
|
const tagList = new TagList(tags);
|
486
485
|
const modifierList = new ModifierList(modifiers);
|
487
|
-
const functionKeyword = this.keyword(
|
486
|
+
const functionKeyword = this.keyword(12 /* Function */);
|
488
487
|
const nameIdentifier = this.createIdentifier(name);
|
489
488
|
const typeParameterClause = this.createTypeParameterClause(typeParameters);
|
490
489
|
const parameterClause = this.parameterClause(parameters);
|
@@ -503,7 +502,7 @@ var SyntaxFactory = class {
|
|
503
502
|
static packageMethodTypeDeclaration(tags, modifiers, name, typeParameters, body) {
|
504
503
|
const tagList = new TagList(tags);
|
505
504
|
const modifierList = new ModifierList(modifiers);
|
506
|
-
const typeKeyword = this.keyword(
|
505
|
+
const typeKeyword = this.keyword(16 /* Type */);
|
507
506
|
const nameIdentifier = this.createIdentifier(name);
|
508
507
|
const typeParameterClause = this.createTypeParameterClause(typeParameters);
|
509
508
|
const equalsToken = this.token(57 /* Equals */);
|
@@ -518,7 +517,7 @@ var SyntaxFactory = class {
|
|
518
517
|
);
|
519
518
|
}
|
520
519
|
static methodTypeDeclarationBody(parameters, returnTypeSpecifier) {
|
521
|
-
const functionKeyword = this.keyword(
|
520
|
+
const functionKeyword = this.keyword(12 /* Function */);
|
522
521
|
const parameterClause = this.parameterClause(parameters);
|
523
522
|
const returnTypeAnnotation = this.createTypeAnnotation(returnTypeSpecifier);
|
524
523
|
return new MethodTypeDeclarationBody(void 0, functionKeyword, parameterClause, returnTypeAnnotation);
|
@@ -526,7 +525,7 @@ var SyntaxFactory = class {
|
|
526
525
|
static packageStructuredTypeDeclaration(tags, modifiers, name, typeParameters, body) {
|
527
526
|
const tagList = new TagList(tags);
|
528
527
|
const modifierList = new ModifierList(modifiers);
|
529
|
-
const typeKeyword = this.keyword(
|
528
|
+
const typeKeyword = this.keyword(16 /* Type */);
|
530
529
|
const nameIdentifier = this.createIdentifier(name);
|
531
530
|
const typeParameterClause = this.createTypeParameterClause(typeParameters);
|
532
531
|
const equalsToken = this.token(57 /* Equals */);
|
@@ -583,24 +582,17 @@ var SyntaxFactory = class {
|
|
583
582
|
body
|
584
583
|
);
|
585
584
|
}
|
586
|
-
static packageVariableSetterDeclaration(tags, modifiers, name,
|
585
|
+
static packageVariableSetterDeclaration(tags, modifiers, name, body) {
|
587
586
|
const tagList = new TagList(tags);
|
588
587
|
const modifierList = new ModifierList(modifiers);
|
589
588
|
const setKeyword = this.keyword(58 /* Set */);
|
590
589
|
const nameIdentifier = this.createIdentifier(name);
|
591
|
-
return new PackageVariableSetterDeclaration(
|
592
|
-
tagList,
|
593
|
-
modifierList,
|
594
|
-
setKeyword,
|
595
|
-
nameIdentifier,
|
596
|
-
setterParameterClause,
|
597
|
-
body
|
598
|
-
);
|
590
|
+
return new PackageVariableSetterDeclaration(tagList, modifierList, setKeyword, nameIdentifier, body);
|
599
591
|
}
|
600
592
|
static packageVariantTypeDeclaration(tags, modifiers, name, typeParameters, body) {
|
601
593
|
const tagList = new TagList(tags);
|
602
594
|
const modifierList = new ModifierList(modifiers);
|
603
|
-
const typeKeyword = this.keyword(
|
595
|
+
const typeKeyword = this.keyword(16 /* Type */);
|
604
596
|
const nameIdentifier = this.createIdentifier(name);
|
605
597
|
const typeParameterClause = this.createTypeParameterClause(typeParameters);
|
606
598
|
const equalsToken = this.token(57 /* Equals */);
|
@@ -652,24 +644,17 @@ var SyntaxFactory = class {
|
|
652
644
|
body
|
653
645
|
);
|
654
646
|
}
|
655
|
-
static typeVariableSetterDeclaration(tags, modifiers, name,
|
647
|
+
static typeVariableSetterDeclaration(tags, modifiers, name, body) {
|
656
648
|
const tagList = new TagList(tags);
|
657
649
|
const modifierList = new ModifierList(modifiers);
|
658
650
|
const setKeyword = this.keyword(58 /* Set */);
|
659
651
|
const nameIdentifier = this.createIdentifier(name);
|
660
|
-
return new TypeVariableSetterDeclaration(
|
661
|
-
tagList,
|
662
|
-
modifierList,
|
663
|
-
setKeyword,
|
664
|
-
nameIdentifier,
|
665
|
-
setterParameterClause,
|
666
|
-
body
|
667
|
-
);
|
652
|
+
return new TypeVariableSetterDeclaration(tagList, modifierList, setKeyword, nameIdentifier, body);
|
668
653
|
}
|
669
654
|
static typeMethodDeclaration(tags, modifiers, name, typeParameters, parameters, returnTypeSpecifier, body) {
|
670
655
|
const tagList = new TagList(tags);
|
671
656
|
const modifierList = new ModifierList(modifiers);
|
672
|
-
const functionKeyword = this.keyword(
|
657
|
+
const functionKeyword = this.keyword(12 /* Function */);
|
673
658
|
const nameIdentifier = this.createIdentifier(name);
|
674
659
|
const typeParameterClause = this.createTypeParameterClause(typeParameters);
|
675
660
|
const parameterClause = this.parameterClause(parameters);
|
@@ -688,7 +673,7 @@ var SyntaxFactory = class {
|
|
688
673
|
static typeConstructorDeclaration(tags, modifiers, parameters, body) {
|
689
674
|
const tagList = new TagList(tags);
|
690
675
|
const modifierList = new ModifierList(modifiers);
|
691
|
-
const creationKeyword = this.keyword(
|
676
|
+
const creationKeyword = this.keyword(29 /* Creation */);
|
692
677
|
const parameterClause = this.parameterClause(parameters);
|
693
678
|
return new TypeConstructorDeclaration(tagList, modifierList, creationKeyword, parameterClause, body);
|
694
679
|
}
|
@@ -714,19 +699,12 @@ var SyntaxFactory = class {
|
|
714
699
|
body
|
715
700
|
);
|
716
701
|
}
|
717
|
-
static typeIndexedSetterDeclaration(tags, modifiers, parameters,
|
702
|
+
static typeIndexedSetterDeclaration(tags, modifiers, parameters, body) {
|
718
703
|
const tagList = new TagList(tags);
|
719
704
|
const modifierList = new ModifierList(modifiers);
|
720
705
|
const getKeyword = this.keyword(58 /* Set */);
|
721
706
|
const parameterClause = this.indexerParameterClause(parameters);
|
722
|
-
return new TypeIndexedSetterDeclaration(
|
723
|
-
tagList,
|
724
|
-
modifierList,
|
725
|
-
getKeyword,
|
726
|
-
parameterClause,
|
727
|
-
setterParameterClause,
|
728
|
-
body
|
729
|
-
);
|
707
|
+
return new TypeIndexedSetterDeclaration(tagList, modifierList, getKeyword, parameterClause, body);
|
730
708
|
}
|
731
709
|
static typeMemberGroupDeclaration(tags, modifiers, members) {
|
732
710
|
const tagList = new TagList(tags);
|
@@ -821,27 +799,31 @@ var SyntaxFactory = class {
|
|
821
799
|
}
|
822
800
|
return new ParameterDeclaration(tagList, nameIdentifier, typeAnnotation, equalsToken, defaultValue);
|
823
801
|
}
|
824
|
-
static
|
825
|
-
const openParenthesisToken = this.token(44 /* OpenParenthesis */);
|
826
|
-
const nameIdentifier = this.createIdentifier(name);
|
827
|
-
const typeAnnotation = this.typeAnnotation(typeSpecifier);
|
828
|
-
const parameterDeclaration = new SetterParameterDeclaration(nameIdentifier, typeAnnotation);
|
829
|
-
const closeParenthesisToken = this.token(21 /* CloseParenthesis */);
|
830
|
-
return new SetterParameterClause(openParenthesisToken, parameterDeclaration, closeParenthesisToken);
|
831
|
-
}
|
832
|
-
static tag(typeSpecifier, callArguments) {
|
802
|
+
static tag(name, typeArguments, args) {
|
833
803
|
const hashSignToken = this.token(35 /* HashSign */);
|
804
|
+
const qualifiedNameIdentifiers = typeof name === "string" ? [this.createIdentifier(name)] : name.map((s) => this.createIdentifier(s));
|
805
|
+
const qualifiedName = new QualifiedName(
|
806
|
+
this.createTokenSeparatedElements(qualifiedNameIdentifiers, 26 /* Dot */)
|
807
|
+
);
|
808
|
+
const typeArgumentClause = typeArguments !== void 0 ? this.typeArgumentClause(typeArguments) : void 0;
|
834
809
|
let openParenthesisToken;
|
835
|
-
let
|
810
|
+
let argumentList;
|
836
811
|
let closeParenthesisToken;
|
837
|
-
if (
|
812
|
+
if (args !== void 0) {
|
838
813
|
openParenthesisToken = this.token(44 /* OpenParenthesis */);
|
839
|
-
|
840
|
-
this.createTokenSeparatedElements(
|
814
|
+
argumentList = new ArgumentList(
|
815
|
+
this.createTokenSeparatedElements(args, 24 /* Comma */)
|
841
816
|
);
|
842
817
|
closeParenthesisToken = this.token(21 /* CloseParenthesis */);
|
843
818
|
}
|
844
|
-
return new Tag(
|
819
|
+
return new Tag(
|
820
|
+
hashSignToken,
|
821
|
+
qualifiedName,
|
822
|
+
typeArgumentClause,
|
823
|
+
openParenthesisToken,
|
824
|
+
argumentList,
|
825
|
+
closeParenthesisToken
|
826
|
+
);
|
845
827
|
}
|
846
828
|
static modifier(value, level) {
|
847
829
|
const valueKeyword = this.keyword(value);
|
@@ -901,7 +883,7 @@ var SyntaxFactory = class {
|
|
901
883
|
return new PackageVariableTranslation(sourceNameIdentifier, minusGreaterThanToken, translatedNameIdentifier);
|
902
884
|
}
|
903
885
|
static packageMethodTranslation(sourceName, sourceTypeParameters, sourceParameters, translatedName, translatedTypeParameters, translatedParameters) {
|
904
|
-
const functionKeyword = this.keyword(
|
886
|
+
const functionKeyword = this.keyword(12 /* Function */);
|
905
887
|
const sourceNameIdentifier = this.createIdentifier(sourceName);
|
906
888
|
const sourceTypeParameterClause = this.createTranslationTypeParameterClause(sourceTypeParameters);
|
907
889
|
const sourceParameterClause = this.translationParameterClause(sourceParameters);
|
@@ -921,7 +903,7 @@ var SyntaxFactory = class {
|
|
921
903
|
);
|
922
904
|
}
|
923
905
|
static typeTranslation(sourceName, sourceTypeParameters, translatedName, translatedTypeParameters, members) {
|
924
|
-
const typeKeyword = this.keyword(
|
906
|
+
const typeKeyword = this.keyword(16 /* Type */);
|
925
907
|
const sourceNameIdentifier = this.createIdentifier(sourceName);
|
926
908
|
const sourceTypeParameterClause = this.createTranslationTypeParameterClause(sourceTypeParameters);
|
927
909
|
const minusGreaterThanToken = this.token(42 /* MinusGreaterThan */);
|
@@ -948,7 +930,7 @@ var SyntaxFactory = class {
|
|
948
930
|
);
|
949
931
|
}
|
950
932
|
static methodTypeTranslation(sourceName, sourceTypeParameters, sourceParameters, translatedName, translatedTypeParameters, translatedParameters) {
|
951
|
-
const typeKeyword = this.keyword(
|
933
|
+
const typeKeyword = this.keyword(16 /* Type */);
|
952
934
|
const sourceNameIdentifier = this.createIdentifier(sourceName);
|
953
935
|
const sourceTypeParameterClause = this.createTranslationTypeParameterClause(sourceTypeParameters);
|
954
936
|
const sourceParameterClause = this.translationParameterClause(sourceParameters);
|
@@ -978,7 +960,7 @@ var SyntaxFactory = class {
|
|
978
960
|
);
|
979
961
|
}
|
980
962
|
static typeMethodTranslation(sourceName, sourceTypeParameters, sourceParameters, translatedName, translatedTypeParameters, translatedParameters) {
|
981
|
-
const functionKeyword = this.keyword(
|
963
|
+
const functionKeyword = this.keyword(12 /* Function */);
|
982
964
|
const sourceNameIdentifier = this.createIdentifier(sourceName);
|
983
965
|
const sourceTypeParameterClause = this.createTranslationTypeParameterClause(sourceTypeParameters);
|
984
966
|
const sourceParameterClause = this.translationParameterClause(sourceParameters);
|
@@ -998,7 +980,7 @@ var SyntaxFactory = class {
|
|
998
980
|
);
|
999
981
|
}
|
1000
982
|
static constructorTranslation(sourceParameters, translatedParameters) {
|
1001
|
-
const creationKeyword = this.keyword(
|
983
|
+
const creationKeyword = this.keyword(29 /* Creation */);
|
1002
984
|
const sourceParameterClause = this.translationParameterClause(sourceParameters);
|
1003
985
|
const minusGreaterThanToken = this.token(42 /* MinusGreaterThan */);
|
1004
986
|
const translatedParameterClause = this.translationParameterClause(translatedParameters);
|
@@ -1179,10 +1161,6 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1179
1161
|
this.writeKeyword(node.setKeyword);
|
1180
1162
|
this.writeWhitespace();
|
1181
1163
|
this.writeToken(node.name);
|
1182
|
-
if (node.setterParameterClause !== void 0) {
|
1183
|
-
this.writeWhitespace();
|
1184
|
-
this.writeSetterParameterClause(node.setterParameterClause);
|
1185
|
-
}
|
1186
1164
|
if (node.body !== void 0) {
|
1187
1165
|
this.writeDeclarationBody(node.body);
|
1188
1166
|
}
|
@@ -1360,10 +1338,6 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1360
1338
|
this.writeKeyword(node.setKeyword);
|
1361
1339
|
this.writeWhitespace();
|
1362
1340
|
this.writeToken(node.name);
|
1363
|
-
if (node.setterParameterClause !== void 0) {
|
1364
|
-
this.writeWhitespace();
|
1365
|
-
this.writeSetterParameterClause(node.setterParameterClause);
|
1366
|
-
}
|
1367
1341
|
if (node.body !== void 0) {
|
1368
1342
|
this.writeDeclarationBody(node.body);
|
1369
1343
|
}
|
@@ -1438,10 +1412,6 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1438
1412
|
this.writeToken(node.parameterClause.openSquareBracketToken);
|
1439
1413
|
this.writeParameterList(node.parameterClause.parameterList);
|
1440
1414
|
this.writeToken(node.parameterClause.closeSquareBracketToken);
|
1441
|
-
if (node.setterParameterClause !== void 0) {
|
1442
|
-
this.writeWhitespace();
|
1443
|
-
this.writeSetterParameterClause(node.setterParameterClause);
|
1444
|
-
}
|
1445
1415
|
if (node.body !== void 0) {
|
1446
1416
|
this.writeDeclarationBody(node.body);
|
1447
1417
|
}
|
@@ -1463,10 +1433,6 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1463
1433
|
this.writeKeyword(node.setKeyword);
|
1464
1434
|
this.writeWhitespace();
|
1465
1435
|
this.writeToken(node.caretToken);
|
1466
|
-
if (node.setterParameterClause !== void 0) {
|
1467
|
-
this.writeWhitespace();
|
1468
|
-
this.writeSetterParameterClause(node.setterParameterClause);
|
1469
|
-
}
|
1470
1436
|
if (node.body !== void 0) {
|
1471
1437
|
this.writeDeclarationBody(node.body);
|
1472
1438
|
}
|
@@ -1532,12 +1498,6 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1532
1498
|
this.writeExpression(node.defaultValue);
|
1533
1499
|
}
|
1534
1500
|
}
|
1535
|
-
writeSetterParameterClause(node) {
|
1536
|
-
this.writeToken(node.openParenthesisToken);
|
1537
|
-
this.writeToken(node.parameterDeclaration.name);
|
1538
|
-
this.writeTypeAnnotation(node.parameterDeclaration.typeAnnotation, true);
|
1539
|
-
this.writeToken(node.closeParenthesisToken);
|
1540
|
-
}
|
1541
1501
|
writeDeclarationTags(tagList) {
|
1542
1502
|
if (tagList.tags.length > 0) {
|
1543
1503
|
this.writeWhitespaceSeparatedList(tagList.tags, (t) => this.writeTag(t));
|
@@ -1546,10 +1506,13 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1546
1506
|
}
|
1547
1507
|
writeTag(node) {
|
1548
1508
|
this.writeToken(node.hashSignToken);
|
1549
|
-
this.
|
1550
|
-
if (node.
|
1509
|
+
this.writeQualifiedName(node.name);
|
1510
|
+
if (node.typeArgumentClause !== void 0) {
|
1511
|
+
this.writeTypeArgumentClause(node.typeArgumentClause);
|
1512
|
+
}
|
1513
|
+
if (node.openParenthesisToken !== void 0 && node.argumentList !== void 0 && node.closeParenthesisToken !== void 0) {
|
1551
1514
|
this.writeToken(node.openParenthesisToken);
|
1552
|
-
this.writeCommaSeparatedList(node.
|
1515
|
+
this.writeCommaSeparatedList(node.argumentList.elements, (n) => this.writeArgument(n));
|
1553
1516
|
this.writeToken(node.closeParenthesisToken);
|
1554
1517
|
}
|
1555
1518
|
}
|
@@ -1564,7 +1527,6 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1564
1527
|
writeModifier(node) {
|
1565
1528
|
this.writeKeyword(node.value);
|
1566
1529
|
if (node.openParenthesisToken !== void 0 && node.level !== void 0 && node.closeParenthesisToken !== void 0) {
|
1567
|
-
this.writeWhitespace();
|
1568
1530
|
this.writeToken(node.openParenthesisToken);
|
1569
1531
|
this.writeKeyword(node.level);
|
1570
1532
|
this.writeToken(node.closeParenthesisToken);
|
@@ -1690,7 +1652,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1690
1652
|
this.writeToken(node.greaterThanToken);
|
1691
1653
|
}
|
1692
1654
|
}
|
1693
|
-
|
1655
|
+
writeArgument(node) {
|
1694
1656
|
this.writeNodeDefault(node);
|
1695
1657
|
}
|
1696
1658
|
writeExpression(node) {
|
@@ -2033,18 +1995,17 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
2033
1995
|
[55 /* TypeVariableGetterDeclaration */]: this.prototype.writeTypeVariableGetterDeclaration,
|
2034
1996
|
[56 /* TypeVariableSetterDeclaration */]: this.prototype.writeTypeVariableSetterDeclaration,
|
2035
1997
|
[93 /* StatementBlock */]: this.prototype.writeStatementBlock,
|
2036
|
-
[
|
2037
|
-
[
|
2038
|
-
[
|
2039
|
-
[
|
2040
|
-
[
|
2041
|
-
[
|
2042
|
-
[
|
2043
|
-
[
|
2044
|
-
[
|
2045
|
-
[
|
2046
|
-
[
|
2047
|
-
[153 /* TypeParameterClause */]: this.prototype.writeTypeParameterClause,
|
1998
|
+
[133 /* QualifiedName */]: this.prototype.writeQualifiedName,
|
1999
|
+
[140 /* VariantDeclaration */]: this.prototype.writeVariantDeclaration,
|
2000
|
+
[141 /* TypeParameterDeclaration */]: this.prototype.writeTypeParameterDeclaration,
|
2001
|
+
[142 /* ParameterDeclaration */]: this.prototype.writeParameterDeclaration,
|
2002
|
+
[143 /* Argument */]: this.prototype.writeArgument,
|
2003
|
+
[145 /* Tag */]: this.prototype.writeTag,
|
2004
|
+
[147 /* Modifier */]: this.prototype.writeModifier,
|
2005
|
+
[148 /* ParameterClause */]: this.prototype.writeParameterClause,
|
2006
|
+
[149 /* ParameterList */]: this.prototype.writeParameterList,
|
2007
|
+
[150 /* TypeArgumentClause */]: this.prototype.writeTypeArgumentClause,
|
2008
|
+
[152 /* TypeParameterClause */]: this.prototype.writeTypeParameterClause,
|
2048
2009
|
[17 /* AnonymousMethodTypeDeclaration */]: this.prototype.writeAnonymousMethodTypeDeclaration,
|
2049
2010
|
[18 /* AnonymousStructuredTypeDeclaration */]: this.prototype.writeAnonymousStructuredTypeDeclaration,
|
2050
2011
|
[19 /* AnonymousVariantTypeDeclaration */]: this.prototype.writeAnonymousVariantTypeDeclaration,
|
@@ -2072,7 +2033,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
2072
2033
|
[65 /* AsExpression */]: this.prototype.writeNodeDefault,
|
2073
2034
|
[66 /* BinaryExpression */]: this.prototype.writeNodeDefault,
|
2074
2035
|
[67 /* MethodBlockLiteral */]: this.prototype.writeNodeDefault,
|
2075
|
-
[68 /*
|
2036
|
+
[68 /* ArgumentList */]: this.prototype.writeNodeDefault,
|
2076
2037
|
[69 /* CallExpression */]: this.prototype.writeNodeDefault,
|
2077
2038
|
[70 /* AutotypeCallExpression */]: this.prototype.writeNodeDefault,
|
2078
2039
|
[71 /* IndexedAccessExpression */]: this.prototype.writeNodeDefault,
|
@@ -2102,51 +2063,51 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
2102
2063
|
[96 /* DisposeStatement */]: this.prototype.writeNodeDefault,
|
2103
2064
|
[97 /* RunStatementClauseList */]: this.prototype.writeNodeDefault,
|
2104
2065
|
[98 /* RunStatement */]: this.prototype.writeNodeDefault,
|
2105
|
-
[99 /*
|
2106
|
-
[100 /*
|
2107
|
-
[101 /*
|
2108
|
-
[102 /*
|
2109
|
-
[103 /*
|
2110
|
-
[104 /*
|
2111
|
-
[105 /*
|
2112
|
-
[106 /*
|
2113
|
-
[107 /*
|
2114
|
-
[108 /*
|
2115
|
-
[109 /*
|
2116
|
-
[110 /*
|
2117
|
-
[111 /*
|
2118
|
-
[112 /*
|
2119
|
-
[113 /*
|
2120
|
-
[114 /*
|
2121
|
-
[115 /*
|
2122
|
-
[116 /*
|
2123
|
-
[117 /*
|
2124
|
-
[118 /*
|
2125
|
-
[119 /*
|
2126
|
-
[120 /*
|
2127
|
-
[121 /*
|
2128
|
-
[122 /*
|
2129
|
-
[123 /*
|
2130
|
-
[124 /*
|
2131
|
-
[125 /*
|
2132
|
-
[126 /*
|
2133
|
-
[127 /*
|
2134
|
-
[128 /*
|
2135
|
-
[129 /*
|
2136
|
-
[130 /*
|
2137
|
-
[131 /*
|
2138
|
-
[
|
2139
|
-
[134 /*
|
2140
|
-
[135 /*
|
2141
|
-
[136 /*
|
2142
|
-
[137 /*
|
2143
|
-
[138 /*
|
2144
|
-
[
|
2145
|
-
[
|
2146
|
-
[
|
2147
|
-
[
|
2148
|
-
[
|
2149
|
-
[
|
2066
|
+
[99 /* TryStatement */]: this.prototype.writeNodeDefault,
|
2067
|
+
[100 /* CatchClause */]: this.prototype.writeNodeDefault,
|
2068
|
+
[101 /* ErrorVariableDeclaration */]: this.prototype.writeNodeDefault,
|
2069
|
+
[102 /* FinallyClause */]: this.prototype.writeNodeDefault,
|
2070
|
+
[103 /* EmptyStatement */]: this.prototype.writeNodeDefault,
|
2071
|
+
[104 /* ErrorStatement */]: this.prototype.writeNodeDefault,
|
2072
|
+
[105 /* ExpressionStatement */]: this.prototype.writeNodeDefault,
|
2073
|
+
[106 /* EnumerationVariableList */]: this.prototype.writeNodeDefault,
|
2074
|
+
[107 /* ForStatement */]: this.prototype.writeNodeDefault,
|
2075
|
+
[108 /* IfStatement */]: this.prototype.writeNodeDefault,
|
2076
|
+
[109 /* ElseIfClauseList */]: this.prototype.writeNodeDefault,
|
2077
|
+
[110 /* ElseIfClause */]: this.prototype.writeNodeDefault,
|
2078
|
+
[111 /* InvalidStatement */]: this.prototype.writeNodeDefault,
|
2079
|
+
[112 /* NestedMethodDeclarationStatement */]: this.prototype.writeNodeDefault,
|
2080
|
+
[113 /* LocalVariableDeclarationStatement */]: this.prototype.writeNodeDefault,
|
2081
|
+
[114 /* LoopStatement */]: this.prototype.writeNodeDefault,
|
2082
|
+
[115 /* ReturnStatement */]: this.prototype.writeNodeDefault,
|
2083
|
+
[116 /* CaseClauseList */]: this.prototype.writeNodeDefault,
|
2084
|
+
[117 /* SwitchStatement */]: this.prototype.writeNodeDefault,
|
2085
|
+
[118 /* MatchExpressionList */]: this.prototype.writeNodeDefault,
|
2086
|
+
[119 /* SwitchStatementCaseClause */]: this.prototype.writeNodeDefault,
|
2087
|
+
[120 /* WhileStatement */]: this.prototype.writeNodeDefault,
|
2088
|
+
[121 /* YieldStatement */]: this.prototype.writeNodeDefault,
|
2089
|
+
[122 /* TranslationParameterList */]: this.prototype.writeNodeDefault,
|
2090
|
+
[123 /* TranslationParameterClause */]: this.prototype.writeTranslationParameterClause,
|
2091
|
+
[124 /* ConstructorTranslation */]: this.prototype.writeConstructorTranslation,
|
2092
|
+
[125 /* IndexerTranslationParameterClause */]: this.prototype.writeIndexerTranslationParameterClause,
|
2093
|
+
[126 /* IndexerTranslation */]: this.prototype.writeIndexerTranslation,
|
2094
|
+
[127 /* TranslationTypeParameterList */]: this.prototype.writeNodeDefault,
|
2095
|
+
[128 /* TranslationTypeParameterClause */]: this.prototype.writeTranslationTypeParameterClause,
|
2096
|
+
[129 /* PackageMethodTranslation */]: this.prototype.writePackageMethodTranslation,
|
2097
|
+
[130 /* TypeMethodTranslation */]: this.prototype.writeTypeMethodTranslation,
|
2098
|
+
[131 /* MethodTypeTranslation */]: this.prototype.writeMethodTypeTranslation,
|
2099
|
+
[132 /* PackageImportTranslation */]: this.prototype.writePackageImportTranslation,
|
2100
|
+
[134 /* PackageVariableTranslation */]: this.prototype.writePackageVariableTranslation,
|
2101
|
+
[135 /* TypeVariableOrVariantTranslation */]: this.prototype.writeTypeVariableOrVariantTranslation,
|
2102
|
+
[136 /* TypeMemberTranslationList */]: this.prototype.writeNodeDefault,
|
2103
|
+
[137 /* TypeTranslation */]: this.prototype.writeTypeTranslation,
|
2104
|
+
[138 /* TextLiteralTranslation */]: this.prototype.writeNodeDefault,
|
2105
|
+
[139 /* TextTemplateLiteralTranslation */]: this.prototype.writeNodeDefault,
|
2106
|
+
[144 /* TagList */]: this.prototype.writeNodeDefault,
|
2107
|
+
[146 /* ModifierList */]: this.prototype.writeNodeDefault,
|
2108
|
+
[151 /* TypeArgumentList */]: this.prototype.writeNodeDefault,
|
2109
|
+
[153 /* TypeParameterList */]: this.prototype.writeNodeDefault,
|
2110
|
+
[154 /* TypeAnnotation */]: this.prototype.writeNodeDefault
|
2150
2111
|
};
|
2151
2112
|
return writeFunctions;
|
2152
2113
|
}
|
@@ -2157,14 +2118,14 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
2157
2118
|
}
|
2158
2119
|
};
|
2159
2120
|
var modifierSortOrder = {
|
2160
|
-
[
|
2161
|
-
[
|
2162
|
-
[
|
2163
|
-
[
|
2164
|
-
[
|
2165
|
-
[
|
2166
|
-
[
|
2167
|
-
[
|
2121
|
+
[35 /* Hidden */]: 0,
|
2122
|
+
[40 /* Static */]: 1,
|
2123
|
+
[17 /* Basic */]: 2,
|
2124
|
+
[37 /* Redefinable */]: 3,
|
2125
|
+
[36 /* Abstract */]: 4,
|
2126
|
+
[38 /* Redefined */]: 5,
|
2127
|
+
[39 /* Async */]: 6,
|
2128
|
+
[34 /* Const */]: 7
|
2168
2129
|
};
|
2169
2130
|
|
2170
2131
|
// source/services/TreeUtils.ts
|
@@ -2332,7 +2293,7 @@ var TranslationsGenerationService = class {
|
|
2332
2293
|
return void 0;
|
2333
2294
|
}
|
2334
2295
|
let result;
|
2335
|
-
if (tokenOrKeyword.isToken(63 /* Identifier */) && tokenOrKeyword.parent.kind ===
|
2296
|
+
if (tokenOrKeyword.isToken(63 /* Identifier */) && tokenOrKeyword.parent.kind === 137 /* TypeTranslation */ && tokenOrKeyword.value === tokenOrKeyword.parent.sourceName) {
|
2336
2297
|
const translationPackage = analyzer.getAnalyzedTranslationPackageIfTargetResolved(sourceFile.package);
|
2337
2298
|
if (translationPackage !== void 0) {
|
2338
2299
|
const generator = new TranslationsGenerator(
|
@@ -2378,7 +2339,7 @@ var TranslationsGenerationService = class {
|
|
2378
2339
|
return false;
|
2379
2340
|
}
|
2380
2341
|
const generator = new TranslationsGenerator(analyzer, sourceFile, translationPackage, sourceFile.package.dialect);
|
2381
|
-
return Query.from(tokenOrKeyword.parent.translationList.translationDeclarations).filter((t) => t.kind ===
|
2342
|
+
return Query.from(tokenOrKeyword.parent.translationList.translationDeclarations).filter((t) => t.kind === 137 /* TypeTranslation */).mapAndFilter((t) => translationPackage.getTypeTranslationTarget(t).target).any((t) => generator.collectNotTranslatedTypeMembers(t).length > 0);
|
2382
2343
|
}
|
2383
2344
|
};
|
2384
2345
|
var TranslationsGenerator = class _TranslationsGenerator {
|
@@ -2405,7 +2366,7 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2405
2366
|
};
|
2406
2367
|
const memberTranslationsCode = Query.from(memberEntities).mapAndFilter((m) => this.createPackageMemberTranslationNode(m)).uniqueWithComparator(compareNodes).map((n) => {
|
2407
2368
|
const code = new SyntaxToCode(n, syntaxToCodeOptions).convert();
|
2408
|
-
if (n.kind ===
|
2369
|
+
if (n.kind === 137 /* TypeTranslation */) {
|
2409
2370
|
const startOffset = Math.max(code.indexOf(newLine), 0);
|
2410
2371
|
return this.addNewLineBeforeArrowsInTranslation(
|
2411
2372
|
code,
|
@@ -2437,7 +2398,7 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2437
2398
|
generateMissingTranslationsForPartiallyTranslatedTypes(translationsDeclaration) {
|
2438
2399
|
const result = new Array();
|
2439
2400
|
for (const translation of translationsDeclaration.translationList.translationDeclarations) {
|
2440
|
-
if (translation.kind ===
|
2401
|
+
if (translation.kind === 137 /* TypeTranslation */) {
|
2441
2402
|
const edits = this.generateMissingTypeMemberTranslations(translation);
|
2442
2403
|
if (edits !== void 0) {
|
2443
2404
|
result.push(...edits);
|
@@ -2520,17 +2481,6 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2520
2481
|
result.push(indexer);
|
2521
2482
|
}
|
2522
2483
|
}
|
2523
|
-
if (entity.kind === 2 /* VariantType */) {
|
2524
|
-
const translatedVariants = new Set(this._translationPackage.getVariants(entity)?.get().map((m) => m.value));
|
2525
|
-
for (const variant of entity.getVariants().get()) {
|
2526
|
-
if (variant.isHidden() !== void 0) {
|
2527
|
-
continue;
|
2528
|
-
}
|
2529
|
-
if (!translatedVariants.has(variant)) {
|
2530
|
-
result.push(variant);
|
2531
|
-
}
|
2532
|
-
}
|
2533
|
-
}
|
2534
2484
|
return result;
|
2535
2485
|
}
|
2536
2486
|
detectIndentationForPackageMemberTranslations(translationsDeclaration) {
|
@@ -2545,13 +2495,13 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2545
2495
|
}
|
2546
2496
|
detectIndentationStepForTypeMemberTranslations(node) {
|
2547
2497
|
let indentationStepSize;
|
2548
|
-
if (node.kind ===
|
2498
|
+
if (node.kind === 137 /* TypeTranslation */) {
|
2549
2499
|
indentationStepSize = tryDetectIndentationStepSizeUsingTypeTranslation(node, this._sourceFile);
|
2550
2500
|
}
|
2551
2501
|
if (indentationStepSize === void 0) {
|
2552
2502
|
const translationsDeclarations = node.kind === 21 /* TranslationsDeclaration */ ? node : node.parent.parent;
|
2553
2503
|
for (const member of translationsDeclarations.translationList.translationDeclarations) {
|
2554
|
-
if (member.kind ===
|
2504
|
+
if (member.kind === 137 /* TypeTranslation */) {
|
2555
2505
|
indentationStepSize = tryDetectIndentationStepSizeUsingTypeTranslation(member, this._sourceFile);
|
2556
2506
|
if (indentationStepSize !== void 0) {
|
2557
2507
|
break;
|
@@ -2586,14 +2536,14 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2586
2536
|
}
|
2587
2537
|
collectNotTranslatedPackageMembers() {
|
2588
2538
|
const result = new Array();
|
2589
|
-
const translatedPackageMembers = new Set(this._translationPackage.getMembers().getNamedMembers().map((m) => m.value
|
2539
|
+
const translatedPackageMembers = new Set(this._translationPackage.getMembers().getNamedMembers().map((m) => m.value));
|
2590
2540
|
const membersOfTargetPackage = this._translationPackage.getTranslatedPackage().getMembers();
|
2591
2541
|
for (const member of membersOfTargetPackage.getNamedMembers()) {
|
2592
2542
|
if (member.isHidden() !== void 0) {
|
2593
2543
|
continue;
|
2594
2544
|
}
|
2595
|
-
if (!translatedPackageMembers.has(member
|
2596
|
-
result.push(member
|
2545
|
+
if (!translatedPackageMembers.has(member)) {
|
2546
|
+
result.push(member);
|
2597
2547
|
}
|
2598
2548
|
}
|
2599
2549
|
return result;
|
@@ -2602,15 +2552,15 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2602
2552
|
switch (entity.kind) {
|
2603
2553
|
case 0 /* Variable */:
|
2604
2554
|
return this.createPackageVariableTranslation(entity);
|
2605
|
-
case
|
2555
|
+
case 1 /* Method */:
|
2606
2556
|
return this.createPackageMethodTranslation(entity);
|
2607
|
-
case 2 /*
|
2608
|
-
|
2609
|
-
|
2610
|
-
|
2611
|
-
|
2612
|
-
|
2613
|
-
case
|
2557
|
+
case 2 /* Type */:
|
2558
|
+
if (entity.typeEntityKind === 0 /* Method */) {
|
2559
|
+
return this.createPackageMethodTypeTranslation(entity);
|
2560
|
+
} else {
|
2561
|
+
return this.createPackageTypeWithMembersTranslation(entity);
|
2562
|
+
}
|
2563
|
+
case 11 /* TypeExtension */:
|
2614
2564
|
return void 0;
|
2615
2565
|
default:
|
2616
2566
|
Debug.never(entity);
|
@@ -2642,17 +2592,15 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2642
2592
|
switch (entity.kind) {
|
2643
2593
|
case 0 /* Variable */:
|
2644
2594
|
return this.createTypeVariableTranslation(entity);
|
2645
|
-
case
|
2595
|
+
case 1 /* Method */:
|
2646
2596
|
return this.createTypeMethodTranslation(entity);
|
2647
|
-
case
|
2597
|
+
case 7 /* Constructor */:
|
2648
2598
|
return this.createConstructorTranslation(entity);
|
2649
|
-
case
|
2599
|
+
case 5 /* Indexer */:
|
2650
2600
|
return this.createIndexerTranslation(entity);
|
2651
|
-
case
|
2652
|
-
|
2653
|
-
case
|
2654
|
-
case 10 /* Destructor */:
|
2655
|
-
case 15 /* Operator */:
|
2601
|
+
case 6 /* DereferenceOperator */:
|
2602
|
+
case 8 /* Destructor */:
|
2603
|
+
case 9 /* Operator */:
|
2656
2604
|
return void 0;
|
2657
2605
|
default:
|
2658
2606
|
Debug.never(entity);
|
@@ -2676,10 +2624,6 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2676
2624
|
const parameters = entity.getValueParameters().map((p) => this.getNameText(p.getName()));
|
2677
2625
|
return SyntaxFactory.indexerTranslation(parameters, parameters);
|
2678
2626
|
}
|
2679
|
-
createVariantTranslation(entity) {
|
2680
|
-
const name = this.getNameText(entity.getName());
|
2681
|
-
return SyntaxFactory.typeVariableOrVariantTranslation(name, name);
|
2682
|
-
}
|
2683
2627
|
getNameText(name) {
|
2684
2628
|
const flags = name.flags & ~16 /* ConflictResolvingParameterName */;
|
2685
2629
|
return name.getPreferredUnescapedOriginal(flags);
|
@@ -2799,17 +2743,17 @@ function isGenerateMissingTranslationsCodeActionData(value) {
|
|
2799
2743
|
// source/services/signature-help/SignatureWithValueParameters.ts
|
2800
2744
|
var ValueArgumentFactory = class _ValueArgumentFactory {
|
2801
2745
|
static createValueArgumentsOfCallExpression(node) {
|
2802
|
-
return _ValueArgumentFactory.createValueArgumentsFromList(node.
|
2746
|
+
return _ValueArgumentFactory.createValueArgumentsFromList(node.argumentList);
|
2803
2747
|
}
|
2804
2748
|
static createValueArgumentsOfAutotypeCallExpression(node) {
|
2805
|
-
return _ValueArgumentFactory.createValueArgumentsFromList(node.
|
2749
|
+
return _ValueArgumentFactory.createValueArgumentsFromList(node.argumentList);
|
2806
2750
|
}
|
2807
2751
|
static createValueArgumentsOfIndexedAccessExpression(node) {
|
2808
|
-
return _ValueArgumentFactory.createValueArgumentsFromList(node.
|
2752
|
+
return _ValueArgumentFactory.createValueArgumentsFromList(node.argumentList);
|
2809
2753
|
}
|
2810
2754
|
static createValueArgumentsOfTag(node) {
|
2811
|
-
if (node.
|
2812
|
-
return _ValueArgumentFactory.createValueArgumentsFromList(node.
|
2755
|
+
if (node.argumentList !== void 0) {
|
2756
|
+
return _ValueArgumentFactory.createValueArgumentsFromList(node.argumentList);
|
2813
2757
|
}
|
2814
2758
|
return [];
|
2815
2759
|
}
|
@@ -2844,7 +2788,7 @@ var SignatureForNode = class _SignatureForNode {
|
|
2844
2788
|
return _SignatureForNode.getSignaturesForAutotypeCallExpression(analyzer, node);
|
2845
2789
|
case 71 /* IndexedAccessExpression */:
|
2846
2790
|
return _SignatureForNode.getSignaturesForIndexedAccessExpression(analyzer, node);
|
2847
|
-
case
|
2791
|
+
case 145 /* Tag */:
|
2848
2792
|
return _SignatureForNode.getSignaturesForTag(analyzer, node);
|
2849
2793
|
default:
|
2850
2794
|
Debug.never(node);
|
@@ -2866,16 +2810,7 @@ var SignatureForNode = class _SignatureForNode {
|
|
2866
2810
|
if (info.suitableMethods.length === 1) {
|
2867
2811
|
suitableSignatureIndex = info.candidates.indexOf(info.suitableMethods[0]);
|
2868
2812
|
}
|
2869
|
-
const signatures = info.candidates.map((c) =>
|
2870
|
-
switch (c.value.kind) {
|
2871
|
-
case "entity":
|
2872
|
-
return new MethodEntitySignature({ value: c.value.value, localization: c.localization });
|
2873
|
-
case "type-member":
|
2874
|
-
return new TypeMethodSignature({ value: c.value.value, localization: c.localization });
|
2875
|
-
case "substituted-method":
|
2876
|
-
return new SubstitutedMethodSignature({ value: c.value.value, localization: c.localization });
|
2877
|
-
}
|
2878
|
-
});
|
2813
|
+
const signatures = info.candidates.map((c) => new AccessedMethodSignature(c));
|
2879
2814
|
return new SignaturesWithSingleSuitable(signatures, suitableSignatureIndex);
|
2880
2815
|
}
|
2881
2816
|
if (meaning.kind === "object-method-call") {
|
@@ -2914,8 +2849,8 @@ var SignatureForNode = class _SignatureForNode {
|
|
2914
2849
|
}
|
2915
2850
|
}
|
2916
2851
|
static getSignaturesForTag(analyzer, node) {
|
2917
|
-
const meaning = analyzer.
|
2918
|
-
if (meaning.kind === "
|
2852
|
+
const meaning = analyzer.resolveTag(node).meaning;
|
2853
|
+
if (meaning.kind === "tag-type") {
|
2919
2854
|
let suitableSignatureIndex;
|
2920
2855
|
if (meaning.suitableConstructors.length === 1) {
|
2921
2856
|
suitableSignatureIndex = meaning.candidates.indexOf(meaning.suitableConstructors[0]);
|
@@ -2923,6 +2858,14 @@ var SignatureForNode = class _SignatureForNode {
|
|
2923
2858
|
const signatures = meaning.candidates.map((c) => new ConstructorSignature(c));
|
2924
2859
|
return new SignaturesWithSingleSuitable(signatures, suitableSignatureIndex);
|
2925
2860
|
}
|
2861
|
+
if (meaning.kind === "tag-method") {
|
2862
|
+
let suitableSignatureIndex;
|
2863
|
+
if (meaning.suitableMethods.length === 1) {
|
2864
|
+
suitableSignatureIndex = meaning.candidates.indexOf(meaning.suitableMethods[0]);
|
2865
|
+
}
|
2866
|
+
const signatures = meaning.candidates.map((c) => new AccessedMethodSignature(c));
|
2867
|
+
return new SignaturesWithSingleSuitable(signatures, suitableSignatureIndex);
|
2868
|
+
}
|
2926
2869
|
if (meaning.kind === "unresolved") {
|
2927
2870
|
return void 0;
|
2928
2871
|
}
|
@@ -3031,47 +2974,9 @@ var MatchedSignature = class {
|
|
3031
2974
|
this.matchResult = matchResult;
|
3032
2975
|
}
|
3033
2976
|
};
|
3034
|
-
var
|
3035
|
-
constructor(method) {
|
3036
|
-
this.kind = "method-entity";
|
3037
|
-
this._valueParameters = new Cached();
|
3038
|
-
this.method = method;
|
3039
|
-
}
|
3040
|
-
getValueParameters() {
|
3041
|
-
return this._valueParameters.getOrInsertWith(() => {
|
3042
|
-
const localizedSignature = EntityLocalizationHelper.getLocalizedMethodSignature(
|
3043
|
-
this.method.value,
|
3044
|
-
this.method.localization
|
3045
|
-
);
|
3046
|
-
return Query.from(this.method.value.getValueParameters()).zip(
|
3047
|
-
localizedSignature.getValueParameterNames(),
|
3048
|
-
(p, n) => new UniversalValueParameter(n.value, p.getType(), p, n.localization)
|
3049
|
-
).toArray();
|
3050
|
-
});
|
3051
|
-
}
|
3052
|
-
};
|
3053
|
-
var TypeMethodSignature = class {
|
3054
|
-
constructor(method) {
|
3055
|
-
this.kind = "type-method";
|
3056
|
-
this._valueParameters = new Cached();
|
3057
|
-
this.method = method;
|
3058
|
-
}
|
3059
|
-
getValueParameters() {
|
3060
|
-
return this._valueParameters.getOrInsertWith(() => {
|
3061
|
-
const localizedSignature = EntityLocalizationHelper.getLocalizedMethodSignature(
|
3062
|
-
this.method.value.getEntity(),
|
3063
|
-
this.method.localization
|
3064
|
-
);
|
3065
|
-
return Query.from(this.method.value.getValueParameters()).zip(
|
3066
|
-
localizedSignature.getValueParameterNames(),
|
3067
|
-
(p, n) => new UniversalValueParameter(n.value, p.getType(), p.getEntity(), n.localization)
|
3068
|
-
).toArray();
|
3069
|
-
});
|
3070
|
-
}
|
3071
|
-
};
|
3072
|
-
var SubstitutedMethodSignature = class {
|
2977
|
+
var AccessedMethodSignature = class {
|
3073
2978
|
constructor(method) {
|
3074
|
-
this.kind = "
|
2979
|
+
this.kind = "accessed-method";
|
3075
2980
|
this._valueParameters = new Cached();
|
3076
2981
|
this.method = method;
|
3077
2982
|
}
|
@@ -3263,7 +3168,7 @@ var CompletionService = class {
|
|
3263
3168
|
return new OperatorNameCompletionContext(syntaxContext.isInQuotedIdentifier);
|
3264
3169
|
}
|
3265
3170
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3266
|
-
if (tokenOrKeyword.isKeyword(
|
3171
|
+
if (tokenOrKeyword.isKeyword(18 /* Import */) && tokenOrKeyword.parent.kind === 5 /* SinglePackageImportDirective */) {
|
3267
3172
|
return new PackageImportCompletionContext([], void 0);
|
3268
3173
|
}
|
3269
3174
|
if (tokenOrKeyword.isToken(57 /* Equals */) && tokenOrKeyword.parent.kind === 8 /* PackageImport */) {
|
@@ -3318,7 +3223,7 @@ var CompletionService = class {
|
|
3318
3223
|
typeExtensionLookup
|
3319
3224
|
);
|
3320
3225
|
}
|
3321
|
-
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind ===
|
3226
|
+
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 133 /* QualifiedName */ && tokenOrKeyword.parent.parent.kind === 10 /* NamedTypeSpecifier */) {
|
3322
3227
|
const namedTypeSpecifier = tokenOrKeyword.parent.parent;
|
3323
3228
|
const resolutionResult = this._analyzer.resolveNamedTypeSpecifier(namedTypeSpecifier);
|
3324
3229
|
const segmentIndex = Math.floor(
|
@@ -3360,6 +3265,42 @@ var CompletionService = class {
|
|
3360
3265
|
}
|
3361
3266
|
return { kind: "none" };
|
3362
3267
|
}
|
3268
|
+
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 133 /* QualifiedName */ && tokenOrKeyword.parent.parent.kind === 145 /* Tag */) {
|
3269
|
+
const tag = tokenOrKeyword.parent.parent;
|
3270
|
+
const resolutionResult = this._analyzer.resolveTag(tag);
|
3271
|
+
const segmentIndex = Math.floor(
|
3272
|
+
tag.name.parts.indexOf(tokenOrKeyword.value) / 2
|
3273
|
+
);
|
3274
|
+
if (segmentIndex < resolutionResult.resolvedQualifiers.length) {
|
3275
|
+
const resolvedQualifier = resolutionResult.resolvedQualifiers[segmentIndex];
|
3276
|
+
if (resolvedQualifier.kind === "package-name-segment") {
|
3277
|
+
let lookup;
|
3278
|
+
if (resolvedQualifier.packageTreeNode.package !== void 0) {
|
3279
|
+
lookup = new PackageMemberLookup(
|
3280
|
+
resolvedQualifier.packageTreeNode.package.value,
|
3281
|
+
semanticContext.getLocalizationContext()
|
3282
|
+
);
|
3283
|
+
}
|
3284
|
+
const hidingMatcher = semanticContext.getHidingMatcher();
|
3285
|
+
const typeSearchLocation = new PackageNameSegmentTypeSearchLocation(
|
3286
|
+
resolvedQualifier.packageTreeNode,
|
3287
|
+
lookup,
|
3288
|
+
hidingMatcher
|
3289
|
+
);
|
3290
|
+
return new TagCompletionContext(typeSearchLocation);
|
3291
|
+
}
|
3292
|
+
if (resolvedQualifier.kind === "package-alias") {
|
3293
|
+
const package_ = resolvedQualifier.packageAlias.getPackage();
|
3294
|
+
if (package_ !== void 0) {
|
3295
|
+
const lookup = new PackageMemberLookup(package_, semanticContext.getLocalizationContext());
|
3296
|
+
const hidingMatcher = semanticContext.getHidingMatcher();
|
3297
|
+
const typeSearchLocation = new PackageAliasTypeSearchLocation(lookup, hidingMatcher);
|
3298
|
+
return new TagCompletionContext(typeSearchLocation);
|
3299
|
+
}
|
3300
|
+
}
|
3301
|
+
}
|
3302
|
+
return { kind: "none" };
|
3303
|
+
}
|
3363
3304
|
if (syntaxContext.isUnqualifiedTypeContext !== void 0) {
|
3364
3305
|
let completionInIsOrAsExpressionInfo;
|
3365
3306
|
if (tokenOrKeyword.parent.kind === 73 /* IsExpression */ || tokenOrKeyword.parent.kind === 65 /* AsExpression */) {
|
@@ -3371,6 +3312,11 @@ var CompletionService = class {
|
|
3371
3312
|
const typeSearchLocation = new ScopeTypeSearchLocation(lookup);
|
3372
3313
|
return new TypeCompletionContext(typeSearchLocation, completionInIsOrAsExpressionInfo);
|
3373
3314
|
}
|
3315
|
+
if (syntaxContext.isUnqualifiedTagNameCompletionContext) {
|
3316
|
+
const lookup = semanticContext.getScopeLookup();
|
3317
|
+
const typeSearchLocation = new ScopeTypeSearchLocation(lookup);
|
3318
|
+
return new TagCompletionContext(typeSearchLocation);
|
3319
|
+
}
|
3374
3320
|
if (syntaxContext.isExpressionContext !== void 0) {
|
3375
3321
|
const lookup = semanticContext.getScopeLookup();
|
3376
3322
|
const { targetTypes, targetSignaturesParameters } = this.getTargetTypesAndTargetSignaturesParameters(syntaxContext.isExpressionContext.expressionRole, semanticContext);
|
@@ -3412,17 +3358,17 @@ var CompletionService = class {
|
|
3412
3358
|
translationKind = 0 /* Any */;
|
3413
3359
|
hasPrecedingKeyword = false;
|
3414
3360
|
}
|
3415
|
-
if (tokenOrKeyword.isKeyword(
|
3361
|
+
if (tokenOrKeyword.isKeyword(18 /* Import */) && tokenOrKeyword.parent.kind === 132 /* PackageImportTranslation */) {
|
3416
3362
|
translationsDeclaration = tokenOrKeyword.parent.parent.parent;
|
3417
3363
|
translationKind = 1 /* PackageImport */;
|
3418
3364
|
hasPrecedingKeyword = true;
|
3419
3365
|
}
|
3420
|
-
if (tokenOrKeyword.isKeyword(
|
3366
|
+
if (tokenOrKeyword.isKeyword(16 /* Type */) && (tokenOrKeyword.parent.kind === 137 /* TypeTranslation */ || tokenOrKeyword.parent.kind === 131 /* MethodTypeTranslation */)) {
|
3421
3367
|
translationsDeclaration = tokenOrKeyword.parent.parent.parent;
|
3422
3368
|
translationKind = 3 /* Type */;
|
3423
3369
|
hasPrecedingKeyword = true;
|
3424
3370
|
}
|
3425
|
-
if (tokenOrKeyword.isKeyword(
|
3371
|
+
if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 129 /* PackageMethodTranslation */) {
|
3426
3372
|
translationsDeclaration = tokenOrKeyword.parent.parent.parent;
|
3427
3373
|
translationKind = 2 /* Method */;
|
3428
3374
|
hasPrecedingKeyword = true;
|
@@ -3442,9 +3388,9 @@ var CompletionService = class {
|
|
3442
3388
|
hasPrecedingKeyword
|
3443
3389
|
);
|
3444
3390
|
}
|
3445
|
-
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind ===
|
3391
|
+
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 133 /* QualifiedName */) {
|
3446
3392
|
const qualifiedName = tokenOrKeyword.parent;
|
3447
|
-
if (qualifiedName.parent.kind ===
|
3393
|
+
if (qualifiedName.parent.kind === 132 /* PackageImportTranslation */ && qualifiedName === qualifiedName.parent.sourceName) {
|
3448
3394
|
const precedingSegmentNames = qualifiedName.qualifiers.takeWhile((s) => s.rangeStart < tokenOrKeyword.value.rangeStart).map((p) => this._analyzer.createNameFromIdentifier(p)).toArray();
|
3449
3395
|
const sourceLocale = translationPackage.getTranslatedPackage().getLocale();
|
3450
3396
|
return new PackageImportCompletionContext(precedingSegmentNames, { sourceLocale });
|
@@ -3469,12 +3415,12 @@ var CompletionService = class {
|
|
3469
3415
|
translationKind = 0 /* Any */;
|
3470
3416
|
hasPrecedingKeyword = false;
|
3471
3417
|
}
|
3472
|
-
if (tokenOrKeyword.isKeyword(
|
3418
|
+
if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 130 /* TypeMethodTranslation */) {
|
3473
3419
|
typeTranslation = tokenOrKeyword.parent.parent.parent;
|
3474
3420
|
translationKind = 1 /* Method */;
|
3475
3421
|
hasPrecedingKeyword = true;
|
3476
3422
|
}
|
3477
|
-
if (tokenOrKeyword.isKeyword(
|
3423
|
+
if (tokenOrKeyword.isKeyword(29 /* Creation */) && tokenOrKeyword.parent.kind === 124 /* ConstructorTranslation */) {
|
3478
3424
|
typeTranslation = tokenOrKeyword.parent.parent.parent;
|
3479
3425
|
translationKind = 3 /* Constructor */;
|
3480
3426
|
hasPrecedingKeyword = true;
|
@@ -3514,7 +3460,7 @@ var CompletionService = class {
|
|
3514
3460
|
role.argumentList.parent
|
3515
3461
|
);
|
3516
3462
|
break;
|
3517
|
-
case
|
3463
|
+
case 145 /* Tag */:
|
3518
3464
|
signatures = SignatureForNode.getSignaturesForTag(this._analyzer, role.argumentList.parent);
|
3519
3465
|
valueArguments = ValueArgumentFactory.createValueArgumentsOfTag(role.argumentList.parent);
|
3520
3466
|
break;
|
@@ -3612,6 +3558,9 @@ var CompletionService = class {
|
|
3612
3558
|
case "type":
|
3613
3559
|
result = this.getTypeCompletionItemInfos(completionContext);
|
3614
3560
|
break;
|
3561
|
+
case "tag":
|
3562
|
+
result = this.getTagCompletionItemInfos(completionContext);
|
3563
|
+
break;
|
3615
3564
|
case "expression":
|
3616
3565
|
result = this.getExpressionCompletionItemInfos(completionContext);
|
3617
3566
|
break;
|
@@ -3644,29 +3593,29 @@ var CompletionService = class {
|
|
3644
3593
|
}
|
3645
3594
|
const kinds = /* @__PURE__ */ new Set();
|
3646
3595
|
if (syntaxContext.isPackageMemberDeclarationListContext) {
|
3647
|
-
kinds.add(
|
3596
|
+
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 */);
|
3648
3597
|
}
|
3649
3598
|
if (syntaxContext.isPackageMemberDeclarationListContext || syntaxContext.isTypeMemberDeclarationListContext) {
|
3650
|
-
kinds.add(
|
3599
|
+
kinds.add(35 /* Hidden */).add(40 /* Static */).add(37 /* Redefinable */).add(36 /* Abstract */).add(38 /* Redefined */).add(39 /* Async */).add(34 /* Const */);
|
3651
3600
|
}
|
3652
3601
|
if (syntaxContext.isTypeMemberDeclarationListContext) {
|
3653
|
-
kinds.add(
|
3602
|
+
kinds.add(29 /* Creation */).add(12 /* Function */).add(46 /* Destruction */).add(57 /* Get */).add(58 /* Set */);
|
3654
3603
|
}
|
3655
3604
|
if (syntaxContext.isStatementContext) {
|
3656
|
-
kinds.add(7 /* Run */).add(
|
3605
|
+
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 */);
|
3657
3606
|
}
|
3658
3607
|
if (this.isFromKeywordContext(positionDescription)) {
|
3659
|
-
kinds.add(
|
3608
|
+
kinds.add(9 /* From */);
|
3660
3609
|
}
|
3661
3610
|
if (syntaxContext.isExpressionContext !== void 0) {
|
3662
|
-
kinds.add(
|
3611
|
+
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 */);
|
3663
3612
|
if (positionDescription.kind === "after-token-or-keyword") {
|
3664
3613
|
const container = semanticContext.getContainingTypeOrTypeExtension();
|
3665
3614
|
if (container !== void 0) {
|
3666
3615
|
kinds.add(4 /* Object */);
|
3667
3616
|
if (container.kind === "type") {
|
3668
3617
|
const typeEntity = container.value;
|
3669
|
-
if (typeEntity?.
|
3618
|
+
if (typeEntity?.typeEntityKind === 1 /* Structured */ && typeEntity.getBaseObjectType() !== void 0 || typeEntity?.typeEntityKind === 3 /* Variant */ || typeEntity?.typeEntityKind === 4 /* Alias */) {
|
3670
3619
|
kinds.add(55 /* Base */);
|
3671
3620
|
}
|
3672
3621
|
}
|
@@ -3674,31 +3623,31 @@ var CompletionService = class {
|
|
3674
3623
|
}
|
3675
3624
|
}
|
3676
3625
|
if (this.isTypeKindCompletionContext(positionDescription)) {
|
3677
|
-
kinds.add(4 /* Object */).add(5 /* PlainObject */).add(3 /* Aspect */).add(6 /* Variant */).add(
|
3626
|
+
kinds.add(4 /* Object */).add(5 /* PlainObject */).add(3 /* Aspect */).add(6 /* Variant */).add(12 /* Function */).add(39 /* Async */);
|
3678
3627
|
}
|
3679
3628
|
if (this.isCaseKeywordContext(positionDescription, syntaxContext)) {
|
3680
|
-
kinds.add(
|
3629
|
+
kinds.add(44 /* Case */);
|
3681
3630
|
}
|
3682
3631
|
if (this.isRunStatementAccessorListContext(positionDescription)) {
|
3683
|
-
kinds.add(
|
3632
|
+
kinds.add(30 /* Catch */).add(20 /* Finally */);
|
3684
3633
|
}
|
3685
3634
|
if (this.isElseOrElseIfKeywordContext(positionDescription)) {
|
3686
|
-
kinds.add(
|
3635
|
+
kinds.add(10 /* Else */).add(11 /* ElseIf */);
|
3687
3636
|
}
|
3688
3637
|
if (syntaxContext.precedingExpression !== void 0) {
|
3689
|
-
kinds.add(
|
3638
|
+
kinds.add(41 /* As */).add(14 /* Is */).add(21 /* And */).add(22 /* Or */).add(23 /* Xor */).add(28 /* When */);
|
3690
3639
|
}
|
3691
3640
|
if (this.isModifierLevelContext(positionDescription)) {
|
3692
3641
|
kinds.add(50 /* InType */).add(47 /* InHierarchy */).add(48 /* InFile */).add(49 /* InPackage */);
|
3693
3642
|
}
|
3694
3643
|
if (this.isRepeatWhileKeywordContext(positionDescription)) {
|
3695
|
-
kinds.add(
|
3644
|
+
kinds.add(26 /* RepeatWhile */);
|
3696
3645
|
}
|
3697
3646
|
if (syntaxContext.isUnqualifiedTypeContext?.allowsAnonymousTypes === true) {
|
3698
|
-
kinds.add(5 /* PlainObject */).add(4 /* Object */).add(6 /* Variant */).add(3 /* Aspect */).add(
|
3647
|
+
kinds.add(5 /* PlainObject */).add(4 /* Object */).add(6 /* Variant */).add(3 /* Aspect */).add(12 /* Function */).add(39 /* Async */);
|
3699
3648
|
}
|
3700
|
-
if (positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isKeyword(
|
3701
|
-
kinds.add(
|
3649
|
+
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 */)) {
|
3650
|
+
kinds.add(12 /* Function */);
|
3702
3651
|
}
|
3703
3652
|
return Query.from(kinds.values()).map(
|
3704
3653
|
(k) => LocalizationHelper.localizeKeyword(k, this._locale, this._dialect).map((v) => new KeywordCompletionItemInfo(this.completionItemInfoContext, k, v))
|
@@ -3709,28 +3658,28 @@ var CompletionService = class {
|
|
3709
3658
|
return false;
|
3710
3659
|
}
|
3711
3660
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3712
|
-
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind ===
|
3661
|
+
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 114 /* LoopStatement */;
|
3713
3662
|
}
|
3714
3663
|
isModifierLevelContext(positionDescription) {
|
3715
3664
|
if (positionDescription.kind !== "after-token-or-keyword") {
|
3716
3665
|
return false;
|
3717
3666
|
}
|
3718
3667
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3719
|
-
return tokenOrKeyword.isToken(44 /* OpenParenthesis */) && tokenOrKeyword.parent.kind ===
|
3668
|
+
return tokenOrKeyword.isToken(44 /* OpenParenthesis */) && tokenOrKeyword.parent.kind === 147 /* Modifier */;
|
3720
3669
|
}
|
3721
3670
|
isElseOrElseIfKeywordContext(positionDescription) {
|
3722
3671
|
if (positionDescription.kind !== "after-token-or-keyword") {
|
3723
3672
|
return false;
|
3724
3673
|
}
|
3725
3674
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3726
|
-
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind ===
|
3675
|
+
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind === 108 /* IfStatement */ && tokenOrKeyword.parent === tokenOrKeyword.parent.parent.thenBlock || tokenOrKeyword.parent.parent.kind === 110 /* ElseIfClause */);
|
3727
3676
|
}
|
3728
3677
|
isRunStatementAccessorListContext(positionDescription) {
|
3729
3678
|
if (positionDescription.kind !== "after-token-or-keyword") {
|
3730
3679
|
return false;
|
3731
3680
|
}
|
3732
3681
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3733
|
-
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind === 98 /* RunStatement */ || tokenOrKeyword.parent.parent.kind ===
|
3682
|
+
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind === 98 /* RunStatement */ || tokenOrKeyword.parent.parent.kind === 100 /* CatchClause */ || tokenOrKeyword.parent.parent.kind === 102 /* FinallyClause */);
|
3734
3683
|
}
|
3735
3684
|
isTypeKindCompletionContext(positionDescription) {
|
3736
3685
|
return positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isToken(57 /* Equals */) && NodeTypeUtils.isPackageTypeDeclaration(positionDescription.tokenOrKeyword.parent);
|
@@ -3747,31 +3696,16 @@ var CompletionService = class {
|
|
3747
3696
|
return false;
|
3748
3697
|
}
|
3749
3698
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3750
|
-
if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind ===
|
3699
|
+
if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 119 /* SwitchStatementCaseClause */) {
|
3751
3700
|
return true;
|
3752
3701
|
}
|
3753
|
-
if (syntaxContext.precedingExpression !== void 0 && syntaxContext.precedingExpression.parent.kind ===
|
3702
|
+
if (syntaxContext.precedingExpression !== void 0 && syntaxContext.precedingExpression.parent.kind === 117 /* SwitchStatement */) {
|
3754
3703
|
return true;
|
3755
3704
|
}
|
3756
3705
|
return false;
|
3757
3706
|
}
|
3758
3707
|
getExpressionCompletionItemInfos(ctx) {
|
3759
|
-
let query =
|
3760
|
-
if (ctx.targetTypes !== void 0) {
|
3761
|
-
const variantType = this.getTargetVariantType(ctx.targetTypes);
|
3762
|
-
if (variantType !== void 0) {
|
3763
|
-
const variantLookup = new VariantLookup(variantType.getEntity(), ctx.localizationContext);
|
3764
|
-
query = query.chain(variantLookup.get().map(
|
3765
|
-
(v) => new VariantCompletionItemInfo(
|
3766
|
-
this.completionItemInfoContext,
|
3767
|
-
v.value,
|
3768
|
-
v.name,
|
3769
|
-
v.requiresExplicitOriginalName
|
3770
|
-
)
|
3771
|
-
).toArray());
|
3772
|
-
}
|
3773
|
-
}
|
3774
|
-
query = query.chain(this.getScopeCompletionItemInfos(ctx.lookup));
|
3708
|
+
let query = this.getScopeCompletionItemInfos(ctx.lookup);
|
3775
3709
|
if (ctx.targetSignaturesValueParameters !== void 0) {
|
3776
3710
|
query = query.chain(this.getCompletionItemInfosForTargetSignaturesValueParameters(ctx.targetSignaturesValueParameters));
|
3777
3711
|
}
|
@@ -3793,19 +3727,6 @@ var CompletionService = class {
|
|
3793
3727
|
}
|
3794
3728
|
}
|
3795
3729
|
}
|
3796
|
-
getTargetVariantType(targetTypes) {
|
3797
|
-
let variantType;
|
3798
|
-
for (const targetType of targetTypes) {
|
3799
|
-
const type = this._analyzer.getUnambiguousTargetVariantType(targetType);
|
3800
|
-
if (variantType === void 0) {
|
3801
|
-
variantType = type;
|
3802
|
-
} else {
|
3803
|
-
variantType = void 0;
|
3804
|
-
break;
|
3805
|
-
}
|
3806
|
-
}
|
3807
|
-
return variantType;
|
3808
|
-
}
|
3809
3730
|
getCompletionItemInfosForTargetSignaturesValueParameters(valueParameters) {
|
3810
3731
|
return valueParameters.map((p) => new TargetSignatureValueParameterCompletionItemInfo(this.completionItemInfoContext, p));
|
3811
3732
|
}
|
@@ -3847,19 +3768,7 @@ var CompletionService = class {
|
|
3847
3768
|
}
|
3848
3769
|
}
|
3849
3770
|
case "type": {
|
3850
|
-
return this.createTypeEntityCompletionItemInfo(
|
3851
|
-
d.value.value.getEntity(),
|
3852
|
-
d.name,
|
3853
|
-
d.requiresExplicitOriginalName
|
3854
|
-
);
|
3855
|
-
}
|
3856
|
-
case "variant": {
|
3857
|
-
return new VariantCompletionItemInfo(
|
3858
|
-
this.completionItemInfoContext,
|
3859
|
-
d.value.value,
|
3860
|
-
d.name,
|
3861
|
-
d.requiresExplicitOriginalName
|
3862
|
-
);
|
3771
|
+
return this.createTypeEntityCompletionItemInfo(d.value.value, d.name, d.requiresExplicitOriginalName);
|
3863
3772
|
}
|
3864
3773
|
case "package-alias":
|
3865
3774
|
return new PackageAliasEntityCompletionItemInfo(this.completionItemInfoContext, d.value.value);
|
@@ -3913,34 +3822,34 @@ var CompletionService = class {
|
|
3913
3822
|
}
|
3914
3823
|
}
|
3915
3824
|
getTypeCompletionItemInfosFromPackage(searchLocation) {
|
3916
|
-
return searchLocation.packageMemberLookup.getNamedMembers(searchLocation.hidingMatcher).
|
3917
|
-
if (m.value.kind ===
|
3825
|
+
return searchLocation.packageMemberLookup.getNamedMembers(searchLocation.hidingMatcher).map((m) => {
|
3826
|
+
if (m.value.kind === 2 /* Type */) {
|
3918
3827
|
return new NamedTypeCompletionItemInfo(
|
3919
3828
|
this.completionItemInfoContext,
|
3920
|
-
m.value
|
3829
|
+
m.value,
|
3921
3830
|
m.name,
|
3922
3831
|
m.requiresExplicitOriginalName
|
3923
3832
|
);
|
3924
3833
|
}
|
3925
3834
|
return void 0;
|
3926
|
-
}).
|
3835
|
+
}).filter((i) => i !== void 0);
|
3927
3836
|
}
|
3928
3837
|
getTypeCompletionItemInfosFromPackageNameSegment(searchLocation) {
|
3929
3838
|
let query = Query.from(searchLocation.packageTreeNode.getChildren()).map((c) => new PackageNameSegmentCompletionItemInfo(this.completionItemInfoContext, c.name));
|
3930
3839
|
if (searchLocation.packageMemberLookup !== void 0) {
|
3931
3840
|
const lookup = searchLocation.packageMemberLookup;
|
3932
3841
|
query = query.chain(
|
3933
|
-
lookup.getNamedMembers(searchLocation.hidingMatcher).
|
3934
|
-
if (m.value.kind ===
|
3842
|
+
lookup.getNamedMembers(searchLocation.hidingMatcher).map((m) => {
|
3843
|
+
if (m.value.kind === 2 /* Type */) {
|
3935
3844
|
return new NamedTypeCompletionItemInfo(
|
3936
3845
|
this.completionItemInfoContext,
|
3937
|
-
m.value
|
3846
|
+
m.value,
|
3938
3847
|
m.name,
|
3939
3848
|
m.requiresExplicitOriginalName
|
3940
3849
|
);
|
3941
3850
|
}
|
3942
3851
|
return void 0;
|
3943
|
-
})
|
3852
|
+
}).filter((i) => i !== void 0)
|
3944
3853
|
);
|
3945
3854
|
}
|
3946
3855
|
return query.toArray();
|
@@ -3951,7 +3860,7 @@ var CompletionService = class {
|
|
3951
3860
|
case "type": {
|
3952
3861
|
return new NamedTypeCompletionItemInfo(
|
3953
3862
|
this.completionItemInfoContext,
|
3954
|
-
d.value.value
|
3863
|
+
d.value.value,
|
3955
3864
|
d.name,
|
3956
3865
|
d.requiresExplicitOriginalName
|
3957
3866
|
);
|
@@ -3965,8 +3874,98 @@ var CompletionService = class {
|
|
3965
3874
|
}
|
3966
3875
|
});
|
3967
3876
|
}
|
3877
|
+
getTagCompletionItemInfos(ctx) {
|
3878
|
+
let result;
|
3879
|
+
switch (ctx.searchLocation.kind) {
|
3880
|
+
case "scope":
|
3881
|
+
result = this.getTagCompletionItemInfosFromScope(ctx.searchLocation);
|
3882
|
+
break;
|
3883
|
+
case "package-alias":
|
3884
|
+
result = this.getTagCompletionItemInfosFromPackage(ctx.searchLocation);
|
3885
|
+
break;
|
3886
|
+
case "package-name-segment":
|
3887
|
+
result = this.getTagCompletionItemInfosFromPackageNameSegment(ctx.searchLocation);
|
3888
|
+
break;
|
3889
|
+
}
|
3890
|
+
return result;
|
3891
|
+
}
|
3892
|
+
getTagCompletionItemInfosFromPackage(searchLocation) {
|
3893
|
+
return searchLocation.packageMemberLookup.getNamedMembers(searchLocation.hidingMatcher).map((m) => {
|
3894
|
+
if (m.value.kind === 2 /* Type */) {
|
3895
|
+
return new NamedTypeCompletionItemInfo(
|
3896
|
+
this.completionItemInfoContext,
|
3897
|
+
m.value,
|
3898
|
+
m.name,
|
3899
|
+
m.requiresExplicitOriginalName
|
3900
|
+
);
|
3901
|
+
} else if (m.value.kind === 1 /* Method */) {
|
3902
|
+
return new MethodEntityCompletionItemInfo(
|
3903
|
+
this.completionItemInfoContext,
|
3904
|
+
m.value,
|
3905
|
+
m.name,
|
3906
|
+
m.requiresExplicitOriginalName
|
3907
|
+
);
|
3908
|
+
}
|
3909
|
+
return void 0;
|
3910
|
+
}).filter((i) => i !== void 0);
|
3911
|
+
}
|
3912
|
+
getTagCompletionItemInfosFromPackageNameSegment(searchLocation) {
|
3913
|
+
let query = Query.from(searchLocation.packageTreeNode.getChildren()).map((c) => new PackageNameSegmentCompletionItemInfo(this.completionItemInfoContext, c.name));
|
3914
|
+
if (searchLocation.packageMemberLookup !== void 0) {
|
3915
|
+
const lookup = searchLocation.packageMemberLookup;
|
3916
|
+
query = query.chain(
|
3917
|
+
lookup.getNamedMembers(searchLocation.hidingMatcher).map((m) => {
|
3918
|
+
if (m.value.kind === 2 /* Type */) {
|
3919
|
+
return new NamedTypeCompletionItemInfo(
|
3920
|
+
this.completionItemInfoContext,
|
3921
|
+
m.value,
|
3922
|
+
m.name,
|
3923
|
+
m.requiresExplicitOriginalName
|
3924
|
+
);
|
3925
|
+
} else if (m.value.kind === 1 /* Method */) {
|
3926
|
+
return new MethodEntityCompletionItemInfo(
|
3927
|
+
this.completionItemInfoContext,
|
3928
|
+
m.value,
|
3929
|
+
m.name,
|
3930
|
+
m.requiresExplicitOriginalName
|
3931
|
+
);
|
3932
|
+
}
|
3933
|
+
return void 0;
|
3934
|
+
}).filter((i) => i !== void 0)
|
3935
|
+
);
|
3936
|
+
}
|
3937
|
+
return query.toArray();
|
3938
|
+
}
|
3939
|
+
getTagCompletionItemInfosFromScope(searchLocation) {
|
3940
|
+
return searchLocation.lookup.getNamedDeclarations().map((d) => {
|
3941
|
+
switch (d.value.kind) {
|
3942
|
+
case "type":
|
3943
|
+
return new NamedTypeCompletionItemInfo(
|
3944
|
+
this.completionItemInfoContext,
|
3945
|
+
d.value.value,
|
3946
|
+
d.name,
|
3947
|
+
d.requiresExplicitOriginalName
|
3948
|
+
);
|
3949
|
+
case "method":
|
3950
|
+
return new MethodEntityCompletionItemInfo(
|
3951
|
+
this.completionItemInfoContext,
|
3952
|
+
d.value.value.getEntity(),
|
3953
|
+
d.name,
|
3954
|
+
d.requiresExplicitOriginalName
|
3955
|
+
);
|
3956
|
+
case "package-name-segment":
|
3957
|
+
return new PackageNameSegmentCompletionItemInfo(this.completionItemInfoContext, d.name.value);
|
3958
|
+
case "package-alias":
|
3959
|
+
return new PackageAliasEntityCompletionItemInfo(this.completionItemInfoContext, d.value.value);
|
3960
|
+
case "variable":
|
3961
|
+
return void 0;
|
3962
|
+
default:
|
3963
|
+
Debug.never(d.value);
|
3964
|
+
}
|
3965
|
+
}).filter((i) => i !== void 0);
|
3966
|
+
}
|
3968
3967
|
getPackageAliasMemberCompletionItemInfos(ctx) {
|
3969
|
-
return ctx.packageMemberLookup.getNamedMembers(ctx.hidingMatcher).map((m) => this.packageMemberToCompletionItemInfo(m.value, m.name, m.requiresExplicitOriginalName))
|
3968
|
+
return ctx.packageMemberLookup.getNamedMembers(ctx.hidingMatcher).map((m) => this.packageMemberToCompletionItemInfo(m.value, m.name, m.requiresExplicitOriginalName));
|
3970
3969
|
}
|
3971
3970
|
getPackageNameSegmentCompletionItemInfos(ctx) {
|
3972
3971
|
let query = Query.from(ctx.packageTreeNode.getChildren()).map((c) => new PackageNameSegmentCompletionItemInfo(this.completionItemInfoContext, c.name));
|
@@ -3980,22 +3979,22 @@ var CompletionService = class {
|
|
3980
3979
|
}
|
3981
3980
|
packageMemberToCompletionItemInfo(member, name, isNameExplicitlyOriginal) {
|
3982
3981
|
switch (member.kind) {
|
3983
|
-
case
|
3982
|
+
case 0 /* Variable */:
|
3984
3983
|
return new VariableEntityCompletionItemInfo(
|
3985
3984
|
this.completionItemInfoContext,
|
3986
|
-
member
|
3985
|
+
member,
|
3987
3986
|
name,
|
3988
3987
|
isNameExplicitlyOriginal
|
3989
3988
|
);
|
3990
|
-
case
|
3989
|
+
case 1 /* Method */:
|
3991
3990
|
return new MethodEntityCompletionItemInfo(
|
3992
3991
|
this.completionItemInfoContext,
|
3993
|
-
member
|
3992
|
+
member,
|
3994
3993
|
name,
|
3995
3994
|
isNameExplicitlyOriginal
|
3996
3995
|
);
|
3997
|
-
case
|
3998
|
-
return this.createTypeEntityCompletionItemInfo(member
|
3996
|
+
case 2 /* Type */:
|
3997
|
+
return this.createTypeEntityCompletionItemInfo(member, name, isNameExplicitlyOriginal);
|
3999
3998
|
default:
|
4000
3999
|
Debug.never(member);
|
4001
4000
|
}
|
@@ -4012,37 +4011,27 @@ var CompletionService = class {
|
|
4012
4011
|
}
|
4013
4012
|
getTypeMemberCompletionItemInfos(ctx) {
|
4014
4013
|
const type = this._analyzer.excludeNoneFromType(ctx.type);
|
4015
|
-
|
4016
|
-
|
4017
|
-
|
4018
|
-
|
4019
|
-
|
4020
|
-
|
4021
|
-
|
4022
|
-
|
4023
|
-
|
4024
|
-
|
4025
|
-
|
4026
|
-
|
4027
|
-
|
4028
|
-
|
4029
|
-
|
4030
|
-
|
4031
|
-
|
4032
|
-
|
4033
|
-
|
4034
|
-
|
4035
|
-
|
4036
|
-
this.completionItemInfoContext,
|
4037
|
-
m.value,
|
4038
|
-
m.name,
|
4039
|
-
m.requiresExplicitOriginalName
|
4040
|
-
);
|
4041
|
-
default:
|
4042
|
-
Debug.never(m.value);
|
4043
|
-
}
|
4044
|
-
}).chain(Query.from(memberLookup.getOperators(ctx.hidingMatcher, ctx.typeExtensionsLookup)).filter((m) => m.value.isStatic() === ctx.isStaticAccess).map((o) => new OperatorCompletionItemInfo(this.completionItemInfoContext, o.value, o.localization))).toArray();
|
4045
|
-
}
|
4014
|
+
const memberLookup = new TypeMemberLookup(this._analyzer, type, ctx.localizationContext);
|
4015
|
+
return memberLookup.getNamedMembers(ctx.hidingMatcher, ctx.typeExtensionsLookup).filter((m) => m.value.isStatic() === ctx.isStaticAccess).map((m) => {
|
4016
|
+
switch (m.value.kind) {
|
4017
|
+
case "method":
|
4018
|
+
return new TypeMethodCompletionItemInfo(
|
4019
|
+
this.completionItemInfoContext,
|
4020
|
+
m.value,
|
4021
|
+
m.name,
|
4022
|
+
m.requiresExplicitOriginalName
|
4023
|
+
);
|
4024
|
+
case "variable":
|
4025
|
+
return new TypeVariableCompletionItemInfo(
|
4026
|
+
this.completionItemInfoContext,
|
4027
|
+
m.value,
|
4028
|
+
m.name,
|
4029
|
+
m.requiresExplicitOriginalName
|
4030
|
+
);
|
4031
|
+
default:
|
4032
|
+
Debug.never(m.value);
|
4033
|
+
}
|
4034
|
+
}).concat(memberLookup.getOperators(ctx.hidingMatcher, ctx.typeExtensionsLookup).filter((m) => m.value.isStatic() === ctx.isStaticAccess).map((o) => new OperatorCompletionItemInfo(this.completionItemInfoContext, o.value, o.localization)));
|
4046
4035
|
}
|
4047
4036
|
getPackageImportCompletionItemInfos(ctx) {
|
4048
4037
|
const result = this._analyzer.packageImports.getPackagesAvailableForImport(this._sourceFile.package).map((p) => p.getImportName()).filter((n) => {
|
@@ -4076,10 +4065,10 @@ var CompletionService = class {
|
|
4076
4065
|
result = items ?? Query.empty();
|
4077
4066
|
} else if (ctx.translationKind === 2 /* Method */) {
|
4078
4067
|
result = Query.from(ctx.packageMemberLookup.getNamedMembers(ctx.hidingMatcher)).mapAndFilter((d) => {
|
4079
|
-
if (d.value.kind ===
|
4068
|
+
if (d.value.kind === 1 /* Method */) {
|
4080
4069
|
return new AliasesSourceMethodCompletionItemInfo(
|
4081
4070
|
this.completionItemInfoContext,
|
4082
|
-
d.value
|
4071
|
+
d.value,
|
4083
4072
|
!ctx.hasPrecedingKeyword,
|
4084
4073
|
displayService_
|
4085
4074
|
);
|
@@ -4088,10 +4077,10 @@ var CompletionService = class {
|
|
4088
4077
|
});
|
4089
4078
|
} else if (ctx.translationKind === 3 /* Type */) {
|
4090
4079
|
result = Query.from(ctx.packageMemberLookup.getNamedMembers(ctx.hidingMatcher)).mapAndFilter((d) => {
|
4091
|
-
if (d.value.kind ===
|
4080
|
+
if (d.value.kind === 2 /* Type */) {
|
4092
4081
|
return new AliasesSourcePackageTypeCompletionItemInfo(
|
4093
4082
|
this.completionItemInfoContext,
|
4094
|
-
d.value
|
4083
|
+
d.value,
|
4095
4084
|
!ctx.hasPrecedingKeyword,
|
4096
4085
|
displayService_
|
4097
4086
|
);
|
@@ -4110,31 +4099,31 @@ var CompletionService = class {
|
|
4110
4099
|
}
|
4111
4100
|
}
|
4112
4101
|
result = Query.from(packageNameItems ?? []).chain(
|
4113
|
-
Query.from(ctx.packageMemberLookup.getNamedMembers(ctx.hidingMatcher)).
|
4114
|
-
|
4115
|
-
|
4116
|
-
|
4117
|
-
|
4118
|
-
|
4119
|
-
|
4120
|
-
|
4121
|
-
|
4122
|
-
|
4123
|
-
|
4124
|
-
|
4125
|
-
|
4126
|
-
|
4127
|
-
|
4128
|
-
|
4129
|
-
|
4130
|
-
|
4131
|
-
|
4132
|
-
|
4133
|
-
|
4134
|
-
|
4135
|
-
|
4102
|
+
Query.from(ctx.packageMemberLookup.getNamedMembers(ctx.hidingMatcher)).map((d) => {
|
4103
|
+
switch (d.value.kind) {
|
4104
|
+
case 0 /* Variable */:
|
4105
|
+
return new AliasesSourceVariableCompletionItemInfo(
|
4106
|
+
this.completionItemInfoContext,
|
4107
|
+
d.value,
|
4108
|
+
displayService_
|
4109
|
+
);
|
4110
|
+
case 1 /* Method */:
|
4111
|
+
return new AliasesSourceMethodCompletionItemInfo(
|
4112
|
+
this.completionItemInfoContext,
|
4113
|
+
d.value,
|
4114
|
+
!ctx.hasPrecedingKeyword,
|
4115
|
+
displayService_
|
4116
|
+
);
|
4117
|
+
case 2 /* Type */:
|
4118
|
+
return new AliasesSourcePackageTypeCompletionItemInfo(
|
4119
|
+
this.completionItemInfoContext,
|
4120
|
+
d.value,
|
4121
|
+
!ctx.hasPrecedingKeyword,
|
4122
|
+
displayService_
|
4123
|
+
);
|
4124
|
+
default:
|
4125
|
+
Debug.never(d.value);
|
4136
4126
|
}
|
4137
|
-
return void 0;
|
4138
4127
|
})
|
4139
4128
|
);
|
4140
4129
|
} else {
|
@@ -4142,9 +4131,9 @@ var CompletionService = class {
|
|
4142
4131
|
}
|
4143
4132
|
if (!ctx.hasPrecedingKeyword) {
|
4144
4133
|
const keywords = [
|
4145
|
-
|
4146
|
-
|
4147
|
-
|
4134
|
+
18 /* Import */,
|
4135
|
+
16 /* Type */,
|
4136
|
+
12 /* Function */
|
4148
4137
|
];
|
4149
4138
|
result = result.chain(
|
4150
4139
|
Query.from(keywords).map(
|
@@ -4160,7 +4149,7 @@ var CompletionService = class {
|
|
4160
4149
|
const displayService_ = new DisplayService(this._analyzer, ctx.sourceLocale, this._dialect);
|
4161
4150
|
if (ctx.translationKind === 1 /* Method */) {
|
4162
4151
|
result = Query.from(ctx.typeEntity.getMembers().getNamedMembers()).mapAndFilter((m) => {
|
4163
|
-
if (m.kind ===
|
4152
|
+
if (m.kind === 1 /* Method */) {
|
4164
4153
|
return new AliasesSourceMethodCompletionItemInfo(
|
4165
4154
|
this.completionItemInfoContext,
|
4166
4155
|
m,
|
@@ -4185,7 +4174,7 @@ var CompletionService = class {
|
|
4185
4174
|
result = Query.from(ctx.typeEntity.getMembers().getNamedMembers()).mapAndFilter((m) => {
|
4186
4175
|
if (m.kind === 0 /* Variable */) {
|
4187
4176
|
return new AliasesSourceVariableCompletionItemInfo(this.completionItemInfoContext, m, displayService_);
|
4188
|
-
} else if (m.kind ===
|
4177
|
+
} else if (m.kind === 1 /* Method */) {
|
4189
4178
|
return new AliasesSourceMethodCompletionItemInfo(
|
4190
4179
|
this.completionItemInfoContext,
|
4191
4180
|
m,
|
@@ -4214,8 +4203,8 @@ var CompletionService = class {
|
|
4214
4203
|
}
|
4215
4204
|
if (!ctx.hasPrecedingKeyword) {
|
4216
4205
|
const keywords = [
|
4217
|
-
|
4218
|
-
|
4206
|
+
12 /* Function */,
|
4207
|
+
29 /* Creation */
|
4219
4208
|
];
|
4220
4209
|
result = result.chain(
|
4221
4210
|
Query.from(keywords).map(
|
@@ -4378,7 +4367,7 @@ function isInvalidNode(node) {
|
|
4378
4367
|
switch (node.kind) {
|
4379
4368
|
case 72 /* InvalidExpression */:
|
4380
4369
|
case 43 /* InvalidPackageMemberDeclaration */:
|
4381
|
-
case
|
4370
|
+
case 111 /* InvalidStatement */:
|
4382
4371
|
case 57 /* InvalidTypeMemberDeclaration */:
|
4383
4372
|
case 16 /* InvalidTypeSpecifier */:
|
4384
4373
|
return true;
|
@@ -4429,6 +4418,12 @@ var TypeCompletionContext = class {
|
|
4429
4418
|
this.kind = "type";
|
4430
4419
|
}
|
4431
4420
|
};
|
4421
|
+
var TagCompletionContext = class {
|
4422
|
+
constructor(searchLocation) {
|
4423
|
+
this.searchLocation = searchLocation;
|
4424
|
+
this.kind = "tag";
|
4425
|
+
}
|
4426
|
+
};
|
4432
4427
|
var OperatorNameCompletionContext = class {
|
4433
4428
|
constructor(nameToken) {
|
4434
4429
|
this.nameToken = nameToken;
|
@@ -4572,7 +4567,7 @@ var TypeVariableCompletionItemInfo = class {
|
|
4572
4567
|
return `${this.isNameExplicitlyOriginal ? "~" : ""}${this.ctx.getInsertTextForName(this.name.value)}`;
|
4573
4568
|
}
|
4574
4569
|
getCompletionItemKind() {
|
4575
|
-
return 2 /* TypeVariable */;
|
4570
|
+
return this.variable.isVariant() ? 12 /* Variant */ : 2 /* TypeVariable */;
|
4576
4571
|
}
|
4577
4572
|
getDetails() {
|
4578
4573
|
return this.ctx.displayService.displayVariableDeclaration(
|
@@ -4646,33 +4641,6 @@ var OperatorCompletionItemInfo = class {
|
|
4646
4641
|
return void 0;
|
4647
4642
|
}
|
4648
4643
|
};
|
4649
|
-
var VariantCompletionItemInfo = class {
|
4650
|
-
constructor(ctx, variant, name, isNameExplicitlyOriginal) {
|
4651
|
-
this.ctx = ctx;
|
4652
|
-
this.variant = variant;
|
4653
|
-
this.name = name;
|
4654
|
-
this.isNameExplicitlyOriginal = isNameExplicitlyOriginal;
|
4655
|
-
this.kind = "variant";
|
4656
|
-
}
|
4657
|
-
getLabel() {
|
4658
|
-
return `${this.isNameExplicitlyOriginal ? "~" : ""}${this.ctx.getInsertTextForName(this.name.value)}`;
|
4659
|
-
}
|
4660
|
-
getCompletionItemKind() {
|
4661
|
-
return 12 /* Variant */;
|
4662
|
-
}
|
4663
|
-
getDetails() {
|
4664
|
-
return this.ctx.displayService.displayVariantEntity(this.variant, this.name.localization);
|
4665
|
-
}
|
4666
|
-
getInsertText() {
|
4667
|
-
return void 0;
|
4668
|
-
}
|
4669
|
-
getSortText() {
|
4670
|
-
return void 0;
|
4671
|
-
}
|
4672
|
-
getEditRange() {
|
4673
|
-
return void 0;
|
4674
|
-
}
|
4675
|
-
};
|
4676
4644
|
var VariableEntityCompletionItemInfo = class {
|
4677
4645
|
constructor(ctx, entity, name, isNameExplicitlyOriginal) {
|
4678
4646
|
this.ctx = ctx;
|
@@ -4689,7 +4657,7 @@ var VariableEntityCompletionItemInfo = class {
|
|
4689
4657
|
case "package":
|
4690
4658
|
return 7 /* PackageVariable */;
|
4691
4659
|
case "type":
|
4692
|
-
return 2 /* TypeVariable */;
|
4660
|
+
return this.entity.isVariant() ? 12 /* Variant */ : 2 /* TypeVariable */;
|
4693
4661
|
case "parameter":
|
4694
4662
|
return 10 /* ParameterVariable */;
|
4695
4663
|
case "local":
|
@@ -4765,14 +4733,14 @@ var NamedTypeCompletionItemInfo = class {
|
|
4765
4733
|
return `${this.prefix}${this.isNameExplicitlyOriginal ? "~" : ""}${this.ctx.getInsertTextForName(this.name.value)}`;
|
4766
4734
|
}
|
4767
4735
|
getCompletionItemKind() {
|
4768
|
-
switch (this.entity.
|
4769
|
-
case
|
4736
|
+
switch (this.entity.typeEntityKind) {
|
4737
|
+
case 3 /* Variant */:
|
4770
4738
|
return 16 /* VariantType */;
|
4771
|
-
case
|
4739
|
+
case 2 /* Parameter */:
|
4772
4740
|
return 17 /* TypeParameter */;
|
4773
|
-
case
|
4741
|
+
case 0 /* Method */:
|
4774
4742
|
return 18 /* MethodType */;
|
4775
|
-
case
|
4743
|
+
case 1 /* Structured */:
|
4776
4744
|
if (this.entity.isRefObject()) {
|
4777
4745
|
return 13 /* RefObjectType */;
|
4778
4746
|
} else if (this.entity.isPlainObject()) {
|
@@ -4782,7 +4750,7 @@ var NamedTypeCompletionItemInfo = class {
|
|
4782
4750
|
} else {
|
4783
4751
|
return 20 /* InvalidType */;
|
4784
4752
|
}
|
4785
|
-
case
|
4753
|
+
case 4 /* Alias */:
|
4786
4754
|
return 19 /* AliasType */;
|
4787
4755
|
default:
|
4788
4756
|
Debug.never(this.entity);
|
@@ -4981,12 +4949,12 @@ var AliasesSourcePackageTypeCompletionItemInfo = class {
|
|
4981
4949
|
return this.ctx.getInsertTextForName(this.typeEntity.getName());
|
4982
4950
|
}
|
4983
4951
|
getCompletionItemKind() {
|
4984
|
-
switch (this.typeEntity.
|
4985
|
-
case
|
4952
|
+
switch (this.typeEntity.typeEntityKind) {
|
4953
|
+
case 3 /* Variant */:
|
4986
4954
|
return 16 /* VariantType */;
|
4987
|
-
case
|
4955
|
+
case 0 /* Method */:
|
4988
4956
|
return 18 /* MethodType */;
|
4989
|
-
case
|
4957
|
+
case 1 /* Structured */: {
|
4990
4958
|
if (this.typeEntity.isRefObject()) {
|
4991
4959
|
return 13 /* RefObjectType */;
|
4992
4960
|
} else if (this.typeEntity.isPlainObject()) {
|
@@ -4996,7 +4964,7 @@ var AliasesSourcePackageTypeCompletionItemInfo = class {
|
|
4996
4964
|
}
|
4997
4965
|
return 20 /* InvalidType */;
|
4998
4966
|
}
|
4999
|
-
case
|
4967
|
+
case 4 /* Alias */:
|
5000
4968
|
return 19 /* AliasType */;
|
5001
4969
|
}
|
5002
4970
|
}
|
@@ -5015,20 +4983,20 @@ var AliasesSourcePackageTypeCompletionItemInfo = class {
|
|
5015
4983
|
}
|
5016
4984
|
getDisplayServiceTypeDeclaration() {
|
5017
4985
|
const localization = Localization.Original.ofEntity(this.typeEntity);
|
5018
|
-
switch (this.typeEntity.
|
5019
|
-
case
|
4986
|
+
switch (this.typeEntity.typeEntityKind) {
|
4987
|
+
case 3 /* Variant */:
|
5020
4988
|
return new TypeDeclaration_variant(
|
5021
4989
|
new TypeDeclarationVariant_entity(this.typeEntity, localization)
|
5022
4990
|
);
|
5023
|
-
case
|
4991
|
+
case 0 /* Method */:
|
5024
4992
|
return new TypeDeclaration_method(
|
5025
4993
|
new TypeDeclarationMethod_entity(this.typeEntity, localization)
|
5026
4994
|
);
|
5027
|
-
case
|
4995
|
+
case 1 /* Structured */:
|
5028
4996
|
return new TypeDeclaration_structured(
|
5029
4997
|
new TypeDeclarationStructured_entity(this.typeEntity, localization)
|
5030
4998
|
);
|
5031
|
-
case
|
4999
|
+
case 4 /* Alias */:
|
5032
5000
|
return new TypeDeclaration_alias(
|
5033
5001
|
new TypeDeclarationAlias_entity(this.typeEntity, localization)
|
5034
5002
|
);
|
@@ -5091,7 +5059,7 @@ var AliasesSourceTypeConstructorCompletionItemInfo = class {
|
|
5091
5059
|
Localization.Original.ofEntity(this.constructor_)
|
5092
5060
|
);
|
5093
5061
|
const displayParts = this.displayService.getConstructorDeclarationDisplayParts(constructorDeclaration);
|
5094
|
-
const creationKeyword = this.displayService.displayKeyword(
|
5062
|
+
const creationKeyword = this.displayService.displayKeyword(29 /* Creation */);
|
5095
5063
|
return creationKeyword + displayParts.valueParametersStart + displayParts.valueParameters.map((p) => p.toString()).join(displayParts.valueParameterSeparator) + displayParts.valueParametersEnd;
|
5096
5064
|
});
|
5097
5065
|
}
|
@@ -5105,7 +5073,7 @@ var AliasesSourceTypeConstructorCompletionItemInfo = class {
|
|
5105
5073
|
return this.label;
|
5106
5074
|
}
|
5107
5075
|
getInsertText() {
|
5108
|
-
const creationKeyword = this.includeOnCreateKeyword ? this.displayService.displayKeyword(
|
5076
|
+
const creationKeyword = this.includeOnCreateKeyword ? this.displayService.displayKeyword(29 /* Creation */) : "";
|
5109
5077
|
const parameters = this.constructor_.getValueParameters().map((p) => this.ctx.getInsertTextForName(p.getName(), true)).join(", ");
|
5110
5078
|
return `${creationKeyword}(${parameters})`;
|
5111
5079
|
}
|
@@ -5143,7 +5111,7 @@ var OperatorNameCompletionItemInfo = class {
|
|
5143
5111
|
}
|
5144
5112
|
};
|
5145
5113
|
var SyntaxContext = class {
|
5146
|
-
constructor(isInComment, isInStringOrChar, isInQuotedIdentifier, isPackageMemberDeclarationListContext, isTypeMemberDeclarationListContext, isStatementContext, isExpressionContext, precedingExpression, isUnqualifiedTypeContext, isTopLevelTranslationListContext, isTypeMemberTranslationListContext) {
|
5114
|
+
constructor(isInComment, isInStringOrChar, isInQuotedIdentifier, isPackageMemberDeclarationListContext, isTypeMemberDeclarationListContext, isStatementContext, isExpressionContext, precedingExpression, isUnqualifiedTypeContext, isUnqualifiedTagNameCompletionContext, isTopLevelTranslationListContext, isTypeMemberTranslationListContext) {
|
5147
5115
|
this.isInComment = isInComment;
|
5148
5116
|
this.isInStringOrChar = isInStringOrChar;
|
5149
5117
|
this.isInQuotedIdentifier = isInQuotedIdentifier;
|
@@ -5153,11 +5121,12 @@ var SyntaxContext = class {
|
|
5153
5121
|
this.isExpressionContext = isExpressionContext;
|
5154
5122
|
this.precedingExpression = precedingExpression;
|
5155
5123
|
this.isUnqualifiedTypeContext = isUnqualifiedTypeContext;
|
5124
|
+
this.isUnqualifiedTagNameCompletionContext = isUnqualifiedTagNameCompletionContext;
|
5156
5125
|
this.isTopLevelTranslationListContext = isTopLevelTranslationListContext;
|
5157
5126
|
this.isTypeMemberTranslationListContext = isTypeMemberTranslationListContext;
|
5158
5127
|
}
|
5159
5128
|
};
|
5160
|
-
var
|
5129
|
+
var ExpressionRole_argument = class {
|
5161
5130
|
constructor(argumentList, index) {
|
5162
5131
|
this.argumentList = argumentList;
|
5163
5132
|
this.index = index;
|
@@ -5218,6 +5187,7 @@ var SyntaxContextFactory = class {
|
|
5218
5187
|
if (positionDescription.kind === "after-token-or-keyword") {
|
5219
5188
|
isUnqualifiedTypeContext = this.isUnqualifiedTypeContext(positionDescription.tokenOrKeyword);
|
5220
5189
|
}
|
5190
|
+
const isUnqualifiedTagNameCompletionContext = positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isToken(35 /* HashSign */) && positionDescription.tokenOrKeyword.parent.kind === 145 /* Tag */;
|
5221
5191
|
let isTopLevelTranslationListContext;
|
5222
5192
|
if (positionDescription.kind === "after-token-or-keyword") {
|
5223
5193
|
isTopLevelTranslationListContext = this.isTopLevelTranslationListContext(positionDescription.tokenOrKeyword);
|
@@ -5236,6 +5206,7 @@ var SyntaxContextFactory = class {
|
|
5236
5206
|
isExpressionContext,
|
5237
5207
|
precedingExpression,
|
5238
5208
|
isUnqualifiedTypeContext,
|
5209
|
+
isUnqualifiedTagNameCompletionContext,
|
5239
5210
|
isTopLevelTranslationListContext,
|
5240
5211
|
isTypeMemberTranslationListContext
|
5241
5212
|
);
|
@@ -5258,15 +5229,15 @@ var SyntaxContextFactory = class {
|
|
5258
5229
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.initializer);
|
5259
5230
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5260
5231
|
}
|
5261
|
-
if (tokenOrKeyword.parent.kind ===
|
5232
|
+
if (tokenOrKeyword.parent.kind === 142 /* ParameterDeclaration */) {
|
5262
5233
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.defaultValue);
|
5263
5234
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5264
5235
|
}
|
5265
|
-
if (tokenOrKeyword.parent.kind ===
|
5236
|
+
if (tokenOrKeyword.parent.kind === 143 /* Argument */) {
|
5266
5237
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.value);
|
5267
5238
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5268
5239
|
}
|
5269
|
-
if (tokenOrKeyword.parent.kind ===
|
5240
|
+
if (tokenOrKeyword.parent.kind === 140 /* VariantDeclaration */) {
|
5270
5241
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.value);
|
5271
5242
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5272
5243
|
}
|
@@ -5315,23 +5286,23 @@ var SyntaxContextFactory = class {
|
|
5315
5286
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5316
5287
|
}
|
5317
5288
|
if (tokenOrKeyword.parent.kind === 69 /* CallExpression */) {
|
5318
|
-
const expressionRole = new
|
5289
|
+
const expressionRole = new ExpressionRole_argument(tokenOrKeyword.parent.argumentList, 0);
|
5319
5290
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5320
5291
|
}
|
5321
5292
|
if (tokenOrKeyword.parent.kind === 70 /* AutotypeCallExpression */) {
|
5322
|
-
const expressionRole = new
|
5293
|
+
const expressionRole = new ExpressionRole_argument(tokenOrKeyword.parent.argumentList, 0);
|
5323
5294
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5324
5295
|
}
|
5325
|
-
if (tokenOrKeyword.parent.kind ===
|
5326
|
-
const
|
5327
|
-
if (
|
5328
|
-
const expressionRole = new
|
5296
|
+
if (tokenOrKeyword.parent.kind === 145 /* Tag */) {
|
5297
|
+
const argumentList = tokenOrKeyword.parent.argumentList;
|
5298
|
+
if (argumentList !== void 0) {
|
5299
|
+
const expressionRole = new ExpressionRole_argument(argumentList, 0);
|
5329
5300
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5330
5301
|
}
|
5331
5302
|
}
|
5332
5303
|
}
|
5333
5304
|
if (tokenOrKeyword.isToken(45 /* OpenSquareBracket */) && tokenOrKeyword.parent.kind === 71 /* IndexedAccessExpression */) {
|
5334
|
-
const expressionRole = new
|
5305
|
+
const expressionRole = new ExpressionRole_argument(tokenOrKeyword.parent.argumentList, 0);
|
5335
5306
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5336
5307
|
}
|
5337
5308
|
if (tokenOrKeyword.isToken(45 /* OpenSquareBracket */) && tokenOrKeyword.parent.kind === 61 /* ArrayLiteral */) {
|
@@ -5339,7 +5310,7 @@ var SyntaxContextFactory = class {
|
|
5339
5310
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5340
5311
|
}
|
5341
5312
|
if (tokenOrKeyword.isToken(24 /* Comma */)) {
|
5342
|
-
if (tokenOrKeyword.parent.kind === 68 /*
|
5313
|
+
if (tokenOrKeyword.parent.kind === 68 /* ArgumentList */) {
|
5343
5314
|
const argumentList = tokenOrKeyword.parent;
|
5344
5315
|
let index = 0;
|
5345
5316
|
for (const element of argumentList.elements) {
|
@@ -5350,10 +5321,10 @@ var SyntaxContextFactory = class {
|
|
5350
5321
|
}
|
5351
5322
|
}
|
5352
5323
|
}
|
5353
|
-
const expressionRole = new
|
5324
|
+
const expressionRole = new ExpressionRole_argument(argumentList, index);
|
5354
5325
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5355
5326
|
}
|
5356
|
-
if (tokenOrKeyword.parent.kind ===
|
5327
|
+
if (tokenOrKeyword.parent.kind === 118 /* MatchExpressionList */) {
|
5357
5328
|
const expressionRole = new ExpressionRole_matchListElement(tokenOrKeyword.parent.parent.parent.parent);
|
5358
5329
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5359
5330
|
}
|
@@ -5362,43 +5333,43 @@ var SyntaxContextFactory = class {
|
|
5362
5333
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5363
5334
|
}
|
5364
5335
|
}
|
5365
|
-
if (tokenOrKeyword.isKeyword(
|
5336
|
+
if (tokenOrKeyword.isKeyword(44 /* Case */) && tokenOrKeyword.parent.kind === 119 /* SwitchStatementCaseClause */) {
|
5366
5337
|
const expressionRole = new ExpressionRole_matchListElement(tokenOrKeyword.parent.parent.parent);
|
5367
5338
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5368
5339
|
}
|
5369
|
-
if (tokenOrKeyword.isKeyword(
|
5340
|
+
if (tokenOrKeyword.isKeyword(15 /* Return */) && tokenOrKeyword.parent.kind === 115 /* ReturnStatement */) {
|
5370
5341
|
const expressionRole = new ExpressionRole_returnedValue(tokenOrKeyword.parent);
|
5371
5342
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5372
5343
|
}
|
5373
|
-
if (tokenOrKeyword.isKeyword(
|
5344
|
+
if (tokenOrKeyword.isKeyword(43 /* Switch */) && tokenOrKeyword.parent.kind === 117 /* SwitchStatement */) {
|
5374
5345
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5375
5346
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5376
5347
|
}
|
5377
|
-
if (tokenOrKeyword.isKeyword(
|
5348
|
+
if (tokenOrKeyword.isKeyword(13 /* If */) && tokenOrKeyword.parent.kind === 108 /* IfStatement */) {
|
5378
5349
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5379
5350
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5380
5351
|
}
|
5381
|
-
if (tokenOrKeyword.isKeyword(
|
5352
|
+
if (tokenOrKeyword.isKeyword(11 /* ElseIf */) && tokenOrKeyword.parent.kind === 110 /* ElseIfClause */) {
|
5382
5353
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5383
5354
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5384
5355
|
}
|
5385
|
-
if (tokenOrKeyword.isKeyword(
|
5356
|
+
if (tokenOrKeyword.isKeyword(9 /* From */) && tokenOrKeyword.parent.kind === 107 /* ForStatement */) {
|
5386
5357
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.enumeratedExpression);
|
5387
5358
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5388
5359
|
}
|
5389
|
-
if (tokenOrKeyword.isKeyword(
|
5360
|
+
if (tokenOrKeyword.isKeyword(24 /* While */) && tokenOrKeyword.parent.kind === 120 /* WhileStatement */) {
|
5390
5361
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5391
5362
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5392
5363
|
}
|
5393
|
-
if (tokenOrKeyword.isKeyword(
|
5364
|
+
if (tokenOrKeyword.isKeyword(26 /* RepeatWhile */) && tokenOrKeyword.parent.kind === 114 /* LoopStatement */) {
|
5394
5365
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5395
5366
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5396
5367
|
}
|
5397
|
-
if (tokenOrKeyword.isKeyword(
|
5368
|
+
if (tokenOrKeyword.isKeyword(27 /* Yield */) && tokenOrKeyword.parent.kind === 121 /* YieldStatement */) {
|
5398
5369
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5399
5370
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5400
5371
|
}
|
5401
|
-
if (tokenOrKeyword.isKeyword(
|
5372
|
+
if (tokenOrKeyword.isKeyword(28 /* When */) && tokenOrKeyword.parent.kind === 76 /* WhenTernaryExpression */) {
|
5402
5373
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5403
5374
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5404
5375
|
}
|
@@ -5436,10 +5407,10 @@ var SyntaxContextFactory = class {
|
|
5436
5407
|
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 37 /* PackageVariableSetterDeclaration */)) {
|
5437
5408
|
return true;
|
5438
5409
|
}
|
5439
|
-
if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind ===
|
5410
|
+
if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind === 147 /* Modifier */ && tokenOrKeyword.value === tokenOrKeyword.parent.value && tokenOrKeyword.parent.openParenthesisToken === void 0 && NodeTypeUtils.isPackageMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
|
5440
5411
|
return true;
|
5441
5412
|
}
|
5442
|
-
if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind ===
|
5413
|
+
if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind === 147 /* Modifier */ && NodeTypeUtils.isPackageMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
|
5443
5414
|
return true;
|
5444
5415
|
}
|
5445
5416
|
return false;
|
@@ -5460,13 +5431,13 @@ var SyntaxContextFactory = class {
|
|
5460
5431
|
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
|
5461
5432
|
tokenOrKeyword,
|
5462
5433
|
51 /* TypeDereferencedVariableSetterDeclaration */
|
5463
|
-
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 52 /* TypeMethodDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 53 /* OperatorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 45 /* TypeConstructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 46 /* TypeDestructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword,
|
5434
|
+
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 52 /* TypeMethodDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 53 /* OperatorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 45 /* TypeConstructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 46 /* TypeDestructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 140 /* VariantDeclaration */)) {
|
5464
5435
|
return true;
|
5465
5436
|
}
|
5466
|
-
if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind ===
|
5437
|
+
if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind === 147 /* Modifier */ && tokenOrKeyword.value === tokenOrKeyword.parent.value && tokenOrKeyword.parent.openParenthesisToken === void 0 && NodeTypeUtils.isTypeMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
|
5467
5438
|
return true;
|
5468
5439
|
}
|
5469
|
-
if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind ===
|
5440
|
+
if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind === 147 /* Modifier */ && NodeTypeUtils.isTypeMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
|
5470
5441
|
return true;
|
5471
5442
|
}
|
5472
5443
|
return false;
|
@@ -5503,34 +5474,34 @@ var SyntaxContextFactory = class {
|
|
5503
5474
|
return result;
|
5504
5475
|
}
|
5505
5476
|
static isUnqualifiedTypeContext(tokenOrKeyword) {
|
5506
|
-
if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind ===
|
5477
|
+
if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind === 154 /* TypeAnnotation */) {
|
5507
5478
|
return { allowsAnonymousTypes: true };
|
5508
5479
|
}
|
5509
5480
|
if ((tokenOrKeyword.isKeyword(4 /* Object */) || tokenOrKeyword.isKeyword(5 /* PlainObject */) || tokenOrKeyword.isKeyword(3 /* Aspect */)) && tokenOrKeyword.parent.kind === 34 /* StructuredTypeDeclarationBody */) {
|
5510
5481
|
return { allowsAnonymousTypes: false };
|
5511
5482
|
}
|
5512
|
-
if (tokenOrKeyword.isKeyword(
|
5483
|
+
if (tokenOrKeyword.isKeyword(16 /* Type */) && (NodeTypeUtils.isPackageTypeDeclaration(tokenOrKeyword.parent) || tokenOrKeyword.parent.kind === 40 /* TypeExtensionDeclaration */)) {
|
5513
5484
|
return { allowsAnonymousTypes: false };
|
5514
5485
|
}
|
5515
|
-
if (tokenOrKeyword.isToken(36 /* LessThan */) && tokenOrKeyword.parent.kind ===
|
5486
|
+
if (tokenOrKeyword.isToken(36 /* LessThan */) && tokenOrKeyword.parent.kind === 150 /* TypeArgumentClause */) {
|
5516
5487
|
return { allowsAnonymousTypes: true };
|
5517
5488
|
}
|
5518
|
-
if (tokenOrKeyword.isToken(24 /* Comma */) && (tokenOrKeyword.parent.kind === 30 /* BaseTypeList */ || tokenOrKeyword.parent.kind ===
|
5519
|
-
return { allowsAnonymousTypes: tokenOrKeyword.parent.kind ===
|
5489
|
+
if (tokenOrKeyword.isToken(24 /* Comma */) && (tokenOrKeyword.parent.kind === 30 /* BaseTypeList */ || tokenOrKeyword.parent.kind === 151 /* TypeArgumentList */)) {
|
5490
|
+
return { allowsAnonymousTypes: tokenOrKeyword.parent.kind === 151 /* TypeArgumentList */ };
|
5520
5491
|
}
|
5521
|
-
if (tokenOrKeyword.isToken(35 /* HashSign */) && tokenOrKeyword.parent.kind ===
|
5492
|
+
if (tokenOrKeyword.isToken(35 /* HashSign */) && tokenOrKeyword.parent.kind === 145 /* Tag */) {
|
5522
5493
|
return { allowsAnonymousTypes: false };
|
5523
5494
|
}
|
5524
|
-
if ((tokenOrKeyword.isToken(23 /* Colon */) || tokenOrKeyword.isToken(57 /* Equals */)) && tokenOrKeyword.parent.kind ===
|
5495
|
+
if ((tokenOrKeyword.isToken(23 /* Colon */) || tokenOrKeyword.isToken(57 /* Equals */)) && tokenOrKeyword.parent.kind === 141 /* TypeParameterDeclaration */) {
|
5525
5496
|
return { allowsAnonymousTypes: false };
|
5526
5497
|
}
|
5527
5498
|
if (tokenOrKeyword.isToken(57 /* Equals */) && tokenOrKeyword.parent.kind === 22 /* PackageAliasTypeDeclaration */) {
|
5528
5499
|
return { allowsAnonymousTypes: false };
|
5529
5500
|
}
|
5530
|
-
if (tokenOrKeyword.isKeyword(
|
5501
|
+
if (tokenOrKeyword.isKeyword(14 /* Is */) && tokenOrKeyword.parent.kind === 73 /* IsExpression */) {
|
5531
5502
|
return { allowsAnonymousTypes: true };
|
5532
5503
|
}
|
5533
|
-
if (tokenOrKeyword.isKeyword(
|
5504
|
+
if (tokenOrKeyword.isKeyword(41 /* As */) && tokenOrKeyword.parent.kind === 65 /* AsExpression */) {
|
5534
5505
|
return { allowsAnonymousTypes: true };
|
5535
5506
|
}
|
5536
5507
|
if (tokenOrKeyword.isToken(17 /* Bar */) && tokenOrKeyword.parent.kind === 12 /* UnionTypeSpecifierTypeList */) {
|
@@ -5547,32 +5518,32 @@ var SyntaxContextFactory = class {
|
|
5547
5518
|
}
|
5548
5519
|
const packageImport = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5549
5520
|
tokenOrKeyword,
|
5550
|
-
|
5521
|
+
132 /* PackageImportTranslation */
|
5551
5522
|
);
|
5552
5523
|
if (packageImport !== void 0) {
|
5553
5524
|
return { translationsDeclaration: packageImport.parent.parent };
|
5554
5525
|
}
|
5555
|
-
const type = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword,
|
5526
|
+
const type = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 137 /* TypeTranslation */);
|
5556
5527
|
if (type !== void 0) {
|
5557
5528
|
return { translationsDeclaration: type.parent.parent };
|
5558
5529
|
}
|
5559
5530
|
const methodType = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5560
5531
|
tokenOrKeyword,
|
5561
|
-
|
5532
|
+
131 /* MethodTypeTranslation */
|
5562
5533
|
);
|
5563
5534
|
if (methodType !== void 0) {
|
5564
5535
|
return { translationsDeclaration: methodType.parent.parent };
|
5565
5536
|
}
|
5566
5537
|
const variable = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5567
5538
|
tokenOrKeyword,
|
5568
|
-
|
5539
|
+
134 /* PackageVariableTranslation */
|
5569
5540
|
);
|
5570
5541
|
if (variable !== void 0) {
|
5571
5542
|
return { translationsDeclaration: variable.parent.parent };
|
5572
5543
|
}
|
5573
5544
|
const method = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5574
5545
|
tokenOrKeyword,
|
5575
|
-
|
5546
|
+
129 /* PackageMethodTranslation */
|
5576
5547
|
);
|
5577
5548
|
if (method !== void 0) {
|
5578
5549
|
return { translationsDeclaration: method.parent.parent };
|
@@ -5580,33 +5551,33 @@ var SyntaxContextFactory = class {
|
|
5580
5551
|
return void 0;
|
5581
5552
|
}
|
5582
5553
|
static isTypeMemberTranslationListContext(tokenOrKeyword) {
|
5583
|
-
if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind ===
|
5554
|
+
if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 136 /* TypeMemberTranslationList */) {
|
5584
5555
|
return { typeTranslation: tokenOrKeyword.parent.parent };
|
5585
5556
|
}
|
5586
|
-
if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind ===
|
5557
|
+
if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 137 /* TypeTranslation */) {
|
5587
5558
|
return { typeTranslation: tokenOrKeyword.parent };
|
5588
5559
|
}
|
5589
|
-
const indexer = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword,
|
5560
|
+
const indexer = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 126 /* IndexerTranslation */);
|
5590
5561
|
if (indexer !== void 0) {
|
5591
5562
|
return { typeTranslation: indexer.parent.parent };
|
5592
5563
|
}
|
5593
5564
|
const constructor = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5594
5565
|
tokenOrKeyword,
|
5595
|
-
|
5566
|
+
124 /* ConstructorTranslation */
|
5596
5567
|
);
|
5597
5568
|
if (constructor !== void 0) {
|
5598
5569
|
return { typeTranslation: constructor.parent.parent };
|
5599
5570
|
}
|
5600
5571
|
const variableOrVariant = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5601
5572
|
tokenOrKeyword,
|
5602
|
-
|
5573
|
+
135 /* TypeVariableOrVariantTranslation */
|
5603
5574
|
);
|
5604
5575
|
if (variableOrVariant !== void 0) {
|
5605
5576
|
return { typeTranslation: variableOrVariant.parent.parent };
|
5606
5577
|
}
|
5607
5578
|
const method = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5608
5579
|
tokenOrKeyword,
|
5609
|
-
|
5580
|
+
130 /* TypeMethodTranslation */
|
5610
5581
|
);
|
5611
5582
|
if (method !== void 0) {
|
5612
5583
|
return { typeTranslation: method.parent.parent };
|
@@ -5731,7 +5702,7 @@ var NodeSemanticInfoService = class {
|
|
5731
5702
|
return this.ofDereferenceExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
|
5732
5703
|
} else if (tokenOrKeyword.parent.kind === 91 /* AssignmentStatement */) {
|
5733
5704
|
return this.ofAssignmentStatementOperator(analyzer, tokenOrKeyword.parent, options6);
|
5734
|
-
} else if (tokenOrKeyword.isKeyword(
|
5705
|
+
} else if (tokenOrKeyword.isKeyword(29 /* Creation */) && tokenOrKeyword.parent.kind === 45 /* TypeConstructorDeclaration */) {
|
5735
5706
|
return this.ofTypeConstructorDeclaration(analyzer, tokenOrKeyword.parent);
|
5736
5707
|
} else if (tokenOrKeyword.isToken(13 /* Asterisk */) && tokenOrKeyword.parent.kind === 90 /* DefaultMatchExpression */) {
|
5737
5708
|
return this.ofDefaultMatchExpression(analyzer, tokenOrKeyword.parent);
|
@@ -5754,11 +5725,11 @@ var NodeSemanticInfoService = class {
|
|
5754
5725
|
let result;
|
5755
5726
|
const parent = node.parent;
|
5756
5727
|
switch (parent.kind) {
|
5757
|
-
case
|
5728
|
+
case 127 /* TranslationTypeParameterList */:
|
5758
5729
|
break;
|
5759
|
-
case
|
5730
|
+
case 122 /* TranslationParameterList */:
|
5760
5731
|
break;
|
5761
|
-
case
|
5732
|
+
case 143 /* Argument */: {
|
5762
5733
|
const respectiveParameter = analyzer.getRespectiveParameter(parent);
|
5763
5734
|
if (respectiveParameter !== void 0) {
|
5764
5735
|
const target = new SimpleWithLocalization(
|
@@ -5775,7 +5746,7 @@ var NodeSemanticInfoService = class {
|
|
5775
5746
|
case 60 /* EnumerationVariableDeclaration */:
|
5776
5747
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofEnumerationVariableDeclaration(parent));
|
5777
5748
|
break;
|
5778
|
-
case
|
5749
|
+
case 101 /* ErrorVariableDeclaration */:
|
5779
5750
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofErrorVariableDeclaration(parent));
|
5780
5751
|
break;
|
5781
5752
|
case 22 /* PackageAliasTypeDeclaration */:
|
@@ -5805,10 +5776,10 @@ var NodeSemanticInfoService = class {
|
|
5805
5776
|
case 59 /* LocalVariableDeclaration */:
|
5806
5777
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofLocalVariableDeclaration(parent));
|
5807
5778
|
break;
|
5808
|
-
case
|
5779
|
+
case 133 /* QualifiedName */:
|
5809
5780
|
result = this.ofQualifiedNameQualifier(analyzer, parent, node, options6);
|
5810
5781
|
break;
|
5811
|
-
case
|
5782
|
+
case 134 /* PackageVariableTranslation */: {
|
5812
5783
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5813
5784
|
const getTargetResult = translationPackage?.getPackageVariableTranslationTarget(parent);
|
5814
5785
|
if (translationPackage !== void 0 && getTargetResult?.target !== void 0) {
|
@@ -5828,7 +5799,7 @@ var NodeSemanticInfoService = class {
|
|
5828
5799
|
}
|
5829
5800
|
break;
|
5830
5801
|
}
|
5831
|
-
case
|
5802
|
+
case 135 /* TypeVariableOrVariantTranslation */: {
|
5832
5803
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5833
5804
|
const getTargetsResult = translationPackage?.getTypeVariableOrVariantTranslationTargets(parent);
|
5834
5805
|
if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
|
@@ -5852,7 +5823,7 @@ var NodeSemanticInfoService = class {
|
|
5852
5823
|
}
|
5853
5824
|
break;
|
5854
5825
|
}
|
5855
|
-
case
|
5826
|
+
case 129 /* PackageMethodTranslation */: {
|
5856
5827
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5857
5828
|
const getTargetsResult = translationPackage?.getPackageMethodTranslationTargets(parent);
|
5858
5829
|
if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
|
@@ -5876,7 +5847,7 @@ var NodeSemanticInfoService = class {
|
|
5876
5847
|
}
|
5877
5848
|
break;
|
5878
5849
|
}
|
5879
|
-
case
|
5850
|
+
case 130 /* TypeMethodTranslation */: {
|
5880
5851
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5881
5852
|
const getTargetsResult = translationPackage?.getTypeMethodTranslationTargets(parent);
|
5882
5853
|
if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
|
@@ -5900,7 +5871,7 @@ var NodeSemanticInfoService = class {
|
|
5900
5871
|
}
|
5901
5872
|
break;
|
5902
5873
|
}
|
5903
|
-
case
|
5874
|
+
case 137 /* TypeTranslation */: {
|
5904
5875
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5905
5876
|
const getTargetResult = translationPackage?.getTypeTranslationTarget(parent);
|
5906
5877
|
if (translationPackage !== void 0 && getTargetResult?.target !== void 0) {
|
@@ -5920,7 +5891,7 @@ var NodeSemanticInfoService = class {
|
|
5920
5891
|
}
|
5921
5892
|
break;
|
5922
5893
|
}
|
5923
|
-
case
|
5894
|
+
case 131 /* MethodTypeTranslation */: {
|
5924
5895
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5925
5896
|
const getTargetResult = translationPackage?.getMethodTypeTranslationTarget(parent);
|
5926
5897
|
if (translationPackage !== void 0 && getTargetResult?.target !== void 0) {
|
@@ -5940,7 +5911,7 @@ var NodeSemanticInfoService = class {
|
|
5940
5911
|
}
|
5941
5912
|
break;
|
5942
5913
|
}
|
5943
|
-
case
|
5914
|
+
case 142 /* ParameterDeclaration */:
|
5944
5915
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofParameterDeclaration(parent));
|
5945
5916
|
break;
|
5946
5917
|
case 8 /* PackageImport */:
|
@@ -5961,10 +5932,10 @@ var NodeSemanticInfoService = class {
|
|
5961
5932
|
case 54 /* TypeVariableDeclaration */:
|
5962
5933
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofTypeVariableDeclaration(parent));
|
5963
5934
|
break;
|
5964
|
-
case
|
5935
|
+
case 141 /* TypeParameterDeclaration */:
|
5965
5936
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofTypeParameterDeclaration(parent));
|
5966
5937
|
break;
|
5967
|
-
case
|
5938
|
+
case 140 /* VariantDeclaration */:
|
5968
5939
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofVariantDeclaration(parent));
|
5969
5940
|
break;
|
5970
5941
|
case 36 /* PackageVariableGetterDeclaration */:
|
@@ -5975,9 +5946,6 @@ var NodeSemanticInfoService = class {
|
|
5975
5946
|
case 56 /* TypeVariableSetterDeclaration */:
|
5976
5947
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofComputedTypeVariableDeclaration(parent));
|
5977
5948
|
break;
|
5978
|
-
case 150 /* SetterParameterDeclaration */:
|
5979
|
-
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofSetterParameterDeclaration(parent));
|
5980
|
-
break;
|
5981
5949
|
case 3 /* Keyword */:
|
5982
5950
|
break;
|
5983
5951
|
default:
|
@@ -5990,18 +5958,10 @@ var NodeSemanticInfoService = class {
|
|
5990
5958
|
let result;
|
5991
5959
|
const meaning = analyzer.resolvePropertyAccessExpression(node).meaning;
|
5992
5960
|
switch (meaning.kind) {
|
5993
|
-
case "variant-access": {
|
5994
|
-
const target = new SimpleWithLocalization(
|
5995
|
-
new EntityReferenceTarget(meaning.variant.value, 0 /* Get */),
|
5996
|
-
meaning.variant.localization
|
5997
|
-
);
|
5998
|
-
result = new ReferenceNodeSemanticInfo([target], false);
|
5999
|
-
break;
|
6000
|
-
}
|
6001
5961
|
case "instance-variable-access": {
|
6002
5962
|
const target = new SimpleWithLocalization(new TypeVariableReferenceTarget(
|
6003
5963
|
meaning.variable.value,
|
6004
|
-
meaning.
|
5964
|
+
meaning.accessKind
|
6005
5965
|
), meaning.variable.localization);
|
6006
5966
|
result = new ReferenceNodeSemanticInfo([target], false);
|
6007
5967
|
break;
|
@@ -6009,7 +5969,7 @@ var NodeSemanticInfoService = class {
|
|
6009
5969
|
case "static-variable-access": {
|
6010
5970
|
const target = new SimpleWithLocalization(new TypeVariableReferenceTarget(
|
6011
5971
|
meaning.variable.value,
|
6012
|
-
meaning.
|
5972
|
+
meaning.accessKind
|
6013
5973
|
), meaning.variable.localization);
|
6014
5974
|
result = new ReferenceNodeSemanticInfo([target], false);
|
6015
5975
|
break;
|
@@ -6017,7 +5977,7 @@ var NodeSemanticInfoService = class {
|
|
6017
5977
|
case "package-variable-access": {
|
6018
5978
|
const target = new SimpleWithLocalization(new EntityReferenceTarget(
|
6019
5979
|
meaning.variable.value,
|
6020
|
-
meaning.
|
5980
|
+
meaning.accessKind
|
6021
5981
|
), meaning.variable.localization);
|
6022
5982
|
result = new ReferenceNodeSemanticInfo([target], false);
|
6023
5983
|
break;
|
@@ -6058,7 +6018,7 @@ var NodeSemanticInfoService = class {
|
|
6058
6018
|
);
|
6059
6019
|
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
|
6060
6020
|
} else {
|
6061
|
-
result = this.
|
6021
|
+
result = this.ofMaybeConstructorCallExpression(analyzer, meaning.suitableTypes, node, options6);
|
6062
6022
|
}
|
6063
6023
|
break;
|
6064
6024
|
case "package-name-segment-access":
|
@@ -6084,19 +6044,70 @@ var NodeSemanticInfoService = class {
|
|
6084
6044
|
}
|
6085
6045
|
static ofQualifiedNameQualifier(analyzer, node, qualifier, options6) {
|
6086
6046
|
switch (node.parent.kind) {
|
6087
|
-
case 10 /* NamedTypeSpecifier */:
|
6088
|
-
|
6089
|
-
|
6090
|
-
|
6091
|
-
|
6092
|
-
|
6093
|
-
|
6094
|
-
|
6095
|
-
|
6096
|
-
|
6097
|
-
|
6098
|
-
|
6099
|
-
|
6047
|
+
case 10 /* NamedTypeSpecifier */:
|
6048
|
+
return this.ofNamedTypeSpecifierNameQualifier(analyzer, node.parent, qualifier, options6);
|
6049
|
+
case 145 /* Tag */:
|
6050
|
+
return this.ofTagNameQualifier(analyzer, node.parent, qualifier, options6);
|
6051
|
+
case 42 /* ExtendedTypeClause */:
|
6052
|
+
case 132 /* PackageImportTranslation */:
|
6053
|
+
return void 0;
|
6054
|
+
default:
|
6055
|
+
Debug.never(node.parent);
|
6056
|
+
}
|
6057
|
+
}
|
6058
|
+
static ofNamedTypeSpecifierNameQualifier(analyzer, node, qualifier, options6) {
|
6059
|
+
let result;
|
6060
|
+
const resolutionResult = analyzer.resolveNamedTypeSpecifier(node);
|
6061
|
+
const qualifierIndex = node.qualifiedName.qualifiers.toArray().indexOf(qualifier);
|
6062
|
+
if (qualifierIndex >= 0 && qualifierIndex < resolutionResult.resolvedQualifiers.length) {
|
6063
|
+
const resolvedQualifier = resolutionResult.resolvedQualifiers[qualifierIndex];
|
6064
|
+
if (resolvedQualifier.kind === "package-alias") {
|
6065
|
+
const target = new SimpleWithLocalization(
|
6066
|
+
new EntityReferenceTarget(resolvedQualifier.packageAlias, 0 /* Get */),
|
6067
|
+
new Localization.Original(resolvedQualifier.packageAlias.getContainingPackage().getLocale())
|
6068
|
+
);
|
6069
|
+
result = new ReferenceNodeSemanticInfo([target], false);
|
6070
|
+
} else if (resolvedQualifier.kind === "type") {
|
6071
|
+
if (resolvedQualifier.suitableTypes.length > 0) {
|
6072
|
+
const targets = resolvedQualifier.suitableTypes.map((t) => new SimpleWithLocalization(new EntityReferenceTarget(t.value, 0 /* Get */), t.localization));
|
6073
|
+
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), targets.length > 1);
|
6074
|
+
} else if (resolvedQualifier.candidates.length > 0) {
|
6075
|
+
const targets = resolvedQualifier.candidates.map((t) => new SimpleWithLocalization(new EntityReferenceTarget(t.value, 0 /* Get */), t.localization));
|
6076
|
+
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
|
6077
|
+
}
|
6078
|
+
} else if (resolvedQualifier.kind === "package-name-segment") {
|
6079
|
+
let currentIndex = qualifierIndex;
|
6080
|
+
while (currentIndex + 1 < resolutionResult.resolvedQualifiers.length && resolutionResult.resolvedQualifiers[currentIndex + 1].kind === "package-name-segment") {
|
6081
|
+
currentIndex++;
|
6082
|
+
}
|
6083
|
+
const qualifier2 = resolutionResult.resolvedQualifiers[currentIndex];
|
6084
|
+
if (qualifier2.kind === "package-name-segment" && qualifier2.packageTreeNode.package !== void 0) {
|
6085
|
+
const target = new SimpleWithLocalization(
|
6086
|
+
new PackageReferenceTarget(qualifier2.packageTreeNode.package.value),
|
6087
|
+
new Localization.Original(qualifier2.packageTreeNode.package.value.getLocale())
|
6088
|
+
);
|
6089
|
+
result = new ReferenceNodeSemanticInfo([target], false);
|
6090
|
+
} else {
|
6091
|
+
result = void 0;
|
6092
|
+
}
|
6093
|
+
} else {
|
6094
|
+
Debug.never(resolvedQualifier);
|
6095
|
+
}
|
6096
|
+
}
|
6097
|
+
if (result !== void 0 && options6.includeBetterReferenceTargets) {
|
6098
|
+
result = this.getBetterReferenceTargetsOrPreserve(result);
|
6099
|
+
}
|
6100
|
+
return result;
|
6101
|
+
}
|
6102
|
+
static ofTagNameQualifier(analyzer, node, qualifier, options6) {
|
6103
|
+
let result;
|
6104
|
+
const resolutionResult = analyzer.resolveTag(node);
|
6105
|
+
const qualifierIndex = node.name.qualifiers.toArray().indexOf(qualifier);
|
6106
|
+
if (qualifierIndex >= 0 && qualifierIndex < resolutionResult.resolvedQualifiers.length) {
|
6107
|
+
const resolvedQualifier = resolutionResult.resolvedQualifiers[qualifierIndex];
|
6108
|
+
switch (resolvedQualifier.kind) {
|
6109
|
+
case "type": {
|
6110
|
+
if (options6.preferredTargetOfExplicitConstructorCall === "type-declaration") {
|
6100
6111
|
if (resolvedQualifier.suitableTypes.length > 0) {
|
6101
6112
|
const targets = resolvedQualifier.suitableTypes.map((t) => new SimpleWithLocalization(new EntityReferenceTarget(t.value, 0 /* Get */), t.localization));
|
6102
6113
|
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), targets.length > 1);
|
@@ -6104,55 +6115,72 @@ var NodeSemanticInfoService = class {
|
|
6104
6115
|
const targets = resolvedQualifier.candidates.map((t) => new SimpleWithLocalization(new EntityReferenceTarget(t.value, 0 /* Get */), t.localization));
|
6105
6116
|
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
|
6106
6117
|
}
|
6107
|
-
} else
|
6108
|
-
|
6109
|
-
|
6110
|
-
|
6111
|
-
|
6112
|
-
|
6113
|
-
|
6114
|
-
|
6115
|
-
|
6116
|
-
new Localization.Original(qualifier2.packageTreeNode.package.value.getLocale())
|
6117
|
-
);
|
6118
|
-
result = new ReferenceNodeSemanticInfo([target], false);
|
6119
|
-
} else {
|
6120
|
-
result = void 0;
|
6118
|
+
} else {
|
6119
|
+
if (resolutionResult.meaning.kind === "tag-type") {
|
6120
|
+
if (resolutionResult.meaning.suitableConstructors.length > 0) {
|
6121
|
+
const targets = resolutionResult.meaning.suitableConstructors.map((t) => new SimpleWithLocalization(new TypeConstructorReferenceTarget(t.value), t.localization));
|
6122
|
+
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), targets.length > 1);
|
6123
|
+
} else if (resolutionResult.meaning.candidates.length > 0) {
|
6124
|
+
const targets = resolutionResult.meaning.candidates.map((t) => new SimpleWithLocalization(new TypeConstructorReferenceTarget(t.value), t.localization));
|
6125
|
+
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
|
6126
|
+
}
|
6121
6127
|
}
|
6128
|
+
}
|
6129
|
+
break;
|
6130
|
+
}
|
6131
|
+
case "method":
|
6132
|
+
if (resolvedQualifier.suitableMethods.length > 0) {
|
6133
|
+
const targets = resolvedQualifier.suitableMethods.map((t) => new SimpleWithLocalization(new EntityReferenceTarget(t.value, 0 /* Get */), t.localization));
|
6134
|
+
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), targets.length > 1);
|
6135
|
+
} else if (resolvedQualifier.candidates.length > 0) {
|
6136
|
+
const targets = resolvedQualifier.candidates.map((t) => new SimpleWithLocalization(new EntityReferenceTarget(t.value, 0 /* Get */), t.localization));
|
6137
|
+
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
|
6138
|
+
}
|
6139
|
+
break;
|
6140
|
+
case "package-name-segment": {
|
6141
|
+
let currentIndex = qualifierIndex;
|
6142
|
+
while (currentIndex + 1 < resolutionResult.resolvedQualifiers.length && resolutionResult.resolvedQualifiers[currentIndex + 1].kind === "package-name-segment") {
|
6143
|
+
currentIndex++;
|
6144
|
+
}
|
6145
|
+
const qualifier2 = resolutionResult.resolvedQualifiers[currentIndex];
|
6146
|
+
if (qualifier2.kind === "package-name-segment" && qualifier2.packageTreeNode.package !== void 0) {
|
6147
|
+
const target = new SimpleWithLocalization(
|
6148
|
+
new PackageReferenceTarget(qualifier2.packageTreeNode.package.value),
|
6149
|
+
new Localization.Original(qualifier2.packageTreeNode.package.value.getLocale())
|
6150
|
+
);
|
6151
|
+
result = new ReferenceNodeSemanticInfo([target], false);
|
6122
6152
|
} else {
|
6123
|
-
|
6153
|
+
result = void 0;
|
6124
6154
|
}
|
6155
|
+
break;
|
6125
6156
|
}
|
6126
|
-
|
6127
|
-
|
6157
|
+
case "package-alias": {
|
6158
|
+
const target = new SimpleWithLocalization(
|
6159
|
+
new EntityReferenceTarget(resolvedQualifier.packageAlias, 0 /* Get */),
|
6160
|
+
new Localization.Original(resolvedQualifier.packageAlias.getContainingPackage().getLocale())
|
6161
|
+
);
|
6162
|
+
result = new ReferenceNodeSemanticInfo([target], false);
|
6163
|
+
break;
|
6128
6164
|
}
|
6129
|
-
|
6165
|
+
default:
|
6166
|
+
Debug.never(resolvedQualifier);
|
6130
6167
|
}
|
6131
|
-
case 42 /* ExtendedTypeClause */:
|
6132
|
-
case 131 /* PackageImportTranslation */:
|
6133
|
-
return void 0;
|
6134
|
-
default:
|
6135
|
-
Debug.never(node.parent);
|
6136
6168
|
}
|
6169
|
+
if (result !== void 0 && options6.includeBetterReferenceTargets) {
|
6170
|
+
result = this.getBetterReferenceTargetsOrPreserve(result);
|
6171
|
+
}
|
6172
|
+
return result;
|
6137
6173
|
}
|
6138
6174
|
static ofIdentifierExpression(analyzer, node, options6) {
|
6139
6175
|
let result;
|
6140
6176
|
const meaning = analyzer.resolveIdentifierExpression(node).meaning;
|
6141
6177
|
switch (meaning.kind) {
|
6142
|
-
case "variant-access": {
|
6143
|
-
const target = new SimpleWithLocalization(
|
6144
|
-
new EntityReferenceTarget(meaning.variant.value, 0 /* Get */),
|
6145
|
-
meaning.variant.localization
|
6146
|
-
);
|
6147
|
-
result = new ReferenceNodeSemanticInfo([target], false);
|
6148
|
-
break;
|
6149
|
-
}
|
6150
6178
|
case "type-access":
|
6151
6179
|
if (meaning.suitableTypes.length === 0 && meaning.candidates.length > 0) {
|
6152
6180
|
const targets = meaning.candidates.map((c) => new SimpleWithLocalization(new EntityReferenceTarget(c.value, 0 /* Get */), c.localization));
|
6153
6181
|
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
|
6154
6182
|
} else {
|
6155
|
-
result = this.
|
6183
|
+
result = this.ofMaybeConstructorCallExpression(analyzer, meaning.suitableTypes, node, options6);
|
6156
6184
|
}
|
6157
6185
|
break;
|
6158
6186
|
case "method-access":
|
@@ -6174,13 +6202,13 @@ var NodeSemanticInfoService = class {
|
|
6174
6202
|
const variable = meaning.variable;
|
6175
6203
|
if (variable.value.kind === "entity") {
|
6176
6204
|
const target = new SimpleWithLocalization(
|
6177
|
-
new EntityReferenceTarget(variable.value.value, meaning.
|
6205
|
+
new EntityReferenceTarget(variable.value.value, meaning.accessKind),
|
6178
6206
|
variable.localization
|
6179
6207
|
);
|
6180
6208
|
result = new ReferenceNodeSemanticInfo([target], false);
|
6181
6209
|
} else if (variable.value.kind === "type-member") {
|
6182
6210
|
const target = new SimpleWithLocalization(
|
6183
|
-
new TypeVariableReferenceTarget(variable.value.value, meaning.
|
6211
|
+
new TypeVariableReferenceTarget(variable.value.value, meaning.accessKind),
|
6184
6212
|
variable.localization
|
6185
6213
|
);
|
6186
6214
|
result = new ReferenceNodeSemanticInfo([target], false);
|
@@ -6206,11 +6234,14 @@ var NodeSemanticInfoService = class {
|
|
6206
6234
|
let target;
|
6207
6235
|
switch (d.value.kind) {
|
6208
6236
|
case "method":
|
6237
|
+
target = new EntityReferenceTarget(d.value.value.getEntity(), 0 /* Get */);
|
6238
|
+
break;
|
6209
6239
|
case "variable":
|
6210
|
-
case "type":
|
6211
6240
|
target = new EntityReferenceTarget(d.value.value.getEntity(), 0 /* Get */);
|
6212
6241
|
break;
|
6213
|
-
case "
|
6242
|
+
case "type":
|
6243
|
+
target = new EntityReferenceTarget(d.value.value, 0 /* Get */);
|
6244
|
+
break;
|
6214
6245
|
case "package-alias":
|
6215
6246
|
target = new EntityReferenceTarget(d.value.value, 0 /* Get */);
|
6216
6247
|
break;
|
@@ -6338,7 +6369,7 @@ var NodeSemanticInfoService = class {
|
|
6338
6369
|
const meaning = analyzer.getDereferenceExpressionMeaning(node);
|
6339
6370
|
if (meaning.kind === "resolved") {
|
6340
6371
|
const target = new SimpleWithLocalization(
|
6341
|
-
new TypeDereferenceOperatorReferenceTarget(meaning.operator.value, meaning.
|
6372
|
+
new TypeDereferenceOperatorReferenceTarget(meaning.operator.value, meaning.accessKind),
|
6342
6373
|
meaning.operator.localization
|
6343
6374
|
);
|
6344
6375
|
let result = new ReferenceNodeSemanticInfo([target], false);
|
@@ -6474,7 +6505,7 @@ var NodeSemanticInfoService = class {
|
|
6474
6505
|
false
|
6475
6506
|
);
|
6476
6507
|
}
|
6477
|
-
static
|
6508
|
+
static ofMaybeConstructorCallExpression(analyzer, types, typeAccessExpression, options6) {
|
6478
6509
|
if (types.length === 0) {
|
6479
6510
|
return void 0;
|
6480
6511
|
}
|
@@ -6501,17 +6532,14 @@ var NodeSemanticInfoService = class {
|
|
6501
6532
|
}
|
6502
6533
|
if (parentCallExpression !== void 0) {
|
6503
6534
|
const meaning = analyzer.getCallExpressionMeaning(parentCallExpression);
|
6504
|
-
if (meaning.kind === "constructor-call"
|
6505
|
-
|
6506
|
-
|
6507
|
-
|
6508
|
-
|
6509
|
-
|
6510
|
-
|
6511
|
-
|
6512
|
-
targets.length > 1,
|
6513
|
-
createNonEmptyArray(betterTargets)
|
6514
|
-
);
|
6535
|
+
if (meaning.kind === "constructor-call") {
|
6536
|
+
if (meaning.suitableConstructors.length > 0) {
|
6537
|
+
const targets = meaning.suitableConstructors.map((c) => new SimpleWithLocalization(new TypeConstructorReferenceTarget(c.value), c.localization));
|
6538
|
+
return new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), meaning.suitableConstructors.length > 1);
|
6539
|
+
} else if (meaning.candidates.length > 0) {
|
6540
|
+
const targets = meaning.candidates.map((c) => new SimpleWithLocalization(new TypeConstructorReferenceTarget(c.value), c.localization));
|
6541
|
+
return new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
|
6542
|
+
}
|
6515
6543
|
}
|
6516
6544
|
}
|
6517
6545
|
if (typeEntities.length > 0) {
|
@@ -6560,7 +6588,7 @@ var NodeSemanticInfoService = class {
|
|
6560
6588
|
);
|
6561
6589
|
}
|
6562
6590
|
}
|
6563
|
-
} else if (currentTarget.value.kind === "entity" && currentTarget.value.entity.kind ===
|
6591
|
+
} else if (currentTarget.value.kind === "entity" && currentTarget.value.entity.kind === 1 /* Method */) {
|
6564
6592
|
}
|
6565
6593
|
if (betterTarget !== void 0) {
|
6566
6594
|
result = betterTarget;
|
@@ -6696,7 +6724,7 @@ var SimpleWithLocalization = class {
|
|
6696
6724
|
|
6697
6725
|
// source/services/Utils.ts
|
6698
6726
|
function getEntitySourceLocations(analyzer, entity) {
|
6699
|
-
if (entity.kind ===
|
6727
|
+
if (entity.kind === 12 /* Package */) {
|
6700
6728
|
return void 0;
|
6701
6729
|
}
|
6702
6730
|
let result;
|
@@ -6717,7 +6745,7 @@ function getEntitySourceLocations(analyzer, entity) {
|
|
6717
6745
|
Debug.never(definition.value);
|
6718
6746
|
}
|
6719
6747
|
}
|
6720
|
-
} else if (entity.kind ===
|
6748
|
+
} else if (entity.kind === 5 /* Indexer */) {
|
6721
6749
|
const definition = entity.getDefinition();
|
6722
6750
|
if (definition.kind === 0 /* Source */) {
|
6723
6751
|
result = definition.nodes.map((d) => {
|
@@ -6726,7 +6754,7 @@ function getEntitySourceLocations(analyzer, entity) {
|
|
6726
6754
|
return new SourceLocation(sourceFile, range);
|
6727
6755
|
});
|
6728
6756
|
}
|
6729
|
-
} else if (entity.kind ===
|
6757
|
+
} else if (entity.kind === 6 /* DereferenceOperator */) {
|
6730
6758
|
const definition = entity.getDefinition();
|
6731
6759
|
if (definition.kind === 0 /* Source */) {
|
6732
6760
|
result = definition.nodes.map((d) => {
|
@@ -6755,8 +6783,7 @@ function getEntitySourceLocations(analyzer, entity) {
|
|
6755
6783
|
case 38 /* PackageVariantTypeDeclaration */:
|
6756
6784
|
case 58 /* NestedMethodDeclaration */:
|
6757
6785
|
case 52 /* TypeMethodDeclaration */:
|
6758
|
-
case
|
6759
|
-
case 139 /* VariantDeclaration */:
|
6786
|
+
case 141 /* TypeParameterDeclaration */:
|
6760
6787
|
case 53 /* OperatorDeclaration */:
|
6761
6788
|
range = node.name.rangeWithoutTrivia;
|
6762
6789
|
break;
|
@@ -7003,7 +7030,7 @@ var ReferencesService = class {
|
|
7003
7030
|
const result = [];
|
7004
7031
|
const restrictions = this.getReferenceRestrictions(definition, options6);
|
7005
7032
|
let semanticInfoOptions;
|
7006
|
-
if (definition.value.kind ===
|
7033
|
+
if (definition.value.kind === 7 /* Constructor */) {
|
7007
7034
|
semanticInfoOptions = {
|
7008
7035
|
preferredTargetOfExplicitConstructorCall: "constructor-declaration",
|
7009
7036
|
includeBetterReferenceTargets: true
|
@@ -7323,7 +7350,7 @@ var ReferencesService = class {
|
|
7323
7350
|
getReferenceRestrictions(definition, _options) {
|
7324
7351
|
const result = new ReferenceRestrictions();
|
7325
7352
|
let namedDefinitionInfo;
|
7326
|
-
if (definition.value.kind ===
|
7353
|
+
if (definition.value.kind === 7 /* Constructor */) {
|
7327
7354
|
const type = definition.value.getContainer().getContextualType();
|
7328
7355
|
if (type !== void 0) {
|
7329
7356
|
namedDefinitionInfo = this.isEntityWithRegularName(type);
|
@@ -7334,11 +7361,11 @@ var ReferencesService = class {
|
|
7334
7361
|
if (namedDefinitionInfo !== void 0) {
|
7335
7362
|
result.canBeIdentifier = true;
|
7336
7363
|
}
|
7337
|
-
if (definition.value.kind ===
|
7364
|
+
if (definition.value.kind === 7 /* Constructor */) {
|
7338
7365
|
result.canBeAutotypeCall = true;
|
7339
7366
|
result.canBeConstructorDeclaration = true;
|
7340
7367
|
}
|
7341
|
-
if (definition.value.kind ===
|
7368
|
+
if (definition.value.kind === 9 /* Operator */) {
|
7342
7369
|
const operatorKind = definition.value.getOperatorKind();
|
7343
7370
|
if (isUnaryOperator(operatorKind)) {
|
7344
7371
|
result.canBePrefixUnaryOperator = true;
|
@@ -7347,17 +7374,17 @@ var ReferencesService = class {
|
|
7347
7374
|
result.canBeAssignmentStatementOperator = true;
|
7348
7375
|
}
|
7349
7376
|
}
|
7350
|
-
if (definition.value.kind ===
|
7377
|
+
if (definition.value.kind === 6 /* DereferenceOperator */) {
|
7351
7378
|
result.canBeDereferenceOperator = true;
|
7352
7379
|
}
|
7353
|
-
if (isTypeEntity(definition.value) || definition.value.kind ===
|
7380
|
+
if (isTypeEntity(definition.value) || definition.value.kind === 7 /* Constructor */) {
|
7354
7381
|
result.canBeObjectExpression = true;
|
7355
7382
|
result.canBeBaseExpression = true;
|
7356
7383
|
}
|
7357
|
-
if (definition.value.kind ===
|
7384
|
+
if (definition.value.kind === 1 /* Method */) {
|
7358
7385
|
result.canBeBaseExpression = true;
|
7359
7386
|
}
|
7360
|
-
if (definition.value.kind ===
|
7387
|
+
if (definition.value.kind === 5 /* Indexer */) {
|
7361
7388
|
result.canBeIndexer = true;
|
7362
7389
|
}
|
7363
7390
|
return result;
|
@@ -7391,46 +7418,50 @@ var ReferencesService = class {
|
|
7391
7418
|
switch (entity.kind) {
|
7392
7419
|
case 0 /* Variable */:
|
7393
7420
|
return { name: entity.getName() };
|
7394
|
-
case
|
7395
|
-
|
7396
|
-
|
7397
|
-
|
7398
|
-
|
7399
|
-
|
7400
|
-
|
7401
|
-
|
7402
|
-
|
7403
|
-
|
7404
|
-
|
7405
|
-
|
7406
|
-
|
7407
|
-
|
7408
|
-
|
7409
|
-
|
7410
|
-
|
7411
|
-
|
7412
|
-
|
7413
|
-
|
7414
|
-
|
7415
|
-
|
7416
|
-
|
7417
|
-
|
7421
|
+
case 2 /* Type */: {
|
7422
|
+
switch (entity.typeEntityKind) {
|
7423
|
+
case 0 /* Method */: {
|
7424
|
+
const naming = entity.getNaming();
|
7425
|
+
if (naming.kind === "named") {
|
7426
|
+
return { name: naming.value };
|
7427
|
+
}
|
7428
|
+
return void 0;
|
7429
|
+
}
|
7430
|
+
case 1 /* Structured */: {
|
7431
|
+
const naming = entity.getNaming();
|
7432
|
+
if (naming.kind === "named") {
|
7433
|
+
return { name: naming.value };
|
7434
|
+
}
|
7435
|
+
return void 0;
|
7436
|
+
}
|
7437
|
+
case 2 /* Parameter */:
|
7438
|
+
return { name: entity.getName() };
|
7439
|
+
case 3 /* Variant */: {
|
7440
|
+
const naming = entity.getNaming();
|
7441
|
+
if (naming.kind === "named") {
|
7442
|
+
return { name: naming.value };
|
7443
|
+
}
|
7444
|
+
return void 0;
|
7445
|
+
}
|
7446
|
+
case 4 /* Alias */:
|
7447
|
+
return { name: entity.getName() };
|
7448
|
+
default:
|
7449
|
+
Debug.never(entity);
|
7418
7450
|
}
|
7419
|
-
return void 0;
|
7420
7451
|
}
|
7421
|
-
case
|
7452
|
+
case 1 /* Method */:
|
7422
7453
|
return { name: entity.getName() };
|
7423
|
-
case
|
7454
|
+
case 10 /* PackageAlias */:
|
7424
7455
|
return { name: entity.getName() };
|
7425
7456
|
case 3 /* Getter */:
|
7426
7457
|
case 4 /* Setter */:
|
7427
|
-
case
|
7428
|
-
case
|
7429
|
-
case
|
7430
|
-
case
|
7431
|
-
case
|
7432
|
-
case
|
7433
|
-
case
|
7458
|
+
case 7 /* Constructor */:
|
7459
|
+
case 8 /* Destructor */:
|
7460
|
+
case 5 /* Indexer */:
|
7461
|
+
case 6 /* DereferenceOperator */:
|
7462
|
+
case 12 /* Package */:
|
7463
|
+
case 11 /* TypeExtension */:
|
7464
|
+
case 9 /* Operator */:
|
7434
7465
|
return void 0;
|
7435
7466
|
default:
|
7436
7467
|
Debug.never(entity);
|
@@ -7593,17 +7624,17 @@ var EvaluatableExpressionService = class {
|
|
7593
7624
|
return { nameIdentifier: node.name };
|
7594
7625
|
case 59 /* LocalVariableDeclaration */:
|
7595
7626
|
return { nameIdentifier: node.name };
|
7596
|
-
case
|
7627
|
+
case 142 /* ParameterDeclaration */:
|
7597
7628
|
return { nameIdentifier: node.name };
|
7598
7629
|
case 52 /* TypeMethodDeclaration */:
|
7599
7630
|
return { nameIdentifier: node.name };
|
7600
7631
|
case 54 /* TypeVariableDeclaration */:
|
7601
7632
|
return { nameIdentifier: node.name };
|
7602
|
-
case
|
7633
|
+
case 141 /* TypeParameterDeclaration */:
|
7603
7634
|
return { nameIdentifier: node.name };
|
7604
|
-
case
|
7635
|
+
case 140 /* VariantDeclaration */:
|
7605
7636
|
return { nameIdentifier: node.name };
|
7606
|
-
case
|
7637
|
+
case 101 /* ErrorVariableDeclaration */:
|
7607
7638
|
return { nameIdentifier: node.name };
|
7608
7639
|
default:
|
7609
7640
|
return void 0;
|
@@ -8016,7 +8047,7 @@ var SourceFileItemsService = class {
|
|
8016
8047
|
);
|
8017
8048
|
break;
|
8018
8049
|
}
|
8019
|
-
case
|
8050
|
+
case 140 /* VariantDeclaration */: {
|
8020
8051
|
result.push(
|
8021
8052
|
this.createItem(
|
8022
8053
|
9 /* Variant */,
|
@@ -8028,7 +8059,7 @@ var SourceFileItemsService = class {
|
|
8028
8059
|
);
|
8029
8060
|
break;
|
8030
8061
|
}
|
8031
|
-
case
|
8062
|
+
case 141 /* TypeParameterDeclaration */: {
|
8032
8063
|
result.push(
|
8033
8064
|
this.createItem(
|
8034
8065
|
18 /* TypeParameter */,
|
@@ -8077,14 +8108,14 @@ var SourceFileItemsService = class {
|
|
8077
8108
|
case 4 /* PackageMethod */:
|
8078
8109
|
case 15 /* TypeMethod */:
|
8079
8110
|
case 19 /* NestedMethod */:
|
8080
|
-
return name ?? `<${LocalizationHelper.localizeKeywordAndTakeFirst(
|
8111
|
+
return name ?? `<${LocalizationHelper.localizeKeywordAndTakeFirst(12 /* Function */, this.locale, this.dialect)}>`;
|
8081
8112
|
case 5 /* StructuredType */:
|
8082
8113
|
case 6 /* MethodType */:
|
8083
8114
|
case 7 /* VariantType */:
|
8084
8115
|
case 8 /* InvalidType */:
|
8085
|
-
return name ?? `<${LocalizationHelper.localizeKeywordAndTakeFirst(
|
8116
|
+
return name ?? `<${LocalizationHelper.localizeKeywordAndTakeFirst(16 /* Type */, this.locale, this.dialect)}>`;
|
8086
8117
|
case 10 /* TypeConstructor */:
|
8087
|
-
return name ?? LocalizationHelper.localizeKeywordAndTakeFirst(
|
8118
|
+
return name ?? LocalizationHelper.localizeKeywordAndTakeFirst(29 /* Creation */, this.locale, this.dialect);
|
8088
8119
|
case 11 /* TypeDestructor */:
|
8089
8120
|
return name ?? LocalizationHelper.localizeKeywordAndTakeFirst(46 /* Destruction */, this.locale, this.dialect);
|
8090
8121
|
case 9 /* Variant */:
|
@@ -8291,7 +8322,7 @@ var SelectionRangeService = class {
|
|
8291
8322
|
}
|
8292
8323
|
}
|
8293
8324
|
switch (node.kind) {
|
8294
|
-
case
|
8325
|
+
case 154 /* TypeAnnotation */:
|
8295
8326
|
case 34 /* StructuredTypeDeclarationBody */:
|
8296
8327
|
case 39 /* VariantTypeDeclarationBody */:
|
8297
8328
|
case 23 /* AliasTypeDeclarationBody */:
|
@@ -8339,29 +8370,37 @@ var SemanticTokensService = class {
|
|
8339
8370
|
const meaning = analyzer.resolveIdentifierExpression(node).meaning;
|
8340
8371
|
if (meaning.kind === "variable-access") {
|
8341
8372
|
const variable = meaning.variable.value.getEntity();
|
8342
|
-
|
8343
|
-
|
8344
|
-
|
8345
|
-
|
8346
|
-
|
8347
|
-
|
8348
|
-
|
8349
|
-
|
8350
|
-
|
8351
|
-
|
8352
|
-
|
8353
|
-
|
8354
|
-
|
8355
|
-
|
8356
|
-
|
8357
|
-
|
8358
|
-
|
8359
|
-
|
8360
|
-
|
8361
|
-
|
8362
|
-
|
8363
|
-
|
8364
|
-
|
8373
|
+
if (variable.subkind === "type" && variable.isVariant()) {
|
8374
|
+
result.push(
|
8375
|
+
new SemanticToken(
|
8376
|
+
node.rangeWithoutTrivia,
|
8377
|
+
3 /* Variant */,
|
8378
|
+
new SemanticTokenModifiers().makeConst()
|
8379
|
+
)
|
8380
|
+
);
|
8381
|
+
} else {
|
8382
|
+
const specialVariableInfo = variable.isSpecial();
|
8383
|
+
if (specialVariableInfo !== void 0) {
|
8384
|
+
let semanticTokenKind;
|
8385
|
+
switch (specialVariableInfo.kind) {
|
8386
|
+
case "result":
|
8387
|
+
case "value":
|
8388
|
+
semanticTokenKind = 1 /* SpecialVariable */;
|
8389
|
+
break;
|
8390
|
+
case "implicit-method-block-parameter":
|
8391
|
+
semanticTokenKind = 0 /* MethodBlockLiteralParameter */;
|
8392
|
+
break;
|
8393
|
+
case "backing":
|
8394
|
+
semanticTokenKind = void 0;
|
8395
|
+
break;
|
8396
|
+
default:
|
8397
|
+
Debug.never(specialVariableInfo);
|
8398
|
+
}
|
8399
|
+
if (semanticTokenKind !== void 0) {
|
8400
|
+
result.push(
|
8401
|
+
new SemanticToken(node.rangeWithoutTrivia, semanticTokenKind, new SemanticTokenModifiers())
|
8402
|
+
);
|
8403
|
+
}
|
8365
8404
|
}
|
8366
8405
|
}
|
8367
8406
|
}
|
@@ -8375,15 +8414,6 @@ var SemanticTokensService = class {
|
|
8375
8414
|
)
|
8376
8415
|
);
|
8377
8416
|
}
|
8378
|
-
if (meaning.kind === "variant-access") {
|
8379
|
-
result.push(
|
8380
|
-
new SemanticToken(
|
8381
|
-
node.rangeWithoutTrivia,
|
8382
|
-
3 /* Variant */,
|
8383
|
-
new SemanticTokenModifiers().makeConst()
|
8384
|
-
)
|
8385
|
-
);
|
8386
|
-
}
|
8387
8417
|
if (meaning.kind === "operator-access") {
|
8388
8418
|
result.push(new SemanticToken(
|
8389
8419
|
node.rangeWithoutTrivia,
|
@@ -8394,14 +8424,17 @@ var SemanticTokensService = class {
|
|
8394
8424
|
}
|
8395
8425
|
if (node.kind === 78 /* PropertyAccessExpression */) {
|
8396
8426
|
const meaning = analyzer.resolvePropertyAccessExpression(node).meaning;
|
8397
|
-
if (meaning.kind === "
|
8398
|
-
|
8399
|
-
|
8400
|
-
|
8401
|
-
|
8402
|
-
|
8403
|
-
|
8404
|
-
|
8427
|
+
if (meaning.kind === "static-variable-access") {
|
8428
|
+
const entity = meaning.variable.value.getEntity();
|
8429
|
+
if (entity.subkind === "type" && entity.isVariant()) {
|
8430
|
+
result.push(
|
8431
|
+
new SemanticToken(
|
8432
|
+
node.propertyName.rangeWithoutTrivia,
|
8433
|
+
3 /* Variant */,
|
8434
|
+
new SemanticTokenModifiers().makeConst()
|
8435
|
+
)
|
8436
|
+
);
|
8437
|
+
}
|
8405
8438
|
}
|
8406
8439
|
let suitableMethods;
|
8407
8440
|
switch (meaning.kind) {
|
@@ -8433,7 +8466,7 @@ var SemanticTokensService = class {
|
|
8433
8466
|
));
|
8434
8467
|
}
|
8435
8468
|
}
|
8436
|
-
if (node.kind ===
|
8469
|
+
if (node.kind === 140 /* VariantDeclaration */) {
|
8437
8470
|
result.push(
|
8438
8471
|
new SemanticToken(
|
8439
8472
|
node.name.rangeWithoutTrivia,
|
@@ -8601,7 +8634,7 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8601
8634
|
const infos = signatures.map(
|
8602
8635
|
(s) => convertSignatureDisplayPartsToSignatureInfo(s.getDisplayParts(), argumentIndex)
|
8603
8636
|
);
|
8604
|
-
const activeSignature = Query.from(signatures).
|
8637
|
+
const activeSignature = Query.from(signatures).first((s) => s.getArity() >= argumentCount) ?? Query.from(signatures).maxByValue((s) => s.getArity());
|
8605
8638
|
if (activeSignature !== void 0) {
|
8606
8639
|
const activeSignatureIndex = signatures.indexOf(activeSignature);
|
8607
8640
|
result = new SignatureHelp(infos, activeSignatureIndex);
|
@@ -8617,7 +8650,7 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8617
8650
|
}
|
8618
8651
|
let node = token.parent;
|
8619
8652
|
while (node !== void 0) {
|
8620
|
-
if (node.kind ===
|
8653
|
+
if (node.kind === 150 /* TypeArgumentClause */ && this._offset >= node.lessThanToken.rangeWithoutTrivia.end && (node.greaterThanToken.rangeWithoutTrivia.isEmpty || this._offset <= node.greaterThanToken.rangeWithoutTrivia.start)) {
|
8621
8654
|
const argumentIndex = this.getArgumentIndex(node.typeArgumentList, this._offset);
|
8622
8655
|
const argumentCount = this.countArguments(node.typeArgumentList);
|
8623
8656
|
return new NodeWithTypeArgumentsInfo(node.parent, argumentIndex, argumentCount);
|
@@ -8664,6 +8697,8 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8664
8697
|
return this.getSignaturesForNamedTypeSpecifier(node);
|
8665
8698
|
case 89 /* GenericSpecializationExpression */:
|
8666
8699
|
return this.getSignaturesForGenericSpecializationExpression(node);
|
8700
|
+
case 145 /* Tag */:
|
8701
|
+
return this.getSignaturesForTag(node);
|
8667
8702
|
default:
|
8668
8703
|
Debug.never(node);
|
8669
8704
|
}
|
@@ -8678,6 +8713,27 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8678
8713
|
}
|
8679
8714
|
return void 0;
|
8680
8715
|
}
|
8716
|
+
getSignaturesForTag(node) {
|
8717
|
+
const resolutionResult = this._analyzer.resolveTag(node);
|
8718
|
+
if (resolutionResult.resolvedQualifiers.length > 0) {
|
8719
|
+
const lastQualifier = resolutionResult.resolvedQualifiers[resolutionResult.resolvedQualifiers.length - 1];
|
8720
|
+
if (lastQualifier.kind === "type") {
|
8721
|
+
return Query.from(lastQualifier.candidates).mapAndFilter((t) => this.getSignatureForNamedType(t.value)).toArray();
|
8722
|
+
} else if (lastQualifier.kind === "method") {
|
8723
|
+
if (resolutionResult.meaning.kind === "tag-method") {
|
8724
|
+
return Query.from(resolutionResult.meaning.candidates).mapAndFilter((d) => {
|
8725
|
+
if (d.value.kind === "substituted-method") {
|
8726
|
+
return this.getSignatureForSubstitutedMethod(d.value.value, d.localization);
|
8727
|
+
}
|
8728
|
+
return void 0;
|
8729
|
+
}).toArray();
|
8730
|
+
} else {
|
8731
|
+
return void 0;
|
8732
|
+
}
|
8733
|
+
}
|
8734
|
+
}
|
8735
|
+
return void 0;
|
8736
|
+
}
|
8681
8737
|
getSignaturesForGenericSpecializationExpression(node) {
|
8682
8738
|
const expression = unwrapParenthesizedExpressions(node.expression);
|
8683
8739
|
if (expression.kind === 88 /* IdentifierExpression */) {
|
@@ -8725,12 +8781,12 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8725
8781
|
switch (method.kind) {
|
8726
8782
|
case "entity":
|
8727
8783
|
if (method.entity.getTypeParametersArity() > 0) {
|
8728
|
-
result = new
|
8784
|
+
result = new MethodEntitySignature(this.signatureContext, method.entity, localization);
|
8729
8785
|
}
|
8730
8786
|
break;
|
8731
8787
|
case "type-member":
|
8732
8788
|
if (method.method.getTypeParametersArity() > 0) {
|
8733
|
-
result = new
|
8789
|
+
result = new TypeMethodSignature(this.signatureContext, method.method, localization);
|
8734
8790
|
}
|
8735
8791
|
break;
|
8736
8792
|
default:
|
@@ -8740,28 +8796,28 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8740
8796
|
}
|
8741
8797
|
getSignatureForNamedType(type) {
|
8742
8798
|
let result = void 0;
|
8743
|
-
switch (type.
|
8744
|
-
case
|
8799
|
+
switch (type.typeEntityKind) {
|
8800
|
+
case 1 /* Structured */:
|
8745
8801
|
if (type.getArity() > 0) {
|
8746
8802
|
result = new StructuredTypeSignature(this.signatureContext, type);
|
8747
8803
|
}
|
8748
8804
|
break;
|
8749
|
-
case
|
8805
|
+
case 0 /* Method */:
|
8750
8806
|
if (type.getArity() > 0) {
|
8751
8807
|
result = new MethodTypeSignature2(this.signatureContext, type);
|
8752
8808
|
}
|
8753
8809
|
break;
|
8754
|
-
case
|
8810
|
+
case 3 /* Variant */:
|
8755
8811
|
if (type.getArity() > 0) {
|
8756
8812
|
result = new VariantTypeSignature(this.signatureContext, type);
|
8757
8813
|
}
|
8758
8814
|
break;
|
8759
|
-
case
|
8815
|
+
case 4 /* Alias */:
|
8760
8816
|
if (type.getArity() > 0) {
|
8761
8817
|
result = new AliasTypeSignature(this.signatureContext, type);
|
8762
8818
|
}
|
8763
8819
|
break;
|
8764
|
-
case
|
8820
|
+
case 2 /* Parameter */:
|
8765
8821
|
break;
|
8766
8822
|
default:
|
8767
8823
|
Debug.never(type);
|
@@ -8776,7 +8832,7 @@ var NodeWithTypeArgumentsInfo = class {
|
|
8776
8832
|
this.argumentCount = argumentCount;
|
8777
8833
|
}
|
8778
8834
|
};
|
8779
|
-
var
|
8835
|
+
var MethodEntitySignature = class {
|
8780
8836
|
constructor(ctx, method, localization) {
|
8781
8837
|
this.ctx = ctx;
|
8782
8838
|
this.method = method;
|
@@ -8792,7 +8848,7 @@ var MethodEntitySignature2 = class {
|
|
8792
8848
|
return this.ctx.convertMethodDisplayParts(displayParts);
|
8793
8849
|
}
|
8794
8850
|
};
|
8795
|
-
var
|
8851
|
+
var TypeMethodSignature = class {
|
8796
8852
|
constructor(ctx, method, localization) {
|
8797
8853
|
this.ctx = ctx;
|
8798
8854
|
this.method = method;
|
@@ -8951,7 +9007,7 @@ var ValueParametersSignatureHelpProvider = class {
|
|
8951
9007
|
case 69 /* CallExpression */: {
|
8952
9008
|
if (this._offset >= node.openParenthesisToken.rangeWithoutTrivia.end && (node.closeParenthesisToken.rangeWithoutTrivia.isEmpty || this._offset <= node.closeParenthesisToken.rangeWithoutTrivia.start)) {
|
8953
9009
|
const valueArguments = ValueArgumentFactory.createValueArgumentsOfCallExpression(node);
|
8954
|
-
const argumentIndex = this.getArgumentIndexInList(node.
|
9010
|
+
const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
|
8955
9011
|
return new NodeWithValueArgumentsInfo(node, valueArguments, argumentIndex);
|
8956
9012
|
}
|
8957
9013
|
break;
|
@@ -8959,7 +9015,7 @@ var ValueParametersSignatureHelpProvider = class {
|
|
8959
9015
|
case 70 /* AutotypeCallExpression */: {
|
8960
9016
|
if (this._offset >= node.openParenthesisToken.rangeWithoutTrivia.end && (node.closeParenthesisToken.rangeWithoutTrivia.isEmpty || this._offset <= node.closeParenthesisToken.rangeWithoutTrivia.start)) {
|
8961
9017
|
const valueArguments = ValueArgumentFactory.createValueArgumentsOfAutotypeCallExpression(node);
|
8962
|
-
const argumentIndex = this.getArgumentIndexInList(node.
|
9018
|
+
const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
|
8963
9019
|
return new NodeWithValueArgumentsInfo(node, valueArguments, argumentIndex);
|
8964
9020
|
}
|
8965
9021
|
break;
|
@@ -8967,14 +9023,14 @@ var ValueParametersSignatureHelpProvider = class {
|
|
8967
9023
|
case 71 /* IndexedAccessExpression */: {
|
8968
9024
|
if (this._offset >= node.openSquareBracketToken.rangeWithoutTrivia.end && (node.closeSquareBracketToken.rangeWithoutTrivia.isEmpty || this._offset <= node.closeSquareBracketToken.rangeWithoutTrivia.start)) {
|
8969
9025
|
const valueArguments = ValueArgumentFactory.createValueArgumentsOfIndexedAccessExpression(node);
|
8970
|
-
const argumentIndex = this.getArgumentIndexInList(node.
|
9026
|
+
const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
|
8971
9027
|
return new NodeWithValueArgumentsInfo(node, valueArguments, argumentIndex);
|
8972
9028
|
}
|
8973
9029
|
break;
|
8974
9030
|
}
|
8975
|
-
case
|
8976
|
-
if (node.openParenthesisToken !== void 0 && this._offset >= node.openParenthesisToken.rangeWithoutTrivia.end && node.
|
8977
|
-
const argumentIndex = this.getArgumentIndexInList(node.
|
9031
|
+
case 145 /* Tag */: {
|
9032
|
+
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)) {
|
9033
|
+
const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
|
8978
9034
|
const valueArguments = ValueArgumentFactory.createValueArgumentsOfTag(node);
|
8979
9035
|
return new NodeWithValueArgumentsInfo(node, valueArguments, argumentIndex);
|
8980
9036
|
}
|
@@ -9000,24 +9056,8 @@ var ValueParametersSignatureHelpProvider = class {
|
|
9000
9056
|
}
|
9001
9057
|
getSignatureDisplayParts(signature) {
|
9002
9058
|
switch (signature.kind) {
|
9003
|
-
case "method
|
9004
|
-
const method = new
|
9005
|
-
signature.method.value,
|
9006
|
-
signature.method.localization
|
9007
|
-
);
|
9008
|
-
const displayParts = this.signatureContext.displayService.getMethodDeclarationDisplayParts(method);
|
9009
|
-
return this.signatureContext.convertMethodDisplayParts(displayParts);
|
9010
|
-
}
|
9011
|
-
case "type-method": {
|
9012
|
-
const method = new MethodDeclaration_typeMember(
|
9013
|
-
signature.method.value,
|
9014
|
-
signature.method.localization
|
9015
|
-
);
|
9016
|
-
const displayParts = this.signatureContext.displayService.getMethodDeclarationDisplayParts(method);
|
9017
|
-
return this.signatureContext.convertMethodDisplayParts(displayParts);
|
9018
|
-
}
|
9019
|
-
case "substituted-method": {
|
9020
|
-
const method = new MethodDeclaration_substitutedMethod(
|
9059
|
+
case "accessed-method": {
|
9060
|
+
const method = new MethodDeclaration_accessedMethod(
|
9021
9061
|
signature.method.value,
|
9022
9062
|
signature.method.localization
|
9023
9063
|
);
|
@@ -9114,16 +9154,16 @@ var SignatureInfo = class {
|
|
9114
9154
|
};
|
9115
9155
|
|
9116
9156
|
// source/services/source-generation/SourceGenerationService.ts
|
9117
|
-
import { atomicRun as atomicRun2,
|
9157
|
+
import { atomicRun as atomicRun2, TriggeringMap as TriggeringMap6, TriggeringObject as TriggeringObject7, reaction as reaction6, Transaction as Transaction4 } from "reactronic";
|
9118
9158
|
|
9119
9159
|
// source/services/workspace/ClientTrackedSourceFiles.ts
|
9120
|
-
import {
|
9121
|
-
var ClientTrackedSourceFiles = class extends
|
9160
|
+
import { TriggeringMap, TriggeringObject, trigger, ReactiveSystem, atomicBlock } from "reactronic";
|
9161
|
+
var ClientTrackedSourceFiles = class extends TriggeringObject {
|
9122
9162
|
constructor() {
|
9123
9163
|
super(...arguments);
|
9124
|
-
this.items = new
|
9164
|
+
this.items = new TriggeringMap();
|
9125
9165
|
}
|
9126
|
-
// @
|
9166
|
+
// @cache
|
9127
9167
|
get unsaved() {
|
9128
9168
|
return Query.from(this.items.entries()).filter((e) => !e[1].isSaved).toMap((e) => e[0], (e) => e[1]);
|
9129
9169
|
}
|
@@ -9174,18 +9214,18 @@ var ClientTrackedSourceFiles = class extends ObservableObject {
|
|
9174
9214
|
}
|
9175
9215
|
};
|
9176
9216
|
__decorateClass([
|
9177
|
-
|
9217
|
+
atomicBlock
|
9178
9218
|
], ClientTrackedSourceFiles.prototype, "track", 1);
|
9179
9219
|
__decorateClass([
|
9180
|
-
|
9220
|
+
atomicBlock
|
9181
9221
|
], ClientTrackedSourceFiles.prototype, "update", 1);
|
9182
9222
|
__decorateClass([
|
9183
|
-
|
9223
|
+
atomicBlock
|
9184
9224
|
], ClientTrackedSourceFiles.prototype, "save", 1);
|
9185
9225
|
__decorateClass([
|
9186
|
-
|
9226
|
+
atomicBlock
|
9187
9227
|
], ClientTrackedSourceFiles.prototype, "close", 1);
|
9188
|
-
var ClientTrackedSourceFile = class extends
|
9228
|
+
var ClientTrackedSourceFile = class extends TriggeringObject {
|
9189
9229
|
constructor(uri, text, version, isSaved) {
|
9190
9230
|
super();
|
9191
9231
|
this.uri = uri;
|
@@ -9201,7 +9241,7 @@ var ClientTrackedSourceFile = class extends ObservableObject {
|
|
9201
9241
|
}
|
9202
9242
|
};
|
9203
9243
|
__decorateClass([
|
9204
|
-
|
9244
|
+
trigger(false)
|
9205
9245
|
], ClientTrackedSourceFile.prototype, "uri", 2);
|
9206
9246
|
var ClientTrackedSourceFileSnapshot = class {
|
9207
9247
|
constructor(uri, text, version, isSaved) {
|
@@ -9215,15 +9255,15 @@ var ClientTrackedSourceFileSnapshot = class {
|
|
9215
9255
|
// source/services/workspace/CompilationController.ts
|
9216
9256
|
import {
|
9217
9257
|
Indicator,
|
9218
|
-
|
9258
|
+
TriggeringObject as TriggeringObject2,
|
9219
9259
|
ReactiveSystem as ReactiveSystem2,
|
9220
9260
|
Reentrance,
|
9221
9261
|
Transaction,
|
9222
|
-
|
9262
|
+
atomicBlock as atomicBlock2,
|
9223
9263
|
nonReactiveRun,
|
9224
9264
|
options,
|
9225
|
-
|
9226
|
-
|
9265
|
+
reaction,
|
9266
|
+
trigger as trigger2
|
9227
9267
|
} from "reactronic";
|
9228
9268
|
var highPriorityDiagnosticsCollectionIndicator = Indicator.create(
|
9229
9269
|
"HighPriorityDiagnosticsCollectionIndicator",
|
@@ -9232,7 +9272,7 @@ var highPriorityDiagnosticsCollectionIndicator = Indicator.create(
|
|
9232
9272
|
100
|
9233
9273
|
);
|
9234
9274
|
var backgroundDiagnosticsCollectionThrottleTimeMs = 3e3;
|
9235
|
-
var CompilationController = class extends
|
9275
|
+
var CompilationController = class extends TriggeringObject2 {
|
9236
9276
|
constructor(config) {
|
9237
9277
|
super();
|
9238
9278
|
this.isConfigurationsProcessingEnabled = false;
|
@@ -9714,72 +9754,72 @@ var CompilationController = class extends ObservableObject2 {
|
|
9714
9754
|
}
|
9715
9755
|
};
|
9716
9756
|
__decorateClass([
|
9717
|
-
|
9757
|
+
trigger2(false)
|
9718
9758
|
], CompilationController.prototype, "mainCompilationReloadIndicator", 2);
|
9719
9759
|
__decorateClass([
|
9720
|
-
|
9760
|
+
trigger2(false)
|
9721
9761
|
], CompilationController.prototype, "configurationControllersUpdateIndictor", 2);
|
9722
9762
|
__decorateClass([
|
9723
|
-
|
9763
|
+
trigger2(false)
|
9724
9764
|
], CompilationController.prototype, "_mainAnalyzerChangedIndicator", 2);
|
9725
9765
|
__decorateClass([
|
9726
|
-
|
9766
|
+
trigger2(false)
|
9727
9767
|
], CompilationController.prototype, "_fileSystemTree", 2);
|
9728
9768
|
__decorateClass([
|
9729
|
-
|
9769
|
+
trigger2(false)
|
9730
9770
|
], CompilationController.prototype, "config", 2);
|
9731
9771
|
__decorateClass([
|
9732
|
-
|
9772
|
+
trigger2(false)
|
9733
9773
|
], CompilationController.prototype, "_rootDirectory", 2);
|
9734
9774
|
__decorateClass([
|
9735
|
-
|
9775
|
+
trigger2(false)
|
9736
9776
|
], CompilationController.prototype, "_previousCompilationLoadResult", 2);
|
9737
9777
|
__decorateClass([
|
9738
|
-
|
9778
|
+
trigger2(false)
|
9739
9779
|
], CompilationController.prototype, "_sourceFilesForWhichDiagnosticsWereReported", 2);
|
9740
9780
|
__decorateClass([
|
9741
|
-
|
9781
|
+
trigger2(false)
|
9742
9782
|
], CompilationController.prototype, "_checkedConfigurationVersionByPackageUri", 2);
|
9743
9783
|
__decorateClass([
|
9744
|
-
|
9784
|
+
trigger2(false)
|
9745
9785
|
], CompilationController.prototype, "_tsInteropInputs", 2);
|
9746
9786
|
__decorateClass([
|
9747
|
-
|
9787
|
+
trigger2(false)
|
9748
9788
|
], CompilationController.prototype, "_tsInteropInputsKey", 2);
|
9749
9789
|
__decorateClass([
|
9750
|
-
|
9790
|
+
trigger2(false)
|
9751
9791
|
], CompilationController.prototype, "_tsProgramLoaderInputs", 2);
|
9752
9792
|
__decorateClass([
|
9753
|
-
|
9793
|
+
trigger2(false)
|
9754
9794
|
], CompilationController.prototype, "_configurationsOfPackagesOutsideProject", 2);
|
9755
9795
|
__decorateClass([
|
9756
|
-
|
9796
|
+
atomicBlock2
|
9757
9797
|
], CompilationController.prototype, "notifyReportedSourceFileDiagnostics", 1);
|
9758
9798
|
__decorateClass([
|
9759
|
-
|
9799
|
+
reaction,
|
9760
9800
|
options({ reentrance: Reentrance.cancelPrevious, order: 24 })
|
9761
9801
|
], CompilationController.prototype, "reloadMainCompilation", 1);
|
9762
9802
|
__decorateClass([
|
9763
|
-
|
9803
|
+
reaction,
|
9764
9804
|
options({ order: 25 })
|
9765
9805
|
], CompilationController.prototype, "updateState", 1);
|
9766
9806
|
__decorateClass([
|
9767
|
-
|
9807
|
+
reaction,
|
9768
9808
|
options({ order: 20 })
|
9769
9809
|
], CompilationController.prototype, "updateConfigurationControllers", 1);
|
9770
9810
|
__decorateClass([
|
9771
|
-
|
9811
|
+
reaction,
|
9772
9812
|
options({ order: 21 })
|
9773
9813
|
], CompilationController.prototype, "onConfigurationsUpdated", 1);
|
9774
9814
|
__decorateClass([
|
9775
|
-
|
9815
|
+
reaction
|
9776
9816
|
], CompilationController.prototype, "onMainAnalyzerChanged", 1);
|
9777
9817
|
__decorateClass([
|
9778
|
-
|
9818
|
+
reaction,
|
9779
9819
|
options({ reentrance: Reentrance.cancelAndWaitPrevious })
|
9780
9820
|
], CompilationController.prototype, "collectDiagnosticsInBackground", 1);
|
9781
9821
|
__decorateClass([
|
9782
|
-
|
9822
|
+
reaction,
|
9783
9823
|
options({ reentrance: Reentrance.waitAndRestart })
|
9784
9824
|
], CompilationController.prototype, "onRawPackageConfigurationsUpdated", 1);
|
9785
9825
|
var TsProgramLoaderInputs = class {
|
@@ -9841,11 +9881,11 @@ var ReadonlyCompilationState = class {
|
|
9841
9881
|
}
|
9842
9882
|
};
|
9843
9883
|
__decorateClass([
|
9844
|
-
|
9884
|
+
atomicBlock2,
|
9845
9885
|
options({ reentrance: Reentrance.runSideBySide, indicator: highPriorityDiagnosticsCollectionIndicator })
|
9846
9886
|
], ReadonlyCompilationState.prototype, "collectSourceFileDiagnosticsWithHighPriority", 1);
|
9847
9887
|
__decorateClass([
|
9848
|
-
|
9888
|
+
atomicBlock2,
|
9849
9889
|
options({ reentrance: Reentrance.runSideBySide })
|
9850
9890
|
], ReadonlyCompilationState.prototype, "collectSourceFileDiagnosticsWithLowPriority", 1);
|
9851
9891
|
var DiagnosticsCollectionSummary = class {
|
@@ -9853,7 +9893,7 @@ var DiagnosticsCollectionSummary = class {
|
|
9853
9893
|
this.hasErrors = hasErrors;
|
9854
9894
|
}
|
9855
9895
|
};
|
9856
|
-
var ConfigurationController = class extends
|
9896
|
+
var ConfigurationController = class extends TriggeringObject2 {
|
9857
9897
|
constructor(rootDirectory, packageUri, mainCompilationController) {
|
9858
9898
|
super();
|
9859
9899
|
// private _compilationState: ReadonlyCompilationState | undefined = undefined
|
@@ -9934,7 +9974,7 @@ var ConfigurationController = class extends ObservableObject2 {
|
|
9934
9974
|
this._convertedConfigurationVersion++;
|
9935
9975
|
});
|
9936
9976
|
}
|
9937
|
-
// @
|
9977
|
+
// @reaction
|
9938
9978
|
// @options({ reentrance: Reentrance.cancelPrevious, order: 21 })
|
9939
9979
|
// private async reloadCompilation(): Promise<void> {
|
9940
9980
|
// if (!this._mainCompilationController.isConfigurationsProcessingEnabled) {
|
@@ -9981,7 +10021,7 @@ var ConfigurationController = class extends ObservableObject2 {
|
|
9981
10021
|
// }
|
9982
10022
|
// }
|
9983
10023
|
// }
|
9984
|
-
// @
|
10024
|
+
// @reaction
|
9985
10025
|
// @options({ reentrance: Reentrance.cancelPrevious, order: 22 })
|
9986
10026
|
// private async analyze(): Promise<void> {
|
9987
10027
|
// if (!this._mainCompilationController.isConfigurationsProcessingEnabled) {
|
@@ -10015,11 +10055,11 @@ var ConfigurationController = class extends ObservableObject2 {
|
|
10015
10055
|
// }
|
10016
10056
|
// }
|
10017
10057
|
// }
|
10018
|
-
// @
|
10058
|
+
// @reaction
|
10019
10059
|
// private diagnosticsChanged(): void {
|
10020
10060
|
// this._configurationDiagnostics // подписка
|
10021
10061
|
// }
|
10022
|
-
// @
|
10062
|
+
// @reaction
|
10023
10063
|
// @options({ reentrance: Reentrance.cancelAndWaitPrevious })
|
10024
10064
|
// private async reportDiagnostics(): Promise<void> {
|
10025
10065
|
// if (!this._mainCompilationController.isConfigurationsProcessingEnabled) {
|
@@ -10045,7 +10085,7 @@ var ConfigurationController = class extends ObservableObject2 {
|
|
10045
10085
|
// }
|
10046
10086
|
// }
|
10047
10087
|
// }
|
10048
|
-
// @
|
10088
|
+
// @reaction
|
10049
10089
|
// @options({ reentrance: Reentrance.cancelPrevious, order: 23 })
|
10050
10090
|
// private async interpretConfiguration(): Promise<void> {
|
10051
10091
|
// if (!this._mainCompilationController.isConfigurationsProcessingEnabled) {
|
@@ -10087,23 +10127,23 @@ var ConfigurationController = class extends ObservableObject2 {
|
|
10087
10127
|
// }
|
10088
10128
|
};
|
10089
10129
|
__decorateClass([
|
10090
|
-
|
10130
|
+
trigger2(false)
|
10091
10131
|
], ConfigurationController.prototype, "packageUri", 2);
|
10092
10132
|
__decorateClass([
|
10093
|
-
|
10133
|
+
trigger2(false)
|
10094
10134
|
], ConfigurationController.prototype, "processingIndicator", 2);
|
10095
10135
|
__decorateClass([
|
10096
|
-
|
10136
|
+
trigger2(false)
|
10097
10137
|
], ConfigurationController.prototype, "rootDirectory", 2);
|
10098
10138
|
__decorateClass([
|
10099
|
-
|
10139
|
+
trigger2(false)
|
10100
10140
|
], ConfigurationController.prototype, "_mainCompilationController", 2);
|
10101
10141
|
__decorateClass([
|
10102
|
-
|
10142
|
+
reaction,
|
10103
10143
|
options({ reentrance: Reentrance.cancelPrevious, order: 21 })
|
10104
10144
|
], ConfigurationController.prototype, "updateJsonConfigurationFile", 1);
|
10105
10145
|
__decorateClass([
|
10106
|
-
|
10146
|
+
reaction,
|
10107
10147
|
options({ reentrance: Reentrance.cancelPrevious, order: 22 })
|
10108
10148
|
], ConfigurationController.prototype, "processConfiguration", 1);
|
10109
10149
|
var ConfigurationDirectory = class {
|
@@ -10165,31 +10205,31 @@ var TsInteropInputsCache = class {
|
|
10165
10205
|
|
10166
10206
|
// source/services/workspace/FileSystemTreeProviderBasedOnWatchedFileSystem.ts
|
10167
10207
|
import {
|
10168
|
-
|
10208
|
+
atomicBlock as atomicBlock3,
|
10169
10209
|
Indicator as Indicator2,
|
10170
10210
|
nonReactiveRun as nonReactiveRun2,
|
10171
|
-
|
10172
|
-
|
10173
|
-
|
10211
|
+
TriggeringArray,
|
10212
|
+
TriggeringMap as TriggeringMap2,
|
10213
|
+
TriggeringObject as TriggeringObject3,
|
10174
10214
|
options as options2,
|
10175
|
-
|
10215
|
+
reaction as reaction2,
|
10176
10216
|
ReactiveSystem as ReactiveSystem3,
|
10177
10217
|
Transaction as Transaction2,
|
10178
|
-
|
10218
|
+
trigger as trigger3
|
10179
10219
|
} from "reactronic";
|
10180
|
-
var FileSystemTreeProviderBasedOnWatchedFileSystem = class extends
|
10220
|
+
var FileSystemTreeProviderBasedOnWatchedFileSystem = class extends TriggeringObject3 {
|
10181
10221
|
// Используется в качестве множества.
|
10182
10222
|
constructor(fileSystem, notificationsPublisher, namesOfDirectoriesToIgnore, additionalUrisOfDirectoriesToLoad) {
|
10183
10223
|
super();
|
10184
10224
|
this.fileSystemTree = new FileSystemTree(true);
|
10185
|
-
this.loadedWorkspaceFolderByUri = new
|
10225
|
+
this.loadedWorkspaceFolderByUri = new TriggeringMap2();
|
10186
10226
|
this._workspaceFolderUris = void 0;
|
10187
10227
|
this._trackedSourceFiles = void 0;
|
10188
10228
|
this._isInitialized = false;
|
10189
10229
|
this._lastCheckedWorkspaceFolderUris = new Array();
|
10190
10230
|
this._taskQueue = new TaskQueue();
|
10191
10231
|
this._lastCheckedTrackedSourceFileInfoVersionByUri = /* @__PURE__ */ new Map();
|
10192
|
-
this._loadedDirectoryUris = new
|
10232
|
+
this._loadedDirectoryUris = new TriggeringMap2();
|
10193
10233
|
this._fileSystem = fileSystem;
|
10194
10234
|
this._notificationsPublisher = notificationsPublisher;
|
10195
10235
|
this._listener = this.onFileSystemUpdated.bind(this);
|
@@ -10557,7 +10597,7 @@ var FileSystemTreeProviderBasedOnWatchedFileSystem = class extends ObservableObj
|
|
10557
10597
|
this.fileSystemTree.deleteFileOrDirectory(uri);
|
10558
10598
|
}
|
10559
10599
|
}
|
10560
|
-
// @
|
10600
|
+
// @reaction
|
10561
10601
|
// @options({ order: 0 })
|
10562
10602
|
// protected unloadWorkspaceFoldersThatNoLongerContainArtelProject(): void {
|
10563
10603
|
// if (this.isMissingConfigurationDirectoryAllowed) {
|
@@ -10682,65 +10722,65 @@ var FileSystemTreeProviderBasedOnWatchedFileSystem = class extends ObservableObj
|
|
10682
10722
|
// }
|
10683
10723
|
};
|
10684
10724
|
__decorateClass([
|
10685
|
-
|
10725
|
+
trigger3(false)
|
10686
10726
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "fileSystemTree", 2);
|
10687
10727
|
__decorateClass([
|
10688
|
-
|
10728
|
+
trigger3(false)
|
10689
10729
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "loadedWorkspaceFolderByUri", 2);
|
10690
10730
|
__decorateClass([
|
10691
|
-
|
10731
|
+
trigger3(false)
|
10692
10732
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "_fileSystem", 2);
|
10693
10733
|
__decorateClass([
|
10694
|
-
|
10734
|
+
trigger3(false)
|
10695
10735
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "_notificationsPublisher", 2);
|
10696
10736
|
__decorateClass([
|
10697
|
-
|
10737
|
+
trigger3(false)
|
10698
10738
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "_listener", 2);
|
10699
10739
|
__decorateClass([
|
10700
|
-
|
10740
|
+
trigger3(false)
|
10701
10741
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "_lastCheckedWorkspaceFolderUris", 2);
|
10702
10742
|
__decorateClass([
|
10703
|
-
|
10743
|
+
trigger3(false)
|
10704
10744
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "_taskQueue", 2);
|
10705
10745
|
__decorateClass([
|
10706
|
-
|
10746
|
+
trigger3(false)
|
10707
10747
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "_namesOfDirectoriesToIgnore", 2);
|
10708
10748
|
__decorateClass([
|
10709
|
-
|
10749
|
+
trigger3(false)
|
10710
10750
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "_additionalUrisOfDirectoriesToLoad", 2);
|
10711
10751
|
__decorateClass([
|
10712
|
-
|
10752
|
+
trigger3(false)
|
10713
10753
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "_lastCheckedTrackedSourceFileInfoVersionByUri", 2);
|
10714
10754
|
__decorateClass([
|
10715
|
-
|
10755
|
+
trigger3(false)
|
10716
10756
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "_loadedDirectoryUris", 2);
|
10717
10757
|
__decorateClass([
|
10718
|
-
|
10758
|
+
reaction2
|
10719
10759
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "onTrackedSourceFilesUpdated", 1);
|
10720
10760
|
__decorateClass([
|
10721
|
-
|
10761
|
+
reaction2
|
10722
10762
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "onWorkspaceFolderUrisUpdated", 1);
|
10723
10763
|
__decorateClass([
|
10724
|
-
|
10764
|
+
reaction2,
|
10725
10765
|
options2({ order: 0 })
|
10726
10766
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "updateLoadedWorkspaceFolders", 1);
|
10727
10767
|
__decorateClass([
|
10728
|
-
|
10768
|
+
reaction2
|
10729
10769
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "loadAdditionalDirectories", 1);
|
10730
10770
|
__decorateClass([
|
10731
|
-
|
10771
|
+
atomicBlock3
|
10732
10772
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "addWorkspaceFoldersWorker", 1);
|
10733
10773
|
__decorateClass([
|
10734
|
-
|
10774
|
+
atomicBlock3
|
10735
10775
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "removeWorkspaceFoldersWorker", 1);
|
10736
10776
|
__decorateClass([
|
10737
|
-
|
10777
|
+
atomicBlock3
|
10738
10778
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "onFileSystemTreeUpdatedWorker", 1);
|
10739
10779
|
__decorateClass([
|
10740
|
-
|
10780
|
+
atomicBlock3
|
10741
10781
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "stopTrackingSourceFile", 1);
|
10742
10782
|
__decorateClass([
|
10743
|
-
|
10783
|
+
atomicBlock3
|
10744
10784
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "updateFileSystemTree", 1);
|
10745
10785
|
var SimpleFileSystemUpdateNotificationsPublisher = class {
|
10746
10786
|
constructor() {
|
@@ -10816,10 +10856,10 @@ var FileSystemTreeUpdate_deleteDirectory = class {
|
|
10816
10856
|
return this.uri;
|
10817
10857
|
}
|
10818
10858
|
};
|
10819
|
-
var TaskQueue = class extends
|
10859
|
+
var TaskQueue = class extends TriggeringObject3 {
|
10820
10860
|
constructor() {
|
10821
10861
|
super();
|
10822
|
-
this._tasks = new
|
10862
|
+
this._tasks = new TriggeringArray();
|
10823
10863
|
this._currentTask = void 0;
|
10824
10864
|
this._processTasksIndicator = Indicator2.create("ProcessTasks", -1, -1, 1e3);
|
10825
10865
|
ReactiveSystem3.getOperation(this.processTasks).configure({ indicator: this._processTasksIndicator });
|
@@ -10875,25 +10915,25 @@ var TaskQueue = class extends ObservableObject3 {
|
|
10875
10915
|
}
|
10876
10916
|
};
|
10877
10917
|
__decorateClass([
|
10878
|
-
|
10918
|
+
trigger3(false)
|
10879
10919
|
], TaskQueue.prototype, "_tasks", 2);
|
10880
10920
|
__decorateClass([
|
10881
|
-
|
10921
|
+
atomicBlock3
|
10882
10922
|
], TaskQueue.prototype, "addTask", 1);
|
10883
10923
|
__decorateClass([
|
10884
|
-
|
10924
|
+
reaction2
|
10885
10925
|
], TaskQueue.prototype, "processTasks", 1);
|
10886
10926
|
__decorateClass([
|
10887
|
-
|
10927
|
+
reaction2
|
10888
10928
|
], TaskQueue.prototype, "executeTask", 1);
|
10889
10929
|
|
10890
10930
|
// source/services/workspace/ManuallyUpdatedFileSystemTreeProvider.ts
|
10891
|
-
import {
|
10892
|
-
var ManuallyUpdatedFileSystemTreeProvider = class extends
|
10931
|
+
import { TriggeringMap as TriggeringMap3, TriggeringObject as TriggeringObject4, options as options3, reaction as reaction3, ReactiveSystem as ReactiveSystem4, trigger as trigger4 } from "reactronic";
|
10932
|
+
var ManuallyUpdatedFileSystemTreeProvider = class extends TriggeringObject4 {
|
10893
10933
|
constructor() {
|
10894
10934
|
super(...arguments);
|
10895
10935
|
this.fileSystemTree = new FileSystemTree(true, true);
|
10896
|
-
this.loadedWorkspaceFolderByUri = new
|
10936
|
+
this.loadedWorkspaceFolderByUri = new TriggeringMap3();
|
10897
10937
|
this._workspaceFolderUris = void 0;
|
10898
10938
|
this._trackedSourceFiles = void 0;
|
10899
10939
|
this._lastCheckedTrackedSourceFileInfoByUri = /* @__PURE__ */ new Map();
|
@@ -10992,59 +11032,59 @@ var ManuallyUpdatedFileSystemTreeProvider = class extends ObservableObject4 {
|
|
10992
11032
|
}
|
10993
11033
|
};
|
10994
11034
|
__decorateClass([
|
10995
|
-
|
11035
|
+
trigger4(false)
|
10996
11036
|
], ManuallyUpdatedFileSystemTreeProvider.prototype, "fileSystemTree", 2);
|
10997
11037
|
__decorateClass([
|
10998
|
-
|
11038
|
+
trigger4(false)
|
10999
11039
|
], ManuallyUpdatedFileSystemTreeProvider.prototype, "loadedWorkspaceFolderByUri", 2);
|
11000
11040
|
__decorateClass([
|
11001
|
-
|
11041
|
+
trigger4(false)
|
11002
11042
|
], ManuallyUpdatedFileSystemTreeProvider.prototype, "_lastCheckedTrackedSourceFileInfoByUri", 2);
|
11003
11043
|
__decorateClass([
|
11004
|
-
|
11044
|
+
trigger4(false)
|
11005
11045
|
], ManuallyUpdatedFileSystemTreeProvider.prototype, "_manuallyCreatedSourceFileTextByUri", 2);
|
11006
11046
|
__decorateClass([
|
11007
|
-
|
11047
|
+
reaction3
|
11008
11048
|
], ManuallyUpdatedFileSystemTreeProvider.prototype, "onTrackedSourceFilesUpdated", 1);
|
11009
11049
|
__decorateClass([
|
11010
|
-
|
11050
|
+
reaction3,
|
11011
11051
|
options3({ order: 0 })
|
11012
11052
|
], ManuallyUpdatedFileSystemTreeProvider.prototype, "updateLoadedWorkspaceFolderByUri", 1);
|
11013
11053
|
|
11014
11054
|
// source/services/workspace/Workspace.ts
|
11015
11055
|
import {
|
11016
|
-
|
11017
|
-
|
11018
|
-
|
11056
|
+
TriggeringArray as TriggeringArray4,
|
11057
|
+
TriggeringMap as TriggeringMap5,
|
11058
|
+
TriggeringObject as TriggeringObject6,
|
11019
11059
|
ReactiveSystem as ReactiveSystem6,
|
11020
11060
|
Reentrance as Reentrance2,
|
11021
11061
|
Transaction as Transaction3,
|
11022
|
-
|
11062
|
+
atomicBlock as atomicBlock5,
|
11023
11063
|
atomicRun,
|
11024
|
-
|
11064
|
+
cache,
|
11025
11065
|
nonReactiveRun as nonReactiveRun3,
|
11026
11066
|
options as options5,
|
11027
|
-
|
11028
|
-
|
11067
|
+
reaction as reaction5,
|
11068
|
+
trigger as trigger6
|
11029
11069
|
} from "reactronic";
|
11030
11070
|
|
11031
11071
|
// source/services/workspace/WorkspaceFiles.ts
|
11032
11072
|
import {
|
11033
|
-
|
11034
|
-
|
11035
|
-
|
11073
|
+
TriggeringArray as TriggeringArray3,
|
11074
|
+
TriggeringMap as TriggeringMap4,
|
11075
|
+
TriggeringObject as TriggeringObject5,
|
11036
11076
|
options as options4,
|
11037
|
-
|
11038
|
-
|
11077
|
+
trigger as trigger5,
|
11078
|
+
reaction as reaction4,
|
11039
11079
|
ReactiveSystem as ReactiveSystem5,
|
11040
|
-
|
11080
|
+
atomicBlock as atomicBlock4
|
11041
11081
|
} from "reactronic";
|
11042
|
-
var WorkspaceFiles = class extends
|
11082
|
+
var WorkspaceFiles = class extends TriggeringObject5 {
|
11043
11083
|
constructor(fileSystemTreeProvider) {
|
11044
11084
|
super();
|
11045
11085
|
this.trackedSourceFiles = new ClientTrackedSourceFiles();
|
11046
|
-
this.workspaceFolderUris = new
|
11047
|
-
this.workspaceFolderWithArtelProjectByUri = new
|
11086
|
+
this.workspaceFolderUris = new TriggeringArray3();
|
11087
|
+
this.workspaceFolderWithArtelProjectByUri = new TriggeringMap4();
|
11048
11088
|
this._fileSystemTreeProvider = fileSystemTreeProvider;
|
11049
11089
|
this._fileSystemTreeProvider.initialize(this.workspaceFolderUris, this.trackedSourceFiles);
|
11050
11090
|
}
|
@@ -11143,39 +11183,39 @@ var WorkspaceFiles = class extends ObservableObject5 {
|
|
11143
11183
|
}
|
11144
11184
|
};
|
11145
11185
|
__decorateClass([
|
11146
|
-
|
11186
|
+
trigger5(false)
|
11147
11187
|
], WorkspaceFiles.prototype, "workspaceFolderUris", 2);
|
11148
11188
|
__decorateClass([
|
11149
|
-
|
11189
|
+
trigger5(false)
|
11150
11190
|
], WorkspaceFiles.prototype, "workspaceFolderWithArtelProjectByUri", 2);
|
11151
11191
|
__decorateClass([
|
11152
|
-
|
11192
|
+
trigger5(false)
|
11153
11193
|
], WorkspaceFiles.prototype, "_fileSystemTreeProvider", 2);
|
11154
11194
|
__decorateClass([
|
11155
|
-
|
11195
|
+
atomicBlock4
|
11156
11196
|
], WorkspaceFiles.prototype, "addWorkspaceFolders", 1);
|
11157
11197
|
__decorateClass([
|
11158
|
-
|
11198
|
+
atomicBlock4
|
11159
11199
|
], WorkspaceFiles.prototype, "removeWorkspaceFolders", 1);
|
11160
11200
|
__decorateClass([
|
11161
|
-
|
11201
|
+
atomicBlock4
|
11162
11202
|
], WorkspaceFiles.prototype, "trackSourceFile", 1);
|
11163
11203
|
__decorateClass([
|
11164
|
-
|
11204
|
+
atomicBlock4
|
11165
11205
|
], WorkspaceFiles.prototype, "updateTrackedSourceFile", 1);
|
11166
11206
|
__decorateClass([
|
11167
|
-
|
11207
|
+
reaction4,
|
11168
11208
|
options4({ order: 1 })
|
11169
11209
|
], WorkspaceFiles.prototype, "updateWorkspaceFolderWithArtelProjectByUri", 1);
|
11170
11210
|
|
11171
11211
|
// source/services/workspace/Workspace.ts
|
11172
|
-
var _Workspace = class _Workspace extends
|
11212
|
+
var _Workspace = class _Workspace extends TriggeringObject6 {
|
11173
11213
|
constructor(config) {
|
11174
11214
|
super();
|
11175
11215
|
this.isReadyToAcceptWorkspaceDiagnostics = false;
|
11176
|
-
this._compilationControllers = new
|
11177
|
-
//
|
11178
|
-
this._controllersWithOpenedFiles = new
|
11216
|
+
this._compilationControllers = new TriggeringArray4();
|
11217
|
+
// TriggeringMap используется в качестве Set'а.
|
11218
|
+
this._controllersWithOpenedFiles = new TriggeringMap5();
|
11179
11219
|
this._atLeastOneFileOfCompilationHasBeenOpened = false;
|
11180
11220
|
this._standardPackageContents = new Cached();
|
11181
11221
|
this._tsInteropInputsCache = new TsInteropInputsCache();
|
@@ -11445,39 +11485,39 @@ var _Workspace = class _Workspace extends ObservableObject6 {
|
|
11445
11485
|
}
|
11446
11486
|
};
|
11447
11487
|
__decorateClass([
|
11448
|
-
|
11488
|
+
trigger6(false)
|
11449
11489
|
], _Workspace.prototype, "_config", 2);
|
11450
11490
|
__decorateClass([
|
11451
|
-
|
11491
|
+
trigger6(false)
|
11452
11492
|
], _Workspace.prototype, "_atLeastOneFileOfCompilationHasBeenOpened", 2);
|
11453
11493
|
__decorateClass([
|
11454
|
-
|
11494
|
+
trigger6(false)
|
11455
11495
|
], _Workspace.prototype, "_files", 2);
|
11456
11496
|
__decorateClass([
|
11457
|
-
|
11497
|
+
trigger6(false)
|
11458
11498
|
], _Workspace.prototype, "_standardPackageContents", 2);
|
11459
11499
|
__decorateClass([
|
11460
|
-
|
11500
|
+
trigger6(false)
|
11461
11501
|
], _Workspace.prototype, "_tsInteropInputsCache", 2);
|
11462
11502
|
__decorateClass([
|
11463
|
-
|
11503
|
+
cache
|
11464
11504
|
], _Workspace.prototype, "compilationControllerByUri", 1);
|
11465
11505
|
__decorateClass([
|
11466
|
-
|
11506
|
+
atomicBlock5
|
11467
11507
|
], _Workspace.prototype, "notifyClosedTextDocument", 1);
|
11468
11508
|
__decorateClass([
|
11469
|
-
|
11509
|
+
reaction5,
|
11470
11510
|
options5({ order: 10 })
|
11471
11511
|
], _Workspace.prototype, "updateCompilationControllers", 1);
|
11472
11512
|
__decorateClass([
|
11473
|
-
|
11513
|
+
reaction5,
|
11474
11514
|
options5({ reentrance: Reentrance2.cancelPrevious })
|
11475
11515
|
], _Workspace.prototype, "processControllersWithUnprocessedConfigs", 1);
|
11476
11516
|
__decorateClass([
|
11477
|
-
|
11517
|
+
reaction5
|
11478
11518
|
], _Workspace.prototype, "updateIsDiagnosticsCollectionInBackgroundEnabled", 1);
|
11479
11519
|
__decorateClass([
|
11480
|
-
|
11520
|
+
reaction5,
|
11481
11521
|
options5({ reentrance: Reentrance2.cancelPrevious })
|
11482
11522
|
], _Workspace.prototype, "updateControllersWithOpenedFiles", 1);
|
11483
11523
|
var Workspace = _Workspace;
|
@@ -11493,22 +11533,30 @@ var EntityToSyntax = class {
|
|
11493
11533
|
return this.convertPackage(this._entity);
|
11494
11534
|
}
|
11495
11535
|
convertPackage(entity) {
|
11496
|
-
const namedPackageMembers = entity.getMembers().getNamedMembers().flatMap((m) => this.convertNamedPackageMember(m
|
11536
|
+
const namedPackageMembers = entity.getMembers().getNamedMembers().flatMap((m) => this.convertNamedPackageMember(m));
|
11497
11537
|
return SyntaxFactory.sourceFile([], namedPackageMembers);
|
11498
11538
|
}
|
11499
11539
|
convertNamedPackageMember(entity) {
|
11500
11540
|
switch (entity.kind) {
|
11501
11541
|
case 0 /* Variable */:
|
11502
11542
|
return this.convertPackageVariable(entity);
|
11503
|
-
case
|
11504
|
-
return this.convertPackageVariantType(entity);
|
11505
|
-
case 5 /* Method */:
|
11543
|
+
case 1 /* Method */:
|
11506
11544
|
return this.convertPackageMethod(entity);
|
11507
|
-
case
|
11545
|
+
case 2 /* Type */:
|
11546
|
+
return this.convertPackageType(entity);
|
11547
|
+
default:
|
11548
|
+
Debug.never(entity);
|
11549
|
+
}
|
11550
|
+
}
|
11551
|
+
convertPackageType(entity) {
|
11552
|
+
switch (entity.typeEntityKind) {
|
11553
|
+
case 0 /* Method */:
|
11508
11554
|
return this.convertPackageMethodType(entity);
|
11509
|
-
case
|
11555
|
+
case 1 /* Structured */:
|
11510
11556
|
return this.convertPackageStructuredType(entity);
|
11511
|
-
case
|
11557
|
+
case 3 /* Variant */:
|
11558
|
+
return this.convertPackageVariantType(entity);
|
11559
|
+
case 4 /* Alias */:
|
11512
11560
|
return this.convertPackageAliasType(entity);
|
11513
11561
|
default:
|
11514
11562
|
Debug.never(entity);
|
@@ -11517,7 +11565,7 @@ var EntityToSyntax = class {
|
|
11517
11565
|
convertPackageVariable(entity) {
|
11518
11566
|
const commonModifiers = new Array();
|
11519
11567
|
if (entity.isConstant()) {
|
11520
|
-
commonModifiers.push(SyntaxFactory.modifier(
|
11568
|
+
commonModifiers.push(SyntaxFactory.modifier(34 /* Const */));
|
11521
11569
|
}
|
11522
11570
|
const name = this.getEntityName(entity);
|
11523
11571
|
const type = this.convertType(entity.getType());
|
@@ -11542,7 +11590,7 @@ var EntityToSyntax = class {
|
|
11542
11590
|
if (isHidden !== void 0) {
|
11543
11591
|
modifiers.push(this.createHidingModifier(isHidden));
|
11544
11592
|
}
|
11545
|
-
result.push(SyntaxFactory.packageVariableSetterDeclaration(tags, modifiers, name, void 0
|
11593
|
+
result.push(SyntaxFactory.packageVariableSetterDeclaration(tags, modifiers, name, void 0));
|
11546
11594
|
}
|
11547
11595
|
} else {
|
11548
11596
|
const tags = this.convertTags(entity.getTags());
|
@@ -11559,7 +11607,7 @@ var EntityToSyntax = class {
|
|
11559
11607
|
const tags = this.convertTags(entity.getTags());
|
11560
11608
|
const modifiers = new Array();
|
11561
11609
|
if (entity.isAsync()) {
|
11562
|
-
modifiers.push(SyntaxFactory.modifier(
|
11610
|
+
modifiers.push(SyntaxFactory.modifier(39 /* Async */));
|
11563
11611
|
}
|
11564
11612
|
const isHidden = entity.isHidden();
|
11565
11613
|
if (isHidden !== void 0) {
|
@@ -11636,21 +11684,24 @@ var EntityToSyntax = class {
|
|
11636
11684
|
return variables.concat(indexers, constructors, methods, destructors);
|
11637
11685
|
}
|
11638
11686
|
convertTypeVariable(entity) {
|
11687
|
+
if (entity.isVariant()) {
|
11688
|
+
return this.convertVariant(entity);
|
11689
|
+
}
|
11639
11690
|
const commonModifiers = new Array();
|
11640
11691
|
if (entity.isConstant()) {
|
11641
|
-
commonModifiers.push(SyntaxFactory.modifier(
|
11692
|
+
commonModifiers.push(SyntaxFactory.modifier(34 /* Const */));
|
11642
11693
|
}
|
11643
11694
|
if (entity.isStatic()) {
|
11644
|
-
commonModifiers.push(SyntaxFactory.modifier(
|
11695
|
+
commonModifiers.push(SyntaxFactory.modifier(40 /* Static */));
|
11645
11696
|
}
|
11646
11697
|
if (entity.isAbstract()) {
|
11647
|
-
commonModifiers.push(SyntaxFactory.modifier(
|
11698
|
+
commonModifiers.push(SyntaxFactory.modifier(36 /* Abstract */));
|
11648
11699
|
}
|
11649
11700
|
if (entity.isRedefinable()) {
|
11650
|
-
commonModifiers.push(SyntaxFactory.modifier(
|
11701
|
+
commonModifiers.push(SyntaxFactory.modifier(37 /* Redefinable */));
|
11651
11702
|
}
|
11652
11703
|
if (entity.isRedefined()) {
|
11653
|
-
commonModifiers.push(SyntaxFactory.modifier(
|
11704
|
+
commonModifiers.push(SyntaxFactory.modifier(38 /* Redefined */));
|
11654
11705
|
}
|
11655
11706
|
const name = this.getEntityName(entity);
|
11656
11707
|
const type = this.convertType(entity.getType());
|
@@ -11675,7 +11726,7 @@ var EntityToSyntax = class {
|
|
11675
11726
|
if (isHidden !== void 0) {
|
11676
11727
|
modifiers.push(this.createHidingModifier(isHidden));
|
11677
11728
|
}
|
11678
|
-
result.push(SyntaxFactory.typeVariableSetterDeclaration(tags, modifiers, name, void 0
|
11729
|
+
result.push(SyntaxFactory.typeVariableSetterDeclaration(tags, modifiers, name, void 0));
|
11679
11730
|
}
|
11680
11731
|
} else {
|
11681
11732
|
const tags = this.convertTags(entity.getTags());
|
@@ -11696,16 +11747,16 @@ var EntityToSyntax = class {
|
|
11696
11747
|
modifiers.push(this.createHidingModifier(isHidden));
|
11697
11748
|
}
|
11698
11749
|
if (entity.isStatic()) {
|
11699
|
-
modifiers.push(SyntaxFactory.modifier(
|
11750
|
+
modifiers.push(SyntaxFactory.modifier(40 /* Static */));
|
11700
11751
|
}
|
11701
11752
|
if (entity.isAbstract()) {
|
11702
|
-
modifiers.push(SyntaxFactory.modifier(
|
11753
|
+
modifiers.push(SyntaxFactory.modifier(36 /* Abstract */));
|
11703
11754
|
}
|
11704
11755
|
if (entity.isRedefinable()) {
|
11705
|
-
modifiers.push(SyntaxFactory.modifier(
|
11756
|
+
modifiers.push(SyntaxFactory.modifier(37 /* Redefinable */));
|
11706
11757
|
}
|
11707
11758
|
if (entity.isRedefined()) {
|
11708
|
-
modifiers.push(SyntaxFactory.modifier(
|
11759
|
+
modifiers.push(SyntaxFactory.modifier(38 /* Redefined */));
|
11709
11760
|
}
|
11710
11761
|
const name = this.getEntityName(entity);
|
11711
11762
|
const typeParameters = this.convertTypeParameters(entity.getTypeParameters());
|
@@ -11721,7 +11772,7 @@ var EntityToSyntax = class {
|
|
11721
11772
|
modifiers.push(this.createHidingModifier(isHidden));
|
11722
11773
|
}
|
11723
11774
|
if (entity.isAbstract()) {
|
11724
|
-
modifiers.push(SyntaxFactory.modifier(
|
11775
|
+
modifiers.push(SyntaxFactory.modifier(36 /* Abstract */));
|
11725
11776
|
}
|
11726
11777
|
const parameters = this.convertValueParameters(entity.getValueParameters());
|
11727
11778
|
return SyntaxFactory.typeConstructorDeclaration(tags, modifiers, parameters, void 0);
|
@@ -11734,7 +11785,7 @@ var EntityToSyntax = class {
|
|
11734
11785
|
modifiers.push(this.createHidingModifier(isHidden));
|
11735
11786
|
}
|
11736
11787
|
if (entity.isAbstract()) {
|
11737
|
-
modifiers.push(SyntaxFactory.modifier(
|
11788
|
+
modifiers.push(SyntaxFactory.modifier(36 /* Abstract */));
|
11738
11789
|
}
|
11739
11790
|
const parameters = this.convertValueParameters(entity.getValueParameters());
|
11740
11791
|
return SyntaxFactory.typeDestructorDeclaration(tags, modifiers, parameters, void 0);
|
@@ -11742,10 +11793,10 @@ var EntityToSyntax = class {
|
|
11742
11793
|
convertTypeIndexer(entity) {
|
11743
11794
|
const commonModifiers = new Array();
|
11744
11795
|
if (entity.isStatic()) {
|
11745
|
-
commonModifiers.push(SyntaxFactory.modifier(
|
11796
|
+
commonModifiers.push(SyntaxFactory.modifier(40 /* Static */));
|
11746
11797
|
}
|
11747
11798
|
if (entity.isAbstract()) {
|
11748
|
-
commonModifiers.push(SyntaxFactory.modifier(
|
11799
|
+
commonModifiers.push(SyntaxFactory.modifier(36 /* Abstract */));
|
11749
11800
|
}
|
11750
11801
|
const parameters = this.convertValueParameters(entity.getValueParameters());
|
11751
11802
|
const result = new Array();
|
@@ -11765,14 +11816,11 @@ var EntityToSyntax = class {
|
|
11765
11816
|
if (setterEntity !== void 0) {
|
11766
11817
|
const tags = this.convertTags(setterEntity.getTags());
|
11767
11818
|
const modifiers = Array.from(commonModifiers);
|
11768
|
-
const declaration = SyntaxFactory.typeIndexedSetterDeclaration(tags, modifiers, parameters, void 0
|
11819
|
+
const declaration = SyntaxFactory.typeIndexedSetterDeclaration(tags, modifiers, parameters, void 0);
|
11769
11820
|
result.push(declaration);
|
11770
11821
|
}
|
11771
11822
|
return result;
|
11772
11823
|
}
|
11773
|
-
convertVariants(variants) {
|
11774
|
-
return variants.get().map((v) => this.convertVariant(v));
|
11775
|
-
}
|
11776
11824
|
convertVariant(entity) {
|
11777
11825
|
const tags = this.convertTags(entity.getTags());
|
11778
11826
|
const name = this.getEntityName(entity);
|
@@ -11817,8 +11865,8 @@ var EntityToSyntax = class {
|
|
11817
11865
|
return SyntaxFactory.aliasTypeDeclarationBody(aliasedType, members);
|
11818
11866
|
}
|
11819
11867
|
createVariantTypeDeclarationBody(entity) {
|
11820
|
-
const
|
11821
|
-
return SyntaxFactory.variantTypeDeclarationBody(
|
11868
|
+
const members = this.convertTypeEntityMembers(entity.getMembers());
|
11869
|
+
return SyntaxFactory.variantTypeDeclarationBody(members);
|
11822
11870
|
}
|
11823
11871
|
createMethodTypeDeclarationBody(entity) {
|
11824
11872
|
const parameters = this.convertValueParameters(entity.getValueParameters());
|
@@ -11876,7 +11924,7 @@ var EntityToSyntax = class {
|
|
11876
11924
|
default:
|
11877
11925
|
Debug.never(hiding);
|
11878
11926
|
}
|
11879
|
-
return SyntaxFactory.modifier(
|
11927
|
+
return SyntaxFactory.modifier(35 /* Hidden */, levelKeyword);
|
11880
11928
|
}
|
11881
11929
|
convertTags(_entityTags) {
|
11882
11930
|
return [];
|
@@ -11964,13 +12012,13 @@ var EntityToSyntax = class {
|
|
11964
12012
|
};
|
11965
12013
|
|
11966
12014
|
// source/services/source-generation/SourceGenerationService.ts
|
11967
|
-
var SourceGenerationService = class extends
|
12015
|
+
var SourceGenerationService = class extends TriggeringObject7 {
|
11968
12016
|
constructor(_trackedSourceFiles, _tsLibrariesProvider, _standardPackageContentsProviders) {
|
11969
12017
|
super();
|
11970
12018
|
this._trackedSourceFiles = _trackedSourceFiles;
|
11971
12019
|
this._tsLibrariesProvider = _tsLibrariesProvider;
|
11972
12020
|
this._standardPackageContentsProviders = _standardPackageContentsProviders;
|
11973
|
-
this._generatedPackageStates = new
|
12021
|
+
this._generatedPackageStates = new TriggeringMap6();
|
11974
12022
|
}
|
11975
12023
|
get compilationControllers() {
|
11976
12024
|
return Array.from(this._generatedPackageStates.values()).map((s) => s.compilationController);
|
@@ -12126,7 +12174,7 @@ var SourceGenerationService = class extends ObservableObject7 {
|
|
12126
12174
|
} else {
|
12127
12175
|
return false;
|
12128
12176
|
}
|
12129
|
-
case
|
12177
|
+
case 1 /* Method */:
|
12130
12178
|
if (entity.subkind === "package") {
|
12131
12179
|
return true;
|
12132
12180
|
} else if (entity.subkind === "type") {
|
@@ -12134,33 +12182,37 @@ var SourceGenerationService = class extends ObservableObject7 {
|
|
12134
12182
|
} else {
|
12135
12183
|
return false;
|
12136
12184
|
}
|
12137
|
-
case
|
12138
|
-
|
12139
|
-
|
12140
|
-
|
12141
|
-
|
12142
|
-
|
12143
|
-
|
12185
|
+
case 2 /* Type */:
|
12186
|
+
switch (entity.typeEntityKind) {
|
12187
|
+
case 1 /* Structured */:
|
12188
|
+
case 3 /* Variant */:
|
12189
|
+
case 0 /* Method */: {
|
12190
|
+
if (entity.subkind === "package") {
|
12191
|
+
return true;
|
12192
|
+
}
|
12193
|
+
return true;
|
12194
|
+
}
|
12195
|
+
case 4 /* Alias */:
|
12196
|
+
return true;
|
12197
|
+
case 2 /* Parameter */:
|
12198
|
+
return this.checkIfEntityOfKindIsPresentInGeneratedCode(entity.getContainingEntity());
|
12199
|
+
default:
|
12200
|
+
Debug.never(entity);
|
12144
12201
|
}
|
12145
|
-
return true;
|
12146
|
-
case 14 /* AliasType */:
|
12147
|
-
return true;
|
12148
12202
|
case 3 /* Getter */:
|
12149
12203
|
case 4 /* Setter */:
|
12150
12204
|
return this.checkIfEntityOfKindIsPresentInGeneratedCode(entity.getOwningEntity());
|
12151
|
-
case
|
12152
|
-
|
12153
|
-
case 7 /*
|
12154
|
-
case 8 /*
|
12155
|
-
case 9 /*
|
12156
|
-
case 10 /* Destructor */:
|
12157
|
-
case 15 /* Operator */:
|
12205
|
+
case 5 /* Indexer */:
|
12206
|
+
case 6 /* DereferenceOperator */:
|
12207
|
+
case 7 /* Constructor */:
|
12208
|
+
case 8 /* Destructor */:
|
12209
|
+
case 9 /* Operator */:
|
12158
12210
|
return this.checkIfEntityOfKindIsPresentInGeneratedCode(entity.getContainer().getEntity());
|
12159
|
-
case
|
12211
|
+
case 10 /* PackageAlias */:
|
12160
12212
|
return false;
|
12161
|
-
case
|
12213
|
+
case 12 /* Package */:
|
12162
12214
|
return false;
|
12163
|
-
case
|
12215
|
+
case 11 /* TypeExtension */:
|
12164
12216
|
return true;
|
12165
12217
|
default:
|
12166
12218
|
Debug.never(entity);
|
@@ -12180,7 +12232,7 @@ var SourceGenerationService = class extends ObservableObject7 {
|
|
12180
12232
|
}
|
12181
12233
|
};
|
12182
12234
|
__decorateClass([
|
12183
|
-
|
12235
|
+
reaction6
|
12184
12236
|
], SourceGenerationService.prototype, "onOpenedSourceFilesChanged", 1);
|
12185
12237
|
var deleteGeneratedPackageTimeoutMs = 1e4;
|
12186
12238
|
var GeneratedPackageState = class {
|
@@ -12203,37 +12255,40 @@ var EntityFinder = class {
|
|
12203
12255
|
switch (entity.kind) {
|
12204
12256
|
case 0 /* Variable */:
|
12205
12257
|
return this.findVariableEntity(entity);
|
12206
|
-
case
|
12258
|
+
case 1 /* Method */:
|
12207
12259
|
return this.findMethodEntity(entity);
|
12208
|
-
case 2 /*
|
12209
|
-
|
12210
|
-
|
12211
|
-
|
12212
|
-
|
12260
|
+
case 2 /* Type */:
|
12261
|
+
switch (entity.typeEntityKind) {
|
12262
|
+
case 3 /* Variant */:
|
12263
|
+
case 1 /* Structured */:
|
12264
|
+
case 0 /* Method */: {
|
12265
|
+
if (entity.subkind === "package") {
|
12266
|
+
return this.findPackageTypeEntityByNameAndArity(this.getEntityName(entity), entity.getArity());
|
12267
|
+
}
|
12268
|
+
return void 0;
|
12269
|
+
}
|
12270
|
+
case 4 /* Alias */:
|
12271
|
+
return this.findPackageTypeEntityByNameAndArity(this.getEntityName(entity), entity.getArity());
|
12272
|
+
case 2 /* Parameter */:
|
12273
|
+
return this.findTypeParameterEntity(entity);
|
12274
|
+
default:
|
12275
|
+
Debug.never(entity);
|
12213
12276
|
}
|
12214
|
-
|
12215
|
-
}
|
12216
|
-
case 14 /* AliasType */:
|
12217
|
-
return this.findPackageTypeEntityByNameAndArity(this.getEntityName(entity), entity.getArity());
|
12218
|
-
case 9 /* Constructor */:
|
12277
|
+
case 7 /* Constructor */:
|
12219
12278
|
return this.findConstructorEntity(entity);
|
12220
|
-
case
|
12279
|
+
case 8 /* Destructor */:
|
12221
12280
|
return this.findDestructorEntity(entity);
|
12222
|
-
case
|
12281
|
+
case 9 /* Operator */:
|
12223
12282
|
return this.findOperatorEntity(entity);
|
12224
|
-
case
|
12283
|
+
case 5 /* Indexer */:
|
12225
12284
|
return this.findIndexerEntity(entity);
|
12226
|
-
case
|
12285
|
+
case 6 /* DereferenceOperator */:
|
12227
12286
|
return this.findDereferenceOperatorEntity(entity);
|
12228
|
-
case
|
12229
|
-
return this.findVariantEntity(entity);
|
12230
|
-
case 6 /* TypeParameter */:
|
12231
|
-
return this.findTypeParameterEntity(entity);
|
12232
|
-
case 13 /* PackageAlias */:
|
12287
|
+
case 10 /* PackageAlias */:
|
12233
12288
|
case 3 /* Getter */:
|
12234
12289
|
case 4 /* Setter */:
|
12235
|
-
case
|
12236
|
-
case
|
12290
|
+
case 12 /* Package */:
|
12291
|
+
case 11 /* TypeExtension */:
|
12237
12292
|
return void 0;
|
12238
12293
|
default:
|
12239
12294
|
Debug.never(entity);
|
@@ -12241,7 +12296,7 @@ var EntityFinder = class {
|
|
12241
12296
|
}
|
12242
12297
|
findVariableEntity(entity) {
|
12243
12298
|
if (entity.subkind === "package") {
|
12244
|
-
return this._packageEntity.getMembers().getNamedMembersByName(this.getEntityName(entity)).at(0)
|
12299
|
+
return this._packageEntity.getMembers().getNamedMembersByName(this.getEntityName(entity)).at(0);
|
12245
12300
|
} else if (entity.subkind === "type") {
|
12246
12301
|
const containingType = this.findEntity(entity.getContainer().getEntity());
|
12247
12302
|
if (containingType !== void 0 && isTypeEntity(containingType) && isTypeEntityWithMembers(containingType)) {
|
@@ -12262,7 +12317,7 @@ var EntityFinder = class {
|
|
12262
12317
|
findMethodEntity(entity) {
|
12263
12318
|
switch (entity.subkind) {
|
12264
12319
|
case "package": {
|
12265
|
-
const members = this._packageEntity.getMembers().getNamedMembersByName(this.getEntityName(entity)).filter((m) => m.kind ===
|
12320
|
+
const members = this._packageEntity.getMembers().getNamedMembersByName(this.getEntityName(entity)).filter((m) => m.kind === 1 /* Method */);
|
12266
12321
|
if (members.length === 0) {
|
12267
12322
|
return void 0;
|
12268
12323
|
} else if (members.length === 1) {
|
@@ -12282,7 +12337,7 @@ var EntityFinder = class {
|
|
12282
12337
|
if (!(containingType !== void 0 && isTypeEntity(containingType) && isTypeEntityWithMembers(containingType))) {
|
12283
12338
|
return void 0;
|
12284
12339
|
}
|
12285
|
-
const members = containingType.getMembers().getNamedMembersByName(this.getEntityName(entity)).filter((m) => m.kind ===
|
12340
|
+
const members = containingType.getMembers().getNamedMembersByName(this.getEntityName(entity)).filter((m) => m.kind === 1 /* Method */);
|
12286
12341
|
if (members.length === 0) {
|
12287
12342
|
return void 0;
|
12288
12343
|
} else if (members.length === 1) {
|
@@ -12385,13 +12440,6 @@ var EntityFinder = class {
|
|
12385
12440
|
return void 0;
|
12386
12441
|
}
|
12387
12442
|
}
|
12388
|
-
findVariantEntity(entity) {
|
12389
|
-
const containingType = this.findEntity(entity.getContainingEntity());
|
12390
|
-
if (!(containingType !== void 0 && containingType.kind === 2 /* VariantType */)) {
|
12391
|
-
return void 0;
|
12392
|
-
}
|
12393
|
-
return containingType.getVariants().getByName(this.getEntityName(entity))[0];
|
12394
|
-
}
|
12395
12443
|
findTypeParameterEntity(entity) {
|
12396
12444
|
const containingEntity = this.findEntity(entity.getContainingEntity());
|
12397
12445
|
const index = entity.getContainingEntity().getTypeParameters().indexOf(entity);
|
@@ -12402,34 +12450,33 @@ var EntityFinder = class {
|
|
12402
12450
|
}
|
12403
12451
|
}
|
12404
12452
|
findPackageTypeEntityByNameAndArity(name, arity) {
|
12405
|
-
return this._packageEntity.getMembers().getNamedMembersByName(name).filter((m) => m.kind ===
|
12453
|
+
return this._packageEntity.getMembers().getNamedMembersByName(name).filter((m) => m.kind === 2 /* Type */).find((m) => m.getArity() === arity);
|
12406
12454
|
}
|
12407
12455
|
ifEntityWithParametersThenParameters(entity) {
|
12408
12456
|
switch (entity.kind) {
|
12409
|
-
case
|
12457
|
+
case 1 /* Method */:
|
12410
12458
|
return entity.getValueParameters();
|
12411
|
-
case
|
12459
|
+
case 5 /* Indexer */:
|
12412
12460
|
return entity.getValueParameters();
|
12413
|
-
case
|
12461
|
+
case 7 /* Constructor */:
|
12414
12462
|
return entity.getValueParameters();
|
12415
|
-
case
|
12463
|
+
case 8 /* Destructor */:
|
12416
12464
|
return entity.getValueParameters();
|
12417
|
-
case
|
12418
|
-
|
12419
|
-
|
12465
|
+
case 2 /* Type */: {
|
12466
|
+
if (entity.typeEntityKind === 0 /* Method */) {
|
12467
|
+
return entity.getValueParameters();
|
12468
|
+
}
|
12469
|
+
return void 0;
|
12470
|
+
}
|
12471
|
+
case 9 /* Operator */:
|
12420
12472
|
return entity.getValueParameters();
|
12421
12473
|
case 0 /* Variable */:
|
12422
|
-
case 1 /* Variant */:
|
12423
|
-
case 2 /* VariantType */:
|
12424
12474
|
case 3 /* Getter */:
|
12425
12475
|
case 4 /* Setter */:
|
12426
|
-
case
|
12427
|
-
case 12 /*
|
12428
|
-
case
|
12429
|
-
case
|
12430
|
-
case 16 /* Package */:
|
12431
|
-
case 17 /* TypeExtension */:
|
12432
|
-
case 8 /* DereferenceOperator */:
|
12476
|
+
case 10 /* PackageAlias */:
|
12477
|
+
case 12 /* Package */:
|
12478
|
+
case 11 /* TypeExtension */:
|
12479
|
+
case 6 /* DereferenceOperator */:
|
12433
12480
|
return void 0;
|
12434
12481
|
default:
|
12435
12482
|
Debug.never(entity);
|
@@ -12437,29 +12484,25 @@ var EntityFinder = class {
|
|
12437
12484
|
}
|
12438
12485
|
ifEntityWithTypeParametersThenParameters(entity) {
|
12439
12486
|
switch (entity.kind) {
|
12440
|
-
case
|
12487
|
+
case 1 /* Method */:
|
12441
12488
|
return entity.getTypeParameters();
|
12442
|
-
case
|
12443
|
-
|
12444
|
-
|
12445
|
-
|
12446
|
-
|
12447
|
-
|
12448
|
-
case
|
12449
|
-
|
12450
|
-
case
|
12451
|
-
case
|
12452
|
-
case 7 /* Indexer */:
|
12453
|
-
case 8 /* DereferenceOperator */:
|
12489
|
+
case 2 /* Type */: {
|
12490
|
+
if (entity.typeEntityKind !== 2 /* Parameter */) {
|
12491
|
+
return entity.getTypeParameters();
|
12492
|
+
}
|
12493
|
+
return void 0;
|
12494
|
+
}
|
12495
|
+
case 8 /* Destructor */:
|
12496
|
+
case 7 /* Constructor */:
|
12497
|
+
case 5 /* Indexer */:
|
12498
|
+
case 6 /* DereferenceOperator */:
|
12454
12499
|
case 0 /* Variable */:
|
12455
|
-
case 1 /* Variant */:
|
12456
12500
|
case 3 /* Getter */:
|
12457
12501
|
case 4 /* Setter */:
|
12458
|
-
case
|
12459
|
-
case
|
12460
|
-
case
|
12461
|
-
case
|
12462
|
-
case 15 /* Operator */:
|
12502
|
+
case 10 /* PackageAlias */:
|
12503
|
+
case 12 /* Package */:
|
12504
|
+
case 11 /* TypeExtension */:
|
12505
|
+
case 9 /* Operator */:
|
12463
12506
|
return void 0;
|
12464
12507
|
default:
|
12465
12508
|
Debug.never(entity);
|
@@ -12586,7 +12629,7 @@ var LanguageServer = class {
|
|
12586
12629
|
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.");
|
12587
12630
|
const initializeStartTime = performance.now();
|
12588
12631
|
this._clientCapabilities = params.capabilities;
|
12589
|
-
setUserLocale("
|
12632
|
+
setUserLocale(params.initializationOptions?.localeOverride ?? params.locale ?? "en");
|
12590
12633
|
let workspaceFolderUris;
|
12591
12634
|
if (params.initializationOptions?.workspaceFoldersOverride !== void 0) {
|
12592
12635
|
workspaceFolderUris = params.initializationOptions.workspaceFoldersOverride.map((f) => this.convertVscodeUriToUri(URI2.parse(f.uri)));
|
@@ -13726,7 +13769,7 @@ ${e}`);
|
|
13726
13769
|
}
|
13727
13770
|
};
|
13728
13771
|
__decorateClass([
|
13729
|
-
|
13772
|
+
atomicBlock6
|
13730
13773
|
], LanguageServer.prototype, "onDidChangeWorkspaceFolders", 1);
|
13731
13774
|
var FileSystemSynchronizationMode;
|
13732
13775
|
((FileSystemSynchronizationMode2) => {
|