@artel/artc 0.6.25216 → 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 +12 -50
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +1056 -1060
- package/build/{chunk-6RYP5SET.js → chunk-FI6LW2RD.js} +5 -4
- package/build/{chunk-TJG64G2K.js → chunk-SK7ZBC3X.js} +16737 -15766
- package/build/{chunk-O7AXOZXA.js → chunk-TQDMVKTN.js} +13 -5
- package/build/types/analysis/AnalyzedTranslationPackage.d.ts +4 -26
- package/build/types/analysis/Analyzer.d.ts +162 -200
- package/build/types/analysis/{CallArgumentToParameterMatchResult.d.ts → ArgumentToParameterMatchResult.d.ts} +6 -7
- 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 +3 -0
- package/build/types/analysis/FindModifier.d.ts +2 -0
- package/build/types/analysis/IdentifierExpressionMeaning.d.ts +14 -12
- package/build/types/analysis/IndexedAccessExpressionMeaning.d.ts +12 -7
- 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 -89
- 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 +111 -103
- package/build/types/emitter/{EmitterGeneratedDeclarationKind.d.ts → EmitPhaseName.d.ts} +1 -44
- package/build/types/emitter/EmitterContext.d.ts +13 -1
- package/build/types/emitter/Entities.d.ts +58 -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 -5
- package/build/types/emitter/Transformer.d.ts +20 -13
- package/build/types/emitter/ir/EmitOptions.d.ts +163 -0
- package/build/types/emitter/ir/Nodes.d.ts +213 -185
- package/build/types/emitter/ir/index.d.ts +1 -2
- package/build/types/emitter/ir/types.d.ts +4 -3
- package/build/types/entities/AliasTypeEntity.d.ts +9 -5
- package/build/types/entities/ConstructorEntity.d.ts +2 -0
- package/build/types/entities/DereferenceOperatorEntity.d.ts +9 -0
- 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 +9 -0
- package/build/types/entities/MethodEntity.d.ts +9 -5
- package/build/types/entities/MethodTypeEntity.d.ts +18 -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 +22 -9
- 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 +12 -7
- package/build/types/entities/VariableEntity.d.ts +50 -41
- package/build/types/entities/VariantTypeEntity.d.ts +18 -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/parser/Scanner.d.ts +0 -6
- package/build/types/parser/UnescapeText.d.ts +1 -1
- 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 +218 -163
- package/build/types/services/NodeSemanticInfo.d.ts +7 -5
- package/build/types/services/signature-help/SignatureWithValueParameters.d.ts +8 -24
- 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 +37 -39
- package/build/types/tree/green/Nodes.d.ts +57 -80
- 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 -93
- package/build/types/ts-interop/Entities.d.ts +77 -34
- package/build/types/ts-interop/TsPackageMembersCreator.d.ts +0 -1
- package/build/types/types/MethodType.d.ts +2 -2
- package/build/types/types/TypeMembers.d.ts +9 -0
- package/build/types/types/VariantType.d.ts +2 -2
- 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 -34
- package/build/types/emitter/ir/LoweringState.d.ts +0 -25
- 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";
|
@@ -302,7 +300,7 @@ var AddPropertyAssignmentService = class {
|
|
302
300
|
let result;
|
303
301
|
let leftValueText;
|
304
302
|
if (propertyName !== void 0) {
|
305
|
-
if (assignmentNode.left.kind !==
|
303
|
+
if (assignmentNode.left.kind !== 78 /* PropertyAccessExpression */) {
|
306
304
|
return void 0;
|
307
305
|
}
|
308
306
|
const propertyReceiver = assignmentNode.left.expression;
|
@@ -367,12 +365,13 @@ var AddPropertyAssignmentService = class {
|
|
367
365
|
case 56 /* TypeVariableSetterDeclaration */:
|
368
366
|
case 58 /* NestedMethodDeclaration */:
|
369
367
|
case 67 /* MethodBlockLiteral */:
|
370
|
-
case
|
368
|
+
case 74 /* MethodLiteral */:
|
371
369
|
case 53 /* OperatorDeclaration */:
|
372
370
|
return void 0;
|
373
|
-
case
|
371
|
+
case 98 /* RunStatement */:
|
374
372
|
return this.ifShouldBeAssignedAtTheEndOfSubprogramThenBody(parent);
|
375
|
-
case
|
373
|
+
case 99 /* TryStatement */:
|
374
|
+
case 100 /* CatchClause */:
|
376
375
|
case 102 /* FinallyClause */:
|
377
376
|
case 107 /* ForStatement */:
|
378
377
|
case 108 /* IfStatement */:
|
@@ -414,7 +413,7 @@ function isSubprogramDeclaration(node) {
|
|
414
413
|
case 56 /* TypeVariableSetterDeclaration */:
|
415
414
|
case 58 /* NestedMethodDeclaration */:
|
416
415
|
case 67 /* MethodBlockLiteral */:
|
417
|
-
case
|
416
|
+
case 74 /* MethodLiteral */:
|
418
417
|
return true;
|
419
418
|
default:
|
420
419
|
Debug.typeIsAssignableTo();
|
@@ -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) {
|
@@ -2032,19 +1994,18 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
2032
1994
|
[54 /* TypeVariableDeclaration */]: this.prototype.writeTypeVariableDeclaration,
|
2033
1995
|
[55 /* TypeVariableGetterDeclaration */]: this.prototype.writeTypeVariableGetterDeclaration,
|
2034
1996
|
[56 /* TypeVariableSetterDeclaration */]: this.prototype.writeTypeVariableSetterDeclaration,
|
2035
|
-
[
|
1997
|
+
[93 /* StatementBlock */]: this.prototype.writeStatementBlock,
|
2036
1998
|
[133 /* QualifiedName */]: this.prototype.writeQualifiedName,
|
2037
1999
|
[140 /* VariantDeclaration */]: this.prototype.writeVariantDeclaration,
|
2038
2000
|
[141 /* TypeParameterDeclaration */]: this.prototype.writeTypeParameterDeclaration,
|
2039
2001
|
[142 /* ParameterDeclaration */]: this.prototype.writeParameterDeclaration,
|
2040
|
-
[143 /*
|
2002
|
+
[143 /* Argument */]: this.prototype.writeArgument,
|
2041
2003
|
[145 /* Tag */]: this.prototype.writeTag,
|
2042
2004
|
[147 /* Modifier */]: this.prototype.writeModifier,
|
2043
2005
|
[148 /* ParameterClause */]: this.prototype.writeParameterClause,
|
2044
2006
|
[149 /* ParameterList */]: this.prototype.writeParameterList,
|
2045
|
-
[150 /*
|
2046
|
-
[152 /*
|
2047
|
-
[154 /* TypeParameterClause */]: this.prototype.writeTypeParameterClause,
|
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,38 +2033,38 @@ 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
|
-
[71 /*
|
2079
|
-
[72 /*
|
2080
|
-
[73 /*
|
2081
|
-
[74 /*
|
2082
|
-
[75 /*
|
2083
|
-
[76 /*
|
2084
|
-
[77 /*
|
2085
|
-
[78 /*
|
2086
|
-
[79 /*
|
2087
|
-
[80 /*
|
2088
|
-
[81 /*
|
2089
|
-
[82 /*
|
2090
|
-
[83 /*
|
2091
|
-
[84 /*
|
2092
|
-
[85 /*
|
2093
|
-
[86 /*
|
2094
|
-
[87 /*
|
2095
|
-
[88 /*
|
2096
|
-
[89 /*
|
2097
|
-
[90 /*
|
2098
|
-
[91 /*
|
2099
|
-
[92 /*
|
2100
|
-
[
|
2101
|
-
[95 /*
|
2102
|
-
[96 /*
|
2103
|
-
[97 /*
|
2104
|
-
[98 /*
|
2105
|
-
[99 /*
|
2106
|
-
[100 /*
|
2039
|
+
[71 /* IndexedAccessExpression */]: this.prototype.writeNodeDefault,
|
2040
|
+
[72 /* InvalidExpression */]: this.prototype.writeNodeDefault,
|
2041
|
+
[73 /* IsExpression */]: this.prototype.writeNodeDefault,
|
2042
|
+
[74 /* MethodLiteral */]: this.prototype.writeNodeDefault,
|
2043
|
+
[75 /* ParenthesizedExpression */]: this.prototype.writeNodeDefault,
|
2044
|
+
[76 /* WhenTernaryExpression */]: this.prototype.writeNodeDefault,
|
2045
|
+
[77 /* PrefixUnaryExpression */]: this.prototype.writeNodeDefault,
|
2046
|
+
[78 /* PropertyAccessExpression */]: this.prototype.writeNodeDefault,
|
2047
|
+
[79 /* ReferenceExpression */]: this.prototype.writeNodeDefault,
|
2048
|
+
[80 /* DereferenceExpression */]: this.prototype.writeNodeDefault,
|
2049
|
+
[81 /* TextTemplateLiteral */]: this.prototype.writeNodeDefault,
|
2050
|
+
[82 /* TextTemplateSpanList */]: this.prototype.writeNodeDefault,
|
2051
|
+
[83 /* TextTemplateSpan */]: this.prototype.writeNodeDefault,
|
2052
|
+
[84 /* TokenExpression */]: this.prototype.writeNodeDefault,
|
2053
|
+
[85 /* KeywordExpression */]: this.prototype.writeNodeDefault,
|
2054
|
+
[86 /* ObjectExpression */]: this.prototype.writeNodeDefault,
|
2055
|
+
[87 /* BaseExpression */]: this.prototype.writeNodeDefault,
|
2056
|
+
[88 /* IdentifierExpression */]: this.prototype.writeNodeDefault,
|
2057
|
+
[89 /* GenericSpecializationExpression */]: this.prototype.writeNodeDefault,
|
2058
|
+
[90 /* DefaultMatchExpression */]: this.prototype.writeNodeDefault,
|
2059
|
+
[91 /* AssignmentStatement */]: this.prototype.writeNodeDefault,
|
2060
|
+
[92 /* StatementList */]: this.prototype.writeNodeDefault,
|
2061
|
+
[94 /* BreakLoopStatement */]: this.prototype.writeNodeDefault,
|
2062
|
+
[95 /* ContinueLoopStatement */]: this.prototype.writeNodeDefault,
|
2063
|
+
[96 /* DisposeStatement */]: this.prototype.writeNodeDefault,
|
2064
|
+
[97 /* RunStatementClauseList */]: this.prototype.writeNodeDefault,
|
2065
|
+
[98 /* RunStatement */]: this.prototype.writeNodeDefault,
|
2066
|
+
[99 /* TryStatement */]: this.prototype.writeNodeDefault,
|
2067
|
+
[100 /* CatchClause */]: this.prototype.writeNodeDefault,
|
2107
2068
|
[101 /* ErrorVariableDeclaration */]: this.prototype.writeNodeDefault,
|
2108
2069
|
[102 /* FinallyClause */]: this.prototype.writeNodeDefault,
|
2109
2070
|
[103 /* EmptyStatement */]: this.prototype.writeNodeDefault,
|
@@ -2144,10 +2105,9 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
2144
2105
|
[139 /* TextTemplateLiteralTranslation */]: this.prototype.writeNodeDefault,
|
2145
2106
|
[144 /* TagList */]: this.prototype.writeNodeDefault,
|
2146
2107
|
[146 /* ModifierList */]: this.prototype.writeNodeDefault,
|
2147
|
-
[151 /*
|
2148
|
-
[153 /*
|
2149
|
-
[
|
2150
|
-
[156 /* TypeAnnotation */]: this.prototype.writeNodeDefault
|
2108
|
+
[151 /* TypeArgumentList */]: this.prototype.writeNodeDefault,
|
2109
|
+
[153 /* TypeParameterList */]: this.prototype.writeNodeDefault,
|
2110
|
+
[154 /* TypeAnnotation */]: this.prototype.writeNodeDefault
|
2151
2111
|
};
|
2152
2112
|
return writeFunctions;
|
2153
2113
|
}
|
@@ -2158,14 +2118,14 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
2158
2118
|
}
|
2159
2119
|
};
|
2160
2120
|
var modifierSortOrder = {
|
2161
|
-
[
|
2162
|
-
[
|
2163
|
-
[
|
2164
|
-
[
|
2165
|
-
[
|
2166
|
-
[
|
2167
|
-
[
|
2168
|
-
[
|
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
|
2169
2129
|
};
|
2170
2130
|
|
2171
2131
|
// source/services/TreeUtils.ts
|
@@ -2521,17 +2481,6 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2521
2481
|
result.push(indexer);
|
2522
2482
|
}
|
2523
2483
|
}
|
2524
|
-
if (entity.kind === 2 /* VariantType */) {
|
2525
|
-
const translatedVariants = new Set(this._translationPackage.getVariants(entity)?.get().map((m) => m.value));
|
2526
|
-
for (const variant of entity.getVariants().get()) {
|
2527
|
-
if (variant.isHidden() !== void 0) {
|
2528
|
-
continue;
|
2529
|
-
}
|
2530
|
-
if (!translatedVariants.has(variant)) {
|
2531
|
-
result.push(variant);
|
2532
|
-
}
|
2533
|
-
}
|
2534
|
-
}
|
2535
2484
|
return result;
|
2536
2485
|
}
|
2537
2486
|
detectIndentationForPackageMemberTranslations(translationsDeclaration) {
|
@@ -2587,14 +2536,14 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2587
2536
|
}
|
2588
2537
|
collectNotTranslatedPackageMembers() {
|
2589
2538
|
const result = new Array();
|
2590
|
-
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));
|
2591
2540
|
const membersOfTargetPackage = this._translationPackage.getTranslatedPackage().getMembers();
|
2592
2541
|
for (const member of membersOfTargetPackage.getNamedMembers()) {
|
2593
2542
|
if (member.isHidden() !== void 0) {
|
2594
2543
|
continue;
|
2595
2544
|
}
|
2596
|
-
if (!translatedPackageMembers.has(member
|
2597
|
-
result.push(member
|
2545
|
+
if (!translatedPackageMembers.has(member)) {
|
2546
|
+
result.push(member);
|
2598
2547
|
}
|
2599
2548
|
}
|
2600
2549
|
return result;
|
@@ -2603,15 +2552,15 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2603
2552
|
switch (entity.kind) {
|
2604
2553
|
case 0 /* Variable */:
|
2605
2554
|
return this.createPackageVariableTranslation(entity);
|
2606
|
-
case
|
2555
|
+
case 1 /* Method */:
|
2607
2556
|
return this.createPackageMethodTranslation(entity);
|
2608
|
-
case 2 /*
|
2609
|
-
|
2610
|
-
|
2611
|
-
|
2612
|
-
|
2613
|
-
|
2614
|
-
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 */:
|
2615
2564
|
return void 0;
|
2616
2565
|
default:
|
2617
2566
|
Debug.never(entity);
|
@@ -2643,17 +2592,15 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2643
2592
|
switch (entity.kind) {
|
2644
2593
|
case 0 /* Variable */:
|
2645
2594
|
return this.createTypeVariableTranslation(entity);
|
2646
|
-
case
|
2595
|
+
case 1 /* Method */:
|
2647
2596
|
return this.createTypeMethodTranslation(entity);
|
2648
|
-
case
|
2597
|
+
case 7 /* Constructor */:
|
2649
2598
|
return this.createConstructorTranslation(entity);
|
2650
|
-
case
|
2599
|
+
case 5 /* Indexer */:
|
2651
2600
|
return this.createIndexerTranslation(entity);
|
2652
|
-
case
|
2653
|
-
|
2654
|
-
case
|
2655
|
-
case 10 /* Destructor */:
|
2656
|
-
case 15 /* Operator */:
|
2601
|
+
case 6 /* DereferenceOperator */:
|
2602
|
+
case 8 /* Destructor */:
|
2603
|
+
case 9 /* Operator */:
|
2657
2604
|
return void 0;
|
2658
2605
|
default:
|
2659
2606
|
Debug.never(entity);
|
@@ -2677,10 +2624,6 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2677
2624
|
const parameters = entity.getValueParameters().map((p) => this.getNameText(p.getName()));
|
2678
2625
|
return SyntaxFactory.indexerTranslation(parameters, parameters);
|
2679
2626
|
}
|
2680
|
-
createVariantTranslation(entity) {
|
2681
|
-
const name = this.getNameText(entity.getName());
|
2682
|
-
return SyntaxFactory.typeVariableOrVariantTranslation(name, name);
|
2683
|
-
}
|
2684
2627
|
getNameText(name) {
|
2685
2628
|
const flags = name.flags & ~16 /* ConflictResolvingParameterName */;
|
2686
2629
|
return name.getPreferredUnescapedOriginal(flags);
|
@@ -2740,7 +2683,7 @@ var CodeActionsService = class {
|
|
2740
2683
|
}
|
2741
2684
|
const result = new Array();
|
2742
2685
|
const diagnosticCodeSet = new Set(diagnosticCodes);
|
2743
|
-
if (diagnosticCodeSet.has(
|
2686
|
+
if (diagnosticCodeSet.has(104 /* TheFollowingDeclarationsAreNotTranslated0 */) || diagnosticCodeSet.has(105 /* TheFollowingDeclarationAreNotTranslated0And1More */)) {
|
2744
2687
|
const data = { onlyTypeMembers: false };
|
2745
2688
|
result.push(CodeAction.unresolved(
|
2746
2689
|
"\u0421\u0433\u0435\u043D\u0435\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043D\u0435\u0434\u043E\u0441\u0442\u0430\u044E\u0449\u0438\u0435 \u043F\u0435\u0440\u0435\u0432\u043E\u0434\u044B.",
|
@@ -2799,56 +2742,38 @@ function isGenerateMissingTranslationsCodeActionData(value) {
|
|
2799
2742
|
|
2800
2743
|
// source/services/signature-help/SignatureWithValueParameters.ts
|
2801
2744
|
var ValueArgumentFactory = class _ValueArgumentFactory {
|
2802
|
-
static {
|
2803
|
-
this.createValueArgumentFromCallArgument = (argument) => new ValueArgument(argument.name?.value, argument.value);
|
2804
|
-
}
|
2805
|
-
static {
|
2806
|
-
this.createValueArgumentFromIndexerArgument = (argument) => new ValueArgument(void 0, argument);
|
2807
|
-
}
|
2808
2745
|
static createValueArgumentsOfCallExpression(node) {
|
2809
|
-
return _ValueArgumentFactory.
|
2810
|
-
node.callArgumentList.elements,
|
2811
|
-
_ValueArgumentFactory.createValueArgumentFromCallArgument
|
2812
|
-
);
|
2746
|
+
return _ValueArgumentFactory.createValueArgumentsFromList(node.argumentList);
|
2813
2747
|
}
|
2814
2748
|
static createValueArgumentsOfAutotypeCallExpression(node) {
|
2815
|
-
return _ValueArgumentFactory.
|
2816
|
-
node.callArgumentList.elements,
|
2817
|
-
_ValueArgumentFactory.createValueArgumentFromCallArgument
|
2818
|
-
);
|
2749
|
+
return _ValueArgumentFactory.createValueArgumentsFromList(node.argumentList);
|
2819
2750
|
}
|
2820
2751
|
static createValueArgumentsOfIndexedAccessExpression(node) {
|
2821
|
-
return _ValueArgumentFactory.
|
2822
|
-
node.argumentsList.elements,
|
2823
|
-
_ValueArgumentFactory.createValueArgumentFromIndexerArgument
|
2824
|
-
);
|
2752
|
+
return _ValueArgumentFactory.createValueArgumentsFromList(node.argumentList);
|
2825
2753
|
}
|
2826
2754
|
static createValueArgumentsOfTag(node) {
|
2827
|
-
if (node.
|
2828
|
-
return _ValueArgumentFactory.
|
2829
|
-
node.callArgumentList.elements,
|
2830
|
-
_ValueArgumentFactory.createValueArgumentFromCallArgument
|
2831
|
-
);
|
2755
|
+
if (node.argumentList !== void 0) {
|
2756
|
+
return _ValueArgumentFactory.createValueArgumentsFromList(node.argumentList);
|
2832
2757
|
}
|
2833
2758
|
return [];
|
2834
2759
|
}
|
2835
|
-
static
|
2760
|
+
static createValueArgumentsFromList(list) {
|
2836
2761
|
const result = new Array();
|
2837
2762
|
let previousElementIsArgument = false;
|
2838
|
-
for (const element of elements) {
|
2763
|
+
for (const element of list.elements) {
|
2839
2764
|
if (element.kind === 0 /* Token */) {
|
2840
2765
|
if (!previousElementIsArgument) {
|
2841
2766
|
result.push(new ValueArgument(void 0, void 0));
|
2842
2767
|
}
|
2843
2768
|
previousElementIsArgument = false;
|
2844
2769
|
} else {
|
2845
|
-
result.push(
|
2770
|
+
result.push(new ValueArgument(element.name?.value, element.value));
|
2846
2771
|
previousElementIsArgument = true;
|
2847
2772
|
}
|
2848
2773
|
}
|
2849
|
-
if (elements.length > 0 && elements[elements.length - 1].kind === 0 /* Token */) {
|
2774
|
+
if (list.elements.length > 0 && list.elements[list.elements.length - 1].kind === 0 /* Token */) {
|
2850
2775
|
result.push(new ValueArgument(void 0, void 0));
|
2851
|
-
} else if (elements.length === 0) {
|
2776
|
+
} else if (list.elements.length === 0) {
|
2852
2777
|
result.push(new ValueArgument(void 0, void 0));
|
2853
2778
|
}
|
2854
2779
|
return result;
|
@@ -2861,7 +2786,7 @@ var SignatureForNode = class _SignatureForNode {
|
|
2861
2786
|
return _SignatureForNode.getSignaturesForCallExpression(analyzer, node);
|
2862
2787
|
case 70 /* AutotypeCallExpression */:
|
2863
2788
|
return _SignatureForNode.getSignaturesForAutotypeCallExpression(analyzer, node);
|
2864
|
-
case
|
2789
|
+
case 71 /* IndexedAccessExpression */:
|
2865
2790
|
return _SignatureForNode.getSignaturesForIndexedAccessExpression(analyzer, node);
|
2866
2791
|
case 145 /* Tag */:
|
2867
2792
|
return _SignatureForNode.getSignaturesForTag(analyzer, node);
|
@@ -2885,16 +2810,7 @@ var SignatureForNode = class _SignatureForNode {
|
|
2885
2810
|
if (info.suitableMethods.length === 1) {
|
2886
2811
|
suitableSignatureIndex = info.candidates.indexOf(info.suitableMethods[0]);
|
2887
2812
|
}
|
2888
|
-
const signatures = info.candidates.map((c) =>
|
2889
|
-
switch (c.value.kind) {
|
2890
|
-
case "entity":
|
2891
|
-
return new MethodEntitySignature({ value: c.value.value, localization: c.localization });
|
2892
|
-
case "type-member":
|
2893
|
-
return new TypeMethodSignature({ value: c.value.value, localization: c.localization });
|
2894
|
-
case "substituted-method":
|
2895
|
-
return new SubstitutedMethodSignature({ value: c.value.value, localization: c.localization });
|
2896
|
-
}
|
2897
|
-
});
|
2813
|
+
const signatures = info.candidates.map((c) => new AccessedMethodSignature(c));
|
2898
2814
|
return new SignaturesWithSingleSuitable(signatures, suitableSignatureIndex);
|
2899
2815
|
}
|
2900
2816
|
if (meaning.kind === "object-method-call") {
|
@@ -2916,26 +2832,25 @@ var SignatureForNode = class _SignatureForNode {
|
|
2916
2832
|
return void 0;
|
2917
2833
|
}
|
2918
2834
|
static getSignaturesForIndexedAccessExpression(analyzer, node) {
|
2919
|
-
const meaning = analyzer.
|
2920
|
-
let indexer;
|
2835
|
+
const meaning = analyzer.resolveIndexedAccessExpression(node).meaning;
|
2921
2836
|
switch (meaning.kind) {
|
2922
|
-
case "resolved":
|
2923
|
-
|
2924
|
-
|
2837
|
+
case "resolved": {
|
2838
|
+
let suitableSignatureIndex;
|
2839
|
+
if (meaning.singleSuitableIndexer !== void 0) {
|
2840
|
+
suitableSignatureIndex = meaning.candidates.indexOf(meaning.singleSuitableIndexer);
|
2841
|
+
}
|
2842
|
+
const signatures = meaning.candidates.map((i) => new IndexerSignature(i));
|
2843
|
+
return new SignaturesWithSingleSuitable(signatures, suitableSignatureIndex);
|
2844
|
+
}
|
2925
2845
|
case "unresolved":
|
2926
|
-
|
2846
|
+
return void 0;
|
2927
2847
|
default:
|
2928
2848
|
Debug.never(meaning);
|
2929
2849
|
}
|
2930
|
-
if (indexer !== void 0) {
|
2931
|
-
const signature = new IndexerSignature(indexer);
|
2932
|
-
return new SignaturesWithSingleSuitable([signature], 0);
|
2933
|
-
}
|
2934
|
-
return void 0;
|
2935
2850
|
}
|
2936
2851
|
static getSignaturesForTag(analyzer, node) {
|
2937
|
-
const meaning = analyzer.
|
2938
|
-
if (meaning.kind === "
|
2852
|
+
const meaning = analyzer.resolveTag(node).meaning;
|
2853
|
+
if (meaning.kind === "tag-type") {
|
2939
2854
|
let suitableSignatureIndex;
|
2940
2855
|
if (meaning.suitableConstructors.length === 1) {
|
2941
2856
|
suitableSignatureIndex = meaning.candidates.indexOf(meaning.suitableConstructors[0]);
|
@@ -2943,6 +2858,14 @@ var SignatureForNode = class _SignatureForNode {
|
|
2943
2858
|
const signatures = meaning.candidates.map((c) => new ConstructorSignature(c));
|
2944
2859
|
return new SignaturesWithSingleSuitable(signatures, suitableSignatureIndex);
|
2945
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
|
+
}
|
2946
2869
|
if (meaning.kind === "unresolved") {
|
2947
2870
|
return void 0;
|
2948
2871
|
}
|
@@ -3003,7 +2926,7 @@ var SimplifiedOverloadResolver = class _SimplifiedOverloadResolver {
|
|
3003
2926
|
result = false;
|
3004
2927
|
break;
|
3005
2928
|
}
|
3006
|
-
if (argument.expression === void 0 || argument.expression.kind ===
|
2929
|
+
if (argument.expression === void 0 || argument.expression.kind === 72 /* InvalidExpression */) {
|
3007
2930
|
continue;
|
3008
2931
|
}
|
3009
2932
|
const targetParameterType = targetParameter.getType();
|
@@ -3051,47 +2974,9 @@ var MatchedSignature = class {
|
|
3051
2974
|
this.matchResult = matchResult;
|
3052
2975
|
}
|
3053
2976
|
};
|
3054
|
-
var
|
3055
|
-
constructor(method) {
|
3056
|
-
this.kind = "method-entity";
|
3057
|
-
this._valueParameters = new Cached();
|
3058
|
-
this.method = method;
|
3059
|
-
}
|
3060
|
-
getValueParameters() {
|
3061
|
-
return this._valueParameters.getOrInsertWith(() => {
|
3062
|
-
const localizedSignature = EntityLocalizationHelper.getLocalizedMethodSignature(
|
3063
|
-
this.method.value,
|
3064
|
-
this.method.localization
|
3065
|
-
);
|
3066
|
-
return Query.from(this.method.value.getValueParameters()).zip(
|
3067
|
-
localizedSignature.getValueParameterNames(),
|
3068
|
-
(p, n) => new UniversalValueParameter(n.value, p.getType(), p, n.localization)
|
3069
|
-
).toArray();
|
3070
|
-
});
|
3071
|
-
}
|
3072
|
-
};
|
3073
|
-
var TypeMethodSignature = class {
|
3074
|
-
constructor(method) {
|
3075
|
-
this.kind = "type-method";
|
3076
|
-
this._valueParameters = new Cached();
|
3077
|
-
this.method = method;
|
3078
|
-
}
|
3079
|
-
getValueParameters() {
|
3080
|
-
return this._valueParameters.getOrInsertWith(() => {
|
3081
|
-
const localizedSignature = EntityLocalizationHelper.getLocalizedMethodSignature(
|
3082
|
-
this.method.value.getEntity(),
|
3083
|
-
this.method.localization
|
3084
|
-
);
|
3085
|
-
return Query.from(this.method.value.getValueParameters()).zip(
|
3086
|
-
localizedSignature.getValueParameterNames(),
|
3087
|
-
(p, n) => new UniversalValueParameter(n.value, p.getType(), p.getEntity(), n.localization)
|
3088
|
-
).toArray();
|
3089
|
-
});
|
3090
|
-
}
|
3091
|
-
};
|
3092
|
-
var SubstitutedMethodSignature = class {
|
2977
|
+
var AccessedMethodSignature = class {
|
3093
2978
|
constructor(method) {
|
3094
|
-
this.kind = "
|
2979
|
+
this.kind = "accessed-method";
|
3095
2980
|
this._valueParameters = new Cached();
|
3096
2981
|
this.method = method;
|
3097
2982
|
}
|
@@ -3283,7 +3168,7 @@ var CompletionService = class {
|
|
3283
3168
|
return new OperatorNameCompletionContext(syntaxContext.isInQuotedIdentifier);
|
3284
3169
|
}
|
3285
3170
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3286
|
-
if (tokenOrKeyword.isKeyword(
|
3171
|
+
if (tokenOrKeyword.isKeyword(18 /* Import */) && tokenOrKeyword.parent.kind === 5 /* SinglePackageImportDirective */) {
|
3287
3172
|
return new PackageImportCompletionContext([], void 0);
|
3288
3173
|
}
|
3289
3174
|
if (tokenOrKeyword.isToken(57 /* Equals */) && tokenOrKeyword.parent.kind === 8 /* PackageImport */) {
|
@@ -3297,7 +3182,7 @@ var CompletionService = class {
|
|
3297
3182
|
if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 6 /* PackageGroupImportDirective */ || this.tokenOrKeywordIsPackageImportListChild(tokenOrKeyword)) {
|
3298
3183
|
return new PackageImportCompletionContext([], void 0);
|
3299
3184
|
}
|
3300
|
-
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind ===
|
3185
|
+
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 78 /* PropertyAccessExpression */) {
|
3301
3186
|
const propertyAccess = tokenOrKeyword.parent;
|
3302
3187
|
{
|
3303
3188
|
const info = this._analyzer.checkExpressionDenotesPackageNameSegment(propertyAccess.expression);
|
@@ -3346,7 +3231,7 @@ var CompletionService = class {
|
|
3346
3231
|
);
|
3347
3232
|
if (segmentIndex < resolutionResult.resolvedQualifiers.length) {
|
3348
3233
|
let completionInIsOrAsExpressionInfo;
|
3349
|
-
if (namedTypeSpecifier.parent.kind ===
|
3234
|
+
if (namedTypeSpecifier.parent.kind === 73 /* IsExpression */ || namedTypeSpecifier.parent.kind === 65 /* AsExpression */) {
|
3350
3235
|
completionInIsOrAsExpressionInfo = {
|
3351
3236
|
expressionType: this._analyzer.type.ofExpression(namedTypeSpecifier.parent.expression)
|
3352
3237
|
};
|
@@ -3380,9 +3265,45 @@ var CompletionService = class {
|
|
3380
3265
|
}
|
3381
3266
|
return { kind: "none" };
|
3382
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
|
+
}
|
3383
3304
|
if (syntaxContext.isUnqualifiedTypeContext !== void 0) {
|
3384
3305
|
let completionInIsOrAsExpressionInfo;
|
3385
|
-
if (tokenOrKeyword.parent.kind ===
|
3306
|
+
if (tokenOrKeyword.parent.kind === 73 /* IsExpression */ || tokenOrKeyword.parent.kind === 65 /* AsExpression */) {
|
3386
3307
|
completionInIsOrAsExpressionInfo = {
|
3387
3308
|
expressionType: this._analyzer.type.ofExpression(tokenOrKeyword.parent.expression)
|
3388
3309
|
};
|
@@ -3391,6 +3312,11 @@ var CompletionService = class {
|
|
3391
3312
|
const typeSearchLocation = new ScopeTypeSearchLocation(lookup);
|
3392
3313
|
return new TypeCompletionContext(typeSearchLocation, completionInIsOrAsExpressionInfo);
|
3393
3314
|
}
|
3315
|
+
if (syntaxContext.isUnqualifiedTagNameCompletionContext) {
|
3316
|
+
const lookup = semanticContext.getScopeLookup();
|
3317
|
+
const typeSearchLocation = new ScopeTypeSearchLocation(lookup);
|
3318
|
+
return new TagCompletionContext(typeSearchLocation);
|
3319
|
+
}
|
3394
3320
|
if (syntaxContext.isExpressionContext !== void 0) {
|
3395
3321
|
const lookup = semanticContext.getScopeLookup();
|
3396
3322
|
const { targetTypes, targetSignaturesParameters } = this.getTargetTypesAndTargetSignaturesParameters(syntaxContext.isExpressionContext.expressionRole, semanticContext);
|
@@ -3432,17 +3358,17 @@ var CompletionService = class {
|
|
3432
3358
|
translationKind = 0 /* Any */;
|
3433
3359
|
hasPrecedingKeyword = false;
|
3434
3360
|
}
|
3435
|
-
if (tokenOrKeyword.isKeyword(
|
3361
|
+
if (tokenOrKeyword.isKeyword(18 /* Import */) && tokenOrKeyword.parent.kind === 132 /* PackageImportTranslation */) {
|
3436
3362
|
translationsDeclaration = tokenOrKeyword.parent.parent.parent;
|
3437
3363
|
translationKind = 1 /* PackageImport */;
|
3438
3364
|
hasPrecedingKeyword = true;
|
3439
3365
|
}
|
3440
|
-
if (tokenOrKeyword.isKeyword(
|
3366
|
+
if (tokenOrKeyword.isKeyword(16 /* Type */) && (tokenOrKeyword.parent.kind === 137 /* TypeTranslation */ || tokenOrKeyword.parent.kind === 131 /* MethodTypeTranslation */)) {
|
3441
3367
|
translationsDeclaration = tokenOrKeyword.parent.parent.parent;
|
3442
3368
|
translationKind = 3 /* Type */;
|
3443
3369
|
hasPrecedingKeyword = true;
|
3444
3370
|
}
|
3445
|
-
if (tokenOrKeyword.isKeyword(
|
3371
|
+
if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 129 /* PackageMethodTranslation */) {
|
3446
3372
|
translationsDeclaration = tokenOrKeyword.parent.parent.parent;
|
3447
3373
|
translationKind = 2 /* Method */;
|
3448
3374
|
hasPrecedingKeyword = true;
|
@@ -3489,12 +3415,12 @@ var CompletionService = class {
|
|
3489
3415
|
translationKind = 0 /* Any */;
|
3490
3416
|
hasPrecedingKeyword = false;
|
3491
3417
|
}
|
3492
|
-
if (tokenOrKeyword.isKeyword(
|
3418
|
+
if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 130 /* TypeMethodTranslation */) {
|
3493
3419
|
typeTranslation = tokenOrKeyword.parent.parent.parent;
|
3494
3420
|
translationKind = 1 /* Method */;
|
3495
3421
|
hasPrecedingKeyword = true;
|
3496
3422
|
}
|
3497
|
-
if (tokenOrKeyword.isKeyword(
|
3423
|
+
if (tokenOrKeyword.isKeyword(29 /* Creation */) && tokenOrKeyword.parent.kind === 124 /* ConstructorTranslation */) {
|
3498
3424
|
typeTranslation = tokenOrKeyword.parent.parent.parent;
|
3499
3425
|
translationKind = 3 /* Constructor */;
|
3500
3426
|
hasPrecedingKeyword = true;
|
@@ -3538,6 +3464,15 @@ var CompletionService = class {
|
|
3538
3464
|
signatures = SignatureForNode.getSignaturesForTag(this._analyzer, role.argumentList.parent);
|
3539
3465
|
valueArguments = ValueArgumentFactory.createValueArgumentsOfTag(role.argumentList.parent);
|
3540
3466
|
break;
|
3467
|
+
case 71 /* IndexedAccessExpression */:
|
3468
|
+
signatures = SignatureForNode.getSignaturesForIndexedAccessExpression(
|
3469
|
+
this._analyzer,
|
3470
|
+
role.argumentList.parent
|
3471
|
+
);
|
3472
|
+
valueArguments = ValueArgumentFactory.createValueArgumentsOfIndexedAccessExpression(role.argumentList.parent);
|
3473
|
+
break;
|
3474
|
+
default:
|
3475
|
+
Debug.never(role.argumentList.parent);
|
3541
3476
|
}
|
3542
3477
|
if (signatures !== void 0) {
|
3543
3478
|
return this.getTargetTypesAndTargetSignaturesParametersFromSignatures(
|
@@ -3549,22 +3484,6 @@ var CompletionService = class {
|
|
3549
3484
|
return { targetTypes: void 0, targetSignaturesParameters: void 0 };
|
3550
3485
|
}
|
3551
3486
|
}
|
3552
|
-
if (role.kind === "indexed-access-argument") {
|
3553
|
-
const signatures = SignatureForNode.getSignaturesForIndexedAccessExpression(
|
3554
|
-
this._analyzer,
|
3555
|
-
role.argumentList.parent
|
3556
|
-
);
|
3557
|
-
const valueArguments = ValueArgumentFactory.createValueArgumentsOfIndexedAccessExpression(role.argumentList.parent);
|
3558
|
-
if (signatures !== void 0) {
|
3559
|
-
return this.getTargetTypesAndTargetSignaturesParametersFromSignatures(
|
3560
|
-
signatures.values,
|
3561
|
-
valueArguments,
|
3562
|
-
role.index
|
3563
|
-
);
|
3564
|
-
} else {
|
3565
|
-
return { targetTypes: void 0, targetSignaturesParameters: void 0 };
|
3566
|
-
}
|
3567
|
-
}
|
3568
3487
|
if (role.kind === "array-element") {
|
3569
3488
|
let type = this._analyzer.type.ofExpression(role.array);
|
3570
3489
|
type = this._analyzer.excludeNoneFromType(type);
|
@@ -3639,6 +3558,9 @@ var CompletionService = class {
|
|
3639
3558
|
case "type":
|
3640
3559
|
result = this.getTypeCompletionItemInfos(completionContext);
|
3641
3560
|
break;
|
3561
|
+
case "tag":
|
3562
|
+
result = this.getTagCompletionItemInfos(completionContext);
|
3563
|
+
break;
|
3642
3564
|
case "expression":
|
3643
3565
|
result = this.getExpressionCompletionItemInfos(completionContext);
|
3644
3566
|
break;
|
@@ -3671,29 +3593,29 @@ var CompletionService = class {
|
|
3671
3593
|
}
|
3672
3594
|
const kinds = /* @__PURE__ */ new Set();
|
3673
3595
|
if (syntaxContext.isPackageMemberDeclarationListContext) {
|
3674
|
-
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 */);
|
3675
3597
|
}
|
3676
3598
|
if (syntaxContext.isPackageMemberDeclarationListContext || syntaxContext.isTypeMemberDeclarationListContext) {
|
3677
|
-
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 */);
|
3678
3600
|
}
|
3679
3601
|
if (syntaxContext.isTypeMemberDeclarationListContext) {
|
3680
|
-
kinds.add(
|
3602
|
+
kinds.add(29 /* Creation */).add(12 /* Function */).add(46 /* Destruction */).add(57 /* Get */).add(58 /* Set */);
|
3681
3603
|
}
|
3682
3604
|
if (syntaxContext.isStatementContext) {
|
3683
|
-
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 */);
|
3684
3606
|
}
|
3685
3607
|
if (this.isFromKeywordContext(positionDescription)) {
|
3686
|
-
kinds.add(
|
3608
|
+
kinds.add(9 /* From */);
|
3687
3609
|
}
|
3688
3610
|
if (syntaxContext.isExpressionContext !== void 0) {
|
3689
|
-
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 */);
|
3690
3612
|
if (positionDescription.kind === "after-token-or-keyword") {
|
3691
3613
|
const container = semanticContext.getContainingTypeOrTypeExtension();
|
3692
3614
|
if (container !== void 0) {
|
3693
3615
|
kinds.add(4 /* Object */);
|
3694
3616
|
if (container.kind === "type") {
|
3695
3617
|
const typeEntity = container.value;
|
3696
|
-
if (typeEntity?.
|
3618
|
+
if (typeEntity?.typeEntityKind === 1 /* Structured */ && typeEntity.getBaseObjectType() !== void 0 || typeEntity?.typeEntityKind === 3 /* Variant */ || typeEntity?.typeEntityKind === 4 /* Alias */) {
|
3697
3619
|
kinds.add(55 /* Base */);
|
3698
3620
|
}
|
3699
3621
|
}
|
@@ -3701,31 +3623,31 @@ var CompletionService = class {
|
|
3701
3623
|
}
|
3702
3624
|
}
|
3703
3625
|
if (this.isTypeKindCompletionContext(positionDescription)) {
|
3704
|
-
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 */);
|
3705
3627
|
}
|
3706
3628
|
if (this.isCaseKeywordContext(positionDescription, syntaxContext)) {
|
3707
|
-
kinds.add(
|
3629
|
+
kinds.add(44 /* Case */);
|
3708
3630
|
}
|
3709
3631
|
if (this.isRunStatementAccessorListContext(positionDescription)) {
|
3710
|
-
kinds.add(
|
3632
|
+
kinds.add(30 /* Catch */).add(20 /* Finally */);
|
3711
3633
|
}
|
3712
3634
|
if (this.isElseOrElseIfKeywordContext(positionDescription)) {
|
3713
|
-
kinds.add(
|
3635
|
+
kinds.add(10 /* Else */).add(11 /* ElseIf */);
|
3714
3636
|
}
|
3715
3637
|
if (syntaxContext.precedingExpression !== void 0) {
|
3716
|
-
kinds.add(
|
3638
|
+
kinds.add(41 /* As */).add(14 /* Is */).add(21 /* And */).add(22 /* Or */).add(23 /* Xor */).add(28 /* When */);
|
3717
3639
|
}
|
3718
3640
|
if (this.isModifierLevelContext(positionDescription)) {
|
3719
3641
|
kinds.add(50 /* InType */).add(47 /* InHierarchy */).add(48 /* InFile */).add(49 /* InPackage */);
|
3720
3642
|
}
|
3721
3643
|
if (this.isRepeatWhileKeywordContext(positionDescription)) {
|
3722
|
-
kinds.add(
|
3644
|
+
kinds.add(26 /* RepeatWhile */);
|
3723
3645
|
}
|
3724
3646
|
if (syntaxContext.isUnqualifiedTypeContext?.allowsAnonymousTypes === true) {
|
3725
|
-
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 */);
|
3726
3648
|
}
|
3727
|
-
if (positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isKeyword(
|
3728
|
-
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 */);
|
3729
3651
|
}
|
3730
3652
|
return Query.from(kinds.values()).map(
|
3731
3653
|
(k) => LocalizationHelper.localizeKeyword(k, this._locale, this._dialect).map((v) => new KeywordCompletionItemInfo(this.completionItemInfoContext, k, v))
|
@@ -3736,7 +3658,7 @@ var CompletionService = class {
|
|
3736
3658
|
return false;
|
3737
3659
|
}
|
3738
3660
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3739
|
-
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind ===
|
3661
|
+
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 114 /* LoopStatement */;
|
3740
3662
|
}
|
3741
3663
|
isModifierLevelContext(positionDescription) {
|
3742
3664
|
if (positionDescription.kind !== "after-token-or-keyword") {
|
@@ -3750,14 +3672,14 @@ var CompletionService = class {
|
|
3750
3672
|
return false;
|
3751
3673
|
}
|
3752
3674
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3753
|
-
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.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 */);
|
3754
3676
|
}
|
3755
3677
|
isRunStatementAccessorListContext(positionDescription) {
|
3756
3678
|
if (positionDescription.kind !== "after-token-or-keyword") {
|
3757
3679
|
return false;
|
3758
3680
|
}
|
3759
3681
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3760
|
-
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.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 */);
|
3761
3683
|
}
|
3762
3684
|
isTypeKindCompletionContext(positionDescription) {
|
3763
3685
|
return positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isToken(57 /* Equals */) && NodeTypeUtils.isPackageTypeDeclaration(positionDescription.tokenOrKeyword.parent);
|
@@ -3774,7 +3696,7 @@ var CompletionService = class {
|
|
3774
3696
|
return false;
|
3775
3697
|
}
|
3776
3698
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3777
|
-
if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind ===
|
3699
|
+
if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 119 /* SwitchStatementCaseClause */) {
|
3778
3700
|
return true;
|
3779
3701
|
}
|
3780
3702
|
if (syntaxContext.precedingExpression !== void 0 && syntaxContext.precedingExpression.parent.kind === 117 /* SwitchStatement */) {
|
@@ -3783,22 +3705,7 @@ var CompletionService = class {
|
|
3783
3705
|
return false;
|
3784
3706
|
}
|
3785
3707
|
getExpressionCompletionItemInfos(ctx) {
|
3786
|
-
let query =
|
3787
|
-
if (ctx.targetTypes !== void 0) {
|
3788
|
-
const variantType = this.getTargetVariantType(ctx.targetTypes);
|
3789
|
-
if (variantType !== void 0) {
|
3790
|
-
const variantLookup = new VariantLookup(variantType.getEntity(), ctx.localizationContext);
|
3791
|
-
query = query.chain(variantLookup.get().map(
|
3792
|
-
(v) => new VariantCompletionItemInfo(
|
3793
|
-
this.completionItemInfoContext,
|
3794
|
-
v.value,
|
3795
|
-
v.name,
|
3796
|
-
v.requiresExplicitOriginalName
|
3797
|
-
)
|
3798
|
-
).toArray());
|
3799
|
-
}
|
3800
|
-
}
|
3801
|
-
query = query.chain(this.getScopeCompletionItemInfos(ctx.lookup));
|
3708
|
+
let query = this.getScopeCompletionItemInfos(ctx.lookup);
|
3802
3709
|
if (ctx.targetSignaturesValueParameters !== void 0) {
|
3803
3710
|
query = query.chain(this.getCompletionItemInfosForTargetSignaturesValueParameters(ctx.targetSignaturesValueParameters));
|
3804
3711
|
}
|
@@ -3820,19 +3727,6 @@ var CompletionService = class {
|
|
3820
3727
|
}
|
3821
3728
|
}
|
3822
3729
|
}
|
3823
|
-
getTargetVariantType(targetTypes) {
|
3824
|
-
let variantType;
|
3825
|
-
for (const targetType of targetTypes) {
|
3826
|
-
const type = this._analyzer.getUnambiguousTargetVariantType(targetType);
|
3827
|
-
if (variantType === void 0) {
|
3828
|
-
variantType = type;
|
3829
|
-
} else {
|
3830
|
-
variantType = void 0;
|
3831
|
-
break;
|
3832
|
-
}
|
3833
|
-
}
|
3834
|
-
return variantType;
|
3835
|
-
}
|
3836
3730
|
getCompletionItemInfosForTargetSignaturesValueParameters(valueParameters) {
|
3837
3731
|
return valueParameters.map((p) => new TargetSignatureValueParameterCompletionItemInfo(this.completionItemInfoContext, p));
|
3838
3732
|
}
|
@@ -3874,19 +3768,7 @@ var CompletionService = class {
|
|
3874
3768
|
}
|
3875
3769
|
}
|
3876
3770
|
case "type": {
|
3877
|
-
return this.createTypeEntityCompletionItemInfo(
|
3878
|
-
d.value.value.getEntity(),
|
3879
|
-
d.name,
|
3880
|
-
d.requiresExplicitOriginalName
|
3881
|
-
);
|
3882
|
-
}
|
3883
|
-
case "variant": {
|
3884
|
-
return new VariantCompletionItemInfo(
|
3885
|
-
this.completionItemInfoContext,
|
3886
|
-
d.value.value,
|
3887
|
-
d.name,
|
3888
|
-
d.requiresExplicitOriginalName
|
3889
|
-
);
|
3771
|
+
return this.createTypeEntityCompletionItemInfo(d.value.value, d.name, d.requiresExplicitOriginalName);
|
3890
3772
|
}
|
3891
3773
|
case "package-alias":
|
3892
3774
|
return new PackageAliasEntityCompletionItemInfo(this.completionItemInfoContext, d.value.value);
|
@@ -3940,34 +3822,34 @@ var CompletionService = class {
|
|
3940
3822
|
}
|
3941
3823
|
}
|
3942
3824
|
getTypeCompletionItemInfosFromPackage(searchLocation) {
|
3943
|
-
return searchLocation.packageMemberLookup.getNamedMembers(searchLocation.hidingMatcher).
|
3944
|
-
if (m.value.kind ===
|
3825
|
+
return searchLocation.packageMemberLookup.getNamedMembers(searchLocation.hidingMatcher).map((m) => {
|
3826
|
+
if (m.value.kind === 2 /* Type */) {
|
3945
3827
|
return new NamedTypeCompletionItemInfo(
|
3946
3828
|
this.completionItemInfoContext,
|
3947
|
-
m.value
|
3829
|
+
m.value,
|
3948
3830
|
m.name,
|
3949
3831
|
m.requiresExplicitOriginalName
|
3950
3832
|
);
|
3951
3833
|
}
|
3952
3834
|
return void 0;
|
3953
|
-
}).
|
3835
|
+
}).filter((i) => i !== void 0);
|
3954
3836
|
}
|
3955
3837
|
getTypeCompletionItemInfosFromPackageNameSegment(searchLocation) {
|
3956
3838
|
let query = Query.from(searchLocation.packageTreeNode.getChildren()).map((c) => new PackageNameSegmentCompletionItemInfo(this.completionItemInfoContext, c.name));
|
3957
3839
|
if (searchLocation.packageMemberLookup !== void 0) {
|
3958
3840
|
const lookup = searchLocation.packageMemberLookup;
|
3959
3841
|
query = query.chain(
|
3960
|
-
lookup.getNamedMembers(searchLocation.hidingMatcher).
|
3961
|
-
if (m.value.kind ===
|
3842
|
+
lookup.getNamedMembers(searchLocation.hidingMatcher).map((m) => {
|
3843
|
+
if (m.value.kind === 2 /* Type */) {
|
3962
3844
|
return new NamedTypeCompletionItemInfo(
|
3963
3845
|
this.completionItemInfoContext,
|
3964
|
-
m.value
|
3846
|
+
m.value,
|
3965
3847
|
m.name,
|
3966
3848
|
m.requiresExplicitOriginalName
|
3967
3849
|
);
|
3968
3850
|
}
|
3969
3851
|
return void 0;
|
3970
|
-
})
|
3852
|
+
}).filter((i) => i !== void 0)
|
3971
3853
|
);
|
3972
3854
|
}
|
3973
3855
|
return query.toArray();
|
@@ -3978,7 +3860,7 @@ var CompletionService = class {
|
|
3978
3860
|
case "type": {
|
3979
3861
|
return new NamedTypeCompletionItemInfo(
|
3980
3862
|
this.completionItemInfoContext,
|
3981
|
-
d.value.value
|
3863
|
+
d.value.value,
|
3982
3864
|
d.name,
|
3983
3865
|
d.requiresExplicitOriginalName
|
3984
3866
|
);
|
@@ -3992,8 +3874,98 @@ var CompletionService = class {
|
|
3992
3874
|
}
|
3993
3875
|
});
|
3994
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
|
+
}
|
3995
3967
|
getPackageAliasMemberCompletionItemInfos(ctx) {
|
3996
|
-
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));
|
3997
3969
|
}
|
3998
3970
|
getPackageNameSegmentCompletionItemInfos(ctx) {
|
3999
3971
|
let query = Query.from(ctx.packageTreeNode.getChildren()).map((c) => new PackageNameSegmentCompletionItemInfo(this.completionItemInfoContext, c.name));
|
@@ -4007,22 +3979,22 @@ var CompletionService = class {
|
|
4007
3979
|
}
|
4008
3980
|
packageMemberToCompletionItemInfo(member, name, isNameExplicitlyOriginal) {
|
4009
3981
|
switch (member.kind) {
|
4010
|
-
case
|
3982
|
+
case 0 /* Variable */:
|
4011
3983
|
return new VariableEntityCompletionItemInfo(
|
4012
3984
|
this.completionItemInfoContext,
|
4013
|
-
member
|
3985
|
+
member,
|
4014
3986
|
name,
|
4015
3987
|
isNameExplicitlyOriginal
|
4016
3988
|
);
|
4017
|
-
case
|
3989
|
+
case 1 /* Method */:
|
4018
3990
|
return new MethodEntityCompletionItemInfo(
|
4019
3991
|
this.completionItemInfoContext,
|
4020
|
-
member
|
3992
|
+
member,
|
4021
3993
|
name,
|
4022
3994
|
isNameExplicitlyOriginal
|
4023
3995
|
);
|
4024
|
-
case
|
4025
|
-
return this.createTypeEntityCompletionItemInfo(member
|
3996
|
+
case 2 /* Type */:
|
3997
|
+
return this.createTypeEntityCompletionItemInfo(member, name, isNameExplicitlyOriginal);
|
4026
3998
|
default:
|
4027
3999
|
Debug.never(member);
|
4028
4000
|
}
|
@@ -4039,37 +4011,27 @@ var CompletionService = class {
|
|
4039
4011
|
}
|
4040
4012
|
getTypeMemberCompletionItemInfos(ctx) {
|
4041
4013
|
const type = this._analyzer.excludeNoneFromType(ctx.type);
|
4042
|
-
|
4043
|
-
|
4044
|
-
|
4045
|
-
|
4046
|
-
|
4047
|
-
|
4048
|
-
|
4049
|
-
|
4050
|
-
|
4051
|
-
|
4052
|
-
|
4053
|
-
|
4054
|
-
|
4055
|
-
|
4056
|
-
|
4057
|
-
|
4058
|
-
|
4059
|
-
|
4060
|
-
|
4061
|
-
|
4062
|
-
|
4063
|
-
this.completionItemInfoContext,
|
4064
|
-
m.value,
|
4065
|
-
m.name,
|
4066
|
-
m.requiresExplicitOriginalName
|
4067
|
-
);
|
4068
|
-
default:
|
4069
|
-
Debug.never(m.value);
|
4070
|
-
}
|
4071
|
-
}).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();
|
4072
|
-
}
|
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)));
|
4073
4035
|
}
|
4074
4036
|
getPackageImportCompletionItemInfos(ctx) {
|
4075
4037
|
const result = this._analyzer.packageImports.getPackagesAvailableForImport(this._sourceFile.package).map((p) => p.getImportName()).filter((n) => {
|
@@ -4088,11 +4050,7 @@ var CompletionService = class {
|
|
4088
4050
|
}
|
4089
4051
|
getTopLevelAliasListCompletionItemInfos(ctx) {
|
4090
4052
|
let result;
|
4091
|
-
const displayService_ = new DisplayService(
|
4092
|
-
this._analyzer,
|
4093
|
-
new LocalizationContext([], ctx.sourceLocale),
|
4094
|
-
this._dialect
|
4095
|
-
);
|
4053
|
+
const displayService_ = new DisplayService(this._analyzer, ctx.sourceLocale, this._dialect);
|
4096
4054
|
if (ctx.translationKind === 1 /* PackageImport */) {
|
4097
4055
|
let items;
|
4098
4056
|
if (this._sourceFile.package.kind === "translation") {
|
@@ -4107,10 +4065,10 @@ var CompletionService = class {
|
|
4107
4065
|
result = items ?? Query.empty();
|
4108
4066
|
} else if (ctx.translationKind === 2 /* Method */) {
|
4109
4067
|
result = Query.from(ctx.packageMemberLookup.getNamedMembers(ctx.hidingMatcher)).mapAndFilter((d) => {
|
4110
|
-
if (d.value.kind ===
|
4068
|
+
if (d.value.kind === 1 /* Method */) {
|
4111
4069
|
return new AliasesSourceMethodCompletionItemInfo(
|
4112
4070
|
this.completionItemInfoContext,
|
4113
|
-
d.value
|
4071
|
+
d.value,
|
4114
4072
|
!ctx.hasPrecedingKeyword,
|
4115
4073
|
displayService_
|
4116
4074
|
);
|
@@ -4119,10 +4077,10 @@ var CompletionService = class {
|
|
4119
4077
|
});
|
4120
4078
|
} else if (ctx.translationKind === 3 /* Type */) {
|
4121
4079
|
result = Query.from(ctx.packageMemberLookup.getNamedMembers(ctx.hidingMatcher)).mapAndFilter((d) => {
|
4122
|
-
if (d.value.kind ===
|
4080
|
+
if (d.value.kind === 2 /* Type */) {
|
4123
4081
|
return new AliasesSourcePackageTypeCompletionItemInfo(
|
4124
4082
|
this.completionItemInfoContext,
|
4125
|
-
d.value
|
4083
|
+
d.value,
|
4126
4084
|
!ctx.hasPrecedingKeyword,
|
4127
4085
|
displayService_
|
4128
4086
|
);
|
@@ -4141,31 +4099,31 @@ var CompletionService = class {
|
|
4141
4099
|
}
|
4142
4100
|
}
|
4143
4101
|
result = Query.from(packageNameItems ?? []).chain(
|
4144
|
-
Query.from(ctx.packageMemberLookup.getNamedMembers(ctx.hidingMatcher)).
|
4145
|
-
|
4146
|
-
|
4147
|
-
|
4148
|
-
|
4149
|
-
|
4150
|
-
|
4151
|
-
|
4152
|
-
|
4153
|
-
|
4154
|
-
|
4155
|
-
|
4156
|
-
|
4157
|
-
|
4158
|
-
|
4159
|
-
|
4160
|
-
|
4161
|
-
|
4162
|
-
|
4163
|
-
|
4164
|
-
|
4165
|
-
|
4166
|
-
|
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);
|
4167
4126
|
}
|
4168
|
-
return void 0;
|
4169
4127
|
})
|
4170
4128
|
);
|
4171
4129
|
} else {
|
@@ -4173,9 +4131,9 @@ var CompletionService = class {
|
|
4173
4131
|
}
|
4174
4132
|
if (!ctx.hasPrecedingKeyword) {
|
4175
4133
|
const keywords = [
|
4176
|
-
|
4177
|
-
|
4178
|
-
|
4134
|
+
18 /* Import */,
|
4135
|
+
16 /* Type */,
|
4136
|
+
12 /* Function */
|
4179
4137
|
];
|
4180
4138
|
result = result.chain(
|
4181
4139
|
Query.from(keywords).map(
|
@@ -4188,14 +4146,10 @@ var CompletionService = class {
|
|
4188
4146
|
getTypeAliasMemberListItemInfos(ctx) {
|
4189
4147
|
let result = Query.empty();
|
4190
4148
|
if (ctx.typeEntity !== void 0) {
|
4191
|
-
const displayService_ = new DisplayService(
|
4192
|
-
this._analyzer,
|
4193
|
-
new LocalizationContext([], ctx.sourceLocale),
|
4194
|
-
this._dialect
|
4195
|
-
);
|
4149
|
+
const displayService_ = new DisplayService(this._analyzer, ctx.sourceLocale, this._dialect);
|
4196
4150
|
if (ctx.translationKind === 1 /* Method */) {
|
4197
4151
|
result = Query.from(ctx.typeEntity.getMembers().getNamedMembers()).mapAndFilter((m) => {
|
4198
|
-
if (m.kind ===
|
4152
|
+
if (m.kind === 1 /* Method */) {
|
4199
4153
|
return new AliasesSourceMethodCompletionItemInfo(
|
4200
4154
|
this.completionItemInfoContext,
|
4201
4155
|
m,
|
@@ -4220,7 +4174,7 @@ var CompletionService = class {
|
|
4220
4174
|
result = Query.from(ctx.typeEntity.getMembers().getNamedMembers()).mapAndFilter((m) => {
|
4221
4175
|
if (m.kind === 0 /* Variable */) {
|
4222
4176
|
return new AliasesSourceVariableCompletionItemInfo(this.completionItemInfoContext, m, displayService_);
|
4223
|
-
} else if (m.kind ===
|
4177
|
+
} else if (m.kind === 1 /* Method */) {
|
4224
4178
|
return new AliasesSourceMethodCompletionItemInfo(
|
4225
4179
|
this.completionItemInfoContext,
|
4226
4180
|
m,
|
@@ -4249,8 +4203,8 @@ var CompletionService = class {
|
|
4249
4203
|
}
|
4250
4204
|
if (!ctx.hasPrecedingKeyword) {
|
4251
4205
|
const keywords = [
|
4252
|
-
|
4253
|
-
|
4206
|
+
12 /* Function */,
|
4207
|
+
29 /* Creation */
|
4254
4208
|
];
|
4255
4209
|
result = result.chain(
|
4256
4210
|
Query.from(keywords).map(
|
@@ -4411,7 +4365,7 @@ function getRightmostChildExcludingValidEmptyNodes(node) {
|
|
4411
4365
|
}
|
4412
4366
|
function isInvalidNode(node) {
|
4413
4367
|
switch (node.kind) {
|
4414
|
-
case
|
4368
|
+
case 72 /* InvalidExpression */:
|
4415
4369
|
case 43 /* InvalidPackageMemberDeclaration */:
|
4416
4370
|
case 111 /* InvalidStatement */:
|
4417
4371
|
case 57 /* InvalidTypeMemberDeclaration */:
|
@@ -4464,6 +4418,12 @@ var TypeCompletionContext = class {
|
|
4464
4418
|
this.kind = "type";
|
4465
4419
|
}
|
4466
4420
|
};
|
4421
|
+
var TagCompletionContext = class {
|
4422
|
+
constructor(searchLocation) {
|
4423
|
+
this.searchLocation = searchLocation;
|
4424
|
+
this.kind = "tag";
|
4425
|
+
}
|
4426
|
+
};
|
4467
4427
|
var OperatorNameCompletionContext = class {
|
4468
4428
|
constructor(nameToken) {
|
4469
4429
|
this.nameToken = nameToken;
|
@@ -4607,7 +4567,7 @@ var TypeVariableCompletionItemInfo = class {
|
|
4607
4567
|
return `${this.isNameExplicitlyOriginal ? "~" : ""}${this.ctx.getInsertTextForName(this.name.value)}`;
|
4608
4568
|
}
|
4609
4569
|
getCompletionItemKind() {
|
4610
|
-
return 2 /* TypeVariable */;
|
4570
|
+
return this.variable.isVariant() ? 12 /* Variant */ : 2 /* TypeVariable */;
|
4611
4571
|
}
|
4612
4572
|
getDetails() {
|
4613
4573
|
return this.ctx.displayService.displayVariableDeclaration(
|
@@ -4681,33 +4641,6 @@ var OperatorCompletionItemInfo = class {
|
|
4681
4641
|
return void 0;
|
4682
4642
|
}
|
4683
4643
|
};
|
4684
|
-
var VariantCompletionItemInfo = class {
|
4685
|
-
constructor(ctx, variant, name, isNameExplicitlyOriginal) {
|
4686
|
-
this.ctx = ctx;
|
4687
|
-
this.variant = variant;
|
4688
|
-
this.name = name;
|
4689
|
-
this.isNameExplicitlyOriginal = isNameExplicitlyOriginal;
|
4690
|
-
this.kind = "variant";
|
4691
|
-
}
|
4692
|
-
getLabel() {
|
4693
|
-
return `${this.isNameExplicitlyOriginal ? "~" : ""}${this.ctx.getInsertTextForName(this.name.value)}`;
|
4694
|
-
}
|
4695
|
-
getCompletionItemKind() {
|
4696
|
-
return 12 /* Variant */;
|
4697
|
-
}
|
4698
|
-
getDetails() {
|
4699
|
-
return this.ctx.displayService.displayVariantEntity(this.variant, this.name.localization);
|
4700
|
-
}
|
4701
|
-
getInsertText() {
|
4702
|
-
return void 0;
|
4703
|
-
}
|
4704
|
-
getSortText() {
|
4705
|
-
return void 0;
|
4706
|
-
}
|
4707
|
-
getEditRange() {
|
4708
|
-
return void 0;
|
4709
|
-
}
|
4710
|
-
};
|
4711
4644
|
var VariableEntityCompletionItemInfo = class {
|
4712
4645
|
constructor(ctx, entity, name, isNameExplicitlyOriginal) {
|
4713
4646
|
this.ctx = ctx;
|
@@ -4724,7 +4657,7 @@ var VariableEntityCompletionItemInfo = class {
|
|
4724
4657
|
case "package":
|
4725
4658
|
return 7 /* PackageVariable */;
|
4726
4659
|
case "type":
|
4727
|
-
return 2 /* TypeVariable */;
|
4660
|
+
return this.entity.isVariant() ? 12 /* Variant */ : 2 /* TypeVariable */;
|
4728
4661
|
case "parameter":
|
4729
4662
|
return 10 /* ParameterVariable */;
|
4730
4663
|
case "local":
|
@@ -4800,14 +4733,14 @@ var NamedTypeCompletionItemInfo = class {
|
|
4800
4733
|
return `${this.prefix}${this.isNameExplicitlyOriginal ? "~" : ""}${this.ctx.getInsertTextForName(this.name.value)}`;
|
4801
4734
|
}
|
4802
4735
|
getCompletionItemKind() {
|
4803
|
-
switch (this.entity.
|
4804
|
-
case
|
4736
|
+
switch (this.entity.typeEntityKind) {
|
4737
|
+
case 3 /* Variant */:
|
4805
4738
|
return 16 /* VariantType */;
|
4806
|
-
case
|
4739
|
+
case 2 /* Parameter */:
|
4807
4740
|
return 17 /* TypeParameter */;
|
4808
|
-
case
|
4741
|
+
case 0 /* Method */:
|
4809
4742
|
return 18 /* MethodType */;
|
4810
|
-
case
|
4743
|
+
case 1 /* Structured */:
|
4811
4744
|
if (this.entity.isRefObject()) {
|
4812
4745
|
return 13 /* RefObjectType */;
|
4813
4746
|
} else if (this.entity.isPlainObject()) {
|
@@ -4817,7 +4750,7 @@ var NamedTypeCompletionItemInfo = class {
|
|
4817
4750
|
} else {
|
4818
4751
|
return 20 /* InvalidType */;
|
4819
4752
|
}
|
4820
|
-
case
|
4753
|
+
case 4 /* Alias */:
|
4821
4754
|
return 19 /* AliasType */;
|
4822
4755
|
default:
|
4823
4756
|
Debug.never(this.entity);
|
@@ -5016,12 +4949,12 @@ var AliasesSourcePackageTypeCompletionItemInfo = class {
|
|
5016
4949
|
return this.ctx.getInsertTextForName(this.typeEntity.getName());
|
5017
4950
|
}
|
5018
4951
|
getCompletionItemKind() {
|
5019
|
-
switch (this.typeEntity.
|
5020
|
-
case
|
4952
|
+
switch (this.typeEntity.typeEntityKind) {
|
4953
|
+
case 3 /* Variant */:
|
5021
4954
|
return 16 /* VariantType */;
|
5022
|
-
case
|
4955
|
+
case 0 /* Method */:
|
5023
4956
|
return 18 /* MethodType */;
|
5024
|
-
case
|
4957
|
+
case 1 /* Structured */: {
|
5025
4958
|
if (this.typeEntity.isRefObject()) {
|
5026
4959
|
return 13 /* RefObjectType */;
|
5027
4960
|
} else if (this.typeEntity.isPlainObject()) {
|
@@ -5031,7 +4964,7 @@ var AliasesSourcePackageTypeCompletionItemInfo = class {
|
|
5031
4964
|
}
|
5032
4965
|
return 20 /* InvalidType */;
|
5033
4966
|
}
|
5034
|
-
case
|
4967
|
+
case 4 /* Alias */:
|
5035
4968
|
return 19 /* AliasType */;
|
5036
4969
|
}
|
5037
4970
|
}
|
@@ -5050,20 +4983,20 @@ var AliasesSourcePackageTypeCompletionItemInfo = class {
|
|
5050
4983
|
}
|
5051
4984
|
getDisplayServiceTypeDeclaration() {
|
5052
4985
|
const localization = Localization.Original.ofEntity(this.typeEntity);
|
5053
|
-
switch (this.typeEntity.
|
5054
|
-
case
|
4986
|
+
switch (this.typeEntity.typeEntityKind) {
|
4987
|
+
case 3 /* Variant */:
|
5055
4988
|
return new TypeDeclaration_variant(
|
5056
4989
|
new TypeDeclarationVariant_entity(this.typeEntity, localization)
|
5057
4990
|
);
|
5058
|
-
case
|
4991
|
+
case 0 /* Method */:
|
5059
4992
|
return new TypeDeclaration_method(
|
5060
4993
|
new TypeDeclarationMethod_entity(this.typeEntity, localization)
|
5061
4994
|
);
|
5062
|
-
case
|
4995
|
+
case 1 /* Structured */:
|
5063
4996
|
return new TypeDeclaration_structured(
|
5064
4997
|
new TypeDeclarationStructured_entity(this.typeEntity, localization)
|
5065
4998
|
);
|
5066
|
-
case
|
4999
|
+
case 4 /* Alias */:
|
5067
5000
|
return new TypeDeclaration_alias(
|
5068
5001
|
new TypeDeclarationAlias_entity(this.typeEntity, localization)
|
5069
5002
|
);
|
@@ -5126,7 +5059,7 @@ var AliasesSourceTypeConstructorCompletionItemInfo = class {
|
|
5126
5059
|
Localization.Original.ofEntity(this.constructor_)
|
5127
5060
|
);
|
5128
5061
|
const displayParts = this.displayService.getConstructorDeclarationDisplayParts(constructorDeclaration);
|
5129
|
-
const creationKeyword = this.displayService.displayKeyword(
|
5062
|
+
const creationKeyword = this.displayService.displayKeyword(29 /* Creation */);
|
5130
5063
|
return creationKeyword + displayParts.valueParametersStart + displayParts.valueParameters.map((p) => p.toString()).join(displayParts.valueParameterSeparator) + displayParts.valueParametersEnd;
|
5131
5064
|
});
|
5132
5065
|
}
|
@@ -5140,7 +5073,7 @@ var AliasesSourceTypeConstructorCompletionItemInfo = class {
|
|
5140
5073
|
return this.label;
|
5141
5074
|
}
|
5142
5075
|
getInsertText() {
|
5143
|
-
const creationKeyword = this.includeOnCreateKeyword ? this.displayService.displayKeyword(
|
5076
|
+
const creationKeyword = this.includeOnCreateKeyword ? this.displayService.displayKeyword(29 /* Creation */) : "";
|
5144
5077
|
const parameters = this.constructor_.getValueParameters().map((p) => this.ctx.getInsertTextForName(p.getName(), true)).join(", ");
|
5145
5078
|
return `${creationKeyword}(${parameters})`;
|
5146
5079
|
}
|
@@ -5178,7 +5111,7 @@ var OperatorNameCompletionItemInfo = class {
|
|
5178
5111
|
}
|
5179
5112
|
};
|
5180
5113
|
var SyntaxContext = class {
|
5181
|
-
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) {
|
5182
5115
|
this.isInComment = isInComment;
|
5183
5116
|
this.isInStringOrChar = isInStringOrChar;
|
5184
5117
|
this.isInQuotedIdentifier = isInQuotedIdentifier;
|
@@ -5188,24 +5121,18 @@ var SyntaxContext = class {
|
|
5188
5121
|
this.isExpressionContext = isExpressionContext;
|
5189
5122
|
this.precedingExpression = precedingExpression;
|
5190
5123
|
this.isUnqualifiedTypeContext = isUnqualifiedTypeContext;
|
5124
|
+
this.isUnqualifiedTagNameCompletionContext = isUnqualifiedTagNameCompletionContext;
|
5191
5125
|
this.isTopLevelTranslationListContext = isTopLevelTranslationListContext;
|
5192
5126
|
this.isTypeMemberTranslationListContext = isTypeMemberTranslationListContext;
|
5193
5127
|
}
|
5194
5128
|
};
|
5195
|
-
var
|
5129
|
+
var ExpressionRole_argument = class {
|
5196
5130
|
constructor(argumentList, index) {
|
5197
5131
|
this.argumentList = argumentList;
|
5198
5132
|
this.index = index;
|
5199
5133
|
this.kind = "call-argument";
|
5200
5134
|
}
|
5201
5135
|
};
|
5202
|
-
var ExpressionRole_indexedAccessArgument = class {
|
5203
|
-
constructor(argumentList, index) {
|
5204
|
-
this.argumentList = argumentList;
|
5205
|
-
this.index = index;
|
5206
|
-
this.kind = "indexed-access-argument";
|
5207
|
-
}
|
5208
|
-
};
|
5209
5136
|
var ExpressionRole_arrayElement = class {
|
5210
5137
|
constructor(array) {
|
5211
5138
|
this.array = array;
|
@@ -5260,6 +5187,7 @@ var SyntaxContextFactory = class {
|
|
5260
5187
|
if (positionDescription.kind === "after-token-or-keyword") {
|
5261
5188
|
isUnqualifiedTypeContext = this.isUnqualifiedTypeContext(positionDescription.tokenOrKeyword);
|
5262
5189
|
}
|
5190
|
+
const isUnqualifiedTagNameCompletionContext = positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isToken(35 /* HashSign */) && positionDescription.tokenOrKeyword.parent.kind === 145 /* Tag */;
|
5263
5191
|
let isTopLevelTranslationListContext;
|
5264
5192
|
if (positionDescription.kind === "after-token-or-keyword") {
|
5265
5193
|
isTopLevelTranslationListContext = this.isTopLevelTranslationListContext(positionDescription.tokenOrKeyword);
|
@@ -5278,13 +5206,14 @@ var SyntaxContextFactory = class {
|
|
5278
5206
|
isExpressionContext,
|
5279
5207
|
precedingExpression,
|
5280
5208
|
isUnqualifiedTypeContext,
|
5209
|
+
isUnqualifiedTagNameCompletionContext,
|
5281
5210
|
isTopLevelTranslationListContext,
|
5282
5211
|
isTypeMemberTranslationListContext
|
5283
5212
|
);
|
5284
5213
|
}
|
5285
5214
|
static isExpressionOrStatementContext(tokenOrKeyword) {
|
5286
5215
|
if (tokenOrKeyword.isToken(57 /* Equals */)) {
|
5287
|
-
if (tokenOrKeyword.parent.kind ===
|
5216
|
+
if (tokenOrKeyword.parent.kind === 91 /* AssignmentStatement */) {
|
5288
5217
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.right);
|
5289
5218
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5290
5219
|
}
|
@@ -5304,7 +5233,7 @@ var SyntaxContextFactory = class {
|
|
5304
5233
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.defaultValue);
|
5305
5234
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5306
5235
|
}
|
5307
|
-
if (tokenOrKeyword.parent.kind === 143 /*
|
5236
|
+
if (tokenOrKeyword.parent.kind === 143 /* Argument */) {
|
5308
5237
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.value);
|
5309
5238
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5310
5239
|
}
|
@@ -5313,11 +5242,11 @@ var SyntaxContextFactory = class {
|
|
5313
5242
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5314
5243
|
}
|
5315
5244
|
}
|
5316
|
-
if (tokenOrKeyword.parent.kind ===
|
5245
|
+
if (tokenOrKeyword.parent.kind === 91 /* AssignmentStatement */) {
|
5317
5246
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.right);
|
5318
5247
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5319
5248
|
}
|
5320
|
-
if (tokenOrKeyword.parent.kind ===
|
5249
|
+
if (tokenOrKeyword.parent.kind === 77 /* PrefixUnaryExpression */) {
|
5321
5250
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.operand);
|
5322
5251
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5323
5252
|
}
|
@@ -5325,11 +5254,11 @@ var SyntaxContextFactory = class {
|
|
5325
5254
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.right);
|
5326
5255
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5327
5256
|
}
|
5328
|
-
if (tokenOrKeyword.isToken(7 /* TextTemplateHead */) && tokenOrKeyword.parent.kind ===
|
5257
|
+
if (tokenOrKeyword.isToken(7 /* TextTemplateHead */) && tokenOrKeyword.parent.kind === 81 /* TextTemplateLiteral */) {
|
5329
5258
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.spanList.spans.at(0)?.expression);
|
5330
5259
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5331
5260
|
}
|
5332
|
-
if (tokenOrKeyword.isToken(8 /* TextTemplatePart */) && tokenOrKeyword.parent.kind ===
|
5261
|
+
if (tokenOrKeyword.isToken(8 /* TextTemplatePart */) && tokenOrKeyword.parent.kind === 83 /* TextTemplateSpan */) {
|
5333
5262
|
let expressionForTargetType;
|
5334
5263
|
const spanList = tokenOrKeyword.parent.parent;
|
5335
5264
|
const spanIndex = spanList.spans.indexOf(tokenOrKeyword.parent);
|
@@ -5341,39 +5270,39 @@ var SyntaxContextFactory = class {
|
|
5341
5270
|
isStatementContext: false
|
5342
5271
|
};
|
5343
5272
|
}
|
5344
|
-
if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind ===
|
5273
|
+
if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */) {
|
5345
5274
|
return { isExpressionContext: { expressionRole: new ExpressionRole_other(void 0) }, isStatementContext: true };
|
5346
5275
|
}
|
5347
|
-
if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind ===
|
5276
|
+
if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 92 /* StatementList */) {
|
5348
5277
|
return { isExpressionContext: { expressionRole: new ExpressionRole_other(void 0) }, isStatementContext: true };
|
5349
5278
|
}
|
5350
5279
|
if (tokenOrKeyword.isToken(44 /* OpenParenthesis */)) {
|
5351
|
-
if (tokenOrKeyword.parent.kind ===
|
5280
|
+
if (tokenOrKeyword.parent.kind === 75 /* ParenthesizedExpression */) {
|
5352
5281
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5353
5282
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5354
5283
|
}
|
5355
|
-
if (tokenOrKeyword.parent.kind ===
|
5284
|
+
if (tokenOrKeyword.parent.kind === 79 /* ReferenceExpression */) {
|
5356
5285
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5357
5286
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5358
5287
|
}
|
5359
5288
|
if (tokenOrKeyword.parent.kind === 69 /* CallExpression */) {
|
5360
|
-
const expressionRole = new
|
5289
|
+
const expressionRole = new ExpressionRole_argument(tokenOrKeyword.parent.argumentList, 0);
|
5361
5290
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5362
5291
|
}
|
5363
5292
|
if (tokenOrKeyword.parent.kind === 70 /* AutotypeCallExpression */) {
|
5364
|
-
const expressionRole = new
|
5293
|
+
const expressionRole = new ExpressionRole_argument(tokenOrKeyword.parent.argumentList, 0);
|
5365
5294
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5366
5295
|
}
|
5367
5296
|
if (tokenOrKeyword.parent.kind === 145 /* Tag */) {
|
5368
|
-
const
|
5369
|
-
if (
|
5370
|
-
const expressionRole = new
|
5297
|
+
const argumentList = tokenOrKeyword.parent.argumentList;
|
5298
|
+
if (argumentList !== void 0) {
|
5299
|
+
const expressionRole = new ExpressionRole_argument(argumentList, 0);
|
5371
5300
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5372
5301
|
}
|
5373
5302
|
}
|
5374
5303
|
}
|
5375
|
-
if (tokenOrKeyword.isToken(45 /* OpenSquareBracket */) && tokenOrKeyword.parent.kind ===
|
5376
|
-
const expressionRole = new
|
5304
|
+
if (tokenOrKeyword.isToken(45 /* OpenSquareBracket */) && tokenOrKeyword.parent.kind === 71 /* IndexedAccessExpression */) {
|
5305
|
+
const expressionRole = new ExpressionRole_argument(tokenOrKeyword.parent.argumentList, 0);
|
5377
5306
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5378
5307
|
}
|
5379
5308
|
if (tokenOrKeyword.isToken(45 /* OpenSquareBracket */) && tokenOrKeyword.parent.kind === 61 /* ArrayLiteral */) {
|
@@ -5381,21 +5310,7 @@ var SyntaxContextFactory = class {
|
|
5381
5310
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5382
5311
|
}
|
5383
5312
|
if (tokenOrKeyword.isToken(24 /* Comma */)) {
|
5384
|
-
if (tokenOrKeyword.parent.kind === 68 /*
|
5385
|
-
const argumentList = tokenOrKeyword.parent;
|
5386
|
-
let index = 0;
|
5387
|
-
for (const element of argumentList.elements) {
|
5388
|
-
if (element.kind === 0 /* Token */) {
|
5389
|
-
index++;
|
5390
|
-
if (element === tokenOrKeyword.value) {
|
5391
|
-
break;
|
5392
|
-
}
|
5393
|
-
}
|
5394
|
-
}
|
5395
|
-
const expressionRole = new ExpressionRole_callArgument(argumentList, index);
|
5396
|
-
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5397
|
-
}
|
5398
|
-
if (tokenOrKeyword.parent.kind === 71 /* IndexedAccessArgumentList */) {
|
5313
|
+
if (tokenOrKeyword.parent.kind === 68 /* ArgumentList */) {
|
5399
5314
|
const argumentList = tokenOrKeyword.parent;
|
5400
5315
|
let index = 0;
|
5401
5316
|
for (const element of argumentList.elements) {
|
@@ -5406,7 +5321,7 @@ var SyntaxContextFactory = class {
|
|
5406
5321
|
}
|
5407
5322
|
}
|
5408
5323
|
}
|
5409
|
-
const expressionRole = new
|
5324
|
+
const expressionRole = new ExpressionRole_argument(argumentList, index);
|
5410
5325
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5411
5326
|
}
|
5412
5327
|
if (tokenOrKeyword.parent.kind === 118 /* MatchExpressionList */) {
|
@@ -5418,47 +5333,47 @@ var SyntaxContextFactory = class {
|
|
5418
5333
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5419
5334
|
}
|
5420
5335
|
}
|
5421
|
-
if (tokenOrKeyword.isKeyword(
|
5336
|
+
if (tokenOrKeyword.isKeyword(44 /* Case */) && tokenOrKeyword.parent.kind === 119 /* SwitchStatementCaseClause */) {
|
5422
5337
|
const expressionRole = new ExpressionRole_matchListElement(tokenOrKeyword.parent.parent.parent);
|
5423
5338
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5424
5339
|
}
|
5425
|
-
if (tokenOrKeyword.isKeyword(
|
5340
|
+
if (tokenOrKeyword.isKeyword(15 /* Return */) && tokenOrKeyword.parent.kind === 115 /* ReturnStatement */) {
|
5426
5341
|
const expressionRole = new ExpressionRole_returnedValue(tokenOrKeyword.parent);
|
5427
5342
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5428
5343
|
}
|
5429
|
-
if (tokenOrKeyword.isKeyword(
|
5344
|
+
if (tokenOrKeyword.isKeyword(43 /* Switch */) && tokenOrKeyword.parent.kind === 117 /* SwitchStatement */) {
|
5430
5345
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5431
5346
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5432
5347
|
}
|
5433
|
-
if (tokenOrKeyword.isKeyword(
|
5348
|
+
if (tokenOrKeyword.isKeyword(13 /* If */) && tokenOrKeyword.parent.kind === 108 /* IfStatement */) {
|
5434
5349
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5435
5350
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5436
5351
|
}
|
5437
|
-
if (tokenOrKeyword.isKeyword(
|
5352
|
+
if (tokenOrKeyword.isKeyword(11 /* ElseIf */) && tokenOrKeyword.parent.kind === 110 /* ElseIfClause */) {
|
5438
5353
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5439
5354
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5440
5355
|
}
|
5441
|
-
if (tokenOrKeyword.isKeyword(
|
5356
|
+
if (tokenOrKeyword.isKeyword(9 /* From */) && tokenOrKeyword.parent.kind === 107 /* ForStatement */) {
|
5442
5357
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.enumeratedExpression);
|
5443
5358
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5444
5359
|
}
|
5445
|
-
if (tokenOrKeyword.isKeyword(
|
5360
|
+
if (tokenOrKeyword.isKeyword(24 /* While */) && tokenOrKeyword.parent.kind === 120 /* WhileStatement */) {
|
5446
5361
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5447
5362
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5448
5363
|
}
|
5449
|
-
if (tokenOrKeyword.isKeyword(
|
5364
|
+
if (tokenOrKeyword.isKeyword(26 /* RepeatWhile */) && tokenOrKeyword.parent.kind === 114 /* LoopStatement */) {
|
5450
5365
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5451
5366
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5452
5367
|
}
|
5453
|
-
if (tokenOrKeyword.isKeyword(
|
5368
|
+
if (tokenOrKeyword.isKeyword(27 /* Yield */) && tokenOrKeyword.parent.kind === 121 /* YieldStatement */) {
|
5454
5369
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5455
5370
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5456
5371
|
}
|
5457
|
-
if (tokenOrKeyword.isKeyword(
|
5372
|
+
if (tokenOrKeyword.isKeyword(28 /* When */) && tokenOrKeyword.parent.kind === 76 /* WhenTernaryExpression */) {
|
5458
5373
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5459
5374
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5460
5375
|
}
|
5461
|
-
if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind ===
|
5376
|
+
if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind === 76 /* WhenTernaryExpression */) {
|
5462
5377
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.secondExpression);
|
5463
5378
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5464
5379
|
}
|
@@ -5480,7 +5395,7 @@ var SyntaxContextFactory = class {
|
|
5480
5395
|
if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 32 /* TypeMemberDeclarationBlock */ && (tokenOrKeyword.parent.parent.kind === 40 /* TypeExtensionDeclaration */ || tokenOrKeyword.parent.parent.parent.kind === 33 /* PackageStructuredTypeDeclaration */ || tokenOrKeyword.parent.parent.parent.kind === 38 /* PackageVariantTypeDeclaration */ || tokenOrKeyword.parent.parent.parent.kind === 22 /* PackageAliasTypeDeclaration */)) {
|
5481
5396
|
return true;
|
5482
5397
|
}
|
5483
|
-
if (tokenOrKeyword.isToken(20 /* CloseBrace */) && (tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */ || tokenOrKeyword.parent.kind === 24 /* PackageMemberGroupDeclaration */ || tokenOrKeyword.parent.kind === 6 /* PackageGroupImportDirective */ || tokenOrKeyword.parent.kind ===
|
5398
|
+
if (tokenOrKeyword.isToken(20 /* CloseBrace */) && (tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */ || tokenOrKeyword.parent.kind === 24 /* PackageMemberGroupDeclaration */ || tokenOrKeyword.parent.kind === 6 /* PackageGroupImportDirective */ || tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind === 25 /* PackageConstructorDeclaration */ || tokenOrKeyword.parent.parent.kind === 26 /* PackageEntryPointDeclaration */ || tokenOrKeyword.parent.parent.kind === 27 /* PackageMethodDeclaration */))) {
|
5484
5399
|
return true;
|
5485
5400
|
}
|
5486
5401
|
if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 24 /* PackageMemberGroupDeclaration */) {
|
@@ -5559,20 +5474,20 @@ var SyntaxContextFactory = class {
|
|
5559
5474
|
return result;
|
5560
5475
|
}
|
5561
5476
|
static isUnqualifiedTypeContext(tokenOrKeyword) {
|
5562
|
-
if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind ===
|
5477
|
+
if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind === 154 /* TypeAnnotation */) {
|
5563
5478
|
return { allowsAnonymousTypes: true };
|
5564
5479
|
}
|
5565
5480
|
if ((tokenOrKeyword.isKeyword(4 /* Object */) || tokenOrKeyword.isKeyword(5 /* PlainObject */) || tokenOrKeyword.isKeyword(3 /* Aspect */)) && tokenOrKeyword.parent.kind === 34 /* StructuredTypeDeclarationBody */) {
|
5566
5481
|
return { allowsAnonymousTypes: false };
|
5567
5482
|
}
|
5568
|
-
if (tokenOrKeyword.isKeyword(
|
5483
|
+
if (tokenOrKeyword.isKeyword(16 /* Type */) && (NodeTypeUtils.isPackageTypeDeclaration(tokenOrKeyword.parent) || tokenOrKeyword.parent.kind === 40 /* TypeExtensionDeclaration */)) {
|
5569
5484
|
return { allowsAnonymousTypes: false };
|
5570
5485
|
}
|
5571
|
-
if (tokenOrKeyword.isToken(36 /* LessThan */) && tokenOrKeyword.parent.kind ===
|
5486
|
+
if (tokenOrKeyword.isToken(36 /* LessThan */) && tokenOrKeyword.parent.kind === 150 /* TypeArgumentClause */) {
|
5572
5487
|
return { allowsAnonymousTypes: true };
|
5573
5488
|
}
|
5574
|
-
if (tokenOrKeyword.isToken(24 /* Comma */) && (tokenOrKeyword.parent.kind === 30 /* BaseTypeList */ || tokenOrKeyword.parent.kind ===
|
5575
|
-
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 */ };
|
5576
5491
|
}
|
5577
5492
|
if (tokenOrKeyword.isToken(35 /* HashSign */) && tokenOrKeyword.parent.kind === 145 /* Tag */) {
|
5578
5493
|
return { allowsAnonymousTypes: false };
|
@@ -5583,10 +5498,10 @@ var SyntaxContextFactory = class {
|
|
5583
5498
|
if (tokenOrKeyword.isToken(57 /* Equals */) && tokenOrKeyword.parent.kind === 22 /* PackageAliasTypeDeclaration */) {
|
5584
5499
|
return { allowsAnonymousTypes: false };
|
5585
5500
|
}
|
5586
|
-
if (tokenOrKeyword.isKeyword(
|
5501
|
+
if (tokenOrKeyword.isKeyword(14 /* Is */) && tokenOrKeyword.parent.kind === 73 /* IsExpression */) {
|
5587
5502
|
return { allowsAnonymousTypes: true };
|
5588
5503
|
}
|
5589
|
-
if (tokenOrKeyword.isKeyword(
|
5504
|
+
if (tokenOrKeyword.isKeyword(41 /* As */) && tokenOrKeyword.parent.kind === 65 /* AsExpression */) {
|
5590
5505
|
return { allowsAnonymousTypes: true };
|
5591
5506
|
}
|
5592
5507
|
if (tokenOrKeyword.isToken(17 /* Bar */) && tokenOrKeyword.parent.kind === 12 /* UnionTypeSpecifierTypeList */) {
|
@@ -5777,27 +5692,27 @@ var NodeSemanticInfoService = class {
|
|
5777
5692
|
return this.ofNonKeywordIdentifier(analyzer, tokenOrKeyword.value, options6);
|
5778
5693
|
} else if (tokenOrKeyword.isKeyword(2 /* Autotype */) && tokenOrKeyword.parent.kind === 70 /* AutotypeCallExpression */) {
|
5779
5694
|
return this.ofAutotypeCallExpression(analyzer, tokenOrKeyword.parent, options6);
|
5780
|
-
} else if (tokenOrKeyword.parent.kind ===
|
5695
|
+
} else if (tokenOrKeyword.parent.kind === 77 /* PrefixUnaryExpression */) {
|
5781
5696
|
return this.ofPrefixUnaryExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
|
5782
5697
|
} else if (tokenOrKeyword.parent.kind === 66 /* BinaryExpression */) {
|
5783
5698
|
return this.ofBinaryExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
|
5784
5699
|
} else if (tokenOrKeyword.isToken(19 /* Caret */) && (tokenOrKeyword.parent.kind === 50 /* TypeDereferencedVariableGetterDeclaration */ || tokenOrKeyword.parent.kind === 51 /* TypeDereferencedVariableSetterDeclaration */)) {
|
5785
5700
|
return this.ofDereferenceOperatorDeclaration(analyzer, tokenOrKeyword.parent);
|
5786
|
-
} else if (tokenOrKeyword.isToken(19 /* Caret */) && tokenOrKeyword.parent.kind ===
|
5701
|
+
} else if (tokenOrKeyword.isToken(19 /* Caret */) && tokenOrKeyword.parent.kind === 80 /* DereferenceExpression */) {
|
5787
5702
|
return this.ofDereferenceExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
|
5788
|
-
} else if (tokenOrKeyword.parent.kind ===
|
5703
|
+
} else if (tokenOrKeyword.parent.kind === 91 /* AssignmentStatement */) {
|
5789
5704
|
return this.ofAssignmentStatementOperator(analyzer, tokenOrKeyword.parent, options6);
|
5790
|
-
} else if (tokenOrKeyword.isKeyword(
|
5705
|
+
} else if (tokenOrKeyword.isKeyword(29 /* Creation */) && tokenOrKeyword.parent.kind === 45 /* TypeConstructorDeclaration */) {
|
5791
5706
|
return this.ofTypeConstructorDeclaration(analyzer, tokenOrKeyword.parent);
|
5792
|
-
} else if (tokenOrKeyword.isToken(13 /* Asterisk */) && tokenOrKeyword.parent.kind ===
|
5707
|
+
} else if (tokenOrKeyword.isToken(13 /* Asterisk */) && tokenOrKeyword.parent.kind === 90 /* DefaultMatchExpression */) {
|
5793
5708
|
return this.ofDefaultMatchExpression(analyzer, tokenOrKeyword.parent);
|
5794
|
-
} else if (tokenOrKeyword.isKeyword(4 /* Object */) && tokenOrKeyword.parent.kind ===
|
5709
|
+
} else if (tokenOrKeyword.isKeyword(4 /* Object */) && tokenOrKeyword.parent.kind === 86 /* ObjectExpression */) {
|
5795
5710
|
return this.ofObjectExpression(analyzer, tokenOrKeyword.parent, options6);
|
5796
|
-
} else if (tokenOrKeyword.isKeyword(55 /* Base */) && tokenOrKeyword.parent.kind ===
|
5711
|
+
} else if (tokenOrKeyword.isKeyword(55 /* Base */) && tokenOrKeyword.parent.kind === 87 /* BaseExpression */) {
|
5797
5712
|
return this.ofBaseExpression(analyzer, tokenOrKeyword.parent, options6);
|
5798
5713
|
} else if ((tokenOrKeyword.isToken(45 /* OpenSquareBracket */) || tokenOrKeyword.isToken(22 /* CloseSquareBracket */)) && tokenOrKeyword.parent.kind === 49 /* TypeIndexerParameterClause */) {
|
5799
5714
|
return this.ofTypeIndexerDeclaration(analyzer, tokenOrKeyword.parent.parent);
|
5800
|
-
} else if ((tokenOrKeyword.isToken(45 /* OpenSquareBracket */) || tokenOrKeyword.isToken(22 /* CloseSquareBracket */)) && tokenOrKeyword.parent.kind ===
|
5715
|
+
} else if ((tokenOrKeyword.isToken(45 /* OpenSquareBracket */) || tokenOrKeyword.isToken(22 /* CloseSquareBracket */)) && tokenOrKeyword.parent.kind === 71 /* IndexedAccessExpression */) {
|
5801
5716
|
return this.ofIndexedAccessExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
|
5802
5717
|
}
|
5803
5718
|
return void 0;
|
@@ -5814,7 +5729,7 @@ var NodeSemanticInfoService = class {
|
|
5814
5729
|
break;
|
5815
5730
|
case 122 /* TranslationParameterList */:
|
5816
5731
|
break;
|
5817
|
-
case 143 /*
|
5732
|
+
case 143 /* Argument */: {
|
5818
5733
|
const respectiveParameter = analyzer.getRespectiveParameter(parent);
|
5819
5734
|
if (respectiveParameter !== void 0) {
|
5820
5735
|
const target = new SimpleWithLocalization(
|
@@ -5852,7 +5767,7 @@ var NodeSemanticInfoService = class {
|
|
5852
5767
|
case 38 /* PackageVariantTypeDeclaration */:
|
5853
5768
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageVariantTypeDeclaration(parent));
|
5854
5769
|
break;
|
5855
|
-
case
|
5770
|
+
case 88 /* IdentifierExpression */:
|
5856
5771
|
result = this.ofIdentifierExpression(analyzer, parent, options6);
|
5857
5772
|
break;
|
5858
5773
|
case 58 /* NestedMethodDeclaration */:
|
@@ -6005,7 +5920,7 @@ var NodeSemanticInfoService = class {
|
|
6005
5920
|
case 9 /* PackagePath */:
|
6006
5921
|
result = void 0;
|
6007
5922
|
break;
|
6008
|
-
case
|
5923
|
+
case 78 /* PropertyAccessExpression */:
|
6009
5924
|
result = this.ofProperty(analyzer, parent, options6);
|
6010
5925
|
break;
|
6011
5926
|
case 52 /* TypeMethodDeclaration */:
|
@@ -6031,9 +5946,6 @@ var NodeSemanticInfoService = class {
|
|
6031
5946
|
case 56 /* TypeVariableSetterDeclaration */:
|
6032
5947
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofComputedTypeVariableDeclaration(parent));
|
6033
5948
|
break;
|
6034
|
-
case 151 /* SetterParameterDeclaration */:
|
6035
|
-
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofSetterParameterDeclaration(parent));
|
6036
|
-
break;
|
6037
5949
|
case 3 /* Keyword */:
|
6038
5950
|
break;
|
6039
5951
|
default:
|
@@ -6046,18 +5958,10 @@ var NodeSemanticInfoService = class {
|
|
6046
5958
|
let result;
|
6047
5959
|
const meaning = analyzer.resolvePropertyAccessExpression(node).meaning;
|
6048
5960
|
switch (meaning.kind) {
|
6049
|
-
case "variant-access": {
|
6050
|
-
const target = new SimpleWithLocalization(
|
6051
|
-
new EntityReferenceTarget(meaning.variant.value, 0 /* Get */),
|
6052
|
-
meaning.variant.localization
|
6053
|
-
);
|
6054
|
-
result = new ReferenceNodeSemanticInfo([target], false);
|
6055
|
-
break;
|
6056
|
-
}
|
6057
5961
|
case "instance-variable-access": {
|
6058
5962
|
const target = new SimpleWithLocalization(new TypeVariableReferenceTarget(
|
6059
5963
|
meaning.variable.value,
|
6060
|
-
meaning.
|
5964
|
+
meaning.accessKind
|
6061
5965
|
), meaning.variable.localization);
|
6062
5966
|
result = new ReferenceNodeSemanticInfo([target], false);
|
6063
5967
|
break;
|
@@ -6065,7 +5969,7 @@ var NodeSemanticInfoService = class {
|
|
6065
5969
|
case "static-variable-access": {
|
6066
5970
|
const target = new SimpleWithLocalization(new TypeVariableReferenceTarget(
|
6067
5971
|
meaning.variable.value,
|
6068
|
-
meaning.
|
5972
|
+
meaning.accessKind
|
6069
5973
|
), meaning.variable.localization);
|
6070
5974
|
result = new ReferenceNodeSemanticInfo([target], false);
|
6071
5975
|
break;
|
@@ -6073,7 +5977,7 @@ var NodeSemanticInfoService = class {
|
|
6073
5977
|
case "package-variable-access": {
|
6074
5978
|
const target = new SimpleWithLocalization(new EntityReferenceTarget(
|
6075
5979
|
meaning.variable.value,
|
6076
|
-
meaning.
|
5980
|
+
meaning.accessKind
|
6077
5981
|
), meaning.variable.localization);
|
6078
5982
|
result = new ReferenceNodeSemanticInfo([target], false);
|
6079
5983
|
break;
|
@@ -6114,7 +6018,7 @@ var NodeSemanticInfoService = class {
|
|
6114
6018
|
);
|
6115
6019
|
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
|
6116
6020
|
} else {
|
6117
|
-
result = this.
|
6021
|
+
result = this.ofMaybeConstructorCallExpression(analyzer, meaning.suitableTypes, node, options6);
|
6118
6022
|
}
|
6119
6023
|
break;
|
6120
6024
|
case "package-name-segment-access":
|
@@ -6140,19 +6044,70 @@ var NodeSemanticInfoService = class {
|
|
6140
6044
|
}
|
6141
6045
|
static ofQualifiedNameQualifier(analyzer, node, qualifier, options6) {
|
6142
6046
|
switch (node.parent.kind) {
|
6143
|
-
case 10 /* NamedTypeSpecifier */:
|
6144
|
-
|
6145
|
-
|
6146
|
-
|
6147
|
-
|
6148
|
-
|
6149
|
-
|
6150
|
-
|
6151
|
-
|
6152
|
-
|
6153
|
-
|
6154
|
-
|
6155
|
-
|
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") {
|
6156
6111
|
if (resolvedQualifier.suitableTypes.length > 0) {
|
6157
6112
|
const targets = resolvedQualifier.suitableTypes.map((t) => new SimpleWithLocalization(new EntityReferenceTarget(t.value, 0 /* Get */), t.localization));
|
6158
6113
|
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), targets.length > 1);
|
@@ -6160,55 +6115,72 @@ var NodeSemanticInfoService = class {
|
|
6160
6115
|
const targets = resolvedQualifier.candidates.map((t) => new SimpleWithLocalization(new EntityReferenceTarget(t.value, 0 /* Get */), t.localization));
|
6161
6116
|
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
|
6162
6117
|
}
|
6163
|
-
} else
|
6164
|
-
|
6165
|
-
|
6166
|
-
|
6167
|
-
|
6168
|
-
|
6169
|
-
|
6170
|
-
|
6171
|
-
|
6172
|
-
new Localization.Original(qualifier2.packageTreeNode.package.value.getLocale())
|
6173
|
-
);
|
6174
|
-
result = new ReferenceNodeSemanticInfo([target], false);
|
6175
|
-
} else {
|
6176
|
-
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
|
+
}
|
6177
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);
|
6178
6152
|
} else {
|
6179
|
-
|
6153
|
+
result = void 0;
|
6180
6154
|
}
|
6155
|
+
break;
|
6181
6156
|
}
|
6182
|
-
|
6183
|
-
|
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;
|
6184
6164
|
}
|
6185
|
-
|
6165
|
+
default:
|
6166
|
+
Debug.never(resolvedQualifier);
|
6186
6167
|
}
|
6187
|
-
case 42 /* ExtendedTypeClause */:
|
6188
|
-
case 132 /* PackageImportTranslation */:
|
6189
|
-
return void 0;
|
6190
|
-
default:
|
6191
|
-
Debug.never(node.parent);
|
6192
6168
|
}
|
6169
|
+
if (result !== void 0 && options6.includeBetterReferenceTargets) {
|
6170
|
+
result = this.getBetterReferenceTargetsOrPreserve(result);
|
6171
|
+
}
|
6172
|
+
return result;
|
6193
6173
|
}
|
6194
6174
|
static ofIdentifierExpression(analyzer, node, options6) {
|
6195
6175
|
let result;
|
6196
6176
|
const meaning = analyzer.resolveIdentifierExpression(node).meaning;
|
6197
6177
|
switch (meaning.kind) {
|
6198
|
-
case "variant-access": {
|
6199
|
-
const target = new SimpleWithLocalization(
|
6200
|
-
new EntityReferenceTarget(meaning.variant.value, 0 /* Get */),
|
6201
|
-
meaning.variant.localization
|
6202
|
-
);
|
6203
|
-
result = new ReferenceNodeSemanticInfo([target], false);
|
6204
|
-
break;
|
6205
|
-
}
|
6206
6178
|
case "type-access":
|
6207
6179
|
if (meaning.suitableTypes.length === 0 && meaning.candidates.length > 0) {
|
6208
6180
|
const targets = meaning.candidates.map((c) => new SimpleWithLocalization(new EntityReferenceTarget(c.value, 0 /* Get */), c.localization));
|
6209
6181
|
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
|
6210
6182
|
} else {
|
6211
|
-
result = this.
|
6183
|
+
result = this.ofMaybeConstructorCallExpression(analyzer, meaning.suitableTypes, node, options6);
|
6212
6184
|
}
|
6213
6185
|
break;
|
6214
6186
|
case "method-access":
|
@@ -6230,13 +6202,13 @@ var NodeSemanticInfoService = class {
|
|
6230
6202
|
const variable = meaning.variable;
|
6231
6203
|
if (variable.value.kind === "entity") {
|
6232
6204
|
const target = new SimpleWithLocalization(
|
6233
|
-
new EntityReferenceTarget(variable.value.value, meaning.
|
6205
|
+
new EntityReferenceTarget(variable.value.value, meaning.accessKind),
|
6234
6206
|
variable.localization
|
6235
6207
|
);
|
6236
6208
|
result = new ReferenceNodeSemanticInfo([target], false);
|
6237
6209
|
} else if (variable.value.kind === "type-member") {
|
6238
6210
|
const target = new SimpleWithLocalization(
|
6239
|
-
new TypeVariableReferenceTarget(variable.value.value, meaning.
|
6211
|
+
new TypeVariableReferenceTarget(variable.value.value, meaning.accessKind),
|
6240
6212
|
variable.localization
|
6241
6213
|
);
|
6242
6214
|
result = new ReferenceNodeSemanticInfo([target], false);
|
@@ -6262,11 +6234,14 @@ var NodeSemanticInfoService = class {
|
|
6262
6234
|
let target;
|
6263
6235
|
switch (d.value.kind) {
|
6264
6236
|
case "method":
|
6237
|
+
target = new EntityReferenceTarget(d.value.value.getEntity(), 0 /* Get */);
|
6238
|
+
break;
|
6265
6239
|
case "variable":
|
6266
|
-
case "type":
|
6267
6240
|
target = new EntityReferenceTarget(d.value.value.getEntity(), 0 /* Get */);
|
6268
6241
|
break;
|
6269
|
-
case "
|
6242
|
+
case "type":
|
6243
|
+
target = new EntityReferenceTarget(d.value.value, 0 /* Get */);
|
6244
|
+
break;
|
6270
6245
|
case "package-alias":
|
6271
6246
|
target = new EntityReferenceTarget(d.value.value, 0 /* Get */);
|
6272
6247
|
break;
|
@@ -6312,19 +6287,28 @@ var NodeSemanticInfoService = class {
|
|
6312
6287
|
return new DefinitionNodeSemanticInfo(entity);
|
6313
6288
|
}
|
6314
6289
|
static ofIndexedAccessExpressionOperator(analyzer, node, options6) {
|
6315
|
-
const meaning = analyzer.
|
6290
|
+
const meaning = analyzer.resolveIndexedAccessExpression(node).meaning;
|
6316
6291
|
if (meaning.kind === "resolved") {
|
6317
|
-
|
6318
|
-
|
6319
|
-
|
6320
|
-
|
6321
|
-
|
6322
|
-
|
6292
|
+
let result;
|
6293
|
+
if (isNonEmptyArray(meaning.suitableIndexers)) {
|
6294
|
+
result = createIndexersReference(
|
6295
|
+
meaning.suitableIndexers,
|
6296
|
+
meaning.accessKind,
|
6297
|
+
meaning.suitableIndexers.length > 1
|
6298
|
+
);
|
6299
|
+
} else if (isNonEmptyArray(meaning.candidates)) {
|
6300
|
+
result = createIndexersReference(meaning.candidates, meaning.accessKind, true);
|
6301
|
+
}
|
6302
|
+
if (result !== void 0 && options6.includeBetterReferenceTargets) {
|
6323
6303
|
result = this.getBetterReferenceTargetsOrPreserve(result);
|
6324
6304
|
}
|
6325
6305
|
return result;
|
6326
6306
|
}
|
6327
6307
|
return void 0;
|
6308
|
+
function createIndexersReference(indexers, accessKind, isAmbiguous) {
|
6309
|
+
const targets = indexers.map((i) => new SimpleWithLocalization(new TypeIndexerReferenceTarget(i.value, accessKind), i.localization));
|
6310
|
+
return new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), isAmbiguous);
|
6311
|
+
}
|
6328
6312
|
}
|
6329
6313
|
static ofAssignmentStatementOperator(analyzer, node, options6) {
|
6330
6314
|
const operatorKind = analyzer.getBinaryOperatorKindIfCompoundAssignmentOperator(node.operator);
|
@@ -6385,7 +6369,7 @@ var NodeSemanticInfoService = class {
|
|
6385
6369
|
const meaning = analyzer.getDereferenceExpressionMeaning(node);
|
6386
6370
|
if (meaning.kind === "resolved") {
|
6387
6371
|
const target = new SimpleWithLocalization(
|
6388
|
-
new TypeDereferenceOperatorReferenceTarget(meaning.operator.value, meaning.
|
6372
|
+
new TypeDereferenceOperatorReferenceTarget(meaning.operator.value, meaning.accessKind),
|
6389
6373
|
meaning.operator.localization
|
6390
6374
|
);
|
6391
6375
|
let result = new ReferenceNodeSemanticInfo([target], false);
|
@@ -6499,7 +6483,7 @@ var NodeSemanticInfoService = class {
|
|
6499
6483
|
}
|
6500
6484
|
static ofPackageNameSegmentAccess(analyzer, packageTreeNode, node) {
|
6501
6485
|
let parent = getParentSkippingParenthesizedExpressions(node);
|
6502
|
-
while (parent.kind ===
|
6486
|
+
while (parent.kind === 78 /* PropertyAccessExpression */) {
|
6503
6487
|
const meaning = analyzer.resolvePropertyAccessExpression(parent).meaning;
|
6504
6488
|
if (meaning.kind === "package-name-segment-access") {
|
6505
6489
|
packageTreeNode = meaning.packageTreeNode;
|
@@ -6521,7 +6505,7 @@ var NodeSemanticInfoService = class {
|
|
6521
6505
|
false
|
6522
6506
|
);
|
6523
6507
|
}
|
6524
|
-
static
|
6508
|
+
static ofMaybeConstructorCallExpression(analyzer, types, typeAccessExpression, options6) {
|
6525
6509
|
if (types.length === 0) {
|
6526
6510
|
return void 0;
|
6527
6511
|
}
|
@@ -6540,7 +6524,7 @@ var NodeSemanticInfoService = class {
|
|
6540
6524
|
let parentCallExpression;
|
6541
6525
|
if (parent.kind === 69 /* CallExpression */) {
|
6542
6526
|
parentCallExpression = parent;
|
6543
|
-
} else if (parent.kind ===
|
6527
|
+
} else if (parent.kind === 89 /* GenericSpecializationExpression */) {
|
6544
6528
|
const grandParent = getParentSkippingParenthesizedExpressions(parent);
|
6545
6529
|
if (grandParent.kind === 69 /* CallExpression */) {
|
6546
6530
|
parentCallExpression = grandParent;
|
@@ -6548,17 +6532,14 @@ var NodeSemanticInfoService = class {
|
|
6548
6532
|
}
|
6549
6533
|
if (parentCallExpression !== void 0) {
|
6550
6534
|
const meaning = analyzer.getCallExpressionMeaning(parentCallExpression);
|
6551
|
-
if (meaning.kind === "constructor-call"
|
6552
|
-
|
6553
|
-
|
6554
|
-
|
6555
|
-
|
6556
|
-
|
6557
|
-
|
6558
|
-
|
6559
|
-
targets.length > 1,
|
6560
|
-
createNonEmptyArray(betterTargets)
|
6561
|
-
);
|
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
|
+
}
|
6562
6543
|
}
|
6563
6544
|
}
|
6564
6545
|
if (typeEntities.length > 0) {
|
@@ -6607,7 +6588,7 @@ var NodeSemanticInfoService = class {
|
|
6607
6588
|
);
|
6608
6589
|
}
|
6609
6590
|
}
|
6610
|
-
} else if (currentTarget.value.kind === "entity" && currentTarget.value.entity.kind ===
|
6591
|
+
} else if (currentTarget.value.kind === "entity" && currentTarget.value.entity.kind === 1 /* Method */) {
|
6611
6592
|
}
|
6612
6593
|
if (betterTarget !== void 0) {
|
6613
6594
|
result = betterTarget;
|
@@ -6743,7 +6724,7 @@ var SimpleWithLocalization = class {
|
|
6743
6724
|
|
6744
6725
|
// source/services/Utils.ts
|
6745
6726
|
function getEntitySourceLocations(analyzer, entity) {
|
6746
|
-
if (entity.kind ===
|
6727
|
+
if (entity.kind === 12 /* Package */) {
|
6747
6728
|
return void 0;
|
6748
6729
|
}
|
6749
6730
|
let result;
|
@@ -6764,7 +6745,7 @@ function getEntitySourceLocations(analyzer, entity) {
|
|
6764
6745
|
Debug.never(definition.value);
|
6765
6746
|
}
|
6766
6747
|
}
|
6767
|
-
} else if (entity.kind ===
|
6748
|
+
} else if (entity.kind === 5 /* Indexer */) {
|
6768
6749
|
const definition = entity.getDefinition();
|
6769
6750
|
if (definition.kind === 0 /* Source */) {
|
6770
6751
|
result = definition.nodes.map((d) => {
|
@@ -6773,7 +6754,7 @@ function getEntitySourceLocations(analyzer, entity) {
|
|
6773
6754
|
return new SourceLocation(sourceFile, range);
|
6774
6755
|
});
|
6775
6756
|
}
|
6776
|
-
} else if (entity.kind ===
|
6757
|
+
} else if (entity.kind === 6 /* DereferenceOperator */) {
|
6777
6758
|
const definition = entity.getDefinition();
|
6778
6759
|
if (definition.kind === 0 /* Source */) {
|
6779
6760
|
result = definition.nodes.map((d) => {
|
@@ -6792,7 +6773,7 @@ function getEntitySourceLocations(analyzer, entity) {
|
|
6792
6773
|
case 18 /* AnonymousStructuredTypeDeclaration */:
|
6793
6774
|
case 19 /* AnonymousVariantTypeDeclaration */:
|
6794
6775
|
case 67 /* MethodBlockLiteral */:
|
6795
|
-
case
|
6776
|
+
case 74 /* MethodLiteral */:
|
6796
6777
|
range = node.rangeWithoutTrivia;
|
6797
6778
|
break;
|
6798
6779
|
case 22 /* PackageAliasTypeDeclaration */:
|
@@ -6803,7 +6784,6 @@ function getEntitySourceLocations(analyzer, entity) {
|
|
6803
6784
|
case 58 /* NestedMethodDeclaration */:
|
6804
6785
|
case 52 /* TypeMethodDeclaration */:
|
6805
6786
|
case 141 /* TypeParameterDeclaration */:
|
6806
|
-
case 140 /* VariantDeclaration */:
|
6807
6787
|
case 53 /* OperatorDeclaration */:
|
6808
6788
|
range = node.name.rangeWithoutTrivia;
|
6809
6789
|
break;
|
@@ -7050,7 +7030,7 @@ var ReferencesService = class {
|
|
7050
7030
|
const result = [];
|
7051
7031
|
const restrictions = this.getReferenceRestrictions(definition, options6);
|
7052
7032
|
let semanticInfoOptions;
|
7053
|
-
if (definition.value.kind ===
|
7033
|
+
if (definition.value.kind === 7 /* Constructor */) {
|
7054
7034
|
semanticInfoOptions = {
|
7055
7035
|
preferredTargetOfExplicitConstructorCall: "constructor-declaration",
|
7056
7036
|
includeBetterReferenceTargets: true
|
@@ -7092,7 +7072,7 @@ var ReferencesService = class {
|
|
7092
7072
|
result.push(new Reference(sourceFile2, node.autotypeKeyword.rangeWithoutTrivia, referenceKind));
|
7093
7073
|
}
|
7094
7074
|
}
|
7095
|
-
if (node.kind ===
|
7075
|
+
if (node.kind === 77 /* PrefixUnaryExpression */ && restrictions.canBePrefixUnaryOperator) {
|
7096
7076
|
const semanticInfo = NodeSemanticInfoService.ofPrefixUnaryExpressionOperator(
|
7097
7077
|
analyzer,
|
7098
7078
|
node,
|
@@ -7136,7 +7116,7 @@ var ReferencesService = class {
|
|
7136
7116
|
result.push(new Reference(sourceFile2, node.caretToken.rangeWithoutTrivia, referenceKind));
|
7137
7117
|
}
|
7138
7118
|
}
|
7139
|
-
if (node.kind ===
|
7119
|
+
if (node.kind === 80 /* DereferenceExpression */ && restrictions.canBeDereferenceOperator) {
|
7140
7120
|
const semanticInfo = NodeSemanticInfoService.ofDereferenceExpressionOperator(
|
7141
7121
|
analyzer,
|
7142
7122
|
node,
|
@@ -7152,7 +7132,7 @@ var ReferencesService = class {
|
|
7152
7132
|
result.push(new Reference(sourceFile2, node.caretToken.rangeWithoutTrivia, referenceKind));
|
7153
7133
|
}
|
7154
7134
|
}
|
7155
|
-
if (node.kind ===
|
7135
|
+
if (node.kind === 91 /* AssignmentStatement */ && restrictions.canBeAssignmentStatementOperator) {
|
7156
7136
|
const semanticInfo = NodeSemanticInfoService.ofAssignmentStatementOperator(
|
7157
7137
|
analyzer,
|
7158
7138
|
node,
|
@@ -7180,7 +7160,7 @@ var ReferencesService = class {
|
|
7180
7160
|
result.push(new Reference(sourceFile2, node.creationKeyword.rangeWithoutTrivia, referenceKind));
|
7181
7161
|
}
|
7182
7162
|
}
|
7183
|
-
if (node.kind ===
|
7163
|
+
if (node.kind === 86 /* ObjectExpression */ && restrictions.canBeObjectExpression) {
|
7184
7164
|
const semanticInfo = NodeSemanticInfoService.ofObjectExpression(analyzer, node, semanticInfoOptions);
|
7185
7165
|
const referenceKind = this.ifReferenceToDefinitionThenKind(
|
7186
7166
|
definition,
|
@@ -7192,7 +7172,7 @@ var ReferencesService = class {
|
|
7192
7172
|
result.push(new Reference(sourceFile2, node.keyword.rangeWithoutTrivia, referenceKind));
|
7193
7173
|
}
|
7194
7174
|
}
|
7195
|
-
if (node.kind ===
|
7175
|
+
if (node.kind === 87 /* BaseExpression */ && restrictions.canBeBaseExpression) {
|
7196
7176
|
const semanticInfo = NodeSemanticInfoService.ofBaseExpression(analyzer, node, semanticInfoOptions);
|
7197
7177
|
const referenceKind = this.ifReferenceToDefinitionThenKind(
|
7198
7178
|
definition,
|
@@ -7216,7 +7196,7 @@ var ReferencesService = class {
|
|
7216
7196
|
result.push(new Reference(sourceFile2, node.parameterClause.rangeWithoutTrivia, referenceKind));
|
7217
7197
|
}
|
7218
7198
|
}
|
7219
|
-
if (node.kind ===
|
7199
|
+
if (node.kind === 71 /* IndexedAccessExpression */ && restrictions.canBeIndexer) {
|
7220
7200
|
const semanticInfo = NodeSemanticInfoService.ofIndexedAccessExpressionOperator(
|
7221
7201
|
analyzer,
|
7222
7202
|
node,
|
@@ -7370,7 +7350,7 @@ var ReferencesService = class {
|
|
7370
7350
|
getReferenceRestrictions(definition, _options) {
|
7371
7351
|
const result = new ReferenceRestrictions();
|
7372
7352
|
let namedDefinitionInfo;
|
7373
|
-
if (definition.value.kind ===
|
7353
|
+
if (definition.value.kind === 7 /* Constructor */) {
|
7374
7354
|
const type = definition.value.getContainer().getContextualType();
|
7375
7355
|
if (type !== void 0) {
|
7376
7356
|
namedDefinitionInfo = this.isEntityWithRegularName(type);
|
@@ -7381,11 +7361,11 @@ var ReferencesService = class {
|
|
7381
7361
|
if (namedDefinitionInfo !== void 0) {
|
7382
7362
|
result.canBeIdentifier = true;
|
7383
7363
|
}
|
7384
|
-
if (definition.value.kind ===
|
7364
|
+
if (definition.value.kind === 7 /* Constructor */) {
|
7385
7365
|
result.canBeAutotypeCall = true;
|
7386
7366
|
result.canBeConstructorDeclaration = true;
|
7387
7367
|
}
|
7388
|
-
if (definition.value.kind ===
|
7368
|
+
if (definition.value.kind === 9 /* Operator */) {
|
7389
7369
|
const operatorKind = definition.value.getOperatorKind();
|
7390
7370
|
if (isUnaryOperator(operatorKind)) {
|
7391
7371
|
result.canBePrefixUnaryOperator = true;
|
@@ -7394,17 +7374,17 @@ var ReferencesService = class {
|
|
7394
7374
|
result.canBeAssignmentStatementOperator = true;
|
7395
7375
|
}
|
7396
7376
|
}
|
7397
|
-
if (definition.value.kind ===
|
7377
|
+
if (definition.value.kind === 6 /* DereferenceOperator */) {
|
7398
7378
|
result.canBeDereferenceOperator = true;
|
7399
7379
|
}
|
7400
|
-
if (isTypeEntity(definition.value) || definition.value.kind ===
|
7380
|
+
if (isTypeEntity(definition.value) || definition.value.kind === 7 /* Constructor */) {
|
7401
7381
|
result.canBeObjectExpression = true;
|
7402
7382
|
result.canBeBaseExpression = true;
|
7403
7383
|
}
|
7404
|
-
if (definition.value.kind ===
|
7384
|
+
if (definition.value.kind === 1 /* Method */) {
|
7405
7385
|
result.canBeBaseExpression = true;
|
7406
7386
|
}
|
7407
|
-
if (definition.value.kind ===
|
7387
|
+
if (definition.value.kind === 5 /* Indexer */) {
|
7408
7388
|
result.canBeIndexer = true;
|
7409
7389
|
}
|
7410
7390
|
return result;
|
@@ -7438,46 +7418,50 @@ var ReferencesService = class {
|
|
7438
7418
|
switch (entity.kind) {
|
7439
7419
|
case 0 /* Variable */:
|
7440
7420
|
return { name: entity.getName() };
|
7441
|
-
case
|
7442
|
-
|
7443
|
-
|
7444
|
-
|
7445
|
-
|
7446
|
-
|
7447
|
-
|
7448
|
-
|
7449
|
-
|
7450
|
-
|
7451
|
-
|
7452
|
-
|
7453
|
-
|
7454
|
-
|
7455
|
-
|
7456
|
-
|
7457
|
-
|
7458
|
-
|
7459
|
-
|
7460
|
-
|
7461
|
-
|
7462
|
-
|
7463
|
-
|
7464
|
-
|
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);
|
7465
7450
|
}
|
7466
|
-
return void 0;
|
7467
7451
|
}
|
7468
|
-
case
|
7452
|
+
case 1 /* Method */:
|
7469
7453
|
return { name: entity.getName() };
|
7470
|
-
case
|
7454
|
+
case 10 /* PackageAlias */:
|
7471
7455
|
return { name: entity.getName() };
|
7472
7456
|
case 3 /* Getter */:
|
7473
7457
|
case 4 /* Setter */:
|
7474
|
-
case
|
7475
|
-
case
|
7476
|
-
case
|
7477
|
-
case
|
7478
|
-
case
|
7479
|
-
case
|
7480
|
-
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 */:
|
7481
7465
|
return void 0;
|
7482
7466
|
default:
|
7483
7467
|
Debug.never(entity);
|
@@ -7589,9 +7573,9 @@ var EvaluatableExpressionService = class {
|
|
7589
7573
|
getEvaluatableExpressionForIdentifier(node) {
|
7590
7574
|
const parent = node.parent;
|
7591
7575
|
switch (parent.kind) {
|
7592
|
-
case
|
7576
|
+
case 88 /* IdentifierExpression */:
|
7593
7577
|
return parent;
|
7594
|
-
case
|
7578
|
+
case 78 /* PropertyAccessExpression */:
|
7595
7579
|
if (this.isEvaluatableReceiver(parent.expression)) {
|
7596
7580
|
return parent;
|
7597
7581
|
}
|
@@ -7612,9 +7596,9 @@ var EvaluatableExpressionService = class {
|
|
7612
7596
|
}
|
7613
7597
|
isEvaluatableReceiver(expression) {
|
7614
7598
|
switch (expression.kind) {
|
7615
|
-
case
|
7599
|
+
case 88 /* IdentifierExpression */:
|
7616
7600
|
return true;
|
7617
|
-
case
|
7601
|
+
case 78 /* PropertyAccessExpression */:
|
7618
7602
|
return this.isEvaluatableReceiver(expression.expression);
|
7619
7603
|
default:
|
7620
7604
|
return false;
|
@@ -8124,14 +8108,14 @@ var SourceFileItemsService = class {
|
|
8124
8108
|
case 4 /* PackageMethod */:
|
8125
8109
|
case 15 /* TypeMethod */:
|
8126
8110
|
case 19 /* NestedMethod */:
|
8127
|
-
return name ?? `<${LocalizationHelper.localizeKeywordAndTakeFirst(
|
8111
|
+
return name ?? `<${LocalizationHelper.localizeKeywordAndTakeFirst(12 /* Function */, this.locale, this.dialect)}>`;
|
8128
8112
|
case 5 /* StructuredType */:
|
8129
8113
|
case 6 /* MethodType */:
|
8130
8114
|
case 7 /* VariantType */:
|
8131
8115
|
case 8 /* InvalidType */:
|
8132
|
-
return name ?? `<${LocalizationHelper.localizeKeywordAndTakeFirst(
|
8116
|
+
return name ?? `<${LocalizationHelper.localizeKeywordAndTakeFirst(16 /* Type */, this.locale, this.dialect)}>`;
|
8133
8117
|
case 10 /* TypeConstructor */:
|
8134
|
-
return name ?? LocalizationHelper.localizeKeywordAndTakeFirst(
|
8118
|
+
return name ?? LocalizationHelper.localizeKeywordAndTakeFirst(29 /* Creation */, this.locale, this.dialect);
|
8135
8119
|
case 11 /* TypeDestructor */:
|
8136
8120
|
return name ?? LocalizationHelper.localizeKeywordAndTakeFirst(46 /* Destruction */, this.locale, this.dialect);
|
8137
8121
|
case 9 /* Variant */:
|
@@ -8307,7 +8291,7 @@ var SelectionRangeService = class {
|
|
8307
8291
|
if (!this.nodeShouldBeSkipped(child) && !child.rangeWithoutTrivia.equals(result.range)) {
|
8308
8292
|
result = new SelectionRange(child.rangeWithoutTrivia, result);
|
8309
8293
|
}
|
8310
|
-
if (child.kind === 0 /* Token */ && (child.tokenKind === 6 /* TextLiteral */ || child.tokenKind === 7 /* TextTemplateHead */ || child.tokenKind === 8 /* TextTemplatePart */ || child.tokenKind === 9 /* TextTemplateTail */ || child.tokenKind === 5 /* CharLiteral */) || child.kind ===
|
8294
|
+
if (child.kind === 0 /* Token */ && (child.tokenKind === 6 /* TextLiteral */ || child.tokenKind === 7 /* TextTemplateHead */ || child.tokenKind === 8 /* TextTemplatePart */ || child.tokenKind === 9 /* TextTemplateTail */ || child.tokenKind === 5 /* CharLiteral */) || child.kind === 81 /* TextTemplateLiteral */) {
|
8311
8295
|
const textContentStart = child.rangeWithoutTrivia.start + 1;
|
8312
8296
|
const textContentEnd = child.rangeWithoutTrivia.end - 1;
|
8313
8297
|
if (offset >= textContentStart && offset < textContentEnd) {
|
@@ -8338,13 +8322,13 @@ var SelectionRangeService = class {
|
|
8338
8322
|
}
|
8339
8323
|
}
|
8340
8324
|
switch (node.kind) {
|
8341
|
-
case
|
8325
|
+
case 154 /* TypeAnnotation */:
|
8342
8326
|
case 34 /* StructuredTypeDeclarationBody */:
|
8343
8327
|
case 39 /* VariantTypeDeclarationBody */:
|
8344
8328
|
case 23 /* AliasTypeDeclarationBody */:
|
8345
8329
|
case 29 /* MethodTypeDeclarationBody */:
|
8346
|
-
case
|
8347
|
-
case
|
8330
|
+
case 83 /* TextTemplateSpan */:
|
8331
|
+
case 82 /* TextTemplateSpanList */:
|
8348
8332
|
return true;
|
8349
8333
|
default:
|
8350
8334
|
return false;
|
@@ -8382,33 +8366,41 @@ var SemanticTokensService = class {
|
|
8382
8366
|
controller.stopChildrenTraverse();
|
8383
8367
|
return;
|
8384
8368
|
}
|
8385
|
-
if (node.kind ===
|
8369
|
+
if (node.kind === 88 /* IdentifierExpression */) {
|
8386
8370
|
const meaning = analyzer.resolveIdentifierExpression(node).meaning;
|
8387
8371
|
if (meaning.kind === "variable-access") {
|
8388
8372
|
const variable = meaning.variable.value.getEntity();
|
8389
|
-
|
8390
|
-
|
8391
|
-
|
8392
|
-
|
8393
|
-
|
8394
|
-
|
8395
|
-
|
8396
|
-
|
8397
|
-
|
8398
|
-
|
8399
|
-
|
8400
|
-
|
8401
|
-
|
8402
|
-
|
8403
|
-
|
8404
|
-
|
8405
|
-
|
8406
|
-
|
8407
|
-
|
8408
|
-
|
8409
|
-
|
8410
|
-
|
8411
|
-
|
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
|
+
}
|
8412
8404
|
}
|
8413
8405
|
}
|
8414
8406
|
}
|
@@ -8422,15 +8414,6 @@ var SemanticTokensService = class {
|
|
8422
8414
|
)
|
8423
8415
|
);
|
8424
8416
|
}
|
8425
|
-
if (meaning.kind === "variant-access") {
|
8426
|
-
result.push(
|
8427
|
-
new SemanticToken(
|
8428
|
-
node.rangeWithoutTrivia,
|
8429
|
-
3 /* Variant */,
|
8430
|
-
new SemanticTokenModifiers().makeConst()
|
8431
|
-
)
|
8432
|
-
);
|
8433
|
-
}
|
8434
8417
|
if (meaning.kind === "operator-access") {
|
8435
8418
|
result.push(new SemanticToken(
|
8436
8419
|
node.rangeWithoutTrivia,
|
@@ -8439,16 +8422,19 @@ var SemanticTokensService = class {
|
|
8439
8422
|
));
|
8440
8423
|
}
|
8441
8424
|
}
|
8442
|
-
if (node.kind ===
|
8425
|
+
if (node.kind === 78 /* PropertyAccessExpression */) {
|
8443
8426
|
const meaning = analyzer.resolvePropertyAccessExpression(node).meaning;
|
8444
|
-
if (meaning.kind === "
|
8445
|
-
|
8446
|
-
|
8447
|
-
|
8448
|
-
|
8449
|
-
|
8450
|
-
|
8451
|
-
|
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
|
+
}
|
8452
8438
|
}
|
8453
8439
|
let suitableMethods;
|
8454
8440
|
switch (meaning.kind) {
|
@@ -8648,7 +8634,7 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8648
8634
|
const infos = signatures.map(
|
8649
8635
|
(s) => convertSignatureDisplayPartsToSignatureInfo(s.getDisplayParts(), argumentIndex)
|
8650
8636
|
);
|
8651
|
-
const activeSignature = Query.from(signatures).
|
8637
|
+
const activeSignature = Query.from(signatures).first((s) => s.getArity() >= argumentCount) ?? Query.from(signatures).maxByValue((s) => s.getArity());
|
8652
8638
|
if (activeSignature !== void 0) {
|
8653
8639
|
const activeSignatureIndex = signatures.indexOf(activeSignature);
|
8654
8640
|
result = new SignatureHelp(infos, activeSignatureIndex);
|
@@ -8664,7 +8650,7 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8664
8650
|
}
|
8665
8651
|
let node = token.parent;
|
8666
8652
|
while (node !== void 0) {
|
8667
|
-
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)) {
|
8668
8654
|
const argumentIndex = this.getArgumentIndex(node.typeArgumentList, this._offset);
|
8669
8655
|
const argumentCount = this.countArguments(node.typeArgumentList);
|
8670
8656
|
return new NodeWithTypeArgumentsInfo(node.parent, argumentIndex, argumentCount);
|
@@ -8709,8 +8695,10 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8709
8695
|
switch (node.kind) {
|
8710
8696
|
case 10 /* NamedTypeSpecifier */:
|
8711
8697
|
return this.getSignaturesForNamedTypeSpecifier(node);
|
8712
|
-
case
|
8698
|
+
case 89 /* GenericSpecializationExpression */:
|
8713
8699
|
return this.getSignaturesForGenericSpecializationExpression(node);
|
8700
|
+
case 145 /* Tag */:
|
8701
|
+
return this.getSignaturesForTag(node);
|
8714
8702
|
default:
|
8715
8703
|
Debug.never(node);
|
8716
8704
|
}
|
@@ -8725,9 +8713,30 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8725
8713
|
}
|
8726
8714
|
return void 0;
|
8727
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
|
+
}
|
8728
8737
|
getSignaturesForGenericSpecializationExpression(node) {
|
8729
8738
|
const expression = unwrapParenthesizedExpressions(node.expression);
|
8730
|
-
if (expression.kind ===
|
8739
|
+
if (expression.kind === 88 /* IdentifierExpression */) {
|
8731
8740
|
const meaning = this._analyzer.resolveIdentifierExpression(expression).meaning;
|
8732
8741
|
if (meaning.kind === "method-access") {
|
8733
8742
|
return Query.from(meaning.candidates).mapAndFilter((o) => {
|
@@ -8742,7 +8751,7 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8742
8751
|
}
|
8743
8752
|
return void 0;
|
8744
8753
|
}
|
8745
|
-
if (expression.kind ===
|
8754
|
+
if (expression.kind === 78 /* PropertyAccessExpression */) {
|
8746
8755
|
const meaning = this._analyzer.resolvePropertyAccessExpression(expression).meaning;
|
8747
8756
|
let accessedMethods;
|
8748
8757
|
if (meaning.kind === "instance-method-access") {
|
@@ -8772,12 +8781,12 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8772
8781
|
switch (method.kind) {
|
8773
8782
|
case "entity":
|
8774
8783
|
if (method.entity.getTypeParametersArity() > 0) {
|
8775
|
-
result = new
|
8784
|
+
result = new MethodEntitySignature(this.signatureContext, method.entity, localization);
|
8776
8785
|
}
|
8777
8786
|
break;
|
8778
8787
|
case "type-member":
|
8779
8788
|
if (method.method.getTypeParametersArity() > 0) {
|
8780
|
-
result = new
|
8789
|
+
result = new TypeMethodSignature(this.signatureContext, method.method, localization);
|
8781
8790
|
}
|
8782
8791
|
break;
|
8783
8792
|
default:
|
@@ -8787,28 +8796,28 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8787
8796
|
}
|
8788
8797
|
getSignatureForNamedType(type) {
|
8789
8798
|
let result = void 0;
|
8790
|
-
switch (type.
|
8791
|
-
case
|
8799
|
+
switch (type.typeEntityKind) {
|
8800
|
+
case 1 /* Structured */:
|
8792
8801
|
if (type.getArity() > 0) {
|
8793
8802
|
result = new StructuredTypeSignature(this.signatureContext, type);
|
8794
8803
|
}
|
8795
8804
|
break;
|
8796
|
-
case
|
8805
|
+
case 0 /* Method */:
|
8797
8806
|
if (type.getArity() > 0) {
|
8798
8807
|
result = new MethodTypeSignature2(this.signatureContext, type);
|
8799
8808
|
}
|
8800
8809
|
break;
|
8801
|
-
case
|
8810
|
+
case 3 /* Variant */:
|
8802
8811
|
if (type.getArity() > 0) {
|
8803
8812
|
result = new VariantTypeSignature(this.signatureContext, type);
|
8804
8813
|
}
|
8805
8814
|
break;
|
8806
|
-
case
|
8815
|
+
case 4 /* Alias */:
|
8807
8816
|
if (type.getArity() > 0) {
|
8808
8817
|
result = new AliasTypeSignature(this.signatureContext, type);
|
8809
8818
|
}
|
8810
8819
|
break;
|
8811
|
-
case
|
8820
|
+
case 2 /* Parameter */:
|
8812
8821
|
break;
|
8813
8822
|
default:
|
8814
8823
|
Debug.never(type);
|
@@ -8823,7 +8832,7 @@ var NodeWithTypeArgumentsInfo = class {
|
|
8823
8832
|
this.argumentCount = argumentCount;
|
8824
8833
|
}
|
8825
8834
|
};
|
8826
|
-
var
|
8835
|
+
var MethodEntitySignature = class {
|
8827
8836
|
constructor(ctx, method, localization) {
|
8828
8837
|
this.ctx = ctx;
|
8829
8838
|
this.method = method;
|
@@ -8839,7 +8848,7 @@ var MethodEntitySignature2 = class {
|
|
8839
8848
|
return this.ctx.convertMethodDisplayParts(displayParts);
|
8840
8849
|
}
|
8841
8850
|
};
|
8842
|
-
var
|
8851
|
+
var TypeMethodSignature = class {
|
8843
8852
|
constructor(ctx, method, localization) {
|
8844
8853
|
this.ctx = ctx;
|
8845
8854
|
this.method = method;
|
@@ -8998,7 +9007,7 @@ var ValueParametersSignatureHelpProvider = class {
|
|
8998
9007
|
case 69 /* CallExpression */: {
|
8999
9008
|
if (this._offset >= node.openParenthesisToken.rangeWithoutTrivia.end && (node.closeParenthesisToken.rangeWithoutTrivia.isEmpty || this._offset <= node.closeParenthesisToken.rangeWithoutTrivia.start)) {
|
9000
9009
|
const valueArguments = ValueArgumentFactory.createValueArgumentsOfCallExpression(node);
|
9001
|
-
const argumentIndex = this.getArgumentIndexInList(node.
|
9010
|
+
const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
|
9002
9011
|
return new NodeWithValueArgumentsInfo(node, valueArguments, argumentIndex);
|
9003
9012
|
}
|
9004
9013
|
break;
|
@@ -9006,22 +9015,22 @@ var ValueParametersSignatureHelpProvider = class {
|
|
9006
9015
|
case 70 /* AutotypeCallExpression */: {
|
9007
9016
|
if (this._offset >= node.openParenthesisToken.rangeWithoutTrivia.end && (node.closeParenthesisToken.rangeWithoutTrivia.isEmpty || this._offset <= node.closeParenthesisToken.rangeWithoutTrivia.start)) {
|
9008
9017
|
const valueArguments = ValueArgumentFactory.createValueArgumentsOfAutotypeCallExpression(node);
|
9009
|
-
const argumentIndex = this.getArgumentIndexInList(node.
|
9018
|
+
const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
|
9010
9019
|
return new NodeWithValueArgumentsInfo(node, valueArguments, argumentIndex);
|
9011
9020
|
}
|
9012
9021
|
break;
|
9013
9022
|
}
|
9014
|
-
case
|
9023
|
+
case 71 /* IndexedAccessExpression */: {
|
9015
9024
|
if (this._offset >= node.openSquareBracketToken.rangeWithoutTrivia.end && (node.closeSquareBracketToken.rangeWithoutTrivia.isEmpty || this._offset <= node.closeSquareBracketToken.rangeWithoutTrivia.start)) {
|
9016
9025
|
const valueArguments = ValueArgumentFactory.createValueArgumentsOfIndexedAccessExpression(node);
|
9017
|
-
const argumentIndex = this.getArgumentIndexInList(node.
|
9026
|
+
const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
|
9018
9027
|
return new NodeWithValueArgumentsInfo(node, valueArguments, argumentIndex);
|
9019
9028
|
}
|
9020
9029
|
break;
|
9021
9030
|
}
|
9022
9031
|
case 145 /* Tag */: {
|
9023
|
-
if (node.openParenthesisToken !== void 0 && this._offset >= node.openParenthesisToken.rangeWithoutTrivia.end && node.
|
9024
|
-
const argumentIndex = this.getArgumentIndexInList(node.
|
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);
|
9025
9034
|
const valueArguments = ValueArgumentFactory.createValueArgumentsOfTag(node);
|
9026
9035
|
return new NodeWithValueArgumentsInfo(node, valueArguments, argumentIndex);
|
9027
9036
|
}
|
@@ -9047,24 +9056,8 @@ var ValueParametersSignatureHelpProvider = class {
|
|
9047
9056
|
}
|
9048
9057
|
getSignatureDisplayParts(signature) {
|
9049
9058
|
switch (signature.kind) {
|
9050
|
-
case "method
|
9051
|
-
const method = new
|
9052
|
-
signature.method.value,
|
9053
|
-
signature.method.localization
|
9054
|
-
);
|
9055
|
-
const displayParts = this.signatureContext.displayService.getMethodDeclarationDisplayParts(method);
|
9056
|
-
return this.signatureContext.convertMethodDisplayParts(displayParts);
|
9057
|
-
}
|
9058
|
-
case "type-method": {
|
9059
|
-
const method = new MethodDeclaration_typeMember(
|
9060
|
-
signature.method.value,
|
9061
|
-
signature.method.localization
|
9062
|
-
);
|
9063
|
-
const displayParts = this.signatureContext.displayService.getMethodDeclarationDisplayParts(method);
|
9064
|
-
return this.signatureContext.convertMethodDisplayParts(displayParts);
|
9065
|
-
}
|
9066
|
-
case "substituted-method": {
|
9067
|
-
const method = new MethodDeclaration_substitutedMethod(
|
9059
|
+
case "accessed-method": {
|
9060
|
+
const method = new MethodDeclaration_accessedMethod(
|
9068
9061
|
signature.method.value,
|
9069
9062
|
signature.method.localization
|
9070
9063
|
);
|
@@ -9161,16 +9154,16 @@ var SignatureInfo = class {
|
|
9161
9154
|
};
|
9162
9155
|
|
9163
9156
|
// source/services/source-generation/SourceGenerationService.ts
|
9164
|
-
import { atomicRun as atomicRun2,
|
9157
|
+
import { atomicRun as atomicRun2, TriggeringMap as TriggeringMap6, TriggeringObject as TriggeringObject7, reaction as reaction6, Transaction as Transaction4 } from "reactronic";
|
9165
9158
|
|
9166
9159
|
// source/services/workspace/ClientTrackedSourceFiles.ts
|
9167
|
-
import {
|
9168
|
-
var ClientTrackedSourceFiles = class extends
|
9160
|
+
import { TriggeringMap, TriggeringObject, trigger, ReactiveSystem, atomicBlock } from "reactronic";
|
9161
|
+
var ClientTrackedSourceFiles = class extends TriggeringObject {
|
9169
9162
|
constructor() {
|
9170
9163
|
super(...arguments);
|
9171
|
-
this.items = new
|
9164
|
+
this.items = new TriggeringMap();
|
9172
9165
|
}
|
9173
|
-
// @
|
9166
|
+
// @cache
|
9174
9167
|
get unsaved() {
|
9175
9168
|
return Query.from(this.items.entries()).filter((e) => !e[1].isSaved).toMap((e) => e[0], (e) => e[1]);
|
9176
9169
|
}
|
@@ -9221,18 +9214,18 @@ var ClientTrackedSourceFiles = class extends ObservableObject {
|
|
9221
9214
|
}
|
9222
9215
|
};
|
9223
9216
|
__decorateClass([
|
9224
|
-
|
9217
|
+
atomicBlock
|
9225
9218
|
], ClientTrackedSourceFiles.prototype, "track", 1);
|
9226
9219
|
__decorateClass([
|
9227
|
-
|
9220
|
+
atomicBlock
|
9228
9221
|
], ClientTrackedSourceFiles.prototype, "update", 1);
|
9229
9222
|
__decorateClass([
|
9230
|
-
|
9223
|
+
atomicBlock
|
9231
9224
|
], ClientTrackedSourceFiles.prototype, "save", 1);
|
9232
9225
|
__decorateClass([
|
9233
|
-
|
9226
|
+
atomicBlock
|
9234
9227
|
], ClientTrackedSourceFiles.prototype, "close", 1);
|
9235
|
-
var ClientTrackedSourceFile = class extends
|
9228
|
+
var ClientTrackedSourceFile = class extends TriggeringObject {
|
9236
9229
|
constructor(uri, text, version, isSaved) {
|
9237
9230
|
super();
|
9238
9231
|
this.uri = uri;
|
@@ -9248,7 +9241,7 @@ var ClientTrackedSourceFile = class extends ObservableObject {
|
|
9248
9241
|
}
|
9249
9242
|
};
|
9250
9243
|
__decorateClass([
|
9251
|
-
|
9244
|
+
trigger(false)
|
9252
9245
|
], ClientTrackedSourceFile.prototype, "uri", 2);
|
9253
9246
|
var ClientTrackedSourceFileSnapshot = class {
|
9254
9247
|
constructor(uri, text, version, isSaved) {
|
@@ -9262,15 +9255,15 @@ var ClientTrackedSourceFileSnapshot = class {
|
|
9262
9255
|
// source/services/workspace/CompilationController.ts
|
9263
9256
|
import {
|
9264
9257
|
Indicator,
|
9265
|
-
|
9258
|
+
TriggeringObject as TriggeringObject2,
|
9266
9259
|
ReactiveSystem as ReactiveSystem2,
|
9267
9260
|
Reentrance,
|
9268
9261
|
Transaction,
|
9269
|
-
|
9262
|
+
atomicBlock as atomicBlock2,
|
9270
9263
|
nonReactiveRun,
|
9271
9264
|
options,
|
9272
|
-
|
9273
|
-
|
9265
|
+
reaction,
|
9266
|
+
trigger as trigger2
|
9274
9267
|
} from "reactronic";
|
9275
9268
|
var highPriorityDiagnosticsCollectionIndicator = Indicator.create(
|
9276
9269
|
"HighPriorityDiagnosticsCollectionIndicator",
|
@@ -9279,7 +9272,7 @@ var highPriorityDiagnosticsCollectionIndicator = Indicator.create(
|
|
9279
9272
|
100
|
9280
9273
|
);
|
9281
9274
|
var backgroundDiagnosticsCollectionThrottleTimeMs = 3e3;
|
9282
|
-
var CompilationController = class extends
|
9275
|
+
var CompilationController = class extends TriggeringObject2 {
|
9283
9276
|
constructor(config) {
|
9284
9277
|
super();
|
9285
9278
|
this.isConfigurationsProcessingEnabled = false;
|
@@ -9761,72 +9754,72 @@ var CompilationController = class extends ObservableObject2 {
|
|
9761
9754
|
}
|
9762
9755
|
};
|
9763
9756
|
__decorateClass([
|
9764
|
-
|
9757
|
+
trigger2(false)
|
9765
9758
|
], CompilationController.prototype, "mainCompilationReloadIndicator", 2);
|
9766
9759
|
__decorateClass([
|
9767
|
-
|
9760
|
+
trigger2(false)
|
9768
9761
|
], CompilationController.prototype, "configurationControllersUpdateIndictor", 2);
|
9769
9762
|
__decorateClass([
|
9770
|
-
|
9763
|
+
trigger2(false)
|
9771
9764
|
], CompilationController.prototype, "_mainAnalyzerChangedIndicator", 2);
|
9772
9765
|
__decorateClass([
|
9773
|
-
|
9766
|
+
trigger2(false)
|
9774
9767
|
], CompilationController.prototype, "_fileSystemTree", 2);
|
9775
9768
|
__decorateClass([
|
9776
|
-
|
9769
|
+
trigger2(false)
|
9777
9770
|
], CompilationController.prototype, "config", 2);
|
9778
9771
|
__decorateClass([
|
9779
|
-
|
9772
|
+
trigger2(false)
|
9780
9773
|
], CompilationController.prototype, "_rootDirectory", 2);
|
9781
9774
|
__decorateClass([
|
9782
|
-
|
9775
|
+
trigger2(false)
|
9783
9776
|
], CompilationController.prototype, "_previousCompilationLoadResult", 2);
|
9784
9777
|
__decorateClass([
|
9785
|
-
|
9778
|
+
trigger2(false)
|
9786
9779
|
], CompilationController.prototype, "_sourceFilesForWhichDiagnosticsWereReported", 2);
|
9787
9780
|
__decorateClass([
|
9788
|
-
|
9781
|
+
trigger2(false)
|
9789
9782
|
], CompilationController.prototype, "_checkedConfigurationVersionByPackageUri", 2);
|
9790
9783
|
__decorateClass([
|
9791
|
-
|
9784
|
+
trigger2(false)
|
9792
9785
|
], CompilationController.prototype, "_tsInteropInputs", 2);
|
9793
9786
|
__decorateClass([
|
9794
|
-
|
9787
|
+
trigger2(false)
|
9795
9788
|
], CompilationController.prototype, "_tsInteropInputsKey", 2);
|
9796
9789
|
__decorateClass([
|
9797
|
-
|
9790
|
+
trigger2(false)
|
9798
9791
|
], CompilationController.prototype, "_tsProgramLoaderInputs", 2);
|
9799
9792
|
__decorateClass([
|
9800
|
-
|
9793
|
+
trigger2(false)
|
9801
9794
|
], CompilationController.prototype, "_configurationsOfPackagesOutsideProject", 2);
|
9802
9795
|
__decorateClass([
|
9803
|
-
|
9796
|
+
atomicBlock2
|
9804
9797
|
], CompilationController.prototype, "notifyReportedSourceFileDiagnostics", 1);
|
9805
9798
|
__decorateClass([
|
9806
|
-
|
9799
|
+
reaction,
|
9807
9800
|
options({ reentrance: Reentrance.cancelPrevious, order: 24 })
|
9808
9801
|
], CompilationController.prototype, "reloadMainCompilation", 1);
|
9809
9802
|
__decorateClass([
|
9810
|
-
|
9803
|
+
reaction,
|
9811
9804
|
options({ order: 25 })
|
9812
9805
|
], CompilationController.prototype, "updateState", 1);
|
9813
9806
|
__decorateClass([
|
9814
|
-
|
9807
|
+
reaction,
|
9815
9808
|
options({ order: 20 })
|
9816
9809
|
], CompilationController.prototype, "updateConfigurationControllers", 1);
|
9817
9810
|
__decorateClass([
|
9818
|
-
|
9811
|
+
reaction,
|
9819
9812
|
options({ order: 21 })
|
9820
9813
|
], CompilationController.prototype, "onConfigurationsUpdated", 1);
|
9821
9814
|
__decorateClass([
|
9822
|
-
|
9815
|
+
reaction
|
9823
9816
|
], CompilationController.prototype, "onMainAnalyzerChanged", 1);
|
9824
9817
|
__decorateClass([
|
9825
|
-
|
9818
|
+
reaction,
|
9826
9819
|
options({ reentrance: Reentrance.cancelAndWaitPrevious })
|
9827
9820
|
], CompilationController.prototype, "collectDiagnosticsInBackground", 1);
|
9828
9821
|
__decorateClass([
|
9829
|
-
|
9822
|
+
reaction,
|
9830
9823
|
options({ reentrance: Reentrance.waitAndRestart })
|
9831
9824
|
], CompilationController.prototype, "onRawPackageConfigurationsUpdated", 1);
|
9832
9825
|
var TsProgramLoaderInputs = class {
|
@@ -9888,11 +9881,11 @@ var ReadonlyCompilationState = class {
|
|
9888
9881
|
}
|
9889
9882
|
};
|
9890
9883
|
__decorateClass([
|
9891
|
-
|
9884
|
+
atomicBlock2,
|
9892
9885
|
options({ reentrance: Reentrance.runSideBySide, indicator: highPriorityDiagnosticsCollectionIndicator })
|
9893
9886
|
], ReadonlyCompilationState.prototype, "collectSourceFileDiagnosticsWithHighPriority", 1);
|
9894
9887
|
__decorateClass([
|
9895
|
-
|
9888
|
+
atomicBlock2,
|
9896
9889
|
options({ reentrance: Reentrance.runSideBySide })
|
9897
9890
|
], ReadonlyCompilationState.prototype, "collectSourceFileDiagnosticsWithLowPriority", 1);
|
9898
9891
|
var DiagnosticsCollectionSummary = class {
|
@@ -9900,7 +9893,7 @@ var DiagnosticsCollectionSummary = class {
|
|
9900
9893
|
this.hasErrors = hasErrors;
|
9901
9894
|
}
|
9902
9895
|
};
|
9903
|
-
var ConfigurationController = class extends
|
9896
|
+
var ConfigurationController = class extends TriggeringObject2 {
|
9904
9897
|
constructor(rootDirectory, packageUri, mainCompilationController) {
|
9905
9898
|
super();
|
9906
9899
|
// private _compilationState: ReadonlyCompilationState | undefined = undefined
|
@@ -9981,7 +9974,7 @@ var ConfigurationController = class extends ObservableObject2 {
|
|
9981
9974
|
this._convertedConfigurationVersion++;
|
9982
9975
|
});
|
9983
9976
|
}
|
9984
|
-
// @
|
9977
|
+
// @reaction
|
9985
9978
|
// @options({ reentrance: Reentrance.cancelPrevious, order: 21 })
|
9986
9979
|
// private async reloadCompilation(): Promise<void> {
|
9987
9980
|
// if (!this._mainCompilationController.isConfigurationsProcessingEnabled) {
|
@@ -10028,7 +10021,7 @@ var ConfigurationController = class extends ObservableObject2 {
|
|
10028
10021
|
// }
|
10029
10022
|
// }
|
10030
10023
|
// }
|
10031
|
-
// @
|
10024
|
+
// @reaction
|
10032
10025
|
// @options({ reentrance: Reentrance.cancelPrevious, order: 22 })
|
10033
10026
|
// private async analyze(): Promise<void> {
|
10034
10027
|
// if (!this._mainCompilationController.isConfigurationsProcessingEnabled) {
|
@@ -10062,11 +10055,11 @@ var ConfigurationController = class extends ObservableObject2 {
|
|
10062
10055
|
// }
|
10063
10056
|
// }
|
10064
10057
|
// }
|
10065
|
-
// @
|
10058
|
+
// @reaction
|
10066
10059
|
// private diagnosticsChanged(): void {
|
10067
10060
|
// this._configurationDiagnostics // подписка
|
10068
10061
|
// }
|
10069
|
-
// @
|
10062
|
+
// @reaction
|
10070
10063
|
// @options({ reentrance: Reentrance.cancelAndWaitPrevious })
|
10071
10064
|
// private async reportDiagnostics(): Promise<void> {
|
10072
10065
|
// if (!this._mainCompilationController.isConfigurationsProcessingEnabled) {
|
@@ -10092,7 +10085,7 @@ var ConfigurationController = class extends ObservableObject2 {
|
|
10092
10085
|
// }
|
10093
10086
|
// }
|
10094
10087
|
// }
|
10095
|
-
// @
|
10088
|
+
// @reaction
|
10096
10089
|
// @options({ reentrance: Reentrance.cancelPrevious, order: 23 })
|
10097
10090
|
// private async interpretConfiguration(): Promise<void> {
|
10098
10091
|
// if (!this._mainCompilationController.isConfigurationsProcessingEnabled) {
|
@@ -10134,23 +10127,23 @@ var ConfigurationController = class extends ObservableObject2 {
|
|
10134
10127
|
// }
|
10135
10128
|
};
|
10136
10129
|
__decorateClass([
|
10137
|
-
|
10130
|
+
trigger2(false)
|
10138
10131
|
], ConfigurationController.prototype, "packageUri", 2);
|
10139
10132
|
__decorateClass([
|
10140
|
-
|
10133
|
+
trigger2(false)
|
10141
10134
|
], ConfigurationController.prototype, "processingIndicator", 2);
|
10142
10135
|
__decorateClass([
|
10143
|
-
|
10136
|
+
trigger2(false)
|
10144
10137
|
], ConfigurationController.prototype, "rootDirectory", 2);
|
10145
10138
|
__decorateClass([
|
10146
|
-
|
10139
|
+
trigger2(false)
|
10147
10140
|
], ConfigurationController.prototype, "_mainCompilationController", 2);
|
10148
10141
|
__decorateClass([
|
10149
|
-
|
10142
|
+
reaction,
|
10150
10143
|
options({ reentrance: Reentrance.cancelPrevious, order: 21 })
|
10151
10144
|
], ConfigurationController.prototype, "updateJsonConfigurationFile", 1);
|
10152
10145
|
__decorateClass([
|
10153
|
-
|
10146
|
+
reaction,
|
10154
10147
|
options({ reentrance: Reentrance.cancelPrevious, order: 22 })
|
10155
10148
|
], ConfigurationController.prototype, "processConfiguration", 1);
|
10156
10149
|
var ConfigurationDirectory = class {
|
@@ -10212,31 +10205,31 @@ var TsInteropInputsCache = class {
|
|
10212
10205
|
|
10213
10206
|
// source/services/workspace/FileSystemTreeProviderBasedOnWatchedFileSystem.ts
|
10214
10207
|
import {
|
10215
|
-
|
10208
|
+
atomicBlock as atomicBlock3,
|
10216
10209
|
Indicator as Indicator2,
|
10217
10210
|
nonReactiveRun as nonReactiveRun2,
|
10218
|
-
|
10219
|
-
|
10220
|
-
|
10211
|
+
TriggeringArray,
|
10212
|
+
TriggeringMap as TriggeringMap2,
|
10213
|
+
TriggeringObject as TriggeringObject3,
|
10221
10214
|
options as options2,
|
10222
|
-
|
10215
|
+
reaction as reaction2,
|
10223
10216
|
ReactiveSystem as ReactiveSystem3,
|
10224
10217
|
Transaction as Transaction2,
|
10225
|
-
|
10218
|
+
trigger as trigger3
|
10226
10219
|
} from "reactronic";
|
10227
|
-
var FileSystemTreeProviderBasedOnWatchedFileSystem = class extends
|
10220
|
+
var FileSystemTreeProviderBasedOnWatchedFileSystem = class extends TriggeringObject3 {
|
10228
10221
|
// Используется в качестве множества.
|
10229
10222
|
constructor(fileSystem, notificationsPublisher, namesOfDirectoriesToIgnore, additionalUrisOfDirectoriesToLoad) {
|
10230
10223
|
super();
|
10231
10224
|
this.fileSystemTree = new FileSystemTree(true);
|
10232
|
-
this.loadedWorkspaceFolderByUri = new
|
10225
|
+
this.loadedWorkspaceFolderByUri = new TriggeringMap2();
|
10233
10226
|
this._workspaceFolderUris = void 0;
|
10234
10227
|
this._trackedSourceFiles = void 0;
|
10235
10228
|
this._isInitialized = false;
|
10236
10229
|
this._lastCheckedWorkspaceFolderUris = new Array();
|
10237
10230
|
this._taskQueue = new TaskQueue();
|
10238
10231
|
this._lastCheckedTrackedSourceFileInfoVersionByUri = /* @__PURE__ */ new Map();
|
10239
|
-
this._loadedDirectoryUris = new
|
10232
|
+
this._loadedDirectoryUris = new TriggeringMap2();
|
10240
10233
|
this._fileSystem = fileSystem;
|
10241
10234
|
this._notificationsPublisher = notificationsPublisher;
|
10242
10235
|
this._listener = this.onFileSystemUpdated.bind(this);
|
@@ -10604,7 +10597,7 @@ var FileSystemTreeProviderBasedOnWatchedFileSystem = class extends ObservableObj
|
|
10604
10597
|
this.fileSystemTree.deleteFileOrDirectory(uri);
|
10605
10598
|
}
|
10606
10599
|
}
|
10607
|
-
// @
|
10600
|
+
// @reaction
|
10608
10601
|
// @options({ order: 0 })
|
10609
10602
|
// protected unloadWorkspaceFoldersThatNoLongerContainArtelProject(): void {
|
10610
10603
|
// if (this.isMissingConfigurationDirectoryAllowed) {
|
@@ -10729,65 +10722,65 @@ var FileSystemTreeProviderBasedOnWatchedFileSystem = class extends ObservableObj
|
|
10729
10722
|
// }
|
10730
10723
|
};
|
10731
10724
|
__decorateClass([
|
10732
|
-
|
10725
|
+
trigger3(false)
|
10733
10726
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "fileSystemTree", 2);
|
10734
10727
|
__decorateClass([
|
10735
|
-
|
10728
|
+
trigger3(false)
|
10736
10729
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "loadedWorkspaceFolderByUri", 2);
|
10737
10730
|
__decorateClass([
|
10738
|
-
|
10731
|
+
trigger3(false)
|
10739
10732
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "_fileSystem", 2);
|
10740
10733
|
__decorateClass([
|
10741
|
-
|
10734
|
+
trigger3(false)
|
10742
10735
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "_notificationsPublisher", 2);
|
10743
10736
|
__decorateClass([
|
10744
|
-
|
10737
|
+
trigger3(false)
|
10745
10738
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "_listener", 2);
|
10746
10739
|
__decorateClass([
|
10747
|
-
|
10740
|
+
trigger3(false)
|
10748
10741
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "_lastCheckedWorkspaceFolderUris", 2);
|
10749
10742
|
__decorateClass([
|
10750
|
-
|
10743
|
+
trigger3(false)
|
10751
10744
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "_taskQueue", 2);
|
10752
10745
|
__decorateClass([
|
10753
|
-
|
10746
|
+
trigger3(false)
|
10754
10747
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "_namesOfDirectoriesToIgnore", 2);
|
10755
10748
|
__decorateClass([
|
10756
|
-
|
10749
|
+
trigger3(false)
|
10757
10750
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "_additionalUrisOfDirectoriesToLoad", 2);
|
10758
10751
|
__decorateClass([
|
10759
|
-
|
10752
|
+
trigger3(false)
|
10760
10753
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "_lastCheckedTrackedSourceFileInfoVersionByUri", 2);
|
10761
10754
|
__decorateClass([
|
10762
|
-
|
10755
|
+
trigger3(false)
|
10763
10756
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "_loadedDirectoryUris", 2);
|
10764
10757
|
__decorateClass([
|
10765
|
-
|
10758
|
+
reaction2
|
10766
10759
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "onTrackedSourceFilesUpdated", 1);
|
10767
10760
|
__decorateClass([
|
10768
|
-
|
10761
|
+
reaction2
|
10769
10762
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "onWorkspaceFolderUrisUpdated", 1);
|
10770
10763
|
__decorateClass([
|
10771
|
-
|
10764
|
+
reaction2,
|
10772
10765
|
options2({ order: 0 })
|
10773
10766
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "updateLoadedWorkspaceFolders", 1);
|
10774
10767
|
__decorateClass([
|
10775
|
-
|
10768
|
+
reaction2
|
10776
10769
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "loadAdditionalDirectories", 1);
|
10777
10770
|
__decorateClass([
|
10778
|
-
|
10771
|
+
atomicBlock3
|
10779
10772
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "addWorkspaceFoldersWorker", 1);
|
10780
10773
|
__decorateClass([
|
10781
|
-
|
10774
|
+
atomicBlock3
|
10782
10775
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "removeWorkspaceFoldersWorker", 1);
|
10783
10776
|
__decorateClass([
|
10784
|
-
|
10777
|
+
atomicBlock3
|
10785
10778
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "onFileSystemTreeUpdatedWorker", 1);
|
10786
10779
|
__decorateClass([
|
10787
|
-
|
10780
|
+
atomicBlock3
|
10788
10781
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "stopTrackingSourceFile", 1);
|
10789
10782
|
__decorateClass([
|
10790
|
-
|
10783
|
+
atomicBlock3
|
10791
10784
|
], FileSystemTreeProviderBasedOnWatchedFileSystem.prototype, "updateFileSystemTree", 1);
|
10792
10785
|
var SimpleFileSystemUpdateNotificationsPublisher = class {
|
10793
10786
|
constructor() {
|
@@ -10863,10 +10856,10 @@ var FileSystemTreeUpdate_deleteDirectory = class {
|
|
10863
10856
|
return this.uri;
|
10864
10857
|
}
|
10865
10858
|
};
|
10866
|
-
var TaskQueue = class extends
|
10859
|
+
var TaskQueue = class extends TriggeringObject3 {
|
10867
10860
|
constructor() {
|
10868
10861
|
super();
|
10869
|
-
this._tasks = new
|
10862
|
+
this._tasks = new TriggeringArray();
|
10870
10863
|
this._currentTask = void 0;
|
10871
10864
|
this._processTasksIndicator = Indicator2.create("ProcessTasks", -1, -1, 1e3);
|
10872
10865
|
ReactiveSystem3.getOperation(this.processTasks).configure({ indicator: this._processTasksIndicator });
|
@@ -10922,25 +10915,25 @@ var TaskQueue = class extends ObservableObject3 {
|
|
10922
10915
|
}
|
10923
10916
|
};
|
10924
10917
|
__decorateClass([
|
10925
|
-
|
10918
|
+
trigger3(false)
|
10926
10919
|
], TaskQueue.prototype, "_tasks", 2);
|
10927
10920
|
__decorateClass([
|
10928
|
-
|
10921
|
+
atomicBlock3
|
10929
10922
|
], TaskQueue.prototype, "addTask", 1);
|
10930
10923
|
__decorateClass([
|
10931
|
-
|
10924
|
+
reaction2
|
10932
10925
|
], TaskQueue.prototype, "processTasks", 1);
|
10933
10926
|
__decorateClass([
|
10934
|
-
|
10927
|
+
reaction2
|
10935
10928
|
], TaskQueue.prototype, "executeTask", 1);
|
10936
10929
|
|
10937
10930
|
// source/services/workspace/ManuallyUpdatedFileSystemTreeProvider.ts
|
10938
|
-
import {
|
10939
|
-
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 {
|
10940
10933
|
constructor() {
|
10941
10934
|
super(...arguments);
|
10942
10935
|
this.fileSystemTree = new FileSystemTree(true, true);
|
10943
|
-
this.loadedWorkspaceFolderByUri = new
|
10936
|
+
this.loadedWorkspaceFolderByUri = new TriggeringMap3();
|
10944
10937
|
this._workspaceFolderUris = void 0;
|
10945
10938
|
this._trackedSourceFiles = void 0;
|
10946
10939
|
this._lastCheckedTrackedSourceFileInfoByUri = /* @__PURE__ */ new Map();
|
@@ -11039,59 +11032,59 @@ var ManuallyUpdatedFileSystemTreeProvider = class extends ObservableObject4 {
|
|
11039
11032
|
}
|
11040
11033
|
};
|
11041
11034
|
__decorateClass([
|
11042
|
-
|
11035
|
+
trigger4(false)
|
11043
11036
|
], ManuallyUpdatedFileSystemTreeProvider.prototype, "fileSystemTree", 2);
|
11044
11037
|
__decorateClass([
|
11045
|
-
|
11038
|
+
trigger4(false)
|
11046
11039
|
], ManuallyUpdatedFileSystemTreeProvider.prototype, "loadedWorkspaceFolderByUri", 2);
|
11047
11040
|
__decorateClass([
|
11048
|
-
|
11041
|
+
trigger4(false)
|
11049
11042
|
], ManuallyUpdatedFileSystemTreeProvider.prototype, "_lastCheckedTrackedSourceFileInfoByUri", 2);
|
11050
11043
|
__decorateClass([
|
11051
|
-
|
11044
|
+
trigger4(false)
|
11052
11045
|
], ManuallyUpdatedFileSystemTreeProvider.prototype, "_manuallyCreatedSourceFileTextByUri", 2);
|
11053
11046
|
__decorateClass([
|
11054
|
-
|
11047
|
+
reaction3
|
11055
11048
|
], ManuallyUpdatedFileSystemTreeProvider.prototype, "onTrackedSourceFilesUpdated", 1);
|
11056
11049
|
__decorateClass([
|
11057
|
-
|
11050
|
+
reaction3,
|
11058
11051
|
options3({ order: 0 })
|
11059
11052
|
], ManuallyUpdatedFileSystemTreeProvider.prototype, "updateLoadedWorkspaceFolderByUri", 1);
|
11060
11053
|
|
11061
11054
|
// source/services/workspace/Workspace.ts
|
11062
11055
|
import {
|
11063
|
-
|
11064
|
-
|
11065
|
-
|
11056
|
+
TriggeringArray as TriggeringArray4,
|
11057
|
+
TriggeringMap as TriggeringMap5,
|
11058
|
+
TriggeringObject as TriggeringObject6,
|
11066
11059
|
ReactiveSystem as ReactiveSystem6,
|
11067
11060
|
Reentrance as Reentrance2,
|
11068
11061
|
Transaction as Transaction3,
|
11069
|
-
|
11062
|
+
atomicBlock as atomicBlock5,
|
11070
11063
|
atomicRun,
|
11071
|
-
|
11064
|
+
cache,
|
11072
11065
|
nonReactiveRun as nonReactiveRun3,
|
11073
11066
|
options as options5,
|
11074
|
-
|
11075
|
-
|
11067
|
+
reaction as reaction5,
|
11068
|
+
trigger as trigger6
|
11076
11069
|
} from "reactronic";
|
11077
11070
|
|
11078
11071
|
// source/services/workspace/WorkspaceFiles.ts
|
11079
11072
|
import {
|
11080
|
-
|
11081
|
-
|
11082
|
-
|
11073
|
+
TriggeringArray as TriggeringArray3,
|
11074
|
+
TriggeringMap as TriggeringMap4,
|
11075
|
+
TriggeringObject as TriggeringObject5,
|
11083
11076
|
options as options4,
|
11084
|
-
|
11085
|
-
|
11077
|
+
trigger as trigger5,
|
11078
|
+
reaction as reaction4,
|
11086
11079
|
ReactiveSystem as ReactiveSystem5,
|
11087
|
-
|
11080
|
+
atomicBlock as atomicBlock4
|
11088
11081
|
} from "reactronic";
|
11089
|
-
var WorkspaceFiles = class extends
|
11082
|
+
var WorkspaceFiles = class extends TriggeringObject5 {
|
11090
11083
|
constructor(fileSystemTreeProvider) {
|
11091
11084
|
super();
|
11092
11085
|
this.trackedSourceFiles = new ClientTrackedSourceFiles();
|
11093
|
-
this.workspaceFolderUris = new
|
11094
|
-
this.workspaceFolderWithArtelProjectByUri = new
|
11086
|
+
this.workspaceFolderUris = new TriggeringArray3();
|
11087
|
+
this.workspaceFolderWithArtelProjectByUri = new TriggeringMap4();
|
11095
11088
|
this._fileSystemTreeProvider = fileSystemTreeProvider;
|
11096
11089
|
this._fileSystemTreeProvider.initialize(this.workspaceFolderUris, this.trackedSourceFiles);
|
11097
11090
|
}
|
@@ -11190,39 +11183,39 @@ var WorkspaceFiles = class extends ObservableObject5 {
|
|
11190
11183
|
}
|
11191
11184
|
};
|
11192
11185
|
__decorateClass([
|
11193
|
-
|
11186
|
+
trigger5(false)
|
11194
11187
|
], WorkspaceFiles.prototype, "workspaceFolderUris", 2);
|
11195
11188
|
__decorateClass([
|
11196
|
-
|
11189
|
+
trigger5(false)
|
11197
11190
|
], WorkspaceFiles.prototype, "workspaceFolderWithArtelProjectByUri", 2);
|
11198
11191
|
__decorateClass([
|
11199
|
-
|
11192
|
+
trigger5(false)
|
11200
11193
|
], WorkspaceFiles.prototype, "_fileSystemTreeProvider", 2);
|
11201
11194
|
__decorateClass([
|
11202
|
-
|
11195
|
+
atomicBlock4
|
11203
11196
|
], WorkspaceFiles.prototype, "addWorkspaceFolders", 1);
|
11204
11197
|
__decorateClass([
|
11205
|
-
|
11198
|
+
atomicBlock4
|
11206
11199
|
], WorkspaceFiles.prototype, "removeWorkspaceFolders", 1);
|
11207
11200
|
__decorateClass([
|
11208
|
-
|
11201
|
+
atomicBlock4
|
11209
11202
|
], WorkspaceFiles.prototype, "trackSourceFile", 1);
|
11210
11203
|
__decorateClass([
|
11211
|
-
|
11204
|
+
atomicBlock4
|
11212
11205
|
], WorkspaceFiles.prototype, "updateTrackedSourceFile", 1);
|
11213
11206
|
__decorateClass([
|
11214
|
-
|
11207
|
+
reaction4,
|
11215
11208
|
options4({ order: 1 })
|
11216
11209
|
], WorkspaceFiles.prototype, "updateWorkspaceFolderWithArtelProjectByUri", 1);
|
11217
11210
|
|
11218
11211
|
// source/services/workspace/Workspace.ts
|
11219
|
-
var _Workspace = class _Workspace extends
|
11212
|
+
var _Workspace = class _Workspace extends TriggeringObject6 {
|
11220
11213
|
constructor(config) {
|
11221
11214
|
super();
|
11222
11215
|
this.isReadyToAcceptWorkspaceDiagnostics = false;
|
11223
|
-
this._compilationControllers = new
|
11224
|
-
//
|
11225
|
-
this._controllersWithOpenedFiles = new
|
11216
|
+
this._compilationControllers = new TriggeringArray4();
|
11217
|
+
// TriggeringMap используется в качестве Set'а.
|
11218
|
+
this._controllersWithOpenedFiles = new TriggeringMap5();
|
11226
11219
|
this._atLeastOneFileOfCompilationHasBeenOpened = false;
|
11227
11220
|
this._standardPackageContents = new Cached();
|
11228
11221
|
this._tsInteropInputsCache = new TsInteropInputsCache();
|
@@ -11492,39 +11485,39 @@ var _Workspace = class _Workspace extends ObservableObject6 {
|
|
11492
11485
|
}
|
11493
11486
|
};
|
11494
11487
|
__decorateClass([
|
11495
|
-
|
11488
|
+
trigger6(false)
|
11496
11489
|
], _Workspace.prototype, "_config", 2);
|
11497
11490
|
__decorateClass([
|
11498
|
-
|
11491
|
+
trigger6(false)
|
11499
11492
|
], _Workspace.prototype, "_atLeastOneFileOfCompilationHasBeenOpened", 2);
|
11500
11493
|
__decorateClass([
|
11501
|
-
|
11494
|
+
trigger6(false)
|
11502
11495
|
], _Workspace.prototype, "_files", 2);
|
11503
11496
|
__decorateClass([
|
11504
|
-
|
11497
|
+
trigger6(false)
|
11505
11498
|
], _Workspace.prototype, "_standardPackageContents", 2);
|
11506
11499
|
__decorateClass([
|
11507
|
-
|
11500
|
+
trigger6(false)
|
11508
11501
|
], _Workspace.prototype, "_tsInteropInputsCache", 2);
|
11509
11502
|
__decorateClass([
|
11510
|
-
|
11503
|
+
cache
|
11511
11504
|
], _Workspace.prototype, "compilationControllerByUri", 1);
|
11512
11505
|
__decorateClass([
|
11513
|
-
|
11506
|
+
atomicBlock5
|
11514
11507
|
], _Workspace.prototype, "notifyClosedTextDocument", 1);
|
11515
11508
|
__decorateClass([
|
11516
|
-
|
11509
|
+
reaction5,
|
11517
11510
|
options5({ order: 10 })
|
11518
11511
|
], _Workspace.prototype, "updateCompilationControllers", 1);
|
11519
11512
|
__decorateClass([
|
11520
|
-
|
11513
|
+
reaction5,
|
11521
11514
|
options5({ reentrance: Reentrance2.cancelPrevious })
|
11522
11515
|
], _Workspace.prototype, "processControllersWithUnprocessedConfigs", 1);
|
11523
11516
|
__decorateClass([
|
11524
|
-
|
11517
|
+
reaction5
|
11525
11518
|
], _Workspace.prototype, "updateIsDiagnosticsCollectionInBackgroundEnabled", 1);
|
11526
11519
|
__decorateClass([
|
11527
|
-
|
11520
|
+
reaction5,
|
11528
11521
|
options5({ reentrance: Reentrance2.cancelPrevious })
|
11529
11522
|
], _Workspace.prototype, "updateControllersWithOpenedFiles", 1);
|
11530
11523
|
var Workspace = _Workspace;
|
@@ -11540,22 +11533,30 @@ var EntityToSyntax = class {
|
|
11540
11533
|
return this.convertPackage(this._entity);
|
11541
11534
|
}
|
11542
11535
|
convertPackage(entity) {
|
11543
|
-
const namedPackageMembers = entity.getMembers().getNamedMembers().flatMap((m) => this.convertNamedPackageMember(m
|
11536
|
+
const namedPackageMembers = entity.getMembers().getNamedMembers().flatMap((m) => this.convertNamedPackageMember(m));
|
11544
11537
|
return SyntaxFactory.sourceFile([], namedPackageMembers);
|
11545
11538
|
}
|
11546
11539
|
convertNamedPackageMember(entity) {
|
11547
11540
|
switch (entity.kind) {
|
11548
11541
|
case 0 /* Variable */:
|
11549
11542
|
return this.convertPackageVariable(entity);
|
11550
|
-
case
|
11551
|
-
return this.convertPackageVariantType(entity);
|
11552
|
-
case 5 /* Method */:
|
11543
|
+
case 1 /* Method */:
|
11553
11544
|
return this.convertPackageMethod(entity);
|
11554
|
-
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 */:
|
11555
11554
|
return this.convertPackageMethodType(entity);
|
11556
|
-
case
|
11555
|
+
case 1 /* Structured */:
|
11557
11556
|
return this.convertPackageStructuredType(entity);
|
11558
|
-
case
|
11557
|
+
case 3 /* Variant */:
|
11558
|
+
return this.convertPackageVariantType(entity);
|
11559
|
+
case 4 /* Alias */:
|
11559
11560
|
return this.convertPackageAliasType(entity);
|
11560
11561
|
default:
|
11561
11562
|
Debug.never(entity);
|
@@ -11564,7 +11565,7 @@ var EntityToSyntax = class {
|
|
11564
11565
|
convertPackageVariable(entity) {
|
11565
11566
|
const commonModifiers = new Array();
|
11566
11567
|
if (entity.isConstant()) {
|
11567
|
-
commonModifiers.push(SyntaxFactory.modifier(
|
11568
|
+
commonModifiers.push(SyntaxFactory.modifier(34 /* Const */));
|
11568
11569
|
}
|
11569
11570
|
const name = this.getEntityName(entity);
|
11570
11571
|
const type = this.convertType(entity.getType());
|
@@ -11589,7 +11590,7 @@ var EntityToSyntax = class {
|
|
11589
11590
|
if (isHidden !== void 0) {
|
11590
11591
|
modifiers.push(this.createHidingModifier(isHidden));
|
11591
11592
|
}
|
11592
|
-
result.push(SyntaxFactory.packageVariableSetterDeclaration(tags, modifiers, name, void 0
|
11593
|
+
result.push(SyntaxFactory.packageVariableSetterDeclaration(tags, modifiers, name, void 0));
|
11593
11594
|
}
|
11594
11595
|
} else {
|
11595
11596
|
const tags = this.convertTags(entity.getTags());
|
@@ -11606,7 +11607,7 @@ var EntityToSyntax = class {
|
|
11606
11607
|
const tags = this.convertTags(entity.getTags());
|
11607
11608
|
const modifiers = new Array();
|
11608
11609
|
if (entity.isAsync()) {
|
11609
|
-
modifiers.push(SyntaxFactory.modifier(
|
11610
|
+
modifiers.push(SyntaxFactory.modifier(39 /* Async */));
|
11610
11611
|
}
|
11611
11612
|
const isHidden = entity.isHidden();
|
11612
11613
|
if (isHidden !== void 0) {
|
@@ -11683,21 +11684,24 @@ var EntityToSyntax = class {
|
|
11683
11684
|
return variables.concat(indexers, constructors, methods, destructors);
|
11684
11685
|
}
|
11685
11686
|
convertTypeVariable(entity) {
|
11687
|
+
if (entity.isVariant()) {
|
11688
|
+
return this.convertVariant(entity);
|
11689
|
+
}
|
11686
11690
|
const commonModifiers = new Array();
|
11687
11691
|
if (entity.isConstant()) {
|
11688
|
-
commonModifiers.push(SyntaxFactory.modifier(
|
11692
|
+
commonModifiers.push(SyntaxFactory.modifier(34 /* Const */));
|
11689
11693
|
}
|
11690
11694
|
if (entity.isStatic()) {
|
11691
|
-
commonModifiers.push(SyntaxFactory.modifier(
|
11695
|
+
commonModifiers.push(SyntaxFactory.modifier(40 /* Static */));
|
11692
11696
|
}
|
11693
11697
|
if (entity.isAbstract()) {
|
11694
|
-
commonModifiers.push(SyntaxFactory.modifier(
|
11698
|
+
commonModifiers.push(SyntaxFactory.modifier(36 /* Abstract */));
|
11695
11699
|
}
|
11696
11700
|
if (entity.isRedefinable()) {
|
11697
|
-
commonModifiers.push(SyntaxFactory.modifier(
|
11701
|
+
commonModifiers.push(SyntaxFactory.modifier(37 /* Redefinable */));
|
11698
11702
|
}
|
11699
11703
|
if (entity.isRedefined()) {
|
11700
|
-
commonModifiers.push(SyntaxFactory.modifier(
|
11704
|
+
commonModifiers.push(SyntaxFactory.modifier(38 /* Redefined */));
|
11701
11705
|
}
|
11702
11706
|
const name = this.getEntityName(entity);
|
11703
11707
|
const type = this.convertType(entity.getType());
|
@@ -11722,7 +11726,7 @@ var EntityToSyntax = class {
|
|
11722
11726
|
if (isHidden !== void 0) {
|
11723
11727
|
modifiers.push(this.createHidingModifier(isHidden));
|
11724
11728
|
}
|
11725
|
-
result.push(SyntaxFactory.typeVariableSetterDeclaration(tags, modifiers, name, void 0
|
11729
|
+
result.push(SyntaxFactory.typeVariableSetterDeclaration(tags, modifiers, name, void 0));
|
11726
11730
|
}
|
11727
11731
|
} else {
|
11728
11732
|
const tags = this.convertTags(entity.getTags());
|
@@ -11743,16 +11747,16 @@ var EntityToSyntax = class {
|
|
11743
11747
|
modifiers.push(this.createHidingModifier(isHidden));
|
11744
11748
|
}
|
11745
11749
|
if (entity.isStatic()) {
|
11746
|
-
modifiers.push(SyntaxFactory.modifier(
|
11750
|
+
modifiers.push(SyntaxFactory.modifier(40 /* Static */));
|
11747
11751
|
}
|
11748
11752
|
if (entity.isAbstract()) {
|
11749
|
-
modifiers.push(SyntaxFactory.modifier(
|
11753
|
+
modifiers.push(SyntaxFactory.modifier(36 /* Abstract */));
|
11750
11754
|
}
|
11751
11755
|
if (entity.isRedefinable()) {
|
11752
|
-
modifiers.push(SyntaxFactory.modifier(
|
11756
|
+
modifiers.push(SyntaxFactory.modifier(37 /* Redefinable */));
|
11753
11757
|
}
|
11754
11758
|
if (entity.isRedefined()) {
|
11755
|
-
modifiers.push(SyntaxFactory.modifier(
|
11759
|
+
modifiers.push(SyntaxFactory.modifier(38 /* Redefined */));
|
11756
11760
|
}
|
11757
11761
|
const name = this.getEntityName(entity);
|
11758
11762
|
const typeParameters = this.convertTypeParameters(entity.getTypeParameters());
|
@@ -11768,7 +11772,7 @@ var EntityToSyntax = class {
|
|
11768
11772
|
modifiers.push(this.createHidingModifier(isHidden));
|
11769
11773
|
}
|
11770
11774
|
if (entity.isAbstract()) {
|
11771
|
-
modifiers.push(SyntaxFactory.modifier(
|
11775
|
+
modifiers.push(SyntaxFactory.modifier(36 /* Abstract */));
|
11772
11776
|
}
|
11773
11777
|
const parameters = this.convertValueParameters(entity.getValueParameters());
|
11774
11778
|
return SyntaxFactory.typeConstructorDeclaration(tags, modifiers, parameters, void 0);
|
@@ -11781,7 +11785,7 @@ var EntityToSyntax = class {
|
|
11781
11785
|
modifiers.push(this.createHidingModifier(isHidden));
|
11782
11786
|
}
|
11783
11787
|
if (entity.isAbstract()) {
|
11784
|
-
modifiers.push(SyntaxFactory.modifier(
|
11788
|
+
modifiers.push(SyntaxFactory.modifier(36 /* Abstract */));
|
11785
11789
|
}
|
11786
11790
|
const parameters = this.convertValueParameters(entity.getValueParameters());
|
11787
11791
|
return SyntaxFactory.typeDestructorDeclaration(tags, modifiers, parameters, void 0);
|
@@ -11789,10 +11793,10 @@ var EntityToSyntax = class {
|
|
11789
11793
|
convertTypeIndexer(entity) {
|
11790
11794
|
const commonModifiers = new Array();
|
11791
11795
|
if (entity.isStatic()) {
|
11792
|
-
commonModifiers.push(SyntaxFactory.modifier(
|
11796
|
+
commonModifiers.push(SyntaxFactory.modifier(40 /* Static */));
|
11793
11797
|
}
|
11794
11798
|
if (entity.isAbstract()) {
|
11795
|
-
commonModifiers.push(SyntaxFactory.modifier(
|
11799
|
+
commonModifiers.push(SyntaxFactory.modifier(36 /* Abstract */));
|
11796
11800
|
}
|
11797
11801
|
const parameters = this.convertValueParameters(entity.getValueParameters());
|
11798
11802
|
const result = new Array();
|
@@ -11812,14 +11816,11 @@ var EntityToSyntax = class {
|
|
11812
11816
|
if (setterEntity !== void 0) {
|
11813
11817
|
const tags = this.convertTags(setterEntity.getTags());
|
11814
11818
|
const modifiers = Array.from(commonModifiers);
|
11815
|
-
const declaration = SyntaxFactory.typeIndexedSetterDeclaration(tags, modifiers, parameters, void 0
|
11819
|
+
const declaration = SyntaxFactory.typeIndexedSetterDeclaration(tags, modifiers, parameters, void 0);
|
11816
11820
|
result.push(declaration);
|
11817
11821
|
}
|
11818
11822
|
return result;
|
11819
11823
|
}
|
11820
|
-
convertVariants(variants) {
|
11821
|
-
return variants.get().map((v) => this.convertVariant(v));
|
11822
|
-
}
|
11823
11824
|
convertVariant(entity) {
|
11824
11825
|
const tags = this.convertTags(entity.getTags());
|
11825
11826
|
const name = this.getEntityName(entity);
|
@@ -11864,8 +11865,8 @@ var EntityToSyntax = class {
|
|
11864
11865
|
return SyntaxFactory.aliasTypeDeclarationBody(aliasedType, members);
|
11865
11866
|
}
|
11866
11867
|
createVariantTypeDeclarationBody(entity) {
|
11867
|
-
const
|
11868
|
-
return SyntaxFactory.variantTypeDeclarationBody(
|
11868
|
+
const members = this.convertTypeEntityMembers(entity.getMembers());
|
11869
|
+
return SyntaxFactory.variantTypeDeclarationBody(members);
|
11869
11870
|
}
|
11870
11871
|
createMethodTypeDeclarationBody(entity) {
|
11871
11872
|
const parameters = this.convertValueParameters(entity.getValueParameters());
|
@@ -11923,7 +11924,7 @@ var EntityToSyntax = class {
|
|
11923
11924
|
default:
|
11924
11925
|
Debug.never(hiding);
|
11925
11926
|
}
|
11926
|
-
return SyntaxFactory.modifier(
|
11927
|
+
return SyntaxFactory.modifier(35 /* Hidden */, levelKeyword);
|
11927
11928
|
}
|
11928
11929
|
convertTags(_entityTags) {
|
11929
11930
|
return [];
|
@@ -12011,13 +12012,13 @@ var EntityToSyntax = class {
|
|
12011
12012
|
};
|
12012
12013
|
|
12013
12014
|
// source/services/source-generation/SourceGenerationService.ts
|
12014
|
-
var SourceGenerationService = class extends
|
12015
|
+
var SourceGenerationService = class extends TriggeringObject7 {
|
12015
12016
|
constructor(_trackedSourceFiles, _tsLibrariesProvider, _standardPackageContentsProviders) {
|
12016
12017
|
super();
|
12017
12018
|
this._trackedSourceFiles = _trackedSourceFiles;
|
12018
12019
|
this._tsLibrariesProvider = _tsLibrariesProvider;
|
12019
12020
|
this._standardPackageContentsProviders = _standardPackageContentsProviders;
|
12020
|
-
this._generatedPackageStates = new
|
12021
|
+
this._generatedPackageStates = new TriggeringMap6();
|
12021
12022
|
}
|
12022
12023
|
get compilationControllers() {
|
12023
12024
|
return Array.from(this._generatedPackageStates.values()).map((s) => s.compilationController);
|
@@ -12173,7 +12174,7 @@ var SourceGenerationService = class extends ObservableObject7 {
|
|
12173
12174
|
} else {
|
12174
12175
|
return false;
|
12175
12176
|
}
|
12176
|
-
case
|
12177
|
+
case 1 /* Method */:
|
12177
12178
|
if (entity.subkind === "package") {
|
12178
12179
|
return true;
|
12179
12180
|
} else if (entity.subkind === "type") {
|
@@ -12181,33 +12182,37 @@ var SourceGenerationService = class extends ObservableObject7 {
|
|
12181
12182
|
} else {
|
12182
12183
|
return false;
|
12183
12184
|
}
|
12184
|
-
case
|
12185
|
-
|
12186
|
-
|
12187
|
-
|
12188
|
-
|
12189
|
-
|
12190
|
-
|
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);
|
12191
12201
|
}
|
12192
|
-
return true;
|
12193
|
-
case 14 /* AliasType */:
|
12194
|
-
return true;
|
12195
12202
|
case 3 /* Getter */:
|
12196
12203
|
case 4 /* Setter */:
|
12197
12204
|
return this.checkIfEntityOfKindIsPresentInGeneratedCode(entity.getOwningEntity());
|
12198
|
-
case
|
12199
|
-
|
12200
|
-
case 7 /*
|
12201
|
-
case 8 /*
|
12202
|
-
case 9 /*
|
12203
|
-
case 10 /* Destructor */:
|
12204
|
-
case 15 /* Operator */:
|
12205
|
+
case 5 /* Indexer */:
|
12206
|
+
case 6 /* DereferenceOperator */:
|
12207
|
+
case 7 /* Constructor */:
|
12208
|
+
case 8 /* Destructor */:
|
12209
|
+
case 9 /* Operator */:
|
12205
12210
|
return this.checkIfEntityOfKindIsPresentInGeneratedCode(entity.getContainer().getEntity());
|
12206
|
-
case
|
12211
|
+
case 10 /* PackageAlias */:
|
12207
12212
|
return false;
|
12208
|
-
case
|
12213
|
+
case 12 /* Package */:
|
12209
12214
|
return false;
|
12210
|
-
case
|
12215
|
+
case 11 /* TypeExtension */:
|
12211
12216
|
return true;
|
12212
12217
|
default:
|
12213
12218
|
Debug.never(entity);
|
@@ -12227,7 +12232,7 @@ var SourceGenerationService = class extends ObservableObject7 {
|
|
12227
12232
|
}
|
12228
12233
|
};
|
12229
12234
|
__decorateClass([
|
12230
|
-
|
12235
|
+
reaction6
|
12231
12236
|
], SourceGenerationService.prototype, "onOpenedSourceFilesChanged", 1);
|
12232
12237
|
var deleteGeneratedPackageTimeoutMs = 1e4;
|
12233
12238
|
var GeneratedPackageState = class {
|
@@ -12250,37 +12255,40 @@ var EntityFinder = class {
|
|
12250
12255
|
switch (entity.kind) {
|
12251
12256
|
case 0 /* Variable */:
|
12252
12257
|
return this.findVariableEntity(entity);
|
12253
|
-
case
|
12258
|
+
case 1 /* Method */:
|
12254
12259
|
return this.findMethodEntity(entity);
|
12255
|
-
case 2 /*
|
12256
|
-
|
12257
|
-
|
12258
|
-
|
12259
|
-
|
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);
|
12260
12276
|
}
|
12261
|
-
|
12262
|
-
}
|
12263
|
-
case 14 /* AliasType */:
|
12264
|
-
return this.findPackageTypeEntityByNameAndArity(this.getEntityName(entity), entity.getArity());
|
12265
|
-
case 9 /* Constructor */:
|
12277
|
+
case 7 /* Constructor */:
|
12266
12278
|
return this.findConstructorEntity(entity);
|
12267
|
-
case
|
12279
|
+
case 8 /* Destructor */:
|
12268
12280
|
return this.findDestructorEntity(entity);
|
12269
|
-
case
|
12281
|
+
case 9 /* Operator */:
|
12270
12282
|
return this.findOperatorEntity(entity);
|
12271
|
-
case
|
12283
|
+
case 5 /* Indexer */:
|
12272
12284
|
return this.findIndexerEntity(entity);
|
12273
|
-
case
|
12285
|
+
case 6 /* DereferenceOperator */:
|
12274
12286
|
return this.findDereferenceOperatorEntity(entity);
|
12275
|
-
case
|
12276
|
-
return this.findVariantEntity(entity);
|
12277
|
-
case 6 /* TypeParameter */:
|
12278
|
-
return this.findTypeParameterEntity(entity);
|
12279
|
-
case 13 /* PackageAlias */:
|
12287
|
+
case 10 /* PackageAlias */:
|
12280
12288
|
case 3 /* Getter */:
|
12281
12289
|
case 4 /* Setter */:
|
12282
|
-
case
|
12283
|
-
case
|
12290
|
+
case 12 /* Package */:
|
12291
|
+
case 11 /* TypeExtension */:
|
12284
12292
|
return void 0;
|
12285
12293
|
default:
|
12286
12294
|
Debug.never(entity);
|
@@ -12288,7 +12296,7 @@ var EntityFinder = class {
|
|
12288
12296
|
}
|
12289
12297
|
findVariableEntity(entity) {
|
12290
12298
|
if (entity.subkind === "package") {
|
12291
|
-
return this._packageEntity.getMembers().getNamedMembersByName(this.getEntityName(entity)).at(0)
|
12299
|
+
return this._packageEntity.getMembers().getNamedMembersByName(this.getEntityName(entity)).at(0);
|
12292
12300
|
} else if (entity.subkind === "type") {
|
12293
12301
|
const containingType = this.findEntity(entity.getContainer().getEntity());
|
12294
12302
|
if (containingType !== void 0 && isTypeEntity(containingType) && isTypeEntityWithMembers(containingType)) {
|
@@ -12309,7 +12317,7 @@ var EntityFinder = class {
|
|
12309
12317
|
findMethodEntity(entity) {
|
12310
12318
|
switch (entity.subkind) {
|
12311
12319
|
case "package": {
|
12312
|
-
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 */);
|
12313
12321
|
if (members.length === 0) {
|
12314
12322
|
return void 0;
|
12315
12323
|
} else if (members.length === 1) {
|
@@ -12329,7 +12337,7 @@ var EntityFinder = class {
|
|
12329
12337
|
if (!(containingType !== void 0 && isTypeEntity(containingType) && isTypeEntityWithMembers(containingType))) {
|
12330
12338
|
return void 0;
|
12331
12339
|
}
|
12332
|
-
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 */);
|
12333
12341
|
if (members.length === 0) {
|
12334
12342
|
return void 0;
|
12335
12343
|
} else if (members.length === 1) {
|
@@ -12432,13 +12440,6 @@ var EntityFinder = class {
|
|
12432
12440
|
return void 0;
|
12433
12441
|
}
|
12434
12442
|
}
|
12435
|
-
findVariantEntity(entity) {
|
12436
|
-
const containingType = this.findEntity(entity.getContainingEntity());
|
12437
|
-
if (!(containingType !== void 0 && containingType.kind === 2 /* VariantType */)) {
|
12438
|
-
return void 0;
|
12439
|
-
}
|
12440
|
-
return containingType.getVariants().getByName(this.getEntityName(entity))[0];
|
12441
|
-
}
|
12442
12443
|
findTypeParameterEntity(entity) {
|
12443
12444
|
const containingEntity = this.findEntity(entity.getContainingEntity());
|
12444
12445
|
const index = entity.getContainingEntity().getTypeParameters().indexOf(entity);
|
@@ -12449,34 +12450,33 @@ var EntityFinder = class {
|
|
12449
12450
|
}
|
12450
12451
|
}
|
12451
12452
|
findPackageTypeEntityByNameAndArity(name, arity) {
|
12452
|
-
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);
|
12453
12454
|
}
|
12454
12455
|
ifEntityWithParametersThenParameters(entity) {
|
12455
12456
|
switch (entity.kind) {
|
12456
|
-
case
|
12457
|
-
return entity.getValueParameters();
|
12458
|
-
case 7 /* Indexer */:
|
12457
|
+
case 1 /* Method */:
|
12459
12458
|
return entity.getValueParameters();
|
12460
|
-
case
|
12459
|
+
case 5 /* Indexer */:
|
12461
12460
|
return entity.getValueParameters();
|
12462
|
-
case
|
12461
|
+
case 7 /* Constructor */:
|
12463
12462
|
return entity.getValueParameters();
|
12464
|
-
case
|
12463
|
+
case 8 /* Destructor */:
|
12465
12464
|
return entity.getValueParameters();
|
12466
|
-
case
|
12465
|
+
case 2 /* Type */: {
|
12466
|
+
if (entity.typeEntityKind === 0 /* Method */) {
|
12467
|
+
return entity.getValueParameters();
|
12468
|
+
}
|
12469
|
+
return void 0;
|
12470
|
+
}
|
12471
|
+
case 9 /* Operator */:
|
12467
12472
|
return entity.getValueParameters();
|
12468
12473
|
case 0 /* Variable */:
|
12469
|
-
case 1 /* Variant */:
|
12470
|
-
case 2 /* VariantType */:
|
12471
12474
|
case 3 /* Getter */:
|
12472
12475
|
case 4 /* Setter */:
|
12473
|
-
case
|
12474
|
-
case 12 /*
|
12475
|
-
case
|
12476
|
-
case
|
12477
|
-
case 16 /* Package */:
|
12478
|
-
case 17 /* TypeExtension */:
|
12479
|
-
case 8 /* DereferenceOperator */:
|
12476
|
+
case 10 /* PackageAlias */:
|
12477
|
+
case 12 /* Package */:
|
12478
|
+
case 11 /* TypeExtension */:
|
12479
|
+
case 6 /* DereferenceOperator */:
|
12480
12480
|
return void 0;
|
12481
12481
|
default:
|
12482
12482
|
Debug.never(entity);
|
@@ -12484,29 +12484,25 @@ var EntityFinder = class {
|
|
12484
12484
|
}
|
12485
12485
|
ifEntityWithTypeParametersThenParameters(entity) {
|
12486
12486
|
switch (entity.kind) {
|
12487
|
-
case
|
12488
|
-
return entity.getTypeParameters();
|
12489
|
-
case 11 /* MethodType */:
|
12490
|
-
return entity.getTypeParameters();
|
12491
|
-
case 2 /* VariantType */:
|
12492
|
-
return entity.getTypeParameters();
|
12493
|
-
case 12 /* StructuredType */:
|
12487
|
+
case 1 /* Method */:
|
12494
12488
|
return entity.getTypeParameters();
|
12495
|
-
case
|
12496
|
-
|
12497
|
-
|
12498
|
-
|
12499
|
-
|
12500
|
-
|
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 */:
|
12501
12499
|
case 0 /* Variable */:
|
12502
|
-
case 1 /* Variant */:
|
12503
12500
|
case 3 /* Getter */:
|
12504
12501
|
case 4 /* Setter */:
|
12505
|
-
case
|
12506
|
-
case
|
12507
|
-
case
|
12508
|
-
case
|
12509
|
-
case 15 /* Operator */:
|
12502
|
+
case 10 /* PackageAlias */:
|
12503
|
+
case 12 /* Package */:
|
12504
|
+
case 11 /* TypeExtension */:
|
12505
|
+
case 9 /* Operator */:
|
12510
12506
|
return void 0;
|
12511
12507
|
default:
|
12512
12508
|
Debug.never(entity);
|
@@ -13190,7 +13186,7 @@ var LanguageServer = class {
|
|
13190
13186
|
const sourceFileContext = yield this.getSourceFileContext(uri, token);
|
13191
13187
|
if (sourceFileContext !== void 0) {
|
13192
13188
|
const node = NodePath.parse(uri.fragment).getNode(sourceFileContext.sourceFile.getSyntaxNode());
|
13193
|
-
if (node?.kind ===
|
13189
|
+
if (node?.kind === 91 /* AssignmentStatement */) {
|
13194
13190
|
const sourceFileEdit = this._addPropertyAssignmentService.createEditWithAssignment(
|
13195
13191
|
sourceFileContext.sourceFile,
|
13196
13192
|
node,
|
@@ -13227,7 +13223,7 @@ var LanguageServer = class {
|
|
13227
13223
|
const node = NodePath.parse(uri.fragment).getNode(sourceFileContext.sourceFile.getSyntaxNode());
|
13228
13224
|
if (node !== void 0) {
|
13229
13225
|
let nodeForRange = node;
|
13230
|
-
if (node.kind ===
|
13226
|
+
if (node.kind === 91 /* AssignmentStatement */) {
|
13231
13227
|
nodeForRange = node.right;
|
13232
13228
|
}
|
13233
13229
|
result = this.convertSourceFileRange(sourceFileContext.sourceFile, nodeForRange.rangeWithoutTrivia);
|
@@ -13773,7 +13769,7 @@ ${e}`);
|
|
13773
13769
|
}
|
13774
13770
|
};
|
13775
13771
|
__decorateClass([
|
13776
|
-
|
13772
|
+
atomicBlock6
|
13777
13773
|
], LanguageServer.prototype, "onDidChangeWorkspaceFolders", 1);
|
13778
13774
|
var FileSystemSynchronizationMode;
|
13779
13775
|
((FileSystemSynchronizationMode2) => {
|