@artel/artc 0.6.25223 → 0.6.25225
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 +85 -79
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +797 -674
- package/build/{chunk-DZNNWICP.js → chunk-TFTCV5R5.js} +6604 -5875
- package/build/{chunk-AX3LQ2CF.js → chunk-UB6LHKS5.js} +3 -3
- package/build/{chunk-LG4Z4SWO.js → chunk-Z6TZA6SN.js} +3 -3
- package/build/types/analysis/AccessedFunction.d.ts +53 -0
- package/build/types/analysis/AnalyzedTranslationPackage.d.ts +16 -15
- package/build/types/analysis/Analyzer.d.ts +142 -127
- package/build/types/analysis/CallExpressionMeaning.d.ts +10 -10
- package/build/types/analysis/DiagnosticCollector.d.ts +17 -17
- package/build/types/analysis/EntityLocalizationHelper.d.ts +6 -6
- package/build/types/analysis/IdentifierExpressionMeaning.d.ts +10 -10
- package/build/types/analysis/ImportedPackageNameTree.d.ts +1 -0
- package/build/types/analysis/LocalizationContext.d.ts +2 -2
- package/build/types/analysis/{PropertyAccessExpressionMeaning.d.ts → MemberAccessExpressionMeaning.d.ts} +27 -21
- package/build/types/analysis/NamedTypeResolver.d.ts +5 -1
- package/build/types/analysis/NamedTypeSpecifierResolver.d.ts +4 -1
- package/build/types/analysis/NodeTypeUtils.d.ts +13 -13
- package/build/types/analysis/OperationOverloadResolver.d.ts +1 -1
- package/build/types/analysis/Scope.d.ts +15 -15
- package/build/types/analysis/SemanticContext.d.ts +29 -29
- package/build/types/analysis/SemanticContextBuilder.d.ts +22 -22
- package/build/types/analysis/SourceFileMembers.d.ts +2 -2
- package/build/types/analysis/StatementBlockScopeBuilder.d.ts +12 -12
- package/build/types/analysis/{SubstitutedMethod.d.ts → SubstitutedFunction.d.ts} +14 -14
- package/build/types/analysis/TagMeaning.d.ts +23 -20
- package/build/types/analysis/Tags.d.ts +6 -6
- package/build/types/analysis/TypeNarrower.d.ts +21 -21
- package/build/types/analysis/Utils.d.ts +15 -3
- package/build/types/analysis/WellKnownDeclarations.d.ts +4 -4
- package/build/types/analysis/control-flow/GraphBuilder.d.ts +43 -0
- package/build/types/analysis/{ControlFlowGraphVisualizer.d.ts → control-flow/GraphVisualizer.d.ts} +3 -3
- package/build/types/analysis/control-flow/NarrowableExpression.d.ts +5 -0
- package/build/types/analysis/control-flow/Nodes.d.ts +91 -0
- package/build/types/analysis/control-flow/index.d.ts +4 -0
- package/build/types/api/Api.d.ts +3 -3
- package/build/types/common/HelperPhrases.d.ts +3 -2
- package/build/types/diagnostic/DiagnosticCode.d.ts +130 -131
- package/build/types/emitter/EmitPhaseName.d.ts +8 -8
- package/build/types/emitter/Emitter.d.ts +4 -4
- package/build/types/emitter/EmitterContext.d.ts +2 -2
- package/build/types/emitter/Entities.d.ts +31 -29
- package/build/types/emitter/EntityMap.d.ts +8 -8
- package/build/types/emitter/IrBuilder.d.ts +18 -18
- package/build/types/emitter/IrToJs.d.ts +9 -9
- package/build/types/emitter/Transformer.d.ts +37 -37
- package/build/types/emitter/ir/AccessedEntities.d.ts +5 -5
- package/build/types/emitter/ir/ComputedAccess.d.ts +5 -5
- package/build/types/emitter/ir/EmitOptions.d.ts +41 -27
- package/build/types/emitter/ir/Nodes.d.ts +141 -140
- package/build/types/emitter/ir/types.d.ts +8 -8
- package/build/types/entities/ConstructorEntity.d.ts +9 -9
- package/build/types/entities/DereferenceOperatorEntity.d.ts +4 -4
- package/build/types/entities/DestructorEntity.d.ts +4 -4
- package/build/types/entities/{MethodEntity.d.ts → FunctionEntity.d.ts} +36 -36
- package/build/types/entities/{MethodTypeEntity.d.ts → FunctionTypeEntity.d.ts} +23 -23
- package/build/types/entities/GetterEntity.d.ts +9 -9
- package/build/types/entities/IndexerEntity.d.ts +4 -4
- package/build/types/entities/SetterEntity.d.ts +9 -9
- package/build/types/entities/TypeEntity.d.ts +3 -3
- package/build/types/entities/TypeEntityMembers.d.ts +3 -3
- package/build/types/entities/TypeParameterEntity.d.ts +2 -2
- package/build/types/entities/VariableEntity.d.ts +32 -32
- package/build/types/entities/index.d.ts +14 -14
- package/build/types/services/CompletionService.d.ts +8 -9
- package/build/types/services/DisplayService.d.ts +72 -69
- package/build/types/services/HoverService.d.ts +1 -1
- package/build/types/services/NodeSemanticInfo.d.ts +26 -21
- package/build/types/services/SemanticTokensService.d.ts +6 -6
- package/build/types/services/SourceFileItemsService.d.ts +11 -11
- package/build/types/services/TypeDefinitionService.d.ts +2 -2
- package/build/types/services/signature-help/SignatureWithValueParameters.d.ts +10 -10
- package/build/types/services/signature-help/TypeParameterSignatureHelpProvider.d.ts +1 -1
- package/build/types/services/source-generation/EntityToSyntax.d.ts +10 -9
- package/build/types/tree/NodeKind.d.ts +27 -27
- package/build/types/tree/green/Nodes.d.ts +127 -128
- package/build/types/tree/green/SyntaxFactory.d.ts +20 -19
- package/build/types/tree/green/SyntaxToCode.d.ts +23 -21
- package/build/types/tree/red/Nodes.d.ts +173 -172
- package/build/types/ts-interop/Entities.d.ts +28 -28
- package/build/types/ts-interop/TsInteropContext.d.ts +2 -1
- package/build/types/ts-interop/TsPackageMembersCreator.d.ts +1 -1
- package/build/types/ts-interop/TsTypeMembersCreator.d.ts +1 -1
- package/build/types/types/{MethodType.d.ts → FunctionType.d.ts} +6 -6
- package/build/types/types/IntersectionType.d.ts +20 -0
- package/build/types/types/ParameterType.d.ts +6 -3
- package/build/types/types/StandardTypes.d.ts +2 -2
- package/build/types/types/Type.d.ts +3 -2
- package/build/types/types/TypeFactory.d.ts +8 -6
- package/build/types/types/TypeMembers.d.ts +8 -8
- package/build/types/types/index.d.ts +2 -1
- package/package.json +1 -1
- package/build/types/analysis/AccessedMethod.d.ts +0 -53
- package/build/types/analysis/ControlFlowGraphBuilder.d.ts +0 -129
package/build/api/ApiServices.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import {
|
2
|
-
|
2
|
+
AccessedFunction_typeMember,
|
3
3
|
AliasTypeDeclarationBody,
|
4
4
|
Analyzer,
|
5
|
-
|
5
|
+
AnonymousFunctionTypeDeclaration,
|
6
6
|
AnonymousStructuredTypeDeclaration,
|
7
7
|
AnonymousTypeSpecifier,
|
8
8
|
AnonymousVariantTypeDeclaration,
|
@@ -14,6 +14,7 @@ import {
|
|
14
14
|
ConfigurationConverter,
|
15
15
|
ConfigurationDirectoryNameSet,
|
16
16
|
ConfigurationFileParser,
|
17
|
+
ConstructorDeclaration,
|
17
18
|
ConstructorDeclaration_entity,
|
18
19
|
ConstructorDeclaration_typeMember,
|
19
20
|
ConstructorTranslation,
|
@@ -22,19 +23,34 @@ import {
|
|
22
23
|
DefaultLocale,
|
23
24
|
DefaultNamesOfDirectoriesToIgnore,
|
24
25
|
DereferenceOperatorDeclaration_typeMember,
|
26
|
+
DestructorDeclaration,
|
25
27
|
DiagnosticCollector,
|
26
28
|
DisplayService,
|
27
29
|
Emitter,
|
28
30
|
EntityLocalizationHelper,
|
31
|
+
FieldDeclaration,
|
32
|
+
FieldGetterDeclaration,
|
33
|
+
FieldOrVariantTranslation,
|
34
|
+
FieldSetterDeclaration,
|
29
35
|
FileSystemTree,
|
30
36
|
FunctionBlock,
|
37
|
+
FunctionDeclaration_accessedFunction,
|
38
|
+
FunctionDeclaration_entity,
|
39
|
+
FunctionDeclaration_substitutedFunction,
|
40
|
+
FunctionDeclaration_typeMember,
|
41
|
+
FunctionTypeDeclarationBody,
|
42
|
+
FunctionTypeTranslation,
|
31
43
|
GeneratedSourceFileScheme,
|
32
44
|
GenericCancellationToken,
|
33
45
|
InMemoryPackageScheme,
|
46
|
+
IndexParameterClause,
|
47
|
+
IndexParameterTranslationClause,
|
48
|
+
IndexedElementGetterDeclaration,
|
49
|
+
IndexedElementSetterDeclaration,
|
34
50
|
IndexerDeclaration_entity,
|
35
51
|
IndexerDeclaration_typeMember,
|
36
52
|
IndexerTranslation,
|
37
|
-
|
53
|
+
IntersectionTypeSpecifier,
|
38
54
|
JavaScriptInterfacePackageImplementationConfig,
|
39
55
|
JsonConfigurationFileNameSet,
|
40
56
|
Keyword,
|
@@ -45,18 +61,14 @@ import {
|
|
45
61
|
LocalizationContext,
|
46
62
|
LocalizationHelper,
|
47
63
|
Logger,
|
48
|
-
|
49
|
-
|
50
|
-
MethodDeclaration_substitutedMethod,
|
51
|
-
MethodDeclaration_typeMember,
|
52
|
-
MethodTypeDeclarationBody,
|
53
|
-
MethodTypeTranslation,
|
64
|
+
MethodDeclaration,
|
65
|
+
MethodTranslation,
|
54
66
|
Modifier,
|
55
67
|
ModifierList,
|
56
68
|
Name,
|
57
69
|
NamedTypeSpecifier,
|
58
70
|
NamedType_alias,
|
59
|
-
|
71
|
+
NamedType_function,
|
60
72
|
NamedType_structured,
|
61
73
|
NamedType_variant,
|
62
74
|
NodeModulesDirectoryName,
|
@@ -65,15 +77,15 @@ import {
|
|
65
77
|
NullableTypeSpecifier,
|
66
78
|
OperatorDeclaration_typeMember,
|
67
79
|
PackageAliasTypeDeclaration,
|
80
|
+
PackageFunctionDeclaration,
|
81
|
+
PackageFunctionTranslation,
|
82
|
+
PackageFunctionTypeDeclaration,
|
68
83
|
PackageImport,
|
69
84
|
PackageImportDirectiveList,
|
70
85
|
PackageMemberDeclarationList,
|
71
86
|
PackageMemberGroupDeclaration,
|
72
87
|
PackageMemberLookup,
|
73
|
-
|
74
|
-
PackageMethodTranslation,
|
75
|
-
PackageMethodTypeDeclaration,
|
76
|
-
PackagePath,
|
88
|
+
PackageName,
|
77
89
|
PackageStructuredTypeDeclaration,
|
78
90
|
PackageVariableDeclaration,
|
79
91
|
PackageVariableGetterDeclaration,
|
@@ -116,36 +128,24 @@ import {
|
|
116
128
|
TypeAnnotation,
|
117
129
|
TypeArgumentClause,
|
118
130
|
TypeArgumentList,
|
119
|
-
TypeConstructorDeclaration,
|
120
131
|
TypeDeclarationAlias_entity,
|
121
|
-
|
132
|
+
TypeDeclarationFunction_entity,
|
122
133
|
TypeDeclarationStructured_entity,
|
123
134
|
TypeDeclarationVariant_entity,
|
124
135
|
TypeDeclaration_alias,
|
125
|
-
|
136
|
+
TypeDeclaration_function,
|
126
137
|
TypeDeclaration_structured,
|
127
138
|
TypeDeclaration_variant,
|
128
|
-
TypeDestructorDeclaration,
|
129
|
-
TypeIndexedGetterDeclaration,
|
130
|
-
TypeIndexedSetterDeclaration,
|
131
|
-
TypeIndexerParameterClause,
|
132
139
|
TypeMemberDeclarationBlock,
|
133
140
|
TypeMemberDeclarationList,
|
134
141
|
TypeMemberGroupDeclaration,
|
135
142
|
TypeMemberLookup,
|
136
143
|
TypeMemberTranslationList,
|
137
|
-
TypeMethodDeclaration,
|
138
|
-
TypeMethodTranslation,
|
139
144
|
TypeParameterClause,
|
140
145
|
TypeParameterDeclaration,
|
141
146
|
TypeParameterList,
|
142
147
|
TypeTranslation,
|
143
|
-
TypeVariableDeclaration,
|
144
|
-
TypeVariableGetterDeclaration,
|
145
|
-
TypeVariableOrVariantTranslation,
|
146
|
-
TypeVariableSetterDeclaration,
|
147
148
|
UnionTypeSpecifier,
|
148
|
-
UnionTypeSpecifierTypeList,
|
149
149
|
Uri,
|
150
150
|
ValueParameterDeclaration_matchResultValueParameter,
|
151
151
|
ValueParameterDeclaration_typeMember,
|
@@ -182,7 +182,7 @@ import {
|
|
182
182
|
unwrapParenthesizedExpressions,
|
183
183
|
visitChildren,
|
184
184
|
yieldExecution
|
185
|
-
} from "../chunk-
|
185
|
+
} from "../chunk-TFTCV5R5.js";
|
186
186
|
|
187
187
|
// source/services/CustomCommand.ts
|
188
188
|
import * as ls from "vscode-languageserver";
|
@@ -302,7 +302,7 @@ var AddPropertyAssignmentService = class {
|
|
302
302
|
let result;
|
303
303
|
let leftValueText;
|
304
304
|
if (propertyName !== void 0) {
|
305
|
-
if (assignmentNode.left.kind !== 78 /*
|
305
|
+
if (assignmentNode.left.kind !== 78 /* MemberAccessExpression */) {
|
306
306
|
return void 0;
|
307
307
|
}
|
308
308
|
const propertyReceiver = assignmentNode.left.expression;
|
@@ -374,21 +374,21 @@ function isSubprogramDeclaration(node) {
|
|
374
374
|
switch (node.kind) {
|
375
375
|
case 25 /* PackageConstructorDeclaration */:
|
376
376
|
case 26 /* PackageEntryPointDeclaration */:
|
377
|
-
case 27 /*
|
377
|
+
case 27 /* PackageFunctionDeclaration */:
|
378
378
|
case 36 /* PackageVariableGetterDeclaration */:
|
379
379
|
case 37 /* PackageVariableSetterDeclaration */:
|
380
|
-
case 45 /*
|
381
|
-
case 46 /*
|
382
|
-
case 47 /*
|
383
|
-
case 48 /*
|
384
|
-
case 50 /*
|
385
|
-
case 51 /*
|
386
|
-
case 52 /*
|
387
|
-
case 55 /*
|
388
|
-
case 56 /*
|
389
|
-
case 58 /*
|
390
|
-
case 67 /*
|
391
|
-
case 74 /*
|
380
|
+
case 45 /* ConstructorDeclaration */:
|
381
|
+
case 46 /* DestructorDeclaration */:
|
382
|
+
case 47 /* IndexedElementGetterDeclaration */:
|
383
|
+
case 48 /* IndexedElementSetterDeclaration */:
|
384
|
+
case 50 /* DereferencedVariableGetterDeclaration */:
|
385
|
+
case 51 /* DereferencedVariableSetterDeclaration */:
|
386
|
+
case 52 /* MethodDeclaration */:
|
387
|
+
case 55 /* FieldGetterDeclaration */:
|
388
|
+
case 56 /* FieldSetterDeclaration */:
|
389
|
+
case 58 /* NestedFunctionDeclaration */:
|
390
|
+
case 67 /* FunctionBlockLiteral */:
|
391
|
+
case 74 /* FunctionLiteral */:
|
392
392
|
return true;
|
393
393
|
default:
|
394
394
|
Debug.typeIsAssignableTo();
|
@@ -412,15 +412,15 @@ var SyntaxFactory = class {
|
|
412
412
|
aliasIdentifier = this.createIdentifier(alias);
|
413
413
|
equalsToken = this.token(57 /* Equals */);
|
414
414
|
}
|
415
|
-
const
|
416
|
-
const packageImport = new PackageImport(aliasIdentifier, equalsToken,
|
415
|
+
const packageName = this.packageName(pathSegments);
|
416
|
+
const packageImport = new PackageImport(aliasIdentifier, equalsToken, packageName);
|
417
417
|
const importKeyword = this.keyword(18 /* Import */);
|
418
418
|
return new SinglePackageImportDirective(importKeyword, packageImport);
|
419
419
|
}
|
420
|
-
static
|
420
|
+
static packageName(segments) {
|
421
421
|
const segmentIdentifiers = segments.map((s) => this.createIdentifier(s));
|
422
|
-
const
|
423
|
-
return new
|
422
|
+
const packageNameParts = this.createTokenSeparatedElements(segmentIdentifiers, 26 /* Dot */);
|
423
|
+
return new PackageName(packageNameParts);
|
424
424
|
}
|
425
425
|
static packageAliasTypeDeclaration(tags, modifiers, name, typeParameters, body) {
|
426
426
|
const tagList = new TagList(tags);
|
@@ -455,7 +455,7 @@ var SyntaxFactory = class {
|
|
455
455
|
this.token(20 /* CloseBrace */)
|
456
456
|
);
|
457
457
|
}
|
458
|
-
static
|
458
|
+
static packageFunctionDeclaration(tags, modifiers, name, typeParameters, parameters, returnTypeSpecifier, body) {
|
459
459
|
const tagList = new TagList(tags);
|
460
460
|
const modifierList = new ModifierList(modifiers);
|
461
461
|
const functionKeyword = this.keyword(12 /* Function */);
|
@@ -463,7 +463,7 @@ var SyntaxFactory = class {
|
|
463
463
|
const typeParameterClause = this.createTypeParameterClause(typeParameters);
|
464
464
|
const parameterClause = this.parameterClause(parameters);
|
465
465
|
const returnTypeAnnotation = this.createTypeAnnotation(returnTypeSpecifier);
|
466
|
-
return new
|
466
|
+
return new PackageFunctionDeclaration(
|
467
467
|
tagList,
|
468
468
|
modifierList,
|
469
469
|
functionKeyword,
|
@@ -474,14 +474,14 @@ var SyntaxFactory = class {
|
|
474
474
|
body
|
475
475
|
);
|
476
476
|
}
|
477
|
-
static
|
477
|
+
static packageFunctionTypeDeclaration(tags, modifiers, name, typeParameters, body) {
|
478
478
|
const tagList = new TagList(tags);
|
479
479
|
const modifierList = new ModifierList(modifiers);
|
480
480
|
const typeKeyword = this.keyword(16 /* Type */);
|
481
481
|
const nameIdentifier = this.createIdentifier(name);
|
482
482
|
const typeParameterClause = this.createTypeParameterClause(typeParameters);
|
483
483
|
const equalsToken = this.token(57 /* Equals */);
|
484
|
-
return new
|
484
|
+
return new PackageFunctionTypeDeclaration(
|
485
485
|
tagList,
|
486
486
|
modifierList,
|
487
487
|
typeKeyword,
|
@@ -491,11 +491,11 @@ var SyntaxFactory = class {
|
|
491
491
|
body
|
492
492
|
);
|
493
493
|
}
|
494
|
-
static
|
494
|
+
static functionTypeDeclarationBody(parameters, returnTypeSpecifier) {
|
495
495
|
const functionKeyword = this.keyword(12 /* Function */);
|
496
496
|
const parameterClause = this.parameterClause(parameters);
|
497
497
|
const returnTypeAnnotation = this.createTypeAnnotation(returnTypeSpecifier);
|
498
|
-
return new
|
498
|
+
return new FunctionTypeDeclarationBody(void 0, functionKeyword, parameterClause, returnTypeAnnotation);
|
499
499
|
}
|
500
500
|
static packageStructuredTypeDeclaration(tags, modifiers, name, typeParameters, body) {
|
501
501
|
const tagList = new TagList(tags);
|
@@ -586,7 +586,7 @@ var SyntaxFactory = class {
|
|
586
586
|
const memberBlock = this.typeMemberDeclarationBlock(members);
|
587
587
|
return new VariantTypeDeclarationBody(variantKeyword, void 0, memberBlock);
|
588
588
|
}
|
589
|
-
static
|
589
|
+
static fieldDeclaration(tags, modifiers, name, typeSpecifier, initializer) {
|
590
590
|
const tagList = new TagList(tags);
|
591
591
|
const modifierList = new ModifierList(modifiers);
|
592
592
|
const nameIdentifier = this.createIdentifier(name);
|
@@ -595,7 +595,7 @@ var SyntaxFactory = class {
|
|
595
595
|
if (initializer !== void 0) {
|
596
596
|
equalsToken = this.token(57 /* Equals */);
|
597
597
|
}
|
598
|
-
return new
|
598
|
+
return new FieldDeclaration(
|
599
599
|
tagList,
|
600
600
|
modifierList,
|
601
601
|
nameIdentifier,
|
@@ -604,13 +604,13 @@ var SyntaxFactory = class {
|
|
604
604
|
initializer
|
605
605
|
);
|
606
606
|
}
|
607
|
-
static
|
607
|
+
static fieldGetterDeclaration(tags, modifiers, name, typeSpecifier, body) {
|
608
608
|
const tagList = new TagList(tags);
|
609
609
|
const modifierList = new ModifierList(modifiers);
|
610
610
|
const getKeyword = this.keyword(58 /* Get */);
|
611
611
|
const nameIdentifier = this.createIdentifier(name);
|
612
612
|
const typeAnnotation = this.typeAnnotation(typeSpecifier);
|
613
|
-
return new
|
613
|
+
return new FieldGetterDeclaration(
|
614
614
|
tagList,
|
615
615
|
modifierList,
|
616
616
|
getKeyword,
|
@@ -619,14 +619,14 @@ var SyntaxFactory = class {
|
|
619
619
|
body
|
620
620
|
);
|
621
621
|
}
|
622
|
-
static
|
622
|
+
static fieldSetterDeclaration(tags, modifiers, name, body) {
|
623
623
|
const tagList = new TagList(tags);
|
624
624
|
const modifierList = new ModifierList(modifiers);
|
625
625
|
const setKeyword = this.keyword(59 /* Set */);
|
626
626
|
const nameIdentifier = this.createIdentifier(name);
|
627
|
-
return new
|
627
|
+
return new FieldSetterDeclaration(tagList, modifierList, setKeyword, nameIdentifier, body);
|
628
628
|
}
|
629
|
-
static
|
629
|
+
static methodDeclaration(tags, modifiers, name, typeParameters, parameters, returnTypeSpecifier, body) {
|
630
630
|
const tagList = new TagList(tags);
|
631
631
|
const modifierList = new ModifierList(modifiers);
|
632
632
|
const functionKeyword = this.keyword(12 /* Function */);
|
@@ -634,7 +634,7 @@ var SyntaxFactory = class {
|
|
634
634
|
const typeParameterClause = this.createTypeParameterClause(typeParameters);
|
635
635
|
const parameterClause = this.parameterClause(parameters);
|
636
636
|
const returnTypeAnnotation = this.createTypeAnnotation(returnTypeSpecifier);
|
637
|
-
return new
|
637
|
+
return new MethodDeclaration(
|
638
638
|
tagList,
|
639
639
|
modifierList,
|
640
640
|
functionKeyword,
|
@@ -645,27 +645,27 @@ var SyntaxFactory = class {
|
|
645
645
|
body
|
646
646
|
);
|
647
647
|
}
|
648
|
-
static
|
648
|
+
static constructorDeclaration(tags, modifiers, parameters, body) {
|
649
649
|
const tagList = new TagList(tags);
|
650
650
|
const modifierList = new ModifierList(modifiers);
|
651
651
|
const creationKeyword = this.keyword(30 /* Creation */);
|
652
652
|
const parameterClause = this.parameterClause(parameters);
|
653
|
-
return new
|
653
|
+
return new ConstructorDeclaration(tagList, modifierList, creationKeyword, parameterClause, body);
|
654
654
|
}
|
655
|
-
static
|
655
|
+
static destructorDeclaration(tags, modifiers, parameters, body) {
|
656
656
|
const tagList = new TagList(tags);
|
657
657
|
const modifierList = new ModifierList(modifiers);
|
658
658
|
const destructionKeyword = this.keyword(47 /* Destruction */);
|
659
659
|
const parameterClause = this.parameterClause(parameters);
|
660
|
-
return new
|
660
|
+
return new DestructorDeclaration(tagList, modifierList, destructionKeyword, parameterClause, body);
|
661
661
|
}
|
662
|
-
static
|
662
|
+
static indexedElementGetterDeclaration(tags, modifiers, parameters, typeSpecifier, body) {
|
663
663
|
const tagList = new TagList(tags);
|
664
664
|
const modifierList = new ModifierList(modifiers);
|
665
665
|
const getKeyword = this.keyword(58 /* Get */);
|
666
|
-
const parameterClause = this.
|
666
|
+
const parameterClause = this.indexParameterClause(parameters);
|
667
667
|
const typeAnnotation = this.typeAnnotation(typeSpecifier);
|
668
|
-
return new
|
668
|
+
return new IndexedElementGetterDeclaration(
|
669
669
|
tagList,
|
670
670
|
modifierList,
|
671
671
|
getKeyword,
|
@@ -674,12 +674,12 @@ var SyntaxFactory = class {
|
|
674
674
|
body
|
675
675
|
);
|
676
676
|
}
|
677
|
-
static
|
677
|
+
static indexedElementSetterDeclaration(tags, modifiers, parameters, body) {
|
678
678
|
const tagList = new TagList(tags);
|
679
679
|
const modifierList = new ModifierList(modifiers);
|
680
680
|
const getKeyword = this.keyword(59 /* Set */);
|
681
|
-
const parameterClause = this.
|
682
|
-
return new
|
681
|
+
const parameterClause = this.indexParameterClause(parameters);
|
682
|
+
return new IndexedElementSetterDeclaration(tagList, modifierList, getKeyword, parameterClause, body);
|
683
683
|
}
|
684
684
|
static typeMemberGroupDeclaration(tags, modifiers, members) {
|
685
685
|
const tagList = new TagList(tags);
|
@@ -711,10 +711,10 @@ var SyntaxFactory = class {
|
|
711
711
|
this.token(21 /* CloseParenthesis */)
|
712
712
|
);
|
713
713
|
}
|
714
|
-
static
|
715
|
-
return new
|
714
|
+
static indexParameterClause(indexParameters) {
|
715
|
+
return new IndexParameterClause(
|
716
716
|
this.token(45 /* OpenSquareBracket */),
|
717
|
-
new ParameterList(this.createTokenSeparatedElements(
|
717
|
+
new ParameterList(this.createTokenSeparatedElements(indexParameters, 24 /* Comma */)),
|
718
718
|
this.token(22 /* CloseSquareBracket */)
|
719
719
|
);
|
720
720
|
}
|
@@ -730,9 +730,13 @@ var SyntaxFactory = class {
|
|
730
730
|
return new NamedTypeSpecifier(qualifiedName, typeArgumentClause);
|
731
731
|
}
|
732
732
|
static unionTypeSpecifier(typeSpecifiers) {
|
733
|
-
return new UnionTypeSpecifier(
|
734
|
-
|
735
|
-
|
733
|
+
return new UnionTypeSpecifier(this.createTokenSeparatedElements(typeSpecifiers, 17 /* Bar */));
|
734
|
+
}
|
735
|
+
static intersectionTypeSpecifier(typeSpecifiers) {
|
736
|
+
return new IntersectionTypeSpecifier(this.createTokenSeparatedElements(
|
737
|
+
typeSpecifiers,
|
738
|
+
10 /* Ampersand */
|
739
|
+
));
|
736
740
|
}
|
737
741
|
static nullableTypeSpecifier(typeSpecifier) {
|
738
742
|
const questionToken = this.token(49 /* Question */);
|
@@ -746,8 +750,8 @@ var SyntaxFactory = class {
|
|
746
750
|
static anonymousStructuredTypeSpecifier(body) {
|
747
751
|
return new AnonymousTypeSpecifier(new AnonymousStructuredTypeDeclaration(body));
|
748
752
|
}
|
749
|
-
static
|
750
|
-
return new AnonymousTypeSpecifier(new
|
753
|
+
static anonymousFunctionTypeSpecifier(body) {
|
754
|
+
return new AnonymousTypeSpecifier(new AnonymousFunctionTypeDeclaration(body));
|
751
755
|
}
|
752
756
|
static anonymousVariantTypeSpecifier(body) {
|
753
757
|
return new AnonymousTypeSpecifier(new AnonymousVariantTypeDeclaration(body));
|
@@ -868,7 +872,7 @@ var SyntaxFactory = class {
|
|
868
872
|
const translatedNameIdentifier = this.createIdentifier(translatedName);
|
869
873
|
return new PackageVariableTranslation(sourceNameIdentifier, minusGreaterThanToken, translatedNameIdentifier);
|
870
874
|
}
|
871
|
-
static
|
875
|
+
static packageFunctionTranslation(sourceName, sourceTypeParameters, sourceParameters, translatedName, translatedTypeParameters, translatedParameters) {
|
872
876
|
const functionKeyword = this.keyword(12 /* Function */);
|
873
877
|
const sourceNameIdentifier = this.createIdentifier(sourceName);
|
874
878
|
const sourceTypeParameterClause = this.createTranslationTypeParameterClause(sourceTypeParameters);
|
@@ -877,7 +881,7 @@ var SyntaxFactory = class {
|
|
877
881
|
const translatedNameIdentifier = this.createIdentifier(translatedName);
|
878
882
|
const translatedTypeParameterClause = this.createTranslationTypeParameterClause(translatedTypeParameters);
|
879
883
|
const translatedParameterClause = this.translationParameterClause(translatedParameters);
|
880
|
-
return new
|
884
|
+
return new PackageFunctionTranslation(
|
881
885
|
functionKeyword,
|
882
886
|
sourceNameIdentifier,
|
883
887
|
sourceTypeParameterClause,
|
@@ -915,7 +919,7 @@ var SyntaxFactory = class {
|
|
915
919
|
closeBraceToken
|
916
920
|
);
|
917
921
|
}
|
918
|
-
static
|
922
|
+
static functionTypeTranslation(sourceName, sourceTypeParameters, sourceParameters, translatedName, translatedTypeParameters, translatedParameters) {
|
919
923
|
const typeKeyword = this.keyword(16 /* Type */);
|
920
924
|
const sourceNameIdentifier = this.createIdentifier(sourceName);
|
921
925
|
const sourceTypeParameterClause = this.createTranslationTypeParameterClause(sourceTypeParameters);
|
@@ -924,7 +928,7 @@ var SyntaxFactory = class {
|
|
924
928
|
const translatedNameIdentifier = this.createIdentifier(translatedName);
|
925
929
|
const translatedTypeParameterClause = this.createTranslationTypeParameterClause(translatedTypeParameters);
|
926
930
|
const translatedParameterClause = this.translationParameterClause(translatedParameters);
|
927
|
-
return new
|
931
|
+
return new FunctionTypeTranslation(
|
928
932
|
typeKeyword,
|
929
933
|
sourceNameIdentifier,
|
930
934
|
sourceTypeParameterClause,
|
@@ -935,17 +939,17 @@ var SyntaxFactory = class {
|
|
935
939
|
translatedParameterClause
|
936
940
|
);
|
937
941
|
}
|
938
|
-
static
|
942
|
+
static fieldOrVariantTranslation(sourceName, translatedName) {
|
939
943
|
const sourceNameIdentifier = this.createIdentifier(sourceName);
|
940
944
|
const minusGreaterThanToken = this.token(42 /* MinusGreaterThan */);
|
941
945
|
const translatedNameIdentifier = this.createIdentifier(translatedName);
|
942
|
-
return new
|
946
|
+
return new FieldOrVariantTranslation(
|
943
947
|
sourceNameIdentifier,
|
944
948
|
minusGreaterThanToken,
|
945
949
|
translatedNameIdentifier
|
946
950
|
);
|
947
951
|
}
|
948
|
-
static
|
952
|
+
static methodTranslation(sourceName, sourceTypeParameters, sourceParameters, translatedName, translatedTypeParameters, translatedParameters) {
|
949
953
|
const functionKeyword = this.keyword(12 /* Function */);
|
950
954
|
const sourceNameIdentifier = this.createIdentifier(sourceName);
|
951
955
|
const sourceTypeParameterClause = this.createTranslationTypeParameterClause(sourceTypeParameters);
|
@@ -954,7 +958,7 @@ var SyntaxFactory = class {
|
|
954
958
|
const translatedNameIdentifier = this.createIdentifier(translatedName);
|
955
959
|
const translatedTypeParameterClause = this.createTranslationTypeParameterClause(translatedTypeParameters);
|
956
960
|
const translatedParameterClause = this.translationParameterClause(translatedParameters);
|
957
|
-
return new
|
961
|
+
return new MethodTranslation(
|
958
962
|
functionKeyword,
|
959
963
|
sourceNameIdentifier,
|
960
964
|
sourceTypeParameterClause,
|
@@ -978,9 +982,9 @@ var SyntaxFactory = class {
|
|
978
982
|
);
|
979
983
|
}
|
980
984
|
static indexerTranslation(sourceParameters, translatedParameters) {
|
981
|
-
const sourceParameterClause = this.
|
985
|
+
const sourceParameterClause = this.indexParameterTranslationClause(sourceParameters);
|
982
986
|
const minusGreaterThanToken = this.token(42 /* MinusGreaterThan */);
|
983
|
-
const translatedParameterClause = this.
|
987
|
+
const translatedParameterClause = this.indexParameterTranslationClause(translatedParameters);
|
984
988
|
return new IndexerTranslation(sourceParameterClause, minusGreaterThanToken, translatedParameterClause);
|
985
989
|
}
|
986
990
|
static translationParameterClause(parameters) {
|
@@ -991,13 +995,13 @@ var SyntaxFactory = class {
|
|
991
995
|
const closeParenthesisToken = this.token(21 /* CloseParenthesis */);
|
992
996
|
return new TranslationParameterClause(openParenthesisToken, parameterList, closeParenthesisToken);
|
993
997
|
}
|
994
|
-
static
|
998
|
+
static indexParameterTranslationClause(parameters) {
|
995
999
|
const openSquareBracketToken = this.token(45 /* OpenSquareBracket */);
|
996
1000
|
const parameterList = new TranslationParameterList(
|
997
1001
|
this.createTokenSeparatedElements(parameters.map((p) => this.createIdentifier(p)), 24 /* Comma */)
|
998
1002
|
);
|
999
1003
|
const closeSquareBracketToken = this.token(22 /* CloseSquareBracket */);
|
1000
|
-
return new
|
1004
|
+
return new IndexParameterTranslationClause(openSquareBracketToken, parameterList, closeSquareBracketToken);
|
1001
1005
|
}
|
1002
1006
|
static token(kind, value) {
|
1003
1007
|
const flags = value === void 0 ? 1 /* Missing */ : 0 /* None */;
|
@@ -1105,9 +1109,9 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1105
1109
|
this.writeToken(node.equalsToken);
|
1106
1110
|
this.writeWhitespace();
|
1107
1111
|
}
|
1108
|
-
this.
|
1112
|
+
this.writePackageName(node.packageName);
|
1109
1113
|
}
|
1110
|
-
|
1114
|
+
writePackageName(node) {
|
1111
1115
|
for (const part of node.parts) {
|
1112
1116
|
this.writeToken(part);
|
1113
1117
|
}
|
@@ -1151,7 +1155,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1151
1155
|
this.writeDeclarationBody(node.block);
|
1152
1156
|
}
|
1153
1157
|
}
|
1154
|
-
|
1158
|
+
writePackageFunctionDeclaration(node) {
|
1155
1159
|
this.writeDeclarationTags(node.tagList);
|
1156
1160
|
this.writeDeclarationModifiers(node.modifierList);
|
1157
1161
|
this.writeKeyword(node.functionKeyword);
|
@@ -1213,7 +1217,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1213
1217
|
this.writeWhitespace();
|
1214
1218
|
this.writeVariantTypeDeclarationBody(node.body);
|
1215
1219
|
}
|
1216
|
-
|
1220
|
+
writePackageFunctionTypeDeclaration(node) {
|
1217
1221
|
this.writeDeclarationTags(node.tagList);
|
1218
1222
|
this.writeDeclarationModifiers(node.modifierList);
|
1219
1223
|
this.writeKeyword(node.typeKeyword);
|
@@ -1225,7 +1229,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1225
1229
|
this.writeWhitespace();
|
1226
1230
|
this.writeToken(node.equalsToken);
|
1227
1231
|
this.writeWhitespace();
|
1228
|
-
this.
|
1232
|
+
this.writeFunctionTypeDeclarationBody(node.body);
|
1229
1233
|
}
|
1230
1234
|
writePackageMemberGroupDeclaration(node) {
|
1231
1235
|
this.writeDeclarationTags(node.tagList);
|
@@ -1268,7 +1272,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1268
1272
|
}
|
1269
1273
|
this.writeTypeMemberDeclarationBlock(node.memberBlock);
|
1270
1274
|
}
|
1271
|
-
|
1275
|
+
writeFunctionTypeDeclarationBody(node) {
|
1272
1276
|
this.writeKeyword(node.functionKeyword);
|
1273
1277
|
this.writeParameterClause(node.parameterClause);
|
1274
1278
|
if (node.returnTypeAnnotation !== void 0) {
|
@@ -1293,7 +1297,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1293
1297
|
}
|
1294
1298
|
this.writeToken(node.closeBraceToken);
|
1295
1299
|
}
|
1296
|
-
|
1300
|
+
writeFieldDeclaration(node) {
|
1297
1301
|
this.writeDeclarationTags(node.tagList);
|
1298
1302
|
this.writeDeclarationModifiers(node.modifierList);
|
1299
1303
|
this.writeToken(node.name);
|
@@ -1307,7 +1311,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1307
1311
|
this.writeExpression(node.initializer);
|
1308
1312
|
}
|
1309
1313
|
}
|
1310
|
-
|
1314
|
+
writeFieldGetterDeclaration(node) {
|
1311
1315
|
this.writeDeclarationTags(node.tagList);
|
1312
1316
|
this.writeDeclarationModifiers(node.modifierList);
|
1313
1317
|
this.writeKeyword(node.getKeyword);
|
@@ -1318,7 +1322,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1318
1322
|
this.writeDeclarationBody(node.block);
|
1319
1323
|
}
|
1320
1324
|
}
|
1321
|
-
|
1325
|
+
writeFieldSetterDeclaration(node) {
|
1322
1326
|
this.writeDeclarationTags(node.tagList);
|
1323
1327
|
this.writeDeclarationModifiers(node.modifierList);
|
1324
1328
|
this.writeKeyword(node.setKeyword);
|
@@ -1328,7 +1332,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1328
1332
|
this.writeDeclarationBody(node.block);
|
1329
1333
|
}
|
1330
1334
|
}
|
1331
|
-
|
1335
|
+
writeMethodDeclaration(node) {
|
1332
1336
|
this.writeDeclarationTags(node.tagList);
|
1333
1337
|
this.writeDeclarationModifiers(node.modifierList);
|
1334
1338
|
this.writeKeyword(node.functionKeyword);
|
@@ -1359,7 +1363,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1359
1363
|
this.writeDeclarationBody(node.block);
|
1360
1364
|
}
|
1361
1365
|
}
|
1362
|
-
|
1366
|
+
writeConstructorDeclaration(node) {
|
1363
1367
|
this.writeDeclarationTags(node.tagList);
|
1364
1368
|
this.writeDeclarationModifiers(node.modifierList);
|
1365
1369
|
this.writeKeyword(node.creationKeyword);
|
@@ -1368,7 +1372,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1368
1372
|
this.writeDeclarationBody(node.block);
|
1369
1373
|
}
|
1370
1374
|
}
|
1371
|
-
|
1375
|
+
writeDestructorDeclaration(node) {
|
1372
1376
|
this.writeDeclarationTags(node.tagList);
|
1373
1377
|
this.writeDeclarationModifiers(node.modifierList);
|
1374
1378
|
this.writeKeyword(node.destructionKeyword);
|
@@ -1377,7 +1381,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1377
1381
|
this.writeDeclarationBody(node.block);
|
1378
1382
|
}
|
1379
1383
|
}
|
1380
|
-
|
1384
|
+
writeIndexedElementGetterDeclaration(node) {
|
1381
1385
|
this.writeDeclarationTags(node.tagList);
|
1382
1386
|
this.writeDeclarationModifiers(node.modifierList);
|
1383
1387
|
this.writeKeyword(node.getKeyword);
|
@@ -1390,7 +1394,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1390
1394
|
this.writeDeclarationBody(node.block);
|
1391
1395
|
}
|
1392
1396
|
}
|
1393
|
-
|
1397
|
+
writeIndexedElementSetterDeclaration(node) {
|
1394
1398
|
this.writeDeclarationTags(node.tagList);
|
1395
1399
|
this.writeDeclarationModifiers(node.modifierList);
|
1396
1400
|
this.writeKeyword(node.setKeyword);
|
@@ -1402,7 +1406,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1402
1406
|
this.writeDeclarationBody(node.block);
|
1403
1407
|
}
|
1404
1408
|
}
|
1405
|
-
|
1409
|
+
writeDereferencedVariableGetterDeclaration(node) {
|
1406
1410
|
this.writeDeclarationTags(node.tagList);
|
1407
1411
|
this.writeDeclarationModifiers(node.modifierList);
|
1408
1412
|
this.writeKeyword(node.getKeyword);
|
@@ -1413,7 +1417,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1413
1417
|
this.writeDeclarationBody(node.block);
|
1414
1418
|
}
|
1415
1419
|
}
|
1416
|
-
|
1420
|
+
writeDereferencedVariableSetterDeclaration(node) {
|
1417
1421
|
this.writeDeclarationTags(node.tagList);
|
1418
1422
|
this.writeDeclarationModifiers(node.modifierList);
|
1419
1423
|
this.writeKeyword(node.setKeyword);
|
@@ -1542,8 +1546,8 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1542
1546
|
writeAnonymousTypeSpecifier(node) {
|
1543
1547
|
this.writeNode(node.typeDeclaration);
|
1544
1548
|
}
|
1545
|
-
|
1546
|
-
this.
|
1549
|
+
writeAnonymousFunctionTypeDeclaration(node) {
|
1550
|
+
this.writeFunctionTypeDeclarationBody(node.body);
|
1547
1551
|
}
|
1548
1552
|
writeAnonymousStructuredTypeDeclaration(node) {
|
1549
1553
|
this.writeStructuredTypeDeclarationBody(node.body);
|
@@ -1552,8 +1556,8 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1552
1556
|
this.writeVariantTypeDeclarationBody(node.body);
|
1553
1557
|
}
|
1554
1558
|
writeUnionTypeSpecifier(node) {
|
1555
|
-
for (let i = 0; i < node.
|
1556
|
-
const element = node.
|
1559
|
+
for (let i = 0; i < node.typeListElements.length; i++) {
|
1560
|
+
const element = node.typeListElements[i];
|
1557
1561
|
if (element.kind === 0 /* Token */) {
|
1558
1562
|
this.writeWhitespace();
|
1559
1563
|
this.writeToken(element);
|
@@ -1561,7 +1565,28 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1561
1565
|
if (i > 0) {
|
1562
1566
|
this.writeWhitespace();
|
1563
1567
|
}
|
1564
|
-
const areParenthesisRequired = this.
|
1568
|
+
const areParenthesisRequired = this.doesUnionTypeElementRequireParenthesis(element);
|
1569
|
+
if (areParenthesisRequired) {
|
1570
|
+
this.writeCode("(");
|
1571
|
+
}
|
1572
|
+
this.writeTypeSpecifier(element, false);
|
1573
|
+
if (areParenthesisRequired) {
|
1574
|
+
this.writeCode(")");
|
1575
|
+
}
|
1576
|
+
}
|
1577
|
+
}
|
1578
|
+
}
|
1579
|
+
writeIntersectionTypeSpecifier(node) {
|
1580
|
+
for (let i = 0; i < node.typeListElements.length; i++) {
|
1581
|
+
const element = node.typeListElements[i];
|
1582
|
+
if (element.kind === 0 /* Token */) {
|
1583
|
+
this.writeWhitespace();
|
1584
|
+
this.writeToken(element);
|
1585
|
+
} else {
|
1586
|
+
if (i > 0) {
|
1587
|
+
this.writeWhitespace();
|
1588
|
+
}
|
1589
|
+
const areParenthesisRequired = this.doesIntersectionTypeElementRequireParenthesis(element);
|
1565
1590
|
if (areParenthesisRequired) {
|
1566
1591
|
this.writeCode("(");
|
1567
1592
|
}
|
@@ -1588,13 +1613,39 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1588
1613
|
}
|
1589
1614
|
this.writeToken(node.questionToken);
|
1590
1615
|
}
|
1591
|
-
|
1616
|
+
doesUnionTypeElementRequireParenthesis(node) {
|
1592
1617
|
switch (node.kind) {
|
1593
1618
|
case 11 /* UnionTypeSpecifier */:
|
1594
1619
|
return true;
|
1595
1620
|
case 15 /* AnonymousTypeSpecifier */: {
|
1596
1621
|
switch (node.typeDeclaration.body.kind) {
|
1597
|
-
case 29 /*
|
1622
|
+
case 29 /* FunctionTypeDeclarationBody */:
|
1623
|
+
return true;
|
1624
|
+
case 34 /* StructuredTypeDeclarationBody */:
|
1625
|
+
case 39 /* VariantTypeDeclarationBody */:
|
1626
|
+
return false;
|
1627
|
+
default:
|
1628
|
+
Debug.never(node.typeDeclaration.body);
|
1629
|
+
}
|
1630
|
+
}
|
1631
|
+
case 10 /* NamedTypeSpecifier */:
|
1632
|
+
case 13 /* ParenthesizedTypeSpecifier */:
|
1633
|
+
case 14 /* NullableTypeSpecifier */:
|
1634
|
+
case 16 /* InvalidTypeSpecifier */:
|
1635
|
+
case 12 /* IntersectionTypeSpecifier */:
|
1636
|
+
return false;
|
1637
|
+
default:
|
1638
|
+
Debug.never(node);
|
1639
|
+
}
|
1640
|
+
}
|
1641
|
+
doesIntersectionTypeElementRequireParenthesis(node) {
|
1642
|
+
switch (node.kind) {
|
1643
|
+
case 11 /* UnionTypeSpecifier */:
|
1644
|
+
case 12 /* IntersectionTypeSpecifier */:
|
1645
|
+
return true;
|
1646
|
+
case 15 /* AnonymousTypeSpecifier */: {
|
1647
|
+
switch (node.typeDeclaration.body.kind) {
|
1648
|
+
case 29 /* FunctionTypeDeclarationBody */:
|
1598
1649
|
return true;
|
1599
1650
|
case 34 /* StructuredTypeDeclarationBody */:
|
1600
1651
|
case 39 /* VariantTypeDeclarationBody */:
|
@@ -1615,6 +1666,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1615
1666
|
doesTypeMadeNullableRequireParenthesis(node) {
|
1616
1667
|
switch (node.kind) {
|
1617
1668
|
case 11 /* UnionTypeSpecifier */:
|
1669
|
+
case 12 /* IntersectionTypeSpecifier */:
|
1618
1670
|
case 15 /* AnonymousTypeSpecifier */:
|
1619
1671
|
return true;
|
1620
1672
|
case 10 /* NamedTypeSpecifier */:
|
@@ -1694,7 +1746,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1694
1746
|
this.writeWhitespace();
|
1695
1747
|
this.writeToken(node.translatedName);
|
1696
1748
|
}
|
1697
|
-
|
1749
|
+
writePackageFunctionTranslation(node) {
|
1698
1750
|
this.writeKeyword(node.functionKeyword);
|
1699
1751
|
this.writeWhitespace();
|
1700
1752
|
this.writeToken(node.sourceName);
|
@@ -1739,7 +1791,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1739
1791
|
this.writeToken(node.closeBraceToken);
|
1740
1792
|
}
|
1741
1793
|
}
|
1742
|
-
|
1794
|
+
writeFunctionTypeTranslation(node) {
|
1743
1795
|
this.writeKeyword(node.typeKeyword);
|
1744
1796
|
this.writeWhitespace();
|
1745
1797
|
this.writeToken(node.sourceName);
|
@@ -1756,14 +1808,14 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1756
1808
|
}
|
1757
1809
|
this.writeTranslationParameterClause(node.translatedParameterClause);
|
1758
1810
|
}
|
1759
|
-
|
1811
|
+
writeFieldOrVariantTranslation(node) {
|
1760
1812
|
this.writeToken(node.sourceName);
|
1761
1813
|
this.writeWhitespace();
|
1762
1814
|
this.writeToken(node.minusGreaterThanToken);
|
1763
1815
|
this.writeWhitespace();
|
1764
1816
|
this.writeToken(node.translatedName);
|
1765
1817
|
}
|
1766
|
-
|
1818
|
+
writeMethodTranslation(node) {
|
1767
1819
|
this.writeKeyword(node.functionKeyword);
|
1768
1820
|
this.writeWhitespace();
|
1769
1821
|
this.writeToken(node.sourceName);
|
@@ -1781,11 +1833,11 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1781
1833
|
this.writeTranslationParameterClause(node.translatedParameterClause);
|
1782
1834
|
}
|
1783
1835
|
writeIndexerTranslation(node) {
|
1784
|
-
this.
|
1836
|
+
this.writeIndexParameterTranslationClause(node.sourceParameterClause);
|
1785
1837
|
this.writeWhitespace();
|
1786
1838
|
this.writeToken(node.minusGreaterThanToken);
|
1787
1839
|
this.writeWhitespace();
|
1788
|
-
this.
|
1840
|
+
this.writeIndexParameterTranslationClause(node.translatedParameterClause);
|
1789
1841
|
}
|
1790
1842
|
writeConstructorTranslation(node) {
|
1791
1843
|
this.writeKeyword(node.creationKeyword);
|
@@ -1807,7 +1859,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1807
1859
|
this.writeCommaSeparatedList(node.parameterList.elements, (p) => this.writeToken(p));
|
1808
1860
|
this.writeToken(node.closeParenthesisToken);
|
1809
1861
|
}
|
1810
|
-
|
1862
|
+
writeIndexParameterTranslationClause(node) {
|
1811
1863
|
this.writeToken(node.openSquareBracketToken);
|
1812
1864
|
this.writeCommaSeparatedList(node.parameterList.elements, (p) => this.writeToken(p));
|
1813
1865
|
this.writeToken(node.closeSquareBracketToken);
|
@@ -1942,7 +1994,6 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1942
1994
|
decreaseIndentation() {
|
1943
1995
|
this._indentation = this._indentation.substring(0, this._indentation.length - this._indentationStep.length);
|
1944
1996
|
}
|
1945
|
-
/* eslint-disable @stylistic/max-len */
|
1946
1997
|
static createWriteFunctions() {
|
1947
1998
|
const writeFunctions = {
|
1948
1999
|
[0 /* Token */]: this.prototype.writeToken,
|
@@ -1952,9 +2003,10 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1952
2003
|
[4 /* PackageImportDirectiveList */]: this.prototype.writePackageImportDirectiveList,
|
1953
2004
|
[5 /* SinglePackageImportDirective */]: this.prototype.writeSinglePackageImportDirective,
|
1954
2005
|
[8 /* PackageImport */]: this.prototype.writePackageImport,
|
1955
|
-
[9 /*
|
2006
|
+
[9 /* PackageName */]: this.prototype.writePackageName,
|
1956
2007
|
[10 /* NamedTypeSpecifier */]: this.prototype.writeNamedTypeSpecifier,
|
1957
2008
|
[11 /* UnionTypeSpecifier */]: this.prototype.writeUnionTypeSpecifier,
|
2009
|
+
[12 /* IntersectionTypeSpecifier */]: this.prototype.writeIntersectionTypeSpecifier,
|
1958
2010
|
[13 /* ParenthesizedTypeSpecifier */]: this.prototype.writeParenthesizedTypeSpecifier,
|
1959
2011
|
[14 /* NullableTypeSpecifier */]: this.prototype.writeNullableTypeSpecifier,
|
1960
2012
|
[15 /* AnonymousTypeSpecifier */]: this.prototype.writeAnonymousTypeSpecifier,
|
@@ -1962,9 +2014,9 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1962
2014
|
[24 /* PackageMemberGroupDeclaration */]: this.prototype.writePackageMemberGroupDeclaration,
|
1963
2015
|
[25 /* PackageConstructorDeclaration */]: this.prototype.writePackageConstructorDeclaration,
|
1964
2016
|
[26 /* PackageEntryPointDeclaration */]: this.prototype.writePackageEntryPointDeclaration,
|
1965
|
-
[27 /*
|
1966
|
-
[28 /*
|
1967
|
-
[29 /*
|
2017
|
+
[27 /* PackageFunctionDeclaration */]: this.prototype.writePackageFunctionDeclaration,
|
2018
|
+
[28 /* PackageFunctionTypeDeclaration */]: this.prototype.writePackageFunctionTypeDeclaration,
|
2019
|
+
[29 /* FunctionTypeDeclarationBody */]: this.prototype.writeFunctionTypeDeclarationBody,
|
1968
2020
|
[30 /* BaseTypeList */]: this.prototype.writeBaseTypeList,
|
1969
2021
|
[32 /* TypeMemberDeclarationBlock */]: this.prototype.writeTypeMemberDeclarationBlock,
|
1970
2022
|
[33 /* PackageStructuredTypeDeclaration */]: this.prototype.writePackageStructuredTypeDeclaration,
|
@@ -1975,17 +2027,17 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1975
2027
|
[38 /* PackageVariantTypeDeclaration */]: this.prototype.writePackageVariantTypeDeclaration,
|
1976
2028
|
[39 /* VariantTypeDeclarationBody */]: this.prototype.writeVariantTypeDeclarationBody,
|
1977
2029
|
[44 /* TypeMemberGroupDeclaration */]: this.prototype.writeTypeMemberGroupDeclaration,
|
1978
|
-
[45 /*
|
1979
|
-
[46 /*
|
1980
|
-
[47 /*
|
1981
|
-
[48 /*
|
1982
|
-
[50 /*
|
1983
|
-
[51 /*
|
1984
|
-
[52 /*
|
2030
|
+
[45 /* ConstructorDeclaration */]: this.prototype.writeConstructorDeclaration,
|
2031
|
+
[46 /* DestructorDeclaration */]: this.prototype.writeDestructorDeclaration,
|
2032
|
+
[47 /* IndexedElementGetterDeclaration */]: this.prototype.writeIndexedElementGetterDeclaration,
|
2033
|
+
[48 /* IndexedElementSetterDeclaration */]: this.prototype.writeIndexedElementSetterDeclaration,
|
2034
|
+
[50 /* DereferencedVariableGetterDeclaration */]: this.prototype.writeDereferencedVariableGetterDeclaration,
|
2035
|
+
[51 /* DereferencedVariableSetterDeclaration */]: this.prototype.writeDereferencedVariableSetterDeclaration,
|
2036
|
+
[52 /* MethodDeclaration */]: this.prototype.writeMethodDeclaration,
|
1985
2037
|
[53 /* OperatorDeclaration */]: this.prototype.writeOperatorDeclaration,
|
1986
|
-
[54 /*
|
1987
|
-
[55 /*
|
1988
|
-
[56 /*
|
2038
|
+
[54 /* FieldDeclaration */]: this.prototype.writeFieldDeclaration,
|
2039
|
+
[55 /* FieldGetterDeclaration */]: this.prototype.writeFieldGetterDeclaration,
|
2040
|
+
[56 /* FieldSetterDeclaration */]: this.prototype.writeFieldSetterDeclaration,
|
1989
2041
|
[93 /* StatementBlock */]: this.prototype.writeStatementBlock,
|
1990
2042
|
[94 /* FunctionBlock */]: this.prototype.writeFunctionBlock,
|
1991
2043
|
[135 /* QualifiedName */]: this.prototype.writeQualifiedName,
|
@@ -1999,12 +2051,11 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1999
2051
|
[151 /* ParameterList */]: this.prototype.writeParameterList,
|
2000
2052
|
[152 /* TypeArgumentClause */]: this.prototype.writeTypeArgumentClause,
|
2001
2053
|
[154 /* TypeParameterClause */]: this.prototype.writeTypeParameterClause,
|
2002
|
-
[17 /*
|
2054
|
+
[17 /* AnonymousFunctionTypeDeclaration */]: this.prototype.writeAnonymousFunctionTypeDeclaration,
|
2003
2055
|
[18 /* AnonymousStructuredTypeDeclaration */]: this.prototype.writeAnonymousStructuredTypeDeclaration,
|
2004
2056
|
[19 /* AnonymousVariantTypeDeclaration */]: this.prototype.writeAnonymousVariantTypeDeclaration,
|
2005
2057
|
[6 /* PackageGroupImportDirective */]: this.prototype.writeNodeDefault,
|
2006
2058
|
[7 /* PackageImportList */]: this.prototype.writeNodeDefault,
|
2007
|
-
[12 /* UnionTypeSpecifierTypeList */]: this.prototype.writeNodeDefault,
|
2008
2059
|
[16 /* InvalidTypeSpecifier */]: this.prototype.writeNodeDefault,
|
2009
2060
|
[20 /* TopLevelTranslationList */]: this.prototype.writeNodeDefault,
|
2010
2061
|
[21 /* TranslationsDeclaration */]: this.prototype.writeTranslationsDeclaration,
|
@@ -2014,9 +2065,9 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
2014
2065
|
[41 /* ExtendedTypeClauseCommaList */]: this.prototype.writeNodeDefault,
|
2015
2066
|
[42 /* ExtendedTypeClause */]: this.prototype.writeNodeDefault,
|
2016
2067
|
[43 /* InvalidPackageMemberDeclaration */]: this.prototype.writeNodeDefault,
|
2017
|
-
[49 /*
|
2068
|
+
[49 /* IndexParameterClause */]: this.prototype.writeNodeDefault,
|
2018
2069
|
[57 /* InvalidTypeMemberDeclaration */]: this.prototype.writeNodeDefault,
|
2019
|
-
[58 /*
|
2070
|
+
[58 /* NestedFunctionDeclaration */]: this.prototype.writeNodeDefault,
|
2020
2071
|
[59 /* LocalVariableDeclaration */]: this.prototype.writeNodeDefault,
|
2021
2072
|
[60 /* EnumerationVariableDeclaration */]: this.prototype.writeNodeDefault,
|
2022
2073
|
[61 /* ArrayLiteral */]: this.prototype.writeNodeDefault,
|
@@ -2025,18 +2076,18 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
2025
2076
|
[64 /* AssumptionExpression */]: this.prototype.writeNodeDefault,
|
2026
2077
|
[65 /* AsExpression */]: this.prototype.writeNodeDefault,
|
2027
2078
|
[66 /* BinaryExpression */]: this.prototype.writeNodeDefault,
|
2028
|
-
[67 /*
|
2079
|
+
[67 /* FunctionBlockLiteral */]: this.prototype.writeNodeDefault,
|
2029
2080
|
[68 /* ArgumentList */]: this.prototype.writeNodeDefault,
|
2030
2081
|
[69 /* CallExpression */]: this.prototype.writeNodeDefault,
|
2031
2082
|
[70 /* AutotypeCallExpression */]: this.prototype.writeNodeDefault,
|
2032
2083
|
[71 /* IndexedAccessExpression */]: this.prototype.writeNodeDefault,
|
2033
2084
|
[72 /* InvalidExpression */]: this.prototype.writeNodeDefault,
|
2034
2085
|
[73 /* IsExpression */]: this.prototype.writeNodeDefault,
|
2035
|
-
[74 /*
|
2086
|
+
[74 /* FunctionLiteral */]: this.prototype.writeNodeDefault,
|
2036
2087
|
[75 /* ParenthesizedExpression */]: this.prototype.writeNodeDefault,
|
2037
2088
|
[76 /* WhenTernaryExpression */]: this.prototype.writeNodeDefault,
|
2038
2089
|
[77 /* PrefixUnaryExpression */]: this.prototype.writeNodeDefault,
|
2039
|
-
[78 /*
|
2090
|
+
[78 /* MemberAccessExpression */]: this.prototype.writeNodeDefault,
|
2040
2091
|
[79 /* ReferenceExpression */]: this.prototype.writeNodeDefault,
|
2041
2092
|
[80 /* DereferenceExpression */]: this.prototype.writeNodeDefault,
|
2042
2093
|
[81 /* TextTemplateLiteral */]: this.prototype.writeNodeDefault,
|
@@ -2070,7 +2121,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
2070
2121
|
[111 /* ElseIfClause */]: this.prototype.writeNodeDefault,
|
2071
2122
|
[112 /* ElseClause */]: this.prototype.writeNodeDefault,
|
2072
2123
|
[113 /* InvalidStatement */]: this.prototype.writeNodeDefault,
|
2073
|
-
[114 /*
|
2124
|
+
[114 /* NestedFunctionDeclarationStatement */]: this.prototype.writeNodeDefault,
|
2074
2125
|
[115 /* LocalVariableDeclarationStatement */]: this.prototype.writeNodeDefault,
|
2075
2126
|
[116 /* LoopStatement */]: this.prototype.writeNodeDefault,
|
2076
2127
|
[117 /* ReturnStatement */]: this.prototype.writeNodeDefault,
|
@@ -2083,16 +2134,16 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
2083
2134
|
[124 /* TranslationParameterList */]: this.prototype.writeNodeDefault,
|
2084
2135
|
[125 /* TranslationParameterClause */]: this.prototype.writeTranslationParameterClause,
|
2085
2136
|
[126 /* ConstructorTranslation */]: this.prototype.writeConstructorTranslation,
|
2086
|
-
[127 /*
|
2137
|
+
[127 /* IndexParameterTranslationClause */]: this.prototype.writeIndexParameterTranslationClause,
|
2087
2138
|
[128 /* IndexerTranslation */]: this.prototype.writeIndexerTranslation,
|
2088
2139
|
[129 /* TranslationTypeParameterList */]: this.prototype.writeNodeDefault,
|
2089
2140
|
[130 /* TranslationTypeParameterClause */]: this.prototype.writeTranslationTypeParameterClause,
|
2090
|
-
[131 /*
|
2091
|
-
[132 /*
|
2092
|
-
[133 /*
|
2141
|
+
[131 /* PackageFunctionTranslation */]: this.prototype.writePackageFunctionTranslation,
|
2142
|
+
[132 /* MethodTranslation */]: this.prototype.writeMethodTranslation,
|
2143
|
+
[133 /* FunctionTypeTranslation */]: this.prototype.writeFunctionTypeTranslation,
|
2093
2144
|
[134 /* PackageImportTranslation */]: this.prototype.writePackageImportTranslation,
|
2094
2145
|
[136 /* PackageVariableTranslation */]: this.prototype.writePackageVariableTranslation,
|
2095
|
-
[137 /*
|
2146
|
+
[137 /* FieldOrVariantTranslation */]: this.prototype.writeFieldOrVariantTranslation,
|
2096
2147
|
[138 /* TypeMemberTranslationList */]: this.prototype.writeNodeDefault,
|
2097
2148
|
[139 /* TypeTranslation */]: this.prototype.writeTypeTranslation,
|
2098
2149
|
[140 /* TextLiteralTranslation */]: this.prototype.writeNodeDefault,
|
@@ -2105,7 +2156,6 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
2105
2156
|
};
|
2106
2157
|
return writeFunctions;
|
2107
2158
|
}
|
2108
|
-
/* eslint-enable @stylistic/max-len */
|
2109
2159
|
// TODO: перенести метод в другое место (в Scanner)
|
2110
2160
|
escapeLiteralIdentifier(value) {
|
2111
2161
|
return value.replace(/\\/g, "\\\\").replace(/'/g, "\\'");
|
@@ -2546,11 +2596,11 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2546
2596
|
switch (entity.kind) {
|
2547
2597
|
case 0 /* Variable */:
|
2548
2598
|
return this.createPackageVariableTranslation(entity);
|
2549
|
-
case 1 /*
|
2550
|
-
return this.
|
2599
|
+
case 1 /* Function */:
|
2600
|
+
return this.createPackageFunctionTranslation(entity);
|
2551
2601
|
case 2 /* Type */:
|
2552
|
-
if (entity.typeEntityKind === 0 /*
|
2553
|
-
return this.
|
2602
|
+
if (entity.typeEntityKind === 0 /* Function */) {
|
2603
|
+
return this.createPackageFunctionTypeTranslation(entity);
|
2554
2604
|
} else {
|
2555
2605
|
return this.createPackageTypeWithMembersTranslation(entity);
|
2556
2606
|
}
|
@@ -2564,11 +2614,11 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2564
2614
|
const name = this.getNameText(entity.getName());
|
2565
2615
|
return SyntaxFactory.packageVariableTranslation(name, name);
|
2566
2616
|
}
|
2567
|
-
|
2617
|
+
createPackageFunctionTranslation(entity) {
|
2568
2618
|
const name = this.getNameText(entity.getName());
|
2569
2619
|
const typeParameters = entity.getTypeParameters().map((p) => this.getNameText(p.getName()));
|
2570
2620
|
const parameters = entity.getValueParameters().map((p) => this.getNameText(p.getName()));
|
2571
|
-
return SyntaxFactory.
|
2621
|
+
return SyntaxFactory.packageFunctionTranslation(name, typeParameters, parameters, name, typeParameters, parameters);
|
2572
2622
|
}
|
2573
2623
|
createPackageTypeWithMembersTranslation(entity) {
|
2574
2624
|
const name = this.getNameText(entity.getName());
|
@@ -2576,18 +2626,18 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2576
2626
|
const members = Query.from(this.collectNotTranslatedTypeMembers(entity)).mapAndFilter((e) => this.createTypeMemberTranslationNode(e)).filter((n) => n !== void 0).uniqueWithComparator(compareNodes).toArray();
|
2577
2627
|
return SyntaxFactory.typeTranslation(name, typeParameters, name, typeParameters, members);
|
2578
2628
|
}
|
2579
|
-
|
2629
|
+
createPackageFunctionTypeTranslation(entity) {
|
2580
2630
|
const name = this.getNameText(entity.getName());
|
2581
2631
|
const typeParameters = entity.getTypeParameters().map((p) => this.getNameText(p.getName()));
|
2582
2632
|
const parameters = entity.getValueParameters().map((p) => this.getNameText(p.getName()));
|
2583
|
-
return SyntaxFactory.
|
2633
|
+
return SyntaxFactory.functionTypeTranslation(name, typeParameters, parameters, name, typeParameters, parameters);
|
2584
2634
|
}
|
2585
2635
|
createTypeMemberTranslationNode(entity) {
|
2586
2636
|
switch (entity.kind) {
|
2587
2637
|
case 0 /* Variable */:
|
2588
|
-
return this.
|
2589
|
-
case 1 /*
|
2590
|
-
return this.
|
2638
|
+
return this.createFieldTranslation(entity);
|
2639
|
+
case 1 /* Function */:
|
2640
|
+
return this.createMethodTranslation(entity);
|
2591
2641
|
case 7 /* Constructor */:
|
2592
2642
|
return this.createConstructorTranslation(entity);
|
2593
2643
|
case 5 /* Indexer */:
|
@@ -2600,15 +2650,15 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2600
2650
|
Debug.never(entity);
|
2601
2651
|
}
|
2602
2652
|
}
|
2603
|
-
|
2653
|
+
createFieldTranslation(entity) {
|
2604
2654
|
const name = this.getNameText(entity.getName());
|
2605
|
-
return SyntaxFactory.
|
2655
|
+
return SyntaxFactory.fieldOrVariantTranslation(name, name);
|
2606
2656
|
}
|
2607
|
-
|
2657
|
+
createMethodTranslation(entity) {
|
2608
2658
|
const name = this.getNameText(entity.getName());
|
2609
2659
|
const typeParameters = entity.getTypeParameters().map((p) => this.getNameText(p.getName()));
|
2610
2660
|
const parameters = entity.getValueParameters().map((p) => this.getNameText(p.getName()));
|
2611
|
-
return SyntaxFactory.
|
2661
|
+
return SyntaxFactory.methodTranslation(name, typeParameters, parameters, name, typeParameters, parameters);
|
2612
2662
|
}
|
2613
2663
|
createConstructorTranslation(entity) {
|
2614
2664
|
const parameters = entity.getValueParameters().map((p) => this.getNameText(p.getName()));
|
@@ -2677,7 +2727,7 @@ var CodeActionsService = class {
|
|
2677
2727
|
}
|
2678
2728
|
const result = new Array();
|
2679
2729
|
const diagnosticCodeSet = new Set(diagnosticCodes);
|
2680
|
-
if (diagnosticCodeSet.has(
|
2730
|
+
if (diagnosticCodeSet.has(2073 /* TheFollowingDeclarationsAreNotTranslated0 */) || diagnosticCodeSet.has(2074 /* TheFollowingDeclarationAreNotTranslated0And1More */)) {
|
2681
2731
|
const data = { onlyTypeMembers: false };
|
2682
2732
|
result.push(CodeAction.unresolved(
|
2683
2733
|
"\u0421\u0433\u0435\u043D\u0435\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043D\u0435\u0434\u043E\u0441\u0442\u0430\u044E\u0449\u0438\u0435 \u043F\u0435\u0440\u0435\u0432\u043E\u0434\u044B.",
|
@@ -2798,17 +2848,17 @@ var SignatureForNode = class _SignatureForNode {
|
|
2798
2848
|
const signatures = meaning.candidates.map((c) => new ConstructorSignature(c));
|
2799
2849
|
return new SignaturesWithSingleSuitable(signatures, suitableSignatureIndex);
|
2800
2850
|
}
|
2801
|
-
const info = analyzer.
|
2851
|
+
const info = analyzer.checkExpressionDenotesFunction(node.expression);
|
2802
2852
|
if (info !== void 0) {
|
2803
2853
|
let suitableSignatureIndex;
|
2804
|
-
if (info.
|
2805
|
-
suitableSignatureIndex = info.candidates.indexOf(info.
|
2854
|
+
if (info.suitableFunctions.length === 1) {
|
2855
|
+
suitableSignatureIndex = info.candidates.indexOf(info.suitableFunctions[0]);
|
2806
2856
|
}
|
2807
|
-
const signatures = info.candidates.map((c) => new
|
2857
|
+
const signatures = info.candidates.map((c) => new AccessedFunctionSignature(c));
|
2808
2858
|
return new SignaturesWithSingleSuitable(signatures, suitableSignatureIndex);
|
2809
2859
|
}
|
2810
|
-
if (meaning.kind === "object-
|
2811
|
-
const signature = new
|
2860
|
+
if (meaning.kind === "object-function-call") {
|
2861
|
+
const signature = new FunctionTypeSignature(meaning.type);
|
2812
2862
|
return new SignaturesWithSingleSuitable([signature], 0);
|
2813
2863
|
}
|
2814
2864
|
return void 0;
|
@@ -2852,12 +2902,12 @@ var SignatureForNode = class _SignatureForNode {
|
|
2852
2902
|
const signatures = meaning.candidates.map((c) => new ConstructorSignature(c));
|
2853
2903
|
return new SignaturesWithSingleSuitable(signatures, suitableSignatureIndex);
|
2854
2904
|
}
|
2855
|
-
if (meaning.kind === "tag-
|
2905
|
+
if (meaning.kind === "tag-function") {
|
2856
2906
|
let suitableSignatureIndex;
|
2857
|
-
if (meaning.
|
2858
|
-
suitableSignatureIndex = meaning.candidates.indexOf(meaning.
|
2907
|
+
if (meaning.suitableFunctions.length === 1) {
|
2908
|
+
suitableSignatureIndex = meaning.candidates.indexOf(meaning.suitableFunctions[0]);
|
2859
2909
|
}
|
2860
|
-
const signatures = meaning.candidates.map((c) => new
|
2910
|
+
const signatures = meaning.candidates.map((c) => new AccessedFunctionSignature(c));
|
2861
2911
|
return new SignaturesWithSingleSuitable(signatures, suitableSignatureIndex);
|
2862
2912
|
}
|
2863
2913
|
if (meaning.kind === "unresolved") {
|
@@ -2968,34 +3018,34 @@ var MatchedSignature = class {
|
|
2968
3018
|
this.matchResult = matchResult;
|
2969
3019
|
}
|
2970
3020
|
};
|
2971
|
-
var
|
2972
|
-
constructor(
|
2973
|
-
this.kind = "accessed-
|
3021
|
+
var AccessedFunctionSignature = class {
|
3022
|
+
constructor(func) {
|
3023
|
+
this.kind = "accessed-function";
|
2974
3024
|
this._valueParameters = new Cached();
|
2975
|
-
this.
|
3025
|
+
this.func = func;
|
2976
3026
|
}
|
2977
3027
|
getValueParameters() {
|
2978
3028
|
return this._valueParameters.getOrInsertWith(() => {
|
2979
|
-
const localizedSignature = EntityLocalizationHelper.
|
2980
|
-
this.
|
2981
|
-
this.
|
3029
|
+
const localizedSignature = EntityLocalizationHelper.getLocalizedFunctionSignature(
|
3030
|
+
this.func.value.getEntity(),
|
3031
|
+
this.func.localization
|
2982
3032
|
);
|
2983
|
-
return Query.from(this.
|
3033
|
+
return Query.from(this.func.value.getValueParameters()).zip(
|
2984
3034
|
localizedSignature.getValueParameterNames(),
|
2985
3035
|
(p, n) => new UniversalValueParameter(n.value, p.type, p.entity, n.localization)
|
2986
3036
|
).toArray();
|
2987
3037
|
});
|
2988
3038
|
}
|
2989
3039
|
};
|
2990
|
-
var
|
2991
|
-
constructor(
|
2992
|
-
this.kind = "
|
3040
|
+
var FunctionTypeSignature = class {
|
3041
|
+
constructor(functionType) {
|
3042
|
+
this.kind = "function-type";
|
2993
3043
|
this._valueParameters = new Cached();
|
2994
|
-
this.
|
3044
|
+
this.functionType = functionType;
|
2995
3045
|
}
|
2996
3046
|
getValueParameters() {
|
2997
3047
|
return this._valueParameters.getOrInsertWith(
|
2998
|
-
() => this.
|
3048
|
+
() => this.functionType.getValueParameters().map(
|
2999
3049
|
(p) => new UniversalValueParameter(
|
3000
3050
|
p.getName(),
|
3001
3051
|
p.getType(),
|
@@ -3094,7 +3144,7 @@ var CompletionService = class {
|
|
3094
3144
|
semanticContext,
|
3095
3145
|
positionDescription
|
3096
3146
|
);
|
3097
|
-
completionItemInfos = this.
|
3147
|
+
completionItemInfos = this.mergeOverloadedFunctions(completionItemInfos);
|
3098
3148
|
completionItemInfos = this.removeCompletionItemsWithDuplicateLabels(completionItemInfos);
|
3099
3149
|
const cacheId = this._cache.add(completionItemInfos, sourceFile).id;
|
3100
3150
|
const result = this.convertCompletionItemInfos(completionItemInfos, cacheId);
|
@@ -3158,7 +3208,7 @@ var CompletionService = class {
|
|
3158
3208
|
if (syntaxContext.isInComment || syntaxContext.isInStringOrChar) {
|
3159
3209
|
return { kind: "none" };
|
3160
3210
|
}
|
3161
|
-
if (syntaxContext.isInQuotedIdentifier !== void 0 && (syntaxContext.isInQuotedIdentifier.parent.kind === 53 /* OperatorDeclaration */ || syntaxContext.isInQuotedIdentifier.parent.kind === 52 /*
|
3211
|
+
if (syntaxContext.isInQuotedIdentifier !== void 0 && (syntaxContext.isInQuotedIdentifier.parent.kind === 53 /* OperatorDeclaration */ || syntaxContext.isInQuotedIdentifier.parent.kind === 52 /* MethodDeclaration */)) {
|
3162
3212
|
return new OperatorNameCompletionContext(syntaxContext.isInQuotedIdentifier);
|
3163
3213
|
}
|
3164
3214
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
@@ -3168,15 +3218,15 @@ var CompletionService = class {
|
|
3168
3218
|
if (tokenOrKeyword.isToken(57 /* Equals */) && tokenOrKeyword.parent.kind === 8 /* PackageImport */) {
|
3169
3219
|
return new PackageImportCompletionContext([], void 0);
|
3170
3220
|
}
|
3171
|
-
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 9 /*
|
3221
|
+
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 9 /* PackageName */) {
|
3172
3222
|
const packageImport = tokenOrKeyword.parent.parent;
|
3173
|
-
const precedingSegmentNames = packageImport.
|
3223
|
+
const precedingSegmentNames = packageImport.packageName.segments.takeWhile((s) => s.rangeStart < tokenOrKeyword.value.rangeStart).map((p) => this._analyzer.createNameFromIdentifier(p)).toArray();
|
3174
3224
|
return new PackageImportCompletionContext(precedingSegmentNames, void 0);
|
3175
3225
|
}
|
3176
3226
|
if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 6 /* PackageGroupImportDirective */ || this.tokenOrKeywordIsPackageImportListChild(tokenOrKeyword)) {
|
3177
3227
|
return new PackageImportCompletionContext([], void 0);
|
3178
3228
|
}
|
3179
|
-
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 78 /*
|
3229
|
+
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 78 /* MemberAccessExpression */) {
|
3180
3230
|
const propertyAccess = tokenOrKeyword.parent;
|
3181
3231
|
{
|
3182
3232
|
const info = this._analyzer.checkExpressionDenotesPackageNameSegment(propertyAccess.expression);
|
@@ -3357,12 +3407,12 @@ var CompletionService = class {
|
|
3357
3407
|
translationKind = 1 /* PackageImport */;
|
3358
3408
|
hasPrecedingKeyword = true;
|
3359
3409
|
}
|
3360
|
-
if (tokenOrKeyword.isKeyword(16 /* Type */) && (tokenOrKeyword.parent.kind === 139 /* TypeTranslation */ || tokenOrKeyword.parent.kind === 133 /*
|
3410
|
+
if (tokenOrKeyword.isKeyword(16 /* Type */) && (tokenOrKeyword.parent.kind === 139 /* TypeTranslation */ || tokenOrKeyword.parent.kind === 133 /* FunctionTypeTranslation */)) {
|
3361
3411
|
translationsDeclaration = tokenOrKeyword.parent.parent.parent;
|
3362
3412
|
translationKind = 3 /* Type */;
|
3363
3413
|
hasPrecedingKeyword = true;
|
3364
3414
|
}
|
3365
|
-
if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 131 /*
|
3415
|
+
if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 131 /* PackageFunctionTranslation */) {
|
3366
3416
|
translationsDeclaration = tokenOrKeyword.parent.parent.parent;
|
3367
3417
|
translationKind = 2 /* Method */;
|
3368
3418
|
hasPrecedingKeyword = true;
|
@@ -3409,7 +3459,7 @@ var CompletionService = class {
|
|
3409
3459
|
translationKind = 0 /* Any */;
|
3410
3460
|
hasPrecedingKeyword = false;
|
3411
3461
|
}
|
3412
|
-
if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 132 /*
|
3462
|
+
if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 132 /* MethodTranslation */) {
|
3413
3463
|
typeTranslation = tokenOrKeyword.parent.parent.parent;
|
3414
3464
|
translationKind = 1 /* Method */;
|
3415
3465
|
hasPrecedingKeyword = true;
|
@@ -3498,6 +3548,11 @@ var CompletionService = class {
|
|
3498
3548
|
}
|
3499
3549
|
return { targetTypes: void 0, targetSignaturesParameters: void 0 };
|
3500
3550
|
}
|
3551
|
+
if (role.kind === "error-value") {
|
3552
|
+
const errorType = this._analyzer.standardTypes.error;
|
3553
|
+
const textType = this._analyzer.standardTypes.text;
|
3554
|
+
return { targetTypes: [errorType, textType], targetSignaturesParameters: void 0 };
|
3555
|
+
}
|
3501
3556
|
if (role.kind === "function-block-expression") {
|
3502
3557
|
const targetType = semanticContext.getContainingSubprogram()?.getReturnType();
|
3503
3558
|
if (targetType !== void 0 && !targetType.equals(this._analyzer.standardTypes.none)) {
|
@@ -3536,7 +3591,7 @@ var CompletionService = class {
|
|
3536
3591
|
}
|
3537
3592
|
tokenOrKeywordIsPackageImportListChild(tokenOrKeyword) {
|
3538
3593
|
let parent = tokenOrKeyword.parent;
|
3539
|
-
while (parent.kind === 3 /* Keyword */ || parent.kind === 9 /*
|
3594
|
+
while (parent.kind === 3 /* Keyword */ || parent.kind === 9 /* PackageName */ || parent.kind === 8 /* PackageImport */) {
|
3540
3595
|
parent = parent.parent;
|
3541
3596
|
}
|
3542
3597
|
return parent.kind === 7 /* PackageImportList */;
|
@@ -3603,7 +3658,7 @@ var CompletionService = class {
|
|
3603
3658
|
kinds.add(30 /* Creation */).add(12 /* Function */).add(47 /* Destruction */).add(58 /* Get */).add(59 /* Set */);
|
3604
3659
|
}
|
3605
3660
|
if (syntaxContext.isStatementContext) {
|
3606
|
-
kinds.add(7 /* Run */).add(34 /* For */).add(25 /* While */).add(26 /* Loop */).add(15 /* Return */).add(20 /* Error */).add(28 /* Yield */).add(32 /* BreakLoop */).add(33 /* ContinueLoop */).add(13 /* If */).add(44 /* Switch */).add(1 /* Let */).add(35 /* Const */).add(46 /* Dispose */).add(8 /* Try */).add(12 /* Function */).add(40 /* Async */);
|
3661
|
+
kinds.add(7 /* Run */).add(34 /* For */).add(25 /* While */).add(26 /* Loop */).add(15 /* Return */).add(20 /* Error */).add(19 /* Important */).add(28 /* Yield */).add(32 /* BreakLoop */).add(33 /* ContinueLoop */).add(13 /* If */).add(44 /* Switch */).add(1 /* Let */).add(35 /* Const */).add(46 /* Dispose */).add(8 /* Try */).add(12 /* Function */).add(40 /* Async */);
|
3607
3662
|
}
|
3608
3663
|
if (this.isFromKeywordContext(positionDescription)) {
|
3609
3664
|
kinds.add(9 /* From */);
|
@@ -3650,7 +3705,7 @@ var CompletionService = class {
|
|
3650
3705
|
if (syntaxContext.isUnqualifiedTypeContext?.allowsAnonymousTypes === true) {
|
3651
3706
|
kinds.add(5 /* PlainObject */).add(4 /* Object */).add(6 /* Variant */).add(3 /* Aspect */).add(12 /* Function */).add(40 /* Async */);
|
3652
3707
|
}
|
3653
|
-
if (positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isKeyword(40 /* Async */) && (positionDescription.tokenOrKeyword.parent.kind === 58 /*
|
3708
|
+
if (positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isKeyword(40 /* Async */) && (positionDescription.tokenOrKeyword.parent.kind === 58 /* NestedFunctionDeclaration */ || positionDescription.tokenOrKeyword.parent.kind === 74 /* FunctionLiteral */ || positionDescription.tokenOrKeyword.parent.kind === 29 /* FunctionTypeDeclarationBody */)) {
|
3654
3709
|
kinds.add(12 /* Function */);
|
3655
3710
|
}
|
3656
3711
|
return Query.from(kinds.values()).map(
|
@@ -3730,7 +3785,7 @@ var CompletionService = class {
|
|
3730
3785
|
return result;
|
3731
3786
|
}
|
3732
3787
|
prioritizeItemsFromUnionType(items, type) {
|
3733
|
-
const constituentTypeEntities = Query.from(type.unaliasedFlattenedTypes).mapAndFilter((t) =>
|
3788
|
+
const constituentTypeEntities = Query.from(type.unaliasedFlattenedTypes).mapAndFilter((t) => t.getEntity()).uniqueToSet();
|
3734
3789
|
for (const item of items) {
|
3735
3790
|
if (item.kind === "named-type" && constituentTypeEntities.has(item.entity)) {
|
3736
3791
|
item.prefix = "*";
|
@@ -3753,7 +3808,7 @@ var CompletionService = class {
|
|
3753
3808
|
d.requiresExplicitOriginalName
|
3754
3809
|
);
|
3755
3810
|
} else {
|
3756
|
-
return new
|
3811
|
+
return new FieldCompletionItemInfo(
|
3757
3812
|
this.completionItemInfoContext,
|
3758
3813
|
d.value.value.value,
|
3759
3814
|
d.name,
|
@@ -3761,16 +3816,16 @@ var CompletionService = class {
|
|
3761
3816
|
);
|
3762
3817
|
}
|
3763
3818
|
}
|
3764
|
-
case "
|
3819
|
+
case "function": {
|
3765
3820
|
if (d.value.value.kind === "entity") {
|
3766
|
-
return new
|
3821
|
+
return new FunctionEntityCompletionItemInfo(
|
3767
3822
|
this.completionItemInfoContext,
|
3768
3823
|
d.value.value.value,
|
3769
3824
|
d.name,
|
3770
3825
|
d.requiresExplicitOriginalName
|
3771
3826
|
);
|
3772
3827
|
} else {
|
3773
|
-
return new
|
3828
|
+
return new MethodCompletionItemInfo(
|
3774
3829
|
this.completionItemInfoContext,
|
3775
3830
|
d.value.value.value,
|
3776
3831
|
d.name,
|
@@ -3813,25 +3868,6 @@ var CompletionService = class {
|
|
3813
3868
|
}
|
3814
3869
|
return result;
|
3815
3870
|
}
|
3816
|
-
getEntityFromType(type) {
|
3817
|
-
switch (type.kind) {
|
3818
|
-
case "structured":
|
3819
|
-
return type.getEntity();
|
3820
|
-
case "variant":
|
3821
|
-
return type.getEntity();
|
3822
|
-
case "method":
|
3823
|
-
return type.getEntity();
|
3824
|
-
case "alias":
|
3825
|
-
return type.getEntity();
|
3826
|
-
case "parameter":
|
3827
|
-
return type.getEntity();
|
3828
|
-
case "unresolved":
|
3829
|
-
case "union":
|
3830
|
-
return void 0;
|
3831
|
-
default:
|
3832
|
-
Debug.never(type);
|
3833
|
-
}
|
3834
|
-
}
|
3835
3871
|
getTypeCompletionItemInfosFromPackage(searchLocation) {
|
3836
3872
|
return searchLocation.packageMemberLookup.getNamedMembers(searchLocation.hidingMatcher).map((m) => {
|
3837
3873
|
if (m.value.kind === 2 /* Type */) {
|
@@ -3909,8 +3945,8 @@ var CompletionService = class {
|
|
3909
3945
|
m.name,
|
3910
3946
|
m.requiresExplicitOriginalName
|
3911
3947
|
);
|
3912
|
-
} else if (m.value.kind === 1 /*
|
3913
|
-
return new
|
3948
|
+
} else if (m.value.kind === 1 /* Function */) {
|
3949
|
+
return new FunctionEntityCompletionItemInfo(
|
3914
3950
|
this.completionItemInfoContext,
|
3915
3951
|
m.value,
|
3916
3952
|
m.name,
|
@@ -3933,8 +3969,8 @@ var CompletionService = class {
|
|
3933
3969
|
m.name,
|
3934
3970
|
m.requiresExplicitOriginalName
|
3935
3971
|
);
|
3936
|
-
} else if (m.value.kind === 1 /*
|
3937
|
-
return new
|
3972
|
+
} else if (m.value.kind === 1 /* Function */) {
|
3973
|
+
return new FunctionEntityCompletionItemInfo(
|
3938
3974
|
this.completionItemInfoContext,
|
3939
3975
|
m.value,
|
3940
3976
|
m.name,
|
@@ -3957,8 +3993,8 @@ var CompletionService = class {
|
|
3957
3993
|
d.name,
|
3958
3994
|
d.requiresExplicitOriginalName
|
3959
3995
|
);
|
3960
|
-
case "
|
3961
|
-
return new
|
3996
|
+
case "function":
|
3997
|
+
return new FunctionEntityCompletionItemInfo(
|
3962
3998
|
this.completionItemInfoContext,
|
3963
3999
|
d.value.value.getEntity(),
|
3964
4000
|
d.name,
|
@@ -3997,8 +4033,8 @@ var CompletionService = class {
|
|
3997
4033
|
name,
|
3998
4034
|
isNameExplicitlyOriginal
|
3999
4035
|
);
|
4000
|
-
case 1 /*
|
4001
|
-
return new
|
4036
|
+
case 1 /* Function */:
|
4037
|
+
return new FunctionEntityCompletionItemInfo(
|
4002
4038
|
this.completionItemInfoContext,
|
4003
4039
|
member,
|
4004
4040
|
name,
|
@@ -4027,14 +4063,14 @@ var CompletionService = class {
|
|
4027
4063
|
return memberLookup.getNamedMembers(options6, ctx.hidingMatcher, ctx.typeExtensionsLookup).map((m) => {
|
4028
4064
|
switch (m.value.kind) {
|
4029
4065
|
case "method":
|
4030
|
-
return new
|
4066
|
+
return new MethodCompletionItemInfo(
|
4031
4067
|
this.completionItemInfoContext,
|
4032
4068
|
m.value,
|
4033
4069
|
m.name,
|
4034
4070
|
m.requiresExplicitOriginalName
|
4035
4071
|
);
|
4036
4072
|
case "variable":
|
4037
|
-
return new
|
4073
|
+
return new FieldCompletionItemInfo(
|
4038
4074
|
this.completionItemInfoContext,
|
4039
4075
|
m.value,
|
4040
4076
|
m.name,
|
@@ -4077,8 +4113,8 @@ var CompletionService = class {
|
|
4077
4113
|
result = items ?? Query.empty();
|
4078
4114
|
} else if (ctx.translationKind === 2 /* Method */) {
|
4079
4115
|
result = Query.from(ctx.packageMemberLookup.getNamedMembers(ctx.hidingMatcher)).mapAndFilter((d) => {
|
4080
|
-
if (d.value.kind === 1 /*
|
4081
|
-
return new
|
4116
|
+
if (d.value.kind === 1 /* Function */) {
|
4117
|
+
return new AliasesSourceFunctionCompletionItemInfo(
|
4082
4118
|
this.completionItemInfoContext,
|
4083
4119
|
d.value,
|
4084
4120
|
!ctx.hasPrecedingKeyword,
|
@@ -4119,8 +4155,8 @@ var CompletionService = class {
|
|
4119
4155
|
d.value,
|
4120
4156
|
displayService_
|
4121
4157
|
);
|
4122
|
-
case 1 /*
|
4123
|
-
return new
|
4158
|
+
case 1 /* Function */:
|
4159
|
+
return new AliasesSourceFunctionCompletionItemInfo(
|
4124
4160
|
this.completionItemInfoContext,
|
4125
4161
|
d.value,
|
4126
4162
|
!ctx.hasPrecedingKeyword,
|
@@ -4161,8 +4197,8 @@ var CompletionService = class {
|
|
4161
4197
|
const displayService_ = new DisplayService(this._analyzer, ctx.sourceLocale, this._dialect);
|
4162
4198
|
if (ctx.translationKind === 1 /* Method */) {
|
4163
4199
|
result = Query.from(ctx.typeEntity.getMembers().getNamedMembers()).mapAndFilter((m) => {
|
4164
|
-
if (m.kind === 1 /*
|
4165
|
-
return new
|
4200
|
+
if (m.kind === 1 /* Function */) {
|
4201
|
+
return new AliasesSourceFunctionCompletionItemInfo(
|
4166
4202
|
this.completionItemInfoContext,
|
4167
4203
|
m,
|
4168
4204
|
!ctx.hasPrecedingKeyword,
|
@@ -4173,7 +4209,7 @@ var CompletionService = class {
|
|
4173
4209
|
});
|
4174
4210
|
} else if (ctx.translationKind === 3 /* Constructor */) {
|
4175
4211
|
result = Query.from(ctx.typeEntity.getMembers().getConstructors()).map(
|
4176
|
-
(c) => new
|
4212
|
+
(c) => new AliasesSourceConstructorCompletionItemInfo(
|
4177
4213
|
this.completionItemInfoContext,
|
4178
4214
|
c,
|
4179
4215
|
!ctx.hasPrecedingKeyword,
|
@@ -4181,13 +4217,13 @@ var CompletionService = class {
|
|
4181
4217
|
)
|
4182
4218
|
);
|
4183
4219
|
} else if (ctx.translationKind === 2 /* Indexer */) {
|
4184
|
-
result = Query.from(ctx.typeEntity.getMembers().getIndexers()).map((i) => new
|
4220
|
+
result = Query.from(ctx.typeEntity.getMembers().getIndexers()).map((i) => new AliasesSourceIndexerCompletionItemInfo(this.completionItemInfoContext, i, displayService_));
|
4185
4221
|
} else if (ctx.translationKind === 0 /* Any */) {
|
4186
4222
|
result = Query.from(ctx.typeEntity.getMembers().getNamedMembers()).mapAndFilter((m) => {
|
4187
4223
|
if (m.kind === 0 /* Variable */) {
|
4188
4224
|
return new AliasesSourceVariableCompletionItemInfo(this.completionItemInfoContext, m, displayService_);
|
4189
|
-
} else if (m.kind === 1 /*
|
4190
|
-
return new
|
4225
|
+
} else if (m.kind === 1 /* Function */) {
|
4226
|
+
return new AliasesSourceFunctionCompletionItemInfo(
|
4191
4227
|
this.completionItemInfoContext,
|
4192
4228
|
m,
|
4193
4229
|
!ctx.hasPrecedingKeyword,
|
@@ -4197,7 +4233,7 @@ var CompletionService = class {
|
|
4197
4233
|
return void 0;
|
4198
4234
|
}).chain(
|
4199
4235
|
ctx.typeEntity.getMembers().getConstructors().map(
|
4200
|
-
(c) => new
|
4236
|
+
(c) => new AliasesSourceConstructorCompletionItemInfo(
|
4201
4237
|
this.completionItemInfoContext,
|
4202
4238
|
c,
|
4203
4239
|
!ctx.hasPrecedingKeyword,
|
@@ -4206,7 +4242,7 @@ var CompletionService = class {
|
|
4206
4242
|
)
|
4207
4243
|
).chain(
|
4208
4244
|
ctx.typeEntity.getMembers().getIndexers().map(
|
4209
|
-
(i) => new
|
4245
|
+
(i) => new AliasesSourceIndexerCompletionItemInfo(this.completionItemInfoContext, i, displayService_)
|
4210
4246
|
)
|
4211
4247
|
);
|
4212
4248
|
} else {
|
@@ -4237,20 +4273,20 @@ var CompletionService = class {
|
|
4237
4273
|
return new OperatorNameCompletionItemInfo(this.completionItemInfoContext, value, editRange);
|
4238
4274
|
});
|
4239
4275
|
}
|
4240
|
-
|
4276
|
+
mergeOverloadedFunctions(completionItemInfos) {
|
4241
4277
|
const result = new Array();
|
4242
|
-
const
|
4278
|
+
const functionInfoByLabel = /* @__PURE__ */ new Map();
|
4243
4279
|
for (const itemInfo of completionItemInfos) {
|
4244
4280
|
switch (itemInfo.kind) {
|
4245
|
-
case "
|
4246
|
-
case "
|
4281
|
+
case "method":
|
4282
|
+
case "function-entity":
|
4247
4283
|
case "operator": {
|
4248
4284
|
const label = itemInfo.getLabel();
|
4249
|
-
const
|
4250
|
-
if (
|
4251
|
-
|
4285
|
+
const functionInfo = functionInfoByLabel.get(label);
|
4286
|
+
if (functionInfo !== void 0) {
|
4287
|
+
functionInfo.count++;
|
4252
4288
|
} else {
|
4253
|
-
|
4289
|
+
functionInfoByLabel.set(label, { itemInfo, count: 1 });
|
4254
4290
|
}
|
4255
4291
|
break;
|
4256
4292
|
}
|
@@ -4258,17 +4294,17 @@ var CompletionService = class {
|
|
4258
4294
|
result.push(itemInfo);
|
4259
4295
|
}
|
4260
4296
|
}
|
4261
|
-
for (const
|
4262
|
-
if (
|
4297
|
+
for (const functionInfo of functionInfoByLabel.values()) {
|
4298
|
+
if (functionInfo.count > 1) {
|
4263
4299
|
result.push(
|
4264
|
-
new
|
4300
|
+
new MergedOverloadedFunctionCompletionItemInfo(
|
4265
4301
|
this.completionItemInfoContext,
|
4266
|
-
|
4267
|
-
|
4302
|
+
functionInfo.itemInfo,
|
4303
|
+
functionInfo.count
|
4268
4304
|
)
|
4269
4305
|
);
|
4270
4306
|
} else {
|
4271
|
-
result.push(
|
4307
|
+
result.push(functionInfo.itemInfo);
|
4272
4308
|
}
|
4273
4309
|
}
|
4274
4310
|
return result;
|
@@ -4277,7 +4313,7 @@ var CompletionService = class {
|
|
4277
4313
|
const seenLabels = /* @__PURE__ */ new Set();
|
4278
4314
|
const result = new Array();
|
4279
4315
|
for (const completionItemInfo of completionItemInfos) {
|
4280
|
-
if (completionItemInfo.kind === "aliases-source-
|
4316
|
+
if (completionItemInfo.kind === "aliases-source-function" || completionItemInfo.kind === "aliases-source-package-type") {
|
4281
4317
|
result.push(completionItemInfo);
|
4282
4318
|
continue;
|
4283
4319
|
}
|
@@ -4567,7 +4603,7 @@ var PackageAliasEntityCompletionItemInfo = class {
|
|
4567
4603
|
return void 0;
|
4568
4604
|
}
|
4569
4605
|
};
|
4570
|
-
var
|
4606
|
+
var FieldCompletionItemInfo = class {
|
4571
4607
|
constructor(ctx, variable, name, isNameExplicitlyOriginal) {
|
4572
4608
|
this.ctx = ctx;
|
4573
4609
|
this.variable = variable;
|
@@ -4579,7 +4615,7 @@ var TypeVariableCompletionItemInfo = class {
|
|
4579
4615
|
return `${this.isNameExplicitlyOriginal ? "~" : ""}${this.ctx.getInsertTextForName(this.name.value)}`;
|
4580
4616
|
}
|
4581
4617
|
getCompletionItemKind() {
|
4582
|
-
return this.variable.isVariant() ? 12 /* Variant */ : 2 /*
|
4618
|
+
return this.variable.isVariant() ? 12 /* Variant */ : 2 /* Field */;
|
4583
4619
|
}
|
4584
4620
|
getDetails() {
|
4585
4621
|
return this.ctx.displayService.displayVariableDeclaration(
|
@@ -4596,23 +4632,23 @@ var TypeVariableCompletionItemInfo = class {
|
|
4596
4632
|
return void 0;
|
4597
4633
|
}
|
4598
4634
|
};
|
4599
|
-
var
|
4635
|
+
var MethodCompletionItemInfo = class {
|
4600
4636
|
constructor(ctx, method, name, isNameExplicitlyOriginal) {
|
4601
4637
|
this.ctx = ctx;
|
4602
4638
|
this.method = method;
|
4603
4639
|
this.name = name;
|
4604
4640
|
this.isNameExplicitlyOriginal = isNameExplicitlyOriginal;
|
4605
|
-
this.kind = "
|
4641
|
+
this.kind = "method";
|
4606
4642
|
}
|
4607
4643
|
getLabel() {
|
4608
4644
|
return `${this.isNameExplicitlyOriginal ? "~" : ""}${this.ctx.getInsertTextForName(this.name.value)}`;
|
4609
4645
|
}
|
4610
4646
|
getCompletionItemKind() {
|
4611
|
-
return 3 /*
|
4647
|
+
return 3 /* Method */;
|
4612
4648
|
}
|
4613
4649
|
getDetails() {
|
4614
|
-
return this.ctx.displayService.
|
4615
|
-
new
|
4650
|
+
return this.ctx.displayService.displayFunctionDeclaration(
|
4651
|
+
new FunctionDeclaration_typeMember(this.method, this.name.localization)
|
4616
4652
|
);
|
4617
4653
|
}
|
4618
4654
|
getInsertText() {
|
@@ -4668,8 +4704,8 @@ var VariableEntityCompletionItemInfo = class {
|
|
4668
4704
|
switch (this.entity.subkind) {
|
4669
4705
|
case "package":
|
4670
4706
|
return 7 /* PackageVariable */;
|
4671
|
-
case "
|
4672
|
-
return this.entity.isVariant() ? 12 /* Variant */ : 2 /*
|
4707
|
+
case "field":
|
4708
|
+
return this.entity.isVariant() ? 12 /* Variant */ : 2 /* Field */;
|
4673
4709
|
case "parameter":
|
4674
4710
|
return 10 /* ParameterVariable */;
|
4675
4711
|
case "local":
|
@@ -4693,13 +4729,13 @@ var VariableEntityCompletionItemInfo = class {
|
|
4693
4729
|
return void 0;
|
4694
4730
|
}
|
4695
4731
|
};
|
4696
|
-
var
|
4732
|
+
var FunctionEntityCompletionItemInfo = class {
|
4697
4733
|
constructor(ctx, entity, name, isNameExplicitlyOriginal) {
|
4698
4734
|
this.ctx = ctx;
|
4699
4735
|
this.entity = entity;
|
4700
4736
|
this.name = name;
|
4701
4737
|
this.isNameExplicitlyOriginal = isNameExplicitlyOriginal;
|
4702
|
-
this.kind = "
|
4738
|
+
this.kind = "function-entity";
|
4703
4739
|
}
|
4704
4740
|
getLabel() {
|
4705
4741
|
return `${this.isNameExplicitlyOriginal ? "~" : ""}${this.ctx.getInsertTextForName(this.name.value)}`;
|
@@ -4707,18 +4743,18 @@ var MethodEntityCompletionItemInfo = class {
|
|
4707
4743
|
getCompletionItemKind() {
|
4708
4744
|
switch (this.entity.subkind) {
|
4709
4745
|
case "package":
|
4710
|
-
return 8 /*
|
4711
|
-
case "
|
4712
|
-
return 3 /*
|
4746
|
+
return 8 /* PackageFunction */;
|
4747
|
+
case "method":
|
4748
|
+
return 3 /* Method */;
|
4713
4749
|
case "nested":
|
4714
|
-
return 11 /*
|
4750
|
+
return 11 /* NestedFunction */;
|
4715
4751
|
default:
|
4716
4752
|
Debug.never(this.entity);
|
4717
4753
|
}
|
4718
4754
|
}
|
4719
4755
|
getDetails() {
|
4720
|
-
return this.ctx.displayService.
|
4721
|
-
new
|
4756
|
+
return this.ctx.displayService.displayFunctionDeclaration(
|
4757
|
+
new FunctionDeclaration_entity(this.entity, this.name.localization)
|
4722
4758
|
);
|
4723
4759
|
}
|
4724
4760
|
getInsertText() {
|
@@ -4750,8 +4786,8 @@ var NamedTypeCompletionItemInfo = class {
|
|
4750
4786
|
return 16 /* VariantType */;
|
4751
4787
|
case 2 /* Parameter */:
|
4752
4788
|
return 17 /* TypeParameter */;
|
4753
|
-
case 0 /*
|
4754
|
-
return 18 /*
|
4789
|
+
case 0 /* Function */:
|
4790
|
+
return 18 /* FunctionType */;
|
4755
4791
|
case 1 /* Structured */:
|
4756
4792
|
if (this.entity.isRefObject()) {
|
4757
4793
|
return 13 /* RefObjectType */;
|
@@ -4807,12 +4843,12 @@ var KeywordCompletionItemInfo = class {
|
|
4807
4843
|
return void 0;
|
4808
4844
|
}
|
4809
4845
|
};
|
4810
|
-
var
|
4846
|
+
var MergedOverloadedFunctionCompletionItemInfo = class {
|
4811
4847
|
constructor(ctx, firstOverloadInfo, overloadCount) {
|
4812
4848
|
this.ctx = ctx;
|
4813
4849
|
this.firstOverloadInfo = firstOverloadInfo;
|
4814
4850
|
this.overloadCount = overloadCount;
|
4815
|
-
this.kind = "merged-overloaded-
|
4851
|
+
this.kind = "merged-overloaded-function";
|
4816
4852
|
}
|
4817
4853
|
getLabel() {
|
4818
4854
|
return this.firstOverloadInfo.getLabel();
|
@@ -4821,7 +4857,7 @@ var MergedOverloadedMethodCompletionItemInfo = class {
|
|
4821
4857
|
return this.firstOverloadInfo.getCompletionItemKind();
|
4822
4858
|
}
|
4823
4859
|
getDetails() {
|
4824
|
-
const overloadsWord = LocalizationHelper.localizeHelperPhrase(
|
4860
|
+
const overloadsWord = LocalizationHelper.localizeHelperPhrase(7 /* Overloads */, this.ctx.locale);
|
4825
4861
|
const overloadCountText = ` (+${overloadsWord}: ${this.overloadCount - 1})`;
|
4826
4862
|
const originalDetails = this.firstOverloadInfo.getDetails();
|
4827
4863
|
return originalDetails + overloadCountText;
|
@@ -4881,8 +4917,8 @@ var AliasesSourceVariableCompletionItemInfo = class {
|
|
4881
4917
|
switch (this.variable.subkind) {
|
4882
4918
|
case "package":
|
4883
4919
|
return 7 /* PackageVariable */;
|
4884
|
-
case "
|
4885
|
-
return 2 /*
|
4920
|
+
case "field":
|
4921
|
+
return 2 /* Field */;
|
4886
4922
|
case "parameter":
|
4887
4923
|
return 7 /* PackageVariable */;
|
4888
4924
|
case "local":
|
@@ -4906,39 +4942,39 @@ var AliasesSourceVariableCompletionItemInfo = class {
|
|
4906
4942
|
return void 0;
|
4907
4943
|
}
|
4908
4944
|
};
|
4909
|
-
var
|
4910
|
-
constructor(ctx,
|
4945
|
+
var AliasesSourceFunctionCompletionItemInfo = class {
|
4946
|
+
constructor(ctx, func, includeFunctionKeyword, displayService) {
|
4911
4947
|
this.ctx = ctx;
|
4912
|
-
this.
|
4913
|
-
this.
|
4948
|
+
this.func = func;
|
4949
|
+
this.includeFunctionKeyword = includeFunctionKeyword;
|
4914
4950
|
this.displayService = displayService;
|
4915
|
-
this.kind = "aliases-source-
|
4951
|
+
this.kind = "aliases-source-function";
|
4916
4952
|
}
|
4917
4953
|
getLabel() {
|
4918
|
-
return this.ctx.getInsertTextForName(this.
|
4954
|
+
return this.ctx.getInsertTextForName(this.func.getName());
|
4919
4955
|
}
|
4920
4956
|
getCompletionItemKind() {
|
4921
|
-
switch (this.
|
4957
|
+
switch (this.func.subkind) {
|
4922
4958
|
case "package":
|
4923
|
-
return 8 /*
|
4924
|
-
case "
|
4925
|
-
return 3 /*
|
4959
|
+
return 8 /* PackageFunction */;
|
4960
|
+
case "method":
|
4961
|
+
return 3 /* Method */;
|
4926
4962
|
case "nested":
|
4927
|
-
return 11 /*
|
4963
|
+
return 11 /* NestedFunction */;
|
4928
4964
|
default:
|
4929
|
-
Debug.never(this.
|
4965
|
+
Debug.never(this.func);
|
4930
4966
|
}
|
4931
4967
|
}
|
4932
4968
|
getDetails() {
|
4933
|
-
return this.displayService.
|
4934
|
-
new
|
4969
|
+
return this.displayService.displayFunctionDeclaration(
|
4970
|
+
new FunctionDeclaration_entity(this.func, Localization.Original.ofEntity(this.func))
|
4935
4971
|
);
|
4936
4972
|
}
|
4937
4973
|
getInsertText() {
|
4938
|
-
const displayParts = this.displayService.
|
4939
|
-
new
|
4974
|
+
const displayParts = this.displayService.getFunctionDeclarationDisplayParts(
|
4975
|
+
new FunctionDeclaration_entity(this.func, Localization.Original.ofEntity(this.func))
|
4940
4976
|
);
|
4941
|
-
const keywordWithWhitespace = this.
|
4977
|
+
const keywordWithWhitespace = this.includeFunctionKeyword ? displayParts.functionKeyword + displayParts.whitespaceAfterFunctionKeyword : "";
|
4942
4978
|
const valueParameters = displayParts.valueParameters.map((p) => p.name).join(displayParts.typeParameterSeparator);
|
4943
4979
|
return keywordWithWhitespace + displayParts.name + displayParts.typeParametersStart + displayParts.typeParameters.join(displayParts.typeParameterSeparator) + displayParts.typeParametersEnd + displayParts.valueParametersStart + valueParameters + displayParts.valueParametersEnd;
|
4944
4980
|
}
|
@@ -4964,8 +5000,8 @@ var AliasesSourcePackageTypeCompletionItemInfo = class {
|
|
4964
5000
|
switch (this.typeEntity.typeEntityKind) {
|
4965
5001
|
case 3 /* Variant */:
|
4966
5002
|
return 16 /* VariantType */;
|
4967
|
-
case 0 /*
|
4968
|
-
return 18 /*
|
5003
|
+
case 0 /* Function */:
|
5004
|
+
return 18 /* FunctionType */;
|
4969
5005
|
case 1 /* Structured */: {
|
4970
5006
|
if (this.typeEntity.isRefObject()) {
|
4971
5007
|
return 13 /* RefObjectType */;
|
@@ -5000,9 +5036,9 @@ var AliasesSourcePackageTypeCompletionItemInfo = class {
|
|
5000
5036
|
return new TypeDeclaration_variant(
|
5001
5037
|
new TypeDeclarationVariant_entity(this.typeEntity, localization)
|
5002
5038
|
);
|
5003
|
-
case 0 /*
|
5004
|
-
return new
|
5005
|
-
new
|
5039
|
+
case 0 /* Function */:
|
5040
|
+
return new TypeDeclaration_function(
|
5041
|
+
new TypeDeclarationFunction_entity(this.typeEntity, localization)
|
5006
5042
|
);
|
5007
5043
|
case 1 /* Structured */:
|
5008
5044
|
return new TypeDeclaration_structured(
|
@@ -5020,7 +5056,7 @@ var AliasesSourcePackageTypeCompletionItemInfo = class {
|
|
5020
5056
|
return void 0;
|
5021
5057
|
}
|
5022
5058
|
};
|
5023
|
-
var
|
5059
|
+
var AliasesSourceIndexerCompletionItemInfo = class {
|
5024
5060
|
constructor(ctx, indexer, displayService) {
|
5025
5061
|
this.ctx = ctx;
|
5026
5062
|
this.indexer = indexer;
|
@@ -5039,7 +5075,7 @@ var AliasesSourceTypeIndexerCompletionItemInfo = class {
|
|
5039
5075
|
return this.label;
|
5040
5076
|
}
|
5041
5077
|
getCompletionItemKind() {
|
5042
|
-
return 5 /*
|
5078
|
+
return 5 /* Indexer */;
|
5043
5079
|
}
|
5044
5080
|
getDetails() {
|
5045
5081
|
return this.label;
|
@@ -5055,7 +5091,7 @@ var AliasesSourceTypeIndexerCompletionItemInfo = class {
|
|
5055
5091
|
return void 0;
|
5056
5092
|
}
|
5057
5093
|
};
|
5058
|
-
var
|
5094
|
+
var AliasesSourceConstructorCompletionItemInfo = class {
|
5059
5095
|
constructor(ctx, constructor_, includeOnCreateKeyword, displayService) {
|
5060
5096
|
this.ctx = ctx;
|
5061
5097
|
this.constructor_ = constructor_;
|
@@ -5079,7 +5115,7 @@ var AliasesSourceTypeConstructorCompletionItemInfo = class {
|
|
5079
5115
|
return this.label;
|
5080
5116
|
}
|
5081
5117
|
getCompletionItemKind() {
|
5082
|
-
return 6 /*
|
5118
|
+
return 6 /* Constructor */;
|
5083
5119
|
}
|
5084
5120
|
getDetails() {
|
5085
5121
|
return this.label;
|
@@ -5163,6 +5199,12 @@ var ExpressionRole_returnedValue = class {
|
|
5163
5199
|
this.kind = "returned-value";
|
5164
5200
|
}
|
5165
5201
|
};
|
5202
|
+
var ExpressionRole_errorValue = class {
|
5203
|
+
constructor(errorStatement) {
|
5204
|
+
this.errorStatement = errorStatement;
|
5205
|
+
this.kind = "error-value";
|
5206
|
+
}
|
5207
|
+
};
|
5166
5208
|
var ExpressionRole_functionBlockExpression = class {
|
5167
5209
|
constructor(functionBlock) {
|
5168
5210
|
this.functionBlock = functionBlock;
|
@@ -5243,7 +5285,7 @@ var SyntaxContextFactory = class {
|
|
5243
5285
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.initializer);
|
5244
5286
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5245
5287
|
}
|
5246
|
-
if (tokenOrKeyword.parent.kind === 54 /*
|
5288
|
+
if (tokenOrKeyword.parent.kind === 54 /* FieldDeclaration */) {
|
5247
5289
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.initializer);
|
5248
5290
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5249
5291
|
}
|
@@ -5373,6 +5415,14 @@ var SyntaxContextFactory = class {
|
|
5373
5415
|
const expressionRole = new ExpressionRole_returnedValue(tokenOrKeyword.parent);
|
5374
5416
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5375
5417
|
}
|
5418
|
+
if (tokenOrKeyword.isKeyword(20 /* Error */) && tokenOrKeyword.parent.kind === 104 /* ErrorStatement */) {
|
5419
|
+
const expressionRole = new ExpressionRole_errorValue(tokenOrKeyword.parent);
|
5420
|
+
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5421
|
+
}
|
5422
|
+
if (tokenOrKeyword.isKeyword(19 /* Important */) && tokenOrKeyword.parent.kind === 105 /* ImportantStatement */) {
|
5423
|
+
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5424
|
+
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5425
|
+
}
|
5376
5426
|
if (tokenOrKeyword.isKeyword(44 /* Switch */) && tokenOrKeyword.parent.kind === 119 /* SwitchStatement */) {
|
5377
5427
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5378
5428
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
@@ -5427,13 +5477,13 @@ var SyntaxContextFactory = class {
|
|
5427
5477
|
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 */)) {
|
5428
5478
|
return true;
|
5429
5479
|
}
|
5430
|
-
if (tokenOrKeyword.isToken(20 /* CloseBrace */) && (tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */ || tokenOrKeyword.parent.kind === 24 /* PackageMemberGroupDeclaration */ || tokenOrKeyword.parent.kind === 6 /* PackageGroupImportDirective */ || tokenOrKeyword.parent.kind === 94 /* FunctionBlock */ && (tokenOrKeyword.parent.parent.kind === 25 /* PackageConstructorDeclaration */ || tokenOrKeyword.parent.parent.kind === 26 /* PackageEntryPointDeclaration */ || tokenOrKeyword.parent.parent.kind === 27 /*
|
5480
|
+
if (tokenOrKeyword.isToken(20 /* CloseBrace */) && (tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */ || tokenOrKeyword.parent.kind === 24 /* PackageMemberGroupDeclaration */ || tokenOrKeyword.parent.kind === 6 /* PackageGroupImportDirective */ || tokenOrKeyword.parent.kind === 94 /* FunctionBlock */ && (tokenOrKeyword.parent.parent.kind === 25 /* PackageConstructorDeclaration */ || tokenOrKeyword.parent.parent.kind === 26 /* PackageEntryPointDeclaration */ || tokenOrKeyword.parent.parent.kind === 27 /* PackageFunctionDeclaration */))) {
|
5431
5481
|
return true;
|
5432
5482
|
}
|
5433
5483
|
if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 24 /* PackageMemberGroupDeclaration */) {
|
5434
5484
|
return true;
|
5435
5485
|
}
|
5436
|
-
if (SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 5 /* SinglePackageImportDirective */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 27 /*
|
5486
|
+
if (SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 5 /* SinglePackageImportDirective */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 27 /* PackageFunctionDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 28 /* PackageFunctionTypeDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 22 /* PackageAliasTypeDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 35 /* PackageVariableDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
|
5437
5487
|
tokenOrKeyword,
|
5438
5488
|
36 /* PackageVariableGetterDeclaration */
|
5439
5489
|
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 37 /* PackageVariableSetterDeclaration */)) {
|
@@ -5457,13 +5507,19 @@ var SyntaxContextFactory = class {
|
|
5457
5507
|
if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 44 /* TypeMemberGroupDeclaration */) {
|
5458
5508
|
return true;
|
5459
5509
|
}
|
5460
|
-
if (SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 54 /*
|
5510
|
+
if (SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 54 /* FieldDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 55 /* FieldGetterDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 56 /* FieldSetterDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
|
5461
5511
|
tokenOrKeyword,
|
5462
|
-
|
5512
|
+
47 /* IndexedElementGetterDeclaration */
|
5463
5513
|
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
|
5464
5514
|
tokenOrKeyword,
|
5465
|
-
|
5466
|
-
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
|
5515
|
+
48 /* IndexedElementSetterDeclaration */
|
5516
|
+
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
|
5517
|
+
tokenOrKeyword,
|
5518
|
+
50 /* DereferencedVariableGetterDeclaration */
|
5519
|
+
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
|
5520
|
+
tokenOrKeyword,
|
5521
|
+
51 /* DereferencedVariableSetterDeclaration */
|
5522
|
+
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 52 /* MethodDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 53 /* OperatorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 45 /* ConstructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 46 /* DestructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 142 /* VariantDeclaration */)) {
|
5467
5523
|
return true;
|
5468
5524
|
}
|
5469
5525
|
if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind === 149 /* Modifier */ && tokenOrKeyword.value === tokenOrKeyword.parent.value && tokenOrKeyword.parent.openParenthesisToken === void 0 && NodeTypeUtils.isTypeMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
|
@@ -5536,7 +5592,10 @@ var SyntaxContextFactory = class {
|
|
5536
5592
|
if (tokenOrKeyword.isKeyword(42 /* As */) && tokenOrKeyword.parent.kind === 65 /* AsExpression */) {
|
5537
5593
|
return { allowsAnonymousTypes: true };
|
5538
5594
|
}
|
5539
|
-
if (tokenOrKeyword.isToken(17 /* Bar */) && tokenOrKeyword.parent.kind ===
|
5595
|
+
if (tokenOrKeyword.isToken(17 /* Bar */) && tokenOrKeyword.parent.kind === 11 /* UnionTypeSpecifier */) {
|
5596
|
+
return { allowsAnonymousTypes: false };
|
5597
|
+
}
|
5598
|
+
if (tokenOrKeyword.isToken(10 /* Ampersand */) && tokenOrKeyword.parent.kind === 12 /* IntersectionTypeSpecifier */) {
|
5540
5599
|
return { allowsAnonymousTypes: false };
|
5541
5600
|
}
|
5542
5601
|
if (tokenOrKeyword.isToken(44 /* OpenParenthesis */) && tokenOrKeyword.parent.kind === 13 /* ParenthesizedTypeSpecifier */) {
|
@@ -5562,12 +5621,12 @@ var SyntaxContextFactory = class {
|
|
5562
5621
|
if (type !== void 0) {
|
5563
5622
|
return { translationsDeclaration: type.parent.parent };
|
5564
5623
|
}
|
5565
|
-
const
|
5624
|
+
const functionType = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5566
5625
|
tokenOrKeyword,
|
5567
|
-
133 /*
|
5626
|
+
133 /* FunctionTypeTranslation */
|
5568
5627
|
);
|
5569
|
-
if (
|
5570
|
-
return { translationsDeclaration:
|
5628
|
+
if (functionType !== void 0) {
|
5629
|
+
return { translationsDeclaration: functionType.parent.parent };
|
5571
5630
|
}
|
5572
5631
|
const variable = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5573
5632
|
tokenOrKeyword,
|
@@ -5576,12 +5635,12 @@ var SyntaxContextFactory = class {
|
|
5576
5635
|
if (variable !== void 0) {
|
5577
5636
|
return { translationsDeclaration: variable.parent.parent };
|
5578
5637
|
}
|
5579
|
-
const
|
5638
|
+
const func = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5580
5639
|
tokenOrKeyword,
|
5581
|
-
131 /*
|
5640
|
+
131 /* PackageFunctionTranslation */
|
5582
5641
|
);
|
5583
|
-
if (
|
5584
|
-
return { translationsDeclaration:
|
5642
|
+
if (func !== void 0) {
|
5643
|
+
return { translationsDeclaration: func.parent.parent };
|
5585
5644
|
}
|
5586
5645
|
return void 0;
|
5587
5646
|
}
|
@@ -5605,14 +5664,14 @@ var SyntaxContextFactory = class {
|
|
5605
5664
|
}
|
5606
5665
|
const variableOrVariant = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5607
5666
|
tokenOrKeyword,
|
5608
|
-
137 /*
|
5667
|
+
137 /* FieldOrVariantTranslation */
|
5609
5668
|
);
|
5610
5669
|
if (variableOrVariant !== void 0) {
|
5611
5670
|
return { typeTranslation: variableOrVariant.parent.parent };
|
5612
5671
|
}
|
5613
5672
|
const method = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5614
5673
|
tokenOrKeyword,
|
5615
|
-
132 /*
|
5674
|
+
132 /* MethodTranslation */
|
5616
5675
|
);
|
5617
5676
|
if (method !== void 0) {
|
5618
5677
|
return { typeTranslation: method.parent.parent };
|
@@ -5731,22 +5790,22 @@ var NodeSemanticInfoService = class {
|
|
5731
5790
|
return this.ofPrefixUnaryExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
|
5732
5791
|
} else if (tokenOrKeyword.parent.kind === 66 /* BinaryExpression */) {
|
5733
5792
|
return this.ofBinaryExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
|
5734
|
-
} else if (tokenOrKeyword.isToken(19 /* Caret */) && (tokenOrKeyword.parent.kind === 50 /*
|
5793
|
+
} else if (tokenOrKeyword.isToken(19 /* Caret */) && (tokenOrKeyword.parent.kind === 50 /* DereferencedVariableGetterDeclaration */ || tokenOrKeyword.parent.kind === 51 /* DereferencedVariableSetterDeclaration */)) {
|
5735
5794
|
return this.ofDereferenceOperatorDeclaration(analyzer, tokenOrKeyword.parent);
|
5736
5795
|
} else if (tokenOrKeyword.isToken(19 /* Caret */) && tokenOrKeyword.parent.kind === 80 /* DereferenceExpression */) {
|
5737
5796
|
return this.ofDereferenceExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
|
5738
5797
|
} else if (tokenOrKeyword.parent.kind === 91 /* AssignmentStatement */) {
|
5739
5798
|
return this.ofAssignmentStatementOperator(analyzer, tokenOrKeyword.parent, options6);
|
5740
|
-
} else if (tokenOrKeyword.isKeyword(30 /* Creation */) && tokenOrKeyword.parent.kind === 45 /*
|
5741
|
-
return this.
|
5799
|
+
} else if (tokenOrKeyword.isKeyword(30 /* Creation */) && tokenOrKeyword.parent.kind === 45 /* ConstructorDeclaration */) {
|
5800
|
+
return this.ofConstructorDeclaration(analyzer, tokenOrKeyword.parent);
|
5742
5801
|
} else if (tokenOrKeyword.isToken(13 /* Asterisk */) && tokenOrKeyword.parent.kind === 90 /* DefaultMatchExpression */) {
|
5743
5802
|
return this.ofDefaultMatchExpression(analyzer, tokenOrKeyword.parent);
|
5744
5803
|
} else if (tokenOrKeyword.isKeyword(4 /* Object */) && tokenOrKeyword.parent.kind === 86 /* ObjectExpression */) {
|
5745
5804
|
return this.ofObjectExpression(analyzer, tokenOrKeyword.parent, options6);
|
5746
5805
|
} else if (tokenOrKeyword.isKeyword(56 /* Base */) && tokenOrKeyword.parent.kind === 87 /* BaseExpression */) {
|
5747
5806
|
return this.ofBaseExpression(analyzer, tokenOrKeyword.parent, options6);
|
5748
|
-
} else if ((tokenOrKeyword.isToken(45 /* OpenSquareBracket */) || tokenOrKeyword.isToken(22 /* CloseSquareBracket */)) && tokenOrKeyword.parent.kind === 49 /*
|
5749
|
-
return this.
|
5807
|
+
} else if ((tokenOrKeyword.isToken(45 /* OpenSquareBracket */) || tokenOrKeyword.isToken(22 /* CloseSquareBracket */)) && tokenOrKeyword.parent.kind === 49 /* IndexParameterClause */) {
|
5808
|
+
return this.ofIndexedElementAccessorDeclaration(analyzer, tokenOrKeyword.parent.parent);
|
5750
5809
|
} else if ((tokenOrKeyword.isToken(45 /* OpenSquareBracket */) || tokenOrKeyword.isToken(22 /* CloseSquareBracket */)) && tokenOrKeyword.parent.kind === 71 /* IndexedAccessExpression */) {
|
5751
5810
|
return this.ofIndexedAccessExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
|
5752
5811
|
}
|
@@ -5787,11 +5846,11 @@ var NodeSemanticInfoService = class {
|
|
5787
5846
|
case 22 /* PackageAliasTypeDeclaration */:
|
5788
5847
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageAliasTypeDeclaration(parent));
|
5789
5848
|
break;
|
5790
|
-
case 27 /*
|
5791
|
-
result = new DefinitionNodeSemanticInfo(analyzer.entity.
|
5849
|
+
case 27 /* PackageFunctionDeclaration */:
|
5850
|
+
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageFunctionDeclaration(parent));
|
5792
5851
|
break;
|
5793
|
-
case 28 /*
|
5794
|
-
result = new DefinitionNodeSemanticInfo(analyzer.entity.
|
5852
|
+
case 28 /* PackageFunctionTypeDeclaration */:
|
5853
|
+
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageFunctionTypeDeclaration(parent));
|
5795
5854
|
break;
|
5796
5855
|
case 33 /* PackageStructuredTypeDeclaration */:
|
5797
5856
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageStructuredTypeDeclaration(parent));
|
@@ -5805,8 +5864,8 @@ var NodeSemanticInfoService = class {
|
|
5805
5864
|
case 88 /* IdentifierExpression */:
|
5806
5865
|
result = this.ofIdentifierExpression(analyzer, parent, options6);
|
5807
5866
|
break;
|
5808
|
-
case 58 /*
|
5809
|
-
result = new DefinitionNodeSemanticInfo(analyzer.entity.
|
5867
|
+
case 58 /* NestedFunctionDeclaration */:
|
5868
|
+
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofNestedFunctionDeclaration(parent));
|
5810
5869
|
break;
|
5811
5870
|
case 59 /* LocalVariableDeclaration */:
|
5812
5871
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofLocalVariableDeclaration(parent));
|
@@ -5834,9 +5893,9 @@ var NodeSemanticInfoService = class {
|
|
5834
5893
|
}
|
5835
5894
|
break;
|
5836
5895
|
}
|
5837
|
-
case 137 /*
|
5896
|
+
case 137 /* FieldOrVariantTranslation */: {
|
5838
5897
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5839
|
-
const getTargetsResult = translationPackage?.
|
5898
|
+
const getTargetsResult = translationPackage?.getFieldOrVariantTranslationTargets(parent);
|
5840
5899
|
if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
|
5841
5900
|
if (node === parent.sourceName) {
|
5842
5901
|
const targets = getTargetsResult.targets.map((t) => new SimpleWithLocalization(
|
@@ -5858,9 +5917,9 @@ var NodeSemanticInfoService = class {
|
|
5858
5917
|
}
|
5859
5918
|
break;
|
5860
5919
|
}
|
5861
|
-
case 131 /*
|
5920
|
+
case 131 /* PackageFunctionTranslation */: {
|
5862
5921
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5863
|
-
const getTargetsResult = translationPackage?.
|
5922
|
+
const getTargetsResult = translationPackage?.getPackageFunctionTranslationTargets(parent);
|
5864
5923
|
if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
|
5865
5924
|
if (node === parent.sourceName) {
|
5866
5925
|
const targets = getTargetsResult.targets.map((t) => new SimpleWithLocalization(
|
@@ -5882,9 +5941,9 @@ var NodeSemanticInfoService = class {
|
|
5882
5941
|
}
|
5883
5942
|
break;
|
5884
5943
|
}
|
5885
|
-
case 132 /*
|
5944
|
+
case 132 /* MethodTranslation */: {
|
5886
5945
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5887
|
-
const getTargetsResult = translationPackage?.
|
5946
|
+
const getTargetsResult = translationPackage?.getMethodTranslationTargets(parent);
|
5888
5947
|
if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
|
5889
5948
|
if (node === parent.sourceName) {
|
5890
5949
|
const targets = getTargetsResult.targets.map((t) => new SimpleWithLocalization(
|
@@ -5926,9 +5985,9 @@ var NodeSemanticInfoService = class {
|
|
5926
5985
|
}
|
5927
5986
|
break;
|
5928
5987
|
}
|
5929
|
-
case 133 /*
|
5988
|
+
case 133 /* FunctionTypeTranslation */: {
|
5930
5989
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5931
|
-
const getTargetResult = translationPackage?.
|
5990
|
+
const getTargetResult = translationPackage?.getFunctionTypeTranslationTarget(parent);
|
5932
5991
|
if (translationPackage !== void 0 && getTargetResult?.target !== void 0) {
|
5933
5992
|
if (node === parent.sourceName) {
|
5934
5993
|
const target = new SimpleWithLocalization(
|
@@ -5952,20 +6011,20 @@ var NodeSemanticInfoService = class {
|
|
5952
6011
|
case 8 /* PackageImport */:
|
5953
6012
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageImport(parent));
|
5954
6013
|
break;
|
5955
|
-
case 9 /*
|
6014
|
+
case 9 /* PackageName */:
|
5956
6015
|
result = void 0;
|
5957
6016
|
break;
|
5958
|
-
case 78 /*
|
6017
|
+
case 78 /* MemberAccessExpression */:
|
5959
6018
|
result = this.ofProperty(analyzer, parent, options6);
|
5960
6019
|
break;
|
5961
|
-
case 52 /*
|
5962
|
-
result = new DefinitionNodeSemanticInfo(analyzer.entity.
|
6020
|
+
case 52 /* MethodDeclaration */:
|
6021
|
+
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofMethodDeclaration(parent));
|
5963
6022
|
break;
|
5964
6023
|
case 53 /* OperatorDeclaration */:
|
5965
6024
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofOperatorDeclaration(parent));
|
5966
6025
|
break;
|
5967
|
-
case 54 /*
|
5968
|
-
result = new DefinitionNodeSemanticInfo(analyzer.entity.
|
6026
|
+
case 54 /* FieldDeclaration */:
|
6027
|
+
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofFieldDeclaration(parent));
|
5969
6028
|
break;
|
5970
6029
|
case 143 /* TypeParameterDeclaration */:
|
5971
6030
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofTypeParameterDeclaration(parent));
|
@@ -5977,9 +6036,9 @@ var NodeSemanticInfoService = class {
|
|
5977
6036
|
case 37 /* PackageVariableSetterDeclaration */:
|
5978
6037
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofComputedPackageVariableDeclaration(parent));
|
5979
6038
|
break;
|
5980
|
-
case 55 /*
|
5981
|
-
case 56 /*
|
5982
|
-
result = new DefinitionNodeSemanticInfo(analyzer.entity.
|
6039
|
+
case 55 /* FieldGetterDeclaration */:
|
6040
|
+
case 56 /* FieldSetterDeclaration */:
|
6041
|
+
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofComputedFieldDeclaration(parent));
|
5983
6042
|
break;
|
5984
6043
|
case 3 /* Keyword */:
|
5985
6044
|
break;
|
@@ -5991,14 +6050,14 @@ var NodeSemanticInfoService = class {
|
|
5991
6050
|
}
|
5992
6051
|
static ofProperty(analyzer, node, options6) {
|
5993
6052
|
let result;
|
5994
|
-
const meaning = analyzer.
|
6053
|
+
const meaning = analyzer.resolveMemberAccessExpression(node).meaning;
|
5995
6054
|
switch (meaning.kind) {
|
5996
6055
|
case "instance-variable-access": {
|
5997
6056
|
let narrowedType;
|
5998
6057
|
if (isNarrowableReferenceExpression(node)) {
|
5999
6058
|
narrowedType = analyzer.type.ofExpression(node);
|
6000
6059
|
}
|
6001
|
-
const target = new SimpleWithLocalization(new
|
6060
|
+
const target = new SimpleWithLocalization(new FieldReferenceTarget(
|
6002
6061
|
meaning.variable.value,
|
6003
6062
|
meaning.accessKind,
|
6004
6063
|
narrowedType
|
@@ -6011,7 +6070,7 @@ var NodeSemanticInfoService = class {
|
|
6011
6070
|
if (isNarrowableReferenceExpression(node)) {
|
6012
6071
|
narrowedType = analyzer.type.ofExpression(node);
|
6013
6072
|
}
|
6014
|
-
const target = new SimpleWithLocalization(new
|
6073
|
+
const target = new SimpleWithLocalization(new FieldReferenceTarget(
|
6015
6074
|
meaning.variable.value,
|
6016
6075
|
meaning.accessKind,
|
6017
6076
|
narrowedType
|
@@ -6033,17 +6092,17 @@ var NodeSemanticInfoService = class {
|
|
6033
6092
|
break;
|
6034
6093
|
}
|
6035
6094
|
case "instance-method-access":
|
6036
|
-
if (isNonEmptyArray(meaning.
|
6037
|
-
result =
|
6095
|
+
if (isNonEmptyArray(meaning.suitableFunctions)) {
|
6096
|
+
result = createAccessedFunctionsReference(meaning.suitableFunctions, meaning.suitableFunctions.length > 1);
|
6038
6097
|
} else if (isNonEmptyArray(meaning.candidates)) {
|
6039
|
-
result =
|
6098
|
+
result = createAccessedFunctionsReference(meaning.candidates, true);
|
6040
6099
|
}
|
6041
6100
|
break;
|
6042
6101
|
case "static-method-access":
|
6043
|
-
if (isNonEmptyArray(meaning.
|
6044
|
-
result =
|
6102
|
+
if (isNonEmptyArray(meaning.suitableFunctions)) {
|
6103
|
+
result = createAccessedFunctionsReference(meaning.suitableFunctions, meaning.suitableFunctions.length > 1);
|
6045
6104
|
} else if (isNonEmptyArray(meaning.candidates)) {
|
6046
|
-
result =
|
6105
|
+
result = createAccessedFunctionsReference(meaning.candidates, true);
|
6047
6106
|
}
|
6048
6107
|
break;
|
6049
6108
|
case "operator-access": {
|
@@ -6054,11 +6113,11 @@ var NodeSemanticInfoService = class {
|
|
6054
6113
|
}
|
6055
6114
|
break;
|
6056
6115
|
}
|
6057
|
-
case "package-
|
6058
|
-
if (isNonEmptyArray(meaning.
|
6059
|
-
result =
|
6116
|
+
case "package-function-access":
|
6117
|
+
if (isNonEmptyArray(meaning.suitableFunctions)) {
|
6118
|
+
result = createAccessedFunctionsReference(meaning.suitableFunctions, meaning.suitableFunctions.length > 1);
|
6060
6119
|
} else if (isNonEmptyArray(meaning.candidates)) {
|
6061
|
-
result =
|
6120
|
+
result = createAccessedFunctionsReference(meaning.candidates, true);
|
6062
6121
|
}
|
6063
6122
|
break;
|
6064
6123
|
case "package-type-access":
|
@@ -6074,6 +6133,16 @@ var NodeSemanticInfoService = class {
|
|
6074
6133
|
case "package-name-segment-access":
|
6075
6134
|
result = this.ofPackageNameSegmentAccess(analyzer, meaning.packageTreeNode, node);
|
6076
6135
|
break;
|
6136
|
+
case "mixed-ambiguous-access": {
|
6137
|
+
const targets = Query.from(meaning.entities).mapAndFilter((d) => {
|
6138
|
+
const target = new EntityReferenceTarget(d.value, 0 /* Get */);
|
6139
|
+
return new SimpleWithLocalization(target, d.localization);
|
6140
|
+
}).toArray();
|
6141
|
+
if (isNonEmptyArray(targets)) {
|
6142
|
+
result = new ReferenceNodeSemanticInfo(targets, true);
|
6143
|
+
}
|
6144
|
+
break;
|
6145
|
+
}
|
6077
6146
|
case "unresolved":
|
6078
6147
|
break;
|
6079
6148
|
default:
|
@@ -6083,8 +6152,8 @@ var NodeSemanticInfoService = class {
|
|
6083
6152
|
result = this.getBetterReferenceTargetsOrPreserve(result);
|
6084
6153
|
}
|
6085
6154
|
return result;
|
6086
|
-
function
|
6087
|
-
const targets =
|
6155
|
+
function createAccessedFunctionsReference(functions, isAmbiguous) {
|
6156
|
+
const targets = functions.map((o) => new SimpleWithLocalization(new AccessedFunctionReferenceTarget(o.value), o.localization));
|
6088
6157
|
return new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), isAmbiguous);
|
6089
6158
|
}
|
6090
6159
|
function createOperatorsReference(operators, isAmbiguous) {
|
@@ -6143,6 +6212,20 @@ var NodeSemanticInfoService = class {
|
|
6143
6212
|
} else {
|
6144
6213
|
Debug.never(resolvedQualifier);
|
6145
6214
|
}
|
6215
|
+
} else if (qualifierIndex === resolutionResult.resolvedQualifiers.length && resolutionResult.ambiguousDeclarations !== void 0) {
|
6216
|
+
const targets = resolutionResult.ambiguousDeclarations.map((d) => {
|
6217
|
+
switch (d.value.kind) {
|
6218
|
+
case "entity":
|
6219
|
+
return new SimpleWithLocalization(new EntityReferenceTarget(d.value.entity, 0 /* Get */), d.localization);
|
6220
|
+
case "node":
|
6221
|
+
return new SimpleWithLocalization(new PackageNameTreeNodeReferenceTarget(d.value.node), d.localization);
|
6222
|
+
default:
|
6223
|
+
Debug.never(d.value);
|
6224
|
+
}
|
6225
|
+
});
|
6226
|
+
if (isNonEmptyArray(targets)) {
|
6227
|
+
result = new ReferenceNodeSemanticInfo(targets, true);
|
6228
|
+
}
|
6146
6229
|
}
|
6147
6230
|
if (result !== void 0 && options6.includeBetterReferenceTargets) {
|
6148
6231
|
result = this.getBetterReferenceTargetsOrPreserve(result);
|
@@ -6157,7 +6240,7 @@ var NodeSemanticInfoService = class {
|
|
6157
6240
|
const resolvedQualifier = resolutionResult.resolvedQualifiers[qualifierIndex];
|
6158
6241
|
switch (resolvedQualifier.kind) {
|
6159
6242
|
case "type": {
|
6160
|
-
if (options6.preferredTargetOfExplicitConstructorCall === "type-declaration") {
|
6243
|
+
if (options6.preferredTargetOfExplicitConstructorCall === "type-declaration" || resolutionResult.meaning.kind !== "tag-type") {
|
6161
6244
|
if (resolvedQualifier.suitableTypes.length > 0) {
|
6162
6245
|
const targets = resolvedQualifier.suitableTypes.map((t) => new SimpleWithLocalization(new EntityReferenceTarget(t.value, 0 /* Get */), t.localization));
|
6163
6246
|
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), targets.length > 1);
|
@@ -6166,21 +6249,19 @@ var NodeSemanticInfoService = class {
|
|
6166
6249
|
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
|
6167
6250
|
}
|
6168
6251
|
} else {
|
6169
|
-
if (resolutionResult.meaning.
|
6170
|
-
|
6171
|
-
|
6172
|
-
|
6173
|
-
|
6174
|
-
|
6175
|
-
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
|
6176
|
-
}
|
6252
|
+
if (resolutionResult.meaning.suitableConstructors.length > 0) {
|
6253
|
+
const targets = resolutionResult.meaning.suitableConstructors.map((t) => new SimpleWithLocalization(new ConstructorReferenceTarget(t.value), t.localization));
|
6254
|
+
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), targets.length > 1);
|
6255
|
+
} else if (resolutionResult.meaning.candidates.length > 0) {
|
6256
|
+
const targets = resolutionResult.meaning.candidates.map((t) => new SimpleWithLocalization(new ConstructorReferenceTarget(t.value), t.localization));
|
6257
|
+
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
|
6177
6258
|
}
|
6178
6259
|
}
|
6179
6260
|
break;
|
6180
6261
|
}
|
6181
|
-
case "
|
6182
|
-
if (resolvedQualifier.
|
6183
|
-
const targets = resolvedQualifier.
|
6262
|
+
case "function":
|
6263
|
+
if (resolvedQualifier.suitableFunctions.length > 0) {
|
6264
|
+
const targets = resolvedQualifier.suitableFunctions.map((t) => new SimpleWithLocalization(new EntityReferenceTarget(t.value, 0 /* Get */), t.localization));
|
6184
6265
|
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), targets.length > 1);
|
6185
6266
|
} else if (resolvedQualifier.candidates.length > 0) {
|
6186
6267
|
const targets = resolvedQualifier.candidates.map((t) => new SimpleWithLocalization(new EntityReferenceTarget(t.value, 0 /* Get */), t.localization));
|
@@ -6215,6 +6296,20 @@ var NodeSemanticInfoService = class {
|
|
6215
6296
|
default:
|
6216
6297
|
Debug.never(resolvedQualifier);
|
6217
6298
|
}
|
6299
|
+
} else if (qualifierIndex === resolutionResult.resolvedQualifiers.length && resolutionResult.ambiguousDeclarations !== void 0) {
|
6300
|
+
const targets = resolutionResult.ambiguousDeclarations.map((d) => {
|
6301
|
+
switch (d.value.kind) {
|
6302
|
+
case "entity":
|
6303
|
+
return new SimpleWithLocalization(new EntityReferenceTarget(d.value.entity, 0 /* Get */), d.localization);
|
6304
|
+
case "node":
|
6305
|
+
return new SimpleWithLocalization(new PackageNameTreeNodeReferenceTarget(d.value.node), d.localization);
|
6306
|
+
default:
|
6307
|
+
Debug.never(d.value);
|
6308
|
+
}
|
6309
|
+
});
|
6310
|
+
if (isNonEmptyArray(targets)) {
|
6311
|
+
result = new ReferenceNodeSemanticInfo(targets, true);
|
6312
|
+
}
|
6218
6313
|
}
|
6219
6314
|
if (result !== void 0 && options6.includeBetterReferenceTargets) {
|
6220
6315
|
result = this.getBetterReferenceTargetsOrPreserve(result);
|
@@ -6233,11 +6328,11 @@ var NodeSemanticInfoService = class {
|
|
6233
6328
|
result = this.ofMaybeConstructorCallExpression(analyzer, meaning.suitableTypes, node, options6);
|
6234
6329
|
}
|
6235
6330
|
break;
|
6236
|
-
case "
|
6237
|
-
if (isNonEmptyArray(meaning.
|
6238
|
-
result =
|
6331
|
+
case "function-access":
|
6332
|
+
if (isNonEmptyArray(meaning.suitableFunctions)) {
|
6333
|
+
result = createAccessedFunctionsReference(meaning.suitableFunctions, meaning.suitableFunctions.length > 1);
|
6239
6334
|
} else if (isNonEmptyArray(meaning.candidates)) {
|
6240
|
-
result =
|
6335
|
+
result = createAccessedFunctionsReference(meaning.candidates, true);
|
6241
6336
|
}
|
6242
6337
|
break;
|
6243
6338
|
case "operator-access": {
|
@@ -6262,7 +6357,7 @@ var NodeSemanticInfoService = class {
|
|
6262
6357
|
result = new ReferenceNodeSemanticInfo([target], false);
|
6263
6358
|
} else if (variable.value.kind === "type-member") {
|
6264
6359
|
const target = new SimpleWithLocalization(
|
6265
|
-
new
|
6360
|
+
new FieldReferenceTarget(variable.value.value, meaning.accessKind, narrowedType),
|
6266
6361
|
variable.localization
|
6267
6362
|
);
|
6268
6363
|
result = new ReferenceNodeSemanticInfo([target], false);
|
@@ -6284,10 +6379,10 @@ var NodeSemanticInfoService = class {
|
|
6284
6379
|
break;
|
6285
6380
|
}
|
6286
6381
|
case "mixed-ambiguous-access": {
|
6287
|
-
const targets =
|
6382
|
+
const targets = meaning.declarations.map((d) => {
|
6288
6383
|
let target;
|
6289
6384
|
switch (d.value.kind) {
|
6290
|
-
case "
|
6385
|
+
case "function":
|
6291
6386
|
target = new EntityReferenceTarget(d.value.value.getEntity(), 0 /* Get */);
|
6292
6387
|
break;
|
6293
6388
|
case "variable":
|
@@ -6300,15 +6395,13 @@ var NodeSemanticInfoService = class {
|
|
6300
6395
|
target = new EntityReferenceTarget(d.value.value, 0 /* Get */);
|
6301
6396
|
break;
|
6302
6397
|
case "package-name-segment":
|
6303
|
-
|
6304
|
-
target = new PackageReferenceTarget(d.value.value.package.value);
|
6305
|
-
}
|
6398
|
+
target = new PackageNameTreeNodeReferenceTarget(d.value.value);
|
6306
6399
|
break;
|
6307
6400
|
default:
|
6308
6401
|
Debug.never(d.value);
|
6309
6402
|
}
|
6310
|
-
return
|
6311
|
-
})
|
6403
|
+
return new SimpleWithLocalization(target, d.localization);
|
6404
|
+
});
|
6312
6405
|
if (isNonEmptyArray(targets)) {
|
6313
6406
|
result = new ReferenceNodeSemanticInfo(targets, true);
|
6314
6407
|
}
|
@@ -6323,8 +6416,8 @@ var NodeSemanticInfoService = class {
|
|
6323
6416
|
result = this.getBetterReferenceTargetsOrPreserve(result);
|
6324
6417
|
}
|
6325
6418
|
return result;
|
6326
|
-
function
|
6327
|
-
const targets =
|
6419
|
+
function createAccessedFunctionsReference(functions, isAmbiguous) {
|
6420
|
+
const targets = functions.map((o) => new SimpleWithLocalization(new AccessedFunctionReferenceTarget(o.value), o.localization));
|
6328
6421
|
return new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), isAmbiguous);
|
6329
6422
|
}
|
6330
6423
|
function createOperatorsReference(operators, isAmbiguous) {
|
@@ -6332,12 +6425,12 @@ var NodeSemanticInfoService = class {
|
|
6332
6425
|
return new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), isAmbiguous);
|
6333
6426
|
}
|
6334
6427
|
}
|
6335
|
-
static
|
6336
|
-
const entity = analyzer.entity.
|
6428
|
+
static ofConstructorDeclaration(analyzer, node) {
|
6429
|
+
const entity = analyzer.entity.ofConstructorDeclaration(node);
|
6337
6430
|
return new DefinitionNodeSemanticInfo(entity);
|
6338
6431
|
}
|
6339
|
-
static
|
6340
|
-
const entity = analyzer.entity.
|
6432
|
+
static ofIndexedElementAccessorDeclaration(analyzer, node) {
|
6433
|
+
const entity = analyzer.entity.ofIndexerDeclaration(node);
|
6341
6434
|
return new DefinitionNodeSemanticInfo(entity);
|
6342
6435
|
}
|
6343
6436
|
static ofIndexedAccessExpressionOperator(analyzer, node, options6) {
|
@@ -6360,7 +6453,7 @@ var NodeSemanticInfoService = class {
|
|
6360
6453
|
}
|
6361
6454
|
return void 0;
|
6362
6455
|
function createIndexersReference(indexers, accessKind, isAmbiguous) {
|
6363
|
-
const targets = indexers.map((i) => new SimpleWithLocalization(new
|
6456
|
+
const targets = indexers.map((i) => new SimpleWithLocalization(new IndexerReferenceTarget(i.value, accessKind), i.localization));
|
6364
6457
|
return new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), isAmbiguous);
|
6365
6458
|
}
|
6366
6459
|
}
|
@@ -6416,14 +6509,14 @@ var NodeSemanticInfoService = class {
|
|
6416
6509
|
return void 0;
|
6417
6510
|
}
|
6418
6511
|
static ofDereferenceOperatorDeclaration(analyzer, node) {
|
6419
|
-
const entity = analyzer.entity.
|
6512
|
+
const entity = analyzer.entity.ofDereferenceOperatorDeclaration(node);
|
6420
6513
|
return new DefinitionNodeSemanticInfo(entity);
|
6421
6514
|
}
|
6422
6515
|
static ofDereferenceExpressionOperator(analyzer, node, options6) {
|
6423
6516
|
const meaning = analyzer.getDereferenceExpressionMeaning(node);
|
6424
6517
|
if (meaning.kind === "resolved") {
|
6425
6518
|
const target = new SimpleWithLocalization(
|
6426
|
-
new
|
6519
|
+
new DereferenceOperatorReferenceTarget(meaning.operator.value, meaning.accessKind),
|
6427
6520
|
meaning.operator.localization
|
6428
6521
|
);
|
6429
6522
|
let result = new ReferenceNodeSemanticInfo([target], false);
|
@@ -6439,10 +6532,10 @@ var NodeSemanticInfoService = class {
|
|
6439
6532
|
let result;
|
6440
6533
|
if (meaning.kind === "constructor-call") {
|
6441
6534
|
if (meaning.suitableConstructors.length > 0) {
|
6442
|
-
const targets = meaning.suitableConstructors.map((c) => new SimpleWithLocalization(new
|
6535
|
+
const targets = meaning.suitableConstructors.map((c) => new SimpleWithLocalization(new ConstructorReferenceTarget(c.value), c.localization));
|
6443
6536
|
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), meaning.suitableConstructors.length > 1);
|
6444
6537
|
} else if (meaning.candidates.length > 0) {
|
6445
|
-
const targets = meaning.candidates.map((c) => new SimpleWithLocalization(new
|
6538
|
+
const targets = meaning.candidates.map((c) => new SimpleWithLocalization(new ConstructorReferenceTarget(c.value), c.localization));
|
6446
6539
|
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
|
6447
6540
|
}
|
6448
6541
|
}
|
@@ -6457,10 +6550,10 @@ var NodeSemanticInfoService = class {
|
|
6457
6550
|
switch (meaning.kind) {
|
6458
6551
|
case "own-constructor-access": {
|
6459
6552
|
if (meaning.suitableConstructors.length > 0) {
|
6460
|
-
const targets = meaning.suitableConstructors.map((c) => new SimpleWithLocalization(new
|
6553
|
+
const targets = meaning.suitableConstructors.map((c) => new SimpleWithLocalization(new ConstructorReferenceTarget(c.value), c.localization));
|
6461
6554
|
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), meaning.suitableConstructors.length > 1);
|
6462
6555
|
} else if (meaning.candidates.length > 0) {
|
6463
|
-
const targets = meaning.candidates.map((c) => new SimpleWithLocalization(new
|
6556
|
+
const targets = meaning.candidates.map((c) => new SimpleWithLocalization(new ConstructorReferenceTarget(c.value), c.localization));
|
6464
6557
|
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
|
6465
6558
|
}
|
6466
6559
|
break;
|
@@ -6491,10 +6584,10 @@ var NodeSemanticInfoService = class {
|
|
6491
6584
|
switch (meaning.kind) {
|
6492
6585
|
case "base-constructor-access": {
|
6493
6586
|
if (meaning.suitableConstructors.length > 0) {
|
6494
|
-
const targets = meaning.suitableConstructors.map((c) => new SimpleWithLocalization(new
|
6587
|
+
const targets = meaning.suitableConstructors.map((c) => new SimpleWithLocalization(new ConstructorReferenceTarget(c.value), c.localization));
|
6495
6588
|
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), meaning.suitableConstructors.length > 1);
|
6496
6589
|
} else if (meaning.candidates.length > 0) {
|
6497
|
-
const targets = meaning.candidates.map((c) => new SimpleWithLocalization(new
|
6590
|
+
const targets = meaning.candidates.map((c) => new SimpleWithLocalization(new ConstructorReferenceTarget(c.value), c.localization));
|
6498
6591
|
result = new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
|
6499
6592
|
}
|
6500
6593
|
break;
|
@@ -6511,7 +6604,7 @@ var NodeSemanticInfoService = class {
|
|
6511
6604
|
case "overridden-method-access": {
|
6512
6605
|
const locale = TreeQuery.fromNode(node).packageEntity(analyzer).getLocale();
|
6513
6606
|
const target = new SimpleWithLocalization(
|
6514
|
-
new
|
6607
|
+
new AccessedFunctionReferenceTarget(new AccessedFunction_typeMember(meaning.method)),
|
6515
6608
|
new Localization.Original(locale)
|
6516
6609
|
);
|
6517
6610
|
result = new ReferenceNodeSemanticInfo([target], false);
|
@@ -6538,8 +6631,8 @@ var NodeSemanticInfoService = class {
|
|
6538
6631
|
}
|
6539
6632
|
static ofPackageNameSegmentAccess(analyzer, packageTreeNode, node) {
|
6540
6633
|
let parent = getParentSkippingParenthesizedExpressions(node);
|
6541
|
-
while (parent.kind === 78 /*
|
6542
|
-
const meaning = analyzer.
|
6634
|
+
while (parent.kind === 78 /* MemberAccessExpression */) {
|
6635
|
+
const meaning = analyzer.resolveMemberAccessExpression(parent).meaning;
|
6543
6636
|
if (meaning.kind === "package-name-segment-access") {
|
6544
6637
|
packageTreeNode = meaning.packageTreeNode;
|
6545
6638
|
parent = getParentSkippingParenthesizedExpressions(parent);
|
@@ -6589,10 +6682,10 @@ var NodeSemanticInfoService = class {
|
|
6589
6682
|
const meaning = analyzer.getCallExpressionMeaning(parentCallExpression);
|
6590
6683
|
if (meaning.kind === "constructor-call") {
|
6591
6684
|
if (meaning.suitableConstructors.length > 0) {
|
6592
|
-
const targets = meaning.suitableConstructors.map((c) => new SimpleWithLocalization(new
|
6685
|
+
const targets = meaning.suitableConstructors.map((c) => new SimpleWithLocalization(new ConstructorReferenceTarget(c.value), c.localization));
|
6593
6686
|
return new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), meaning.suitableConstructors.length > 1);
|
6594
6687
|
} else if (meaning.candidates.length > 0) {
|
6595
|
-
const targets = meaning.candidates.map((c) => new SimpleWithLocalization(new
|
6688
|
+
const targets = meaning.candidates.map((c) => new SimpleWithLocalization(new ConstructorReferenceTarget(c.value), c.localization));
|
6596
6689
|
return new ReferenceNodeSemanticInfo(createNonEmptyArray(targets), true);
|
6597
6690
|
}
|
6598
6691
|
}
|
@@ -6621,7 +6714,7 @@ var NodeSemanticInfoService = class {
|
|
6621
6714
|
{
|
6622
6715
|
if (currentTarget.value.entity.subkind === "parameter") {
|
6623
6716
|
const specialVariableInfo = currentTarget.value.entity.isSpecial();
|
6624
|
-
if (specialVariableInfo?.kind === "implicit-
|
6717
|
+
if (specialVariableInfo?.kind === "implicit-function-block-parameter") {
|
6625
6718
|
betterTarget = new SimpleWithLocalization(
|
6626
6719
|
new TypeValueParameterReferenceTarget(
|
6627
6720
|
specialVariableInfo.targetTypeParameter,
|
@@ -6643,7 +6736,7 @@ var NodeSemanticInfoService = class {
|
|
6643
6736
|
);
|
6644
6737
|
}
|
6645
6738
|
}
|
6646
|
-
} else if (currentTarget.value.kind === "entity" && currentTarget.value.entity.kind === 1 /*
|
6739
|
+
} else if (currentTarget.value.kind === "entity" && currentTarget.value.entity.kind === 1 /* Function */) {
|
6647
6740
|
}
|
6648
6741
|
if (betterTarget !== void 0) {
|
6649
6742
|
result = betterTarget;
|
@@ -6688,7 +6781,7 @@ var EntityReferenceTarget = class {
|
|
6688
6781
|
this.kind = "entity";
|
6689
6782
|
}
|
6690
6783
|
};
|
6691
|
-
var
|
6784
|
+
var FieldReferenceTarget = class {
|
6692
6785
|
constructor(variable, accessKind, narrowedType) {
|
6693
6786
|
this.variable = variable;
|
6694
6787
|
this.accessKind = accessKind;
|
@@ -6703,23 +6796,23 @@ var TypeValueParameterReferenceTarget = class {
|
|
6703
6796
|
this.kind = "type-value-parameter";
|
6704
6797
|
}
|
6705
6798
|
};
|
6706
|
-
var
|
6799
|
+
var ConstructorReferenceTarget = class {
|
6707
6800
|
constructor(constructor_) {
|
6708
6801
|
this.constructor_ = constructor_;
|
6709
6802
|
this.kind = "type-constructor";
|
6710
6803
|
}
|
6711
6804
|
};
|
6712
|
-
var
|
6805
|
+
var DereferenceOperatorReferenceTarget = class {
|
6713
6806
|
constructor(operator, accessKind) {
|
6714
6807
|
this.operator = operator;
|
6715
6808
|
this.accessKind = accessKind;
|
6716
6809
|
this.kind = "type-dereference-operator";
|
6717
6810
|
}
|
6718
6811
|
};
|
6719
|
-
var
|
6720
|
-
constructor(
|
6721
|
-
this.
|
6722
|
-
this.kind = "accessed-
|
6812
|
+
var AccessedFunctionReferenceTarget = class {
|
6813
|
+
constructor(func) {
|
6814
|
+
this.func = func;
|
6815
|
+
this.kind = "accessed-function";
|
6723
6816
|
}
|
6724
6817
|
};
|
6725
6818
|
var OperatorReferenceTarget = class {
|
@@ -6741,6 +6834,12 @@ var PackageReferenceTarget = class {
|
|
6741
6834
|
this.kind = "package";
|
6742
6835
|
}
|
6743
6836
|
};
|
6837
|
+
var PackageNameTreeNodeReferenceTarget = class {
|
6838
|
+
constructor(node) {
|
6839
|
+
this.node = node;
|
6840
|
+
this.kind = "package-name-tree-node";
|
6841
|
+
}
|
6842
|
+
};
|
6744
6843
|
var TypeContextReferenceTarget = class {
|
6745
6844
|
constructor(type, typeContextKind) {
|
6746
6845
|
this.type = type;
|
@@ -6748,7 +6847,7 @@ var TypeContextReferenceTarget = class {
|
|
6748
6847
|
this.kind = "type-context";
|
6749
6848
|
}
|
6750
6849
|
};
|
6751
|
-
var
|
6850
|
+
var IndexerReferenceTarget = class {
|
6752
6851
|
constructor(indexer, accessKind) {
|
6753
6852
|
this.indexer = indexer;
|
6754
6853
|
this.accessKind = accessKind;
|
@@ -6826,28 +6925,28 @@ function getEntitySourceLocations(analyzer, entity) {
|
|
6826
6925
|
const node = definition.node;
|
6827
6926
|
let range;
|
6828
6927
|
switch (node.kind) {
|
6829
|
-
case 17 /*
|
6928
|
+
case 17 /* AnonymousFunctionTypeDeclaration */:
|
6830
6929
|
case 18 /* AnonymousStructuredTypeDeclaration */:
|
6831
6930
|
case 19 /* AnonymousVariantTypeDeclaration */:
|
6832
|
-
case 67 /*
|
6833
|
-
case 74 /*
|
6931
|
+
case 67 /* FunctionBlockLiteral */:
|
6932
|
+
case 74 /* FunctionLiteral */:
|
6834
6933
|
range = node.rangeWithoutTrivia;
|
6835
6934
|
break;
|
6836
6935
|
case 22 /* PackageAliasTypeDeclaration */:
|
6837
|
-
case 27 /*
|
6838
|
-
case 28 /*
|
6936
|
+
case 27 /* PackageFunctionDeclaration */:
|
6937
|
+
case 28 /* PackageFunctionTypeDeclaration */:
|
6839
6938
|
case 33 /* PackageStructuredTypeDeclaration */:
|
6840
6939
|
case 38 /* PackageVariantTypeDeclaration */:
|
6841
|
-
case 58 /*
|
6842
|
-
case 52 /*
|
6940
|
+
case 58 /* NestedFunctionDeclaration */:
|
6941
|
+
case 52 /* MethodDeclaration */:
|
6843
6942
|
case 143 /* TypeParameterDeclaration */:
|
6844
6943
|
case 53 /* OperatorDeclaration */:
|
6845
6944
|
range = node.name.rangeWithoutTrivia;
|
6846
6945
|
break;
|
6847
|
-
case 45 /*
|
6946
|
+
case 45 /* ConstructorDeclaration */:
|
6848
6947
|
range = node.creationKeyword.rangeWithoutTrivia;
|
6849
6948
|
break;
|
6850
|
-
case 46 /*
|
6949
|
+
case 46 /* DestructorDeclaration */:
|
6851
6950
|
range = node.destructionKeyword.rangeWithoutTrivia;
|
6852
6951
|
break;
|
6853
6952
|
case 8 /* PackageImport */:
|
@@ -6863,22 +6962,22 @@ function getEntitySourceLocations(analyzer, entity) {
|
|
6863
6962
|
case 37 /* PackageVariableSetterDeclaration */:
|
6864
6963
|
range = node.setKeyword.rangeWithoutTrivia;
|
6865
6964
|
break;
|
6866
|
-
case 55 /*
|
6965
|
+
case 55 /* FieldGetterDeclaration */:
|
6867
6966
|
range = node.getKeyword.rangeWithoutTrivia;
|
6868
6967
|
break;
|
6869
|
-
case 56 /*
|
6968
|
+
case 56 /* FieldSetterDeclaration */:
|
6870
6969
|
range = node.setKeyword.rangeWithoutTrivia;
|
6871
6970
|
break;
|
6872
|
-
case 47 /*
|
6971
|
+
case 47 /* IndexedElementGetterDeclaration */:
|
6873
6972
|
range = node.parameterClause.rangeWithoutTrivia;
|
6874
6973
|
break;
|
6875
|
-
case 48 /*
|
6974
|
+
case 48 /* IndexedElementSetterDeclaration */:
|
6876
6975
|
range = node.parameterClause.rangeWithoutTrivia;
|
6877
6976
|
break;
|
6878
|
-
case 50 /*
|
6977
|
+
case 50 /* DereferencedVariableGetterDeclaration */:
|
6879
6978
|
range = node.caretToken.rangeWithoutTrivia;
|
6880
6979
|
break;
|
6881
|
-
case 51 /*
|
6980
|
+
case 51 /* DereferencedVariableSetterDeclaration */:
|
6882
6981
|
range = node.caretToken.rangeWithoutTrivia;
|
6883
6982
|
break;
|
6884
6983
|
default:
|
@@ -6990,8 +7089,8 @@ var DefinitionService = class {
|
|
6990
7089
|
return getEntitySourceLocations(analyzer, target.variable.getEntity());
|
6991
7090
|
case "type-constructor":
|
6992
7091
|
return getEntitySourceLocations(analyzer, target.constructor_.getEntity());
|
6993
|
-
case "accessed-
|
6994
|
-
return getEntitySourceLocations(analyzer, target.
|
7092
|
+
case "accessed-function":
|
7093
|
+
return getEntitySourceLocations(analyzer, target.func.getEntity());
|
6995
7094
|
case "operator":
|
6996
7095
|
return getEntitySourceLocations(analyzer, target.operator.getEntity());
|
6997
7096
|
case "type-dereference-operator":
|
@@ -7000,9 +7099,13 @@ var DefinitionService = class {
|
|
7000
7099
|
return getEntitySourceLocations(analyzer, target.parameter.entity);
|
7001
7100
|
case "type-value-parameter":
|
7002
7101
|
return getEntitySourceLocations(analyzer, target.parameter.getEntity());
|
7003
|
-
case "package":
|
7102
|
+
case "package":
|
7004
7103
|
return [new SourceLocation(sourceFile, tokenOrKeyword.value.rangeWithoutTrivia)];
|
7005
|
-
|
7104
|
+
case "package-name-tree-node":
|
7105
|
+
if (target.node.package !== void 0) {
|
7106
|
+
return [new SourceLocation(sourceFile, tokenOrKeyword.value.rangeWithoutTrivia)];
|
7107
|
+
}
|
7108
|
+
return void 0;
|
7006
7109
|
case "type-context": {
|
7007
7110
|
const entity = target.type.getEntity();
|
7008
7111
|
if (entity !== void 0) {
|
@@ -7030,12 +7133,14 @@ var DefinitionService = class {
|
|
7030
7133
|
return target.operator.getEntity();
|
7031
7134
|
case "type-dereference-operator":
|
7032
7135
|
return target.operator.getEntity();
|
7033
|
-
case "accessed-
|
7034
|
-
return target.
|
7136
|
+
case "accessed-function":
|
7137
|
+
return target.func.getEntity();
|
7035
7138
|
case "match-result-value-parameter":
|
7036
7139
|
return target.parameter.entity;
|
7037
7140
|
case "package":
|
7038
7141
|
return target.package_;
|
7142
|
+
case "package-name-tree-node":
|
7143
|
+
return target.node.package?.value;
|
7039
7144
|
case "type-context":
|
7040
7145
|
return target.type.getEntity();
|
7041
7146
|
case "type-indexer":
|
@@ -7161,7 +7266,7 @@ var ReferencesService = class {
|
|
7161
7266
|
result.push(new Reference(sourceFile2, node.operator.rangeWithoutTrivia, referenceKind));
|
7162
7267
|
}
|
7163
7268
|
}
|
7164
|
-
if ((node.kind === 50 /*
|
7269
|
+
if ((node.kind === 50 /* DereferencedVariableGetterDeclaration */ || node.kind === 51 /* DereferencedVariableSetterDeclaration */) && restrictions.canBeDereferenceOperator) {
|
7165
7270
|
const semanticInfo = NodeSemanticInfoService.ofDereferenceOperatorDeclaration(analyzer, node);
|
7166
7271
|
const referenceKind = this.ifReferenceToDefinitionThenKind(
|
7167
7272
|
definition,
|
@@ -7205,8 +7310,8 @@ var ReferencesService = class {
|
|
7205
7310
|
result.push(new Reference(sourceFile2, node.operator.rangeWithoutTrivia, referenceKind));
|
7206
7311
|
}
|
7207
7312
|
}
|
7208
|
-
if (node.kind === 45 /*
|
7209
|
-
const semanticInfo = NodeSemanticInfoService.
|
7313
|
+
if (node.kind === 45 /* ConstructorDeclaration */ && restrictions.canBeConstructorDeclaration) {
|
7314
|
+
const semanticInfo = NodeSemanticInfoService.ofConstructorDeclaration(analyzer, node);
|
7210
7315
|
const referenceKind = this.ifReferenceToDefinitionThenKind(
|
7211
7316
|
definition,
|
7212
7317
|
semanticInfo,
|
@@ -7241,8 +7346,8 @@ var ReferencesService = class {
|
|
7241
7346
|
result.push(new Reference(sourceFile2, node.keyword.rangeWithoutTrivia, referenceKind));
|
7242
7347
|
}
|
7243
7348
|
}
|
7244
|
-
if ((node.kind === 47 /*
|
7245
|
-
const semanticInfo = NodeSemanticInfoService.
|
7349
|
+
if ((node.kind === 47 /* IndexedElementGetterDeclaration */ || node.kind === 48 /* IndexedElementSetterDeclaration */) && restrictions.canBeIndexer) {
|
7350
|
+
const semanticInfo = NodeSemanticInfoService.ofIndexedElementAccessorDeclaration(analyzer, node);
|
7246
7351
|
const referenceKind = this.ifReferenceToDefinitionThenKind(
|
7247
7352
|
definition,
|
7248
7353
|
semanticInfo,
|
@@ -7380,8 +7485,8 @@ var ReferencesService = class {
|
|
7380
7485
|
target.localization,
|
7381
7486
|
accessKindToReferenceKind(target.value.accessKind)
|
7382
7487
|
);
|
7383
|
-
case "accessed-
|
7384
|
-
return new DefinitionInfo(target.value.
|
7488
|
+
case "accessed-function":
|
7489
|
+
return new DefinitionInfo(target.value.func.getEntity(), target.localization, 0 /* Read */);
|
7385
7490
|
case "match-result-value-parameter":
|
7386
7491
|
return new DefinitionInfo(target.value.parameter.entity, target.localization, 0 /* Read */);
|
7387
7492
|
case "package":
|
@@ -7399,6 +7504,11 @@ var ReferencesService = class {
|
|
7399
7504
|
target.localization,
|
7400
7505
|
accessKindToReferenceKind(target.value.accessKind)
|
7401
7506
|
);
|
7507
|
+
case "package-name-tree-node":
|
7508
|
+
if (target.value.node.package !== void 0) {
|
7509
|
+
return new DefinitionInfo(target.value.node.package.value, target.localization, 0 /* Read */);
|
7510
|
+
}
|
7511
|
+
return void 0;
|
7402
7512
|
default:
|
7403
7513
|
Debug.never(target.value);
|
7404
7514
|
}
|
@@ -7438,7 +7548,7 @@ var ReferencesService = class {
|
|
7438
7548
|
result.canBeObjectExpression = true;
|
7439
7549
|
result.canBeBaseExpression = true;
|
7440
7550
|
}
|
7441
|
-
if (definition.value.kind === 1 /*
|
7551
|
+
if (definition.value.kind === 1 /* Function */) {
|
7442
7552
|
result.canBeBaseExpression = true;
|
7443
7553
|
}
|
7444
7554
|
if (definition.value.kind === 5 /* Indexer */) {
|
@@ -7477,7 +7587,7 @@ var ReferencesService = class {
|
|
7477
7587
|
return { name: entity.getName() };
|
7478
7588
|
case 2 /* Type */: {
|
7479
7589
|
switch (entity.typeEntityKind) {
|
7480
|
-
case 0 /*
|
7590
|
+
case 0 /* Function */: {
|
7481
7591
|
const naming = entity.getNaming();
|
7482
7592
|
if (naming.kind === "named") {
|
7483
7593
|
return { name: naming.value };
|
@@ -7506,7 +7616,7 @@ var ReferencesService = class {
|
|
7506
7616
|
Debug.never(entity);
|
7507
7617
|
}
|
7508
7618
|
}
|
7509
|
-
case 1 /*
|
7619
|
+
case 1 /* Function */:
|
7510
7620
|
return { name: entity.getName() };
|
7511
7621
|
case 10 /* PackageAlias */:
|
7512
7622
|
return { name: entity.getName() };
|
@@ -7632,7 +7742,7 @@ var EvaluatableExpressionService = class {
|
|
7632
7742
|
switch (parent.kind) {
|
7633
7743
|
case 88 /* IdentifierExpression */:
|
7634
7744
|
return parent;
|
7635
|
-
case 78 /*
|
7745
|
+
case 78 /* MemberAccessExpression */:
|
7636
7746
|
if (this.isEvaluatableReceiver(parent.expression)) {
|
7637
7747
|
return parent;
|
7638
7748
|
}
|
@@ -7655,7 +7765,7 @@ var EvaluatableExpressionService = class {
|
|
7655
7765
|
switch (expression.kind) {
|
7656
7766
|
case 88 /* IdentifierExpression */:
|
7657
7767
|
return true;
|
7658
|
-
case 78 /*
|
7768
|
+
case 78 /* MemberAccessExpression */:
|
7659
7769
|
return this.isEvaluatableReceiver(expression.expression);
|
7660
7770
|
default:
|
7661
7771
|
return false;
|
@@ -7667,9 +7777,9 @@ var EvaluatableExpressionService = class {
|
|
7667
7777
|
return { nameIdentifier: node.name };
|
7668
7778
|
case 22 /* PackageAliasTypeDeclaration */:
|
7669
7779
|
return { nameIdentifier: node.name };
|
7670
|
-
case 27 /*
|
7780
|
+
case 27 /* PackageFunctionDeclaration */:
|
7671
7781
|
return { nameIdentifier: node.name };
|
7672
|
-
case 28 /*
|
7782
|
+
case 28 /* PackageFunctionTypeDeclaration */:
|
7673
7783
|
return { nameIdentifier: node.name };
|
7674
7784
|
case 33 /* PackageStructuredTypeDeclaration */:
|
7675
7785
|
return { nameIdentifier: node.name };
|
@@ -7677,15 +7787,15 @@ var EvaluatableExpressionService = class {
|
|
7677
7787
|
return { nameIdentifier: node.name };
|
7678
7788
|
case 38 /* PackageVariantTypeDeclaration */:
|
7679
7789
|
return { nameIdentifier: node.name };
|
7680
|
-
case 58 /*
|
7790
|
+
case 58 /* NestedFunctionDeclaration */:
|
7681
7791
|
return { nameIdentifier: node.name };
|
7682
7792
|
case 59 /* LocalVariableDeclaration */:
|
7683
7793
|
return { nameIdentifier: node.name };
|
7684
7794
|
case 144 /* ParameterDeclaration */:
|
7685
7795
|
return { nameIdentifier: node.name };
|
7686
|
-
case 52 /*
|
7796
|
+
case 52 /* MethodDeclaration */:
|
7687
7797
|
return { nameIdentifier: node.name };
|
7688
|
-
case 54 /*
|
7798
|
+
case 54 /* FieldDeclaration */:
|
7689
7799
|
return { nameIdentifier: node.name };
|
7690
7800
|
case 143 /* TypeParameterDeclaration */:
|
7691
7801
|
return { nameIdentifier: node.name };
|
@@ -7845,8 +7955,8 @@ var HoverService = class {
|
|
7845
7955
|
const operator = new DereferenceOperatorDeclaration_typeMember(firstTarget.value.operator);
|
7846
7956
|
return new Hover(this._displayService.displayDereferenceOperatorDeclaration(operator), range);
|
7847
7957
|
}
|
7848
|
-
case "accessed-
|
7849
|
-
return this.
|
7958
|
+
case "accessed-function":
|
7959
|
+
return this.createHoverAtAccessedFunction(firstTarget.value.func, firstTarget.localization, range);
|
7850
7960
|
case "match-result-value-parameter": {
|
7851
7961
|
const declaration = new ValueParameterDeclaration_matchResultValueParameter(
|
7852
7962
|
firstTarget.value.parameter,
|
@@ -7863,6 +7973,8 @@ var HoverService = class {
|
|
7863
7973
|
}
|
7864
7974
|
case "package":
|
7865
7975
|
return new Hover(this._displayService.displayPackage(firstTarget.value.package_), range);
|
7976
|
+
case "package-name-tree-node":
|
7977
|
+
return new Hover(this._displayService.displayPackageNameTreeNode(firstTarget.value.node), range);
|
7866
7978
|
case "type-context": {
|
7867
7979
|
if (firstTarget.value.typeContextKind === "object") {
|
7868
7980
|
const keywordText = this._displayService.displayKeyword(4 /* Object */);
|
@@ -7887,22 +7999,22 @@ var HoverService = class {
|
|
7887
7999
|
Debug.never(firstTarget.value);
|
7888
8000
|
}
|
7889
8001
|
}
|
7890
|
-
|
7891
|
-
switch (
|
8002
|
+
createHoverAtAccessedFunction(func, localization, range) {
|
8003
|
+
switch (func.kind) {
|
7892
8004
|
case "entity": {
|
7893
|
-
const declaration = new
|
7894
|
-
return new Hover(this._displayService.
|
8005
|
+
const declaration = new FunctionDeclaration_entity(func.value, localization);
|
8006
|
+
return new Hover(this._displayService.displayFunctionDeclaration(declaration), range);
|
7895
8007
|
}
|
7896
8008
|
case "type-member": {
|
7897
|
-
const declaration = new
|
7898
|
-
return new Hover(this._displayService.
|
8009
|
+
const declaration = new FunctionDeclaration_typeMember(func.value, localization);
|
8010
|
+
return new Hover(this._displayService.displayFunctionDeclaration(declaration), range);
|
7899
8011
|
}
|
7900
|
-
case "substituted-
|
7901
|
-
const declaration = new
|
7902
|
-
return new Hover(this._displayService.
|
8012
|
+
case "substituted-function": {
|
8013
|
+
const declaration = new FunctionDeclaration_substitutedFunction(func.value, localization);
|
8014
|
+
return new Hover(this._displayService.displayFunctionDeclaration(declaration), range);
|
7903
8015
|
}
|
7904
8016
|
default:
|
7905
|
-
Debug.never(
|
8017
|
+
Debug.never(func);
|
7906
8018
|
}
|
7907
8019
|
}
|
7908
8020
|
};
|
@@ -7984,10 +8096,10 @@ var SourceFileItemsService = class {
|
|
7984
8096
|
);
|
7985
8097
|
break;
|
7986
8098
|
}
|
7987
|
-
case 27 /*
|
8099
|
+
case 27 /* PackageFunctionDeclaration */: {
|
7988
8100
|
result.push(
|
7989
8101
|
this.createItem(
|
7990
|
-
4 /*
|
8102
|
+
4 /* PackageFunction */,
|
7991
8103
|
node2.name.value,
|
7992
8104
|
node2.rangeWithoutTrivia,
|
7993
8105
|
node2.name.rangeWithoutTrivia,
|
@@ -8008,10 +8120,10 @@ var SourceFileItemsService = class {
|
|
8008
8120
|
);
|
8009
8121
|
break;
|
8010
8122
|
}
|
8011
|
-
case 54 /*
|
8123
|
+
case 54 /* FieldDeclaration */: {
|
8012
8124
|
result.push(
|
8013
8125
|
this.createItem(
|
8014
|
-
12 /*
|
8126
|
+
12 /* Field */,
|
8015
8127
|
node2.name.value,
|
8016
8128
|
node2.rangeWithoutTrivia,
|
8017
8129
|
node2.name.rangeWithoutTrivia,
|
@@ -8020,10 +8132,10 @@ var SourceFileItemsService = class {
|
|
8020
8132
|
);
|
8021
8133
|
break;
|
8022
8134
|
}
|
8023
|
-
case 55 /*
|
8135
|
+
case 55 /* FieldGetterDeclaration */: {
|
8024
8136
|
result.push(
|
8025
8137
|
this.createItem(
|
8026
|
-
13 /*
|
8138
|
+
13 /* FieldGetter */,
|
8027
8139
|
node2.name.value,
|
8028
8140
|
node2.rangeWithoutTrivia,
|
8029
8141
|
node2.name.rangeWithoutTrivia,
|
@@ -8032,10 +8144,10 @@ var SourceFileItemsService = class {
|
|
8032
8144
|
);
|
8033
8145
|
break;
|
8034
8146
|
}
|
8035
|
-
case 56 /*
|
8147
|
+
case 56 /* FieldSetterDeclaration */: {
|
8036
8148
|
result.push(
|
8037
8149
|
this.createItem(
|
8038
|
-
14 /*
|
8150
|
+
14 /* FieldSetter */,
|
8039
8151
|
node2.name.value,
|
8040
8152
|
node2.rangeWithoutTrivia,
|
8041
8153
|
node2.name.rangeWithoutTrivia,
|
@@ -8044,10 +8156,10 @@ var SourceFileItemsService = class {
|
|
8044
8156
|
);
|
8045
8157
|
break;
|
8046
8158
|
}
|
8047
|
-
case 52 /*
|
8159
|
+
case 52 /* MethodDeclaration */: {
|
8048
8160
|
result.push(
|
8049
8161
|
this.createItem(
|
8050
|
-
15 /*
|
8162
|
+
15 /* Method */,
|
8051
8163
|
node2.name.value,
|
8052
8164
|
node2.rangeWithoutTrivia,
|
8053
8165
|
node2.name.rangeWithoutTrivia,
|
@@ -8056,10 +8168,10 @@ var SourceFileItemsService = class {
|
|
8056
8168
|
);
|
8057
8169
|
break;
|
8058
8170
|
}
|
8059
|
-
case 45 /*
|
8171
|
+
case 45 /* ConstructorDeclaration */: {
|
8060
8172
|
result.push(
|
8061
8173
|
this.createItem(
|
8062
|
-
10 /*
|
8174
|
+
10 /* Constructor */,
|
8063
8175
|
void 0,
|
8064
8176
|
node2.rangeWithoutTrivia,
|
8065
8177
|
node2.rangeWithoutTrivia,
|
@@ -8068,9 +8180,9 @@ var SourceFileItemsService = class {
|
|
8068
8180
|
);
|
8069
8181
|
break;
|
8070
8182
|
}
|
8071
|
-
case 46 /*
|
8183
|
+
case 46 /* DestructorDeclaration */: {
|
8072
8184
|
result.push(this.createItem(
|
8073
|
-
11 /*
|
8185
|
+
11 /* Destructor */,
|
8074
8186
|
void 0,
|
8075
8187
|
node2.rangeWithoutTrivia,
|
8076
8188
|
node2.rangeWithoutTrivia,
|
@@ -8078,10 +8190,10 @@ var SourceFileItemsService = class {
|
|
8078
8190
|
));
|
8079
8191
|
break;
|
8080
8192
|
}
|
8081
|
-
case 47 /*
|
8193
|
+
case 47 /* IndexedElementGetterDeclaration */: {
|
8082
8194
|
result.push(
|
8083
8195
|
this.createItem(
|
8084
|
-
16 /*
|
8196
|
+
16 /* IndexedElementGetter */,
|
8085
8197
|
void 0,
|
8086
8198
|
node2.rangeWithoutTrivia,
|
8087
8199
|
node2.rangeWithoutTrivia,
|
@@ -8090,10 +8202,10 @@ var SourceFileItemsService = class {
|
|
8090
8202
|
);
|
8091
8203
|
break;
|
8092
8204
|
}
|
8093
|
-
case 48 /*
|
8205
|
+
case 48 /* IndexedElementSetterDeclaration */: {
|
8094
8206
|
result.push(
|
8095
8207
|
this.createItem(
|
8096
|
-
17 /*
|
8208
|
+
17 /* IndexedElementSetter */,
|
8097
8209
|
void 0,
|
8098
8210
|
node2.rangeWithoutTrivia,
|
8099
8211
|
node2.rangeWithoutTrivia,
|
@@ -8102,10 +8214,10 @@ var SourceFileItemsService = class {
|
|
8102
8214
|
);
|
8103
8215
|
break;
|
8104
8216
|
}
|
8105
|
-
case 28 /*
|
8217
|
+
case 28 /* PackageFunctionTypeDeclaration */: {
|
8106
8218
|
result.push(
|
8107
8219
|
this.createItem(
|
8108
|
-
6 /*
|
8220
|
+
6 /* FunctionType */,
|
8109
8221
|
node2.name.value,
|
8110
8222
|
node2.rangeWithoutTrivia,
|
8111
8223
|
node2.name.rangeWithoutTrivia,
|
@@ -8150,10 +8262,10 @@ var SourceFileItemsService = class {
|
|
8150
8262
|
);
|
8151
8263
|
break;
|
8152
8264
|
}
|
8153
|
-
case 58 /*
|
8265
|
+
case 58 /* NestedFunctionDeclaration */: {
|
8154
8266
|
result.push(
|
8155
8267
|
this.createItem(
|
8156
|
-
19 /*
|
8268
|
+
19 /* NestedFunction */,
|
8157
8269
|
node2.name.value,
|
8158
8270
|
node2.rangeWithoutTrivia,
|
8159
8271
|
node2.name.rangeWithoutTrivia,
|
@@ -8182,34 +8294,34 @@ var SourceFileItemsService = class {
|
|
8182
8294
|
case 0 /* PackageAlias */:
|
8183
8295
|
return name ?? `<${LocalizationHelper.localizeHelperPhrase(4 /* PackageAlias */, this.locale)}>`;
|
8184
8296
|
case 1 /* PackageVariable */:
|
8185
|
-
case 12 /*
|
8186
|
-
return name ?? `<${LocalizationHelper.localizeHelperPhrase(
|
8187
|
-
case 4 /*
|
8188
|
-
case 15 /*
|
8189
|
-
case 19 /*
|
8297
|
+
case 12 /* Field */:
|
8298
|
+
return name ?? `<${LocalizationHelper.localizeHelperPhrase(6 /* Variable */, this.locale)}>`;
|
8299
|
+
case 4 /* PackageFunction */:
|
8300
|
+
case 15 /* Method */:
|
8301
|
+
case 19 /* NestedFunction */:
|
8190
8302
|
return name ?? `<${LocalizationHelper.localizeKeywordAndTakeFirst(12 /* Function */, this.locale, this.dialect)}>`;
|
8191
8303
|
case 5 /* StructuredType */:
|
8192
|
-
case 6 /*
|
8304
|
+
case 6 /* FunctionType */:
|
8193
8305
|
case 7 /* VariantType */:
|
8194
8306
|
case 8 /* InvalidType */:
|
8195
8307
|
return name ?? `<${LocalizationHelper.localizeKeywordAndTakeFirst(16 /* Type */, this.locale, this.dialect)}>`;
|
8196
|
-
case 10 /*
|
8308
|
+
case 10 /* Constructor */:
|
8197
8309
|
return name ?? LocalizationHelper.localizeKeywordAndTakeFirst(30 /* Creation */, this.locale, this.dialect);
|
8198
|
-
case 11 /*
|
8310
|
+
case 11 /* Destructor */:
|
8199
8311
|
return name ?? LocalizationHelper.localizeKeywordAndTakeFirst(47 /* Destruction */, this.locale, this.dialect);
|
8200
8312
|
case 9 /* Variant */:
|
8201
8313
|
return name ?? `<${LocalizationHelper.localizeKeywordAndTakeFirst(6 /* Variant */, this.locale, this.dialect)}>`;
|
8202
8314
|
case 18 /* TypeParameter */:
|
8203
8315
|
return name ?? `<${LocalizationHelper.localizeHelperPhrase(2 /* TypeParameter */, this.locale)}>`;
|
8204
8316
|
case 2 /* PackageVariableGetter */:
|
8205
|
-
case 13 /*
|
8317
|
+
case 13 /* FieldGetter */:
|
8206
8318
|
return `${LocalizationHelper.localizeKeywordAndTakeFirst(58 /* Get */, this.locale, this.dialect)} ${name ?? ""}`;
|
8207
8319
|
case 3 /* PackageVariableSetter */:
|
8208
|
-
case 14 /*
|
8320
|
+
case 14 /* FieldSetter */:
|
8209
8321
|
return `${LocalizationHelper.localizeKeywordAndTakeFirst(59 /* Set */, this.locale, this.dialect)} ${name ?? ""}`;
|
8210
|
-
case 16 /*
|
8322
|
+
case 16 /* IndexedElementGetter */:
|
8211
8323
|
return `${LocalizationHelper.localizeKeywordAndTakeFirst(58 /* Get */, this.locale, this.dialect)} []`;
|
8212
|
-
case 17 /*
|
8324
|
+
case 17 /* IndexedElementSetter */:
|
8213
8325
|
return `${LocalizationHelper.localizeKeywordAndTakeFirst(59 /* Set */, this.locale, this.dialect)} []`;
|
8214
8326
|
default:
|
8215
8327
|
Debug.never(kind);
|
@@ -8311,8 +8423,8 @@ var RenameService = class {
|
|
8311
8423
|
case "type-value-parameter":
|
8312
8424
|
canBeRenamed = this.entityCanBeRenamed(analyzer, target.value.parameter.getEntity());
|
8313
8425
|
break;
|
8314
|
-
case "accessed-
|
8315
|
-
canBeRenamed = this.entityCanBeRenamed(analyzer, target.value.
|
8426
|
+
case "accessed-function":
|
8427
|
+
canBeRenamed = this.entityCanBeRenamed(analyzer, target.value.func.getEntity());
|
8316
8428
|
break;
|
8317
8429
|
case "match-result-value-parameter":
|
8318
8430
|
canBeRenamed = this.entityCanBeRenamed(analyzer, target.value.parameter.entity);
|
@@ -8325,6 +8437,7 @@ var RenameService = class {
|
|
8325
8437
|
case "package":
|
8326
8438
|
case "type-context":
|
8327
8439
|
case "type-indexer":
|
8440
|
+
case "package-name-tree-node":
|
8328
8441
|
canBeRenamed = false;
|
8329
8442
|
break;
|
8330
8443
|
default:
|
@@ -8409,7 +8522,7 @@ var SelectionRangeService = class {
|
|
8409
8522
|
case 34 /* StructuredTypeDeclarationBody */:
|
8410
8523
|
case 39 /* VariantTypeDeclarationBody */:
|
8411
8524
|
case 23 /* AliasTypeDeclarationBody */:
|
8412
|
-
case 29 /*
|
8525
|
+
case 29 /* FunctionTypeDeclarationBody */:
|
8413
8526
|
case 83 /* TextTemplateSpan */:
|
8414
8527
|
case 82 /* TextTemplateSpanList */:
|
8415
8528
|
return true;
|
@@ -8453,7 +8566,7 @@ var SemanticTokensService = class {
|
|
8453
8566
|
const meaning = analyzer.resolveIdentifierExpression(node).meaning;
|
8454
8567
|
if (meaning.kind === "variable-access") {
|
8455
8568
|
const variable = meaning.variable.value.getEntity();
|
8456
|
-
if (variable.subkind === "
|
8569
|
+
if (variable.subkind === "field" && variable.isVariant()) {
|
8457
8570
|
result.push(
|
8458
8571
|
new SemanticToken(
|
8459
8572
|
node.rangeWithoutTrivia,
|
@@ -8470,8 +8583,8 @@ var SemanticTokensService = class {
|
|
8470
8583
|
case "value":
|
8471
8584
|
semanticTokenKind = 1 /* SpecialVariable */;
|
8472
8585
|
break;
|
8473
|
-
case "implicit-
|
8474
|
-
semanticTokenKind = 0 /*
|
8586
|
+
case "implicit-function-block-parameter":
|
8587
|
+
semanticTokenKind = 0 /* FunctionBlockLiteralParameter */;
|
8475
8588
|
break;
|
8476
8589
|
case "backing":
|
8477
8590
|
semanticTokenKind = void 0;
|
@@ -8487,13 +8600,13 @@ var SemanticTokensService = class {
|
|
8487
8600
|
}
|
8488
8601
|
}
|
8489
8602
|
}
|
8490
|
-
if (meaning.kind === "
|
8491
|
-
const
|
8603
|
+
if (meaning.kind === "function-access" && meaning.suitableFunctions.length > 0) {
|
8604
|
+
const func = meaning.suitableFunctions[0];
|
8492
8605
|
result.push(
|
8493
8606
|
new SemanticToken(
|
8494
8607
|
node.rangeWithoutTrivia,
|
8495
|
-
this.
|
8496
|
-
new SemanticTokenModifiers().setCapitalized(this.isCapitalizedName(
|
8608
|
+
this.getSemanticTokenKindForFunctionEntity(func.value.getEntity()),
|
8609
|
+
new SemanticTokenModifiers().setCapitalized(this.isCapitalizedName(func.value.getName()))
|
8497
8610
|
)
|
8498
8611
|
);
|
8499
8612
|
}
|
@@ -8505,11 +8618,11 @@ var SemanticTokensService = class {
|
|
8505
8618
|
));
|
8506
8619
|
}
|
8507
8620
|
}
|
8508
|
-
if (node.kind === 78 /*
|
8509
|
-
const meaning = analyzer.
|
8621
|
+
if (node.kind === 78 /* MemberAccessExpression */) {
|
8622
|
+
const meaning = analyzer.resolveMemberAccessExpression(node).meaning;
|
8510
8623
|
if (meaning.kind === "static-variable-access") {
|
8511
8624
|
const entity = meaning.variable.value.getEntity();
|
8512
|
-
if (entity.subkind === "
|
8625
|
+
if (entity.subkind === "field" && entity.isVariant()) {
|
8513
8626
|
result.push(
|
8514
8627
|
new SemanticToken(
|
8515
8628
|
node.propertyName.rangeWithoutTrivia,
|
@@ -8519,25 +8632,25 @@ var SemanticTokensService = class {
|
|
8519
8632
|
);
|
8520
8633
|
}
|
8521
8634
|
}
|
8522
|
-
let
|
8635
|
+
let suitableFunctions;
|
8523
8636
|
switch (meaning.kind) {
|
8524
|
-
case "package-
|
8525
|
-
|
8637
|
+
case "package-function-access":
|
8638
|
+
suitableFunctions = meaning.suitableFunctions.map((m) => m.value);
|
8526
8639
|
break;
|
8527
8640
|
case "static-method-access":
|
8528
|
-
|
8641
|
+
suitableFunctions = meaning.suitableFunctions.map((m) => m.value);
|
8529
8642
|
break;
|
8530
8643
|
case "instance-method-access":
|
8531
|
-
|
8644
|
+
suitableFunctions = meaning.suitableFunctions.map((m) => m.value);
|
8532
8645
|
break;
|
8533
8646
|
}
|
8534
|
-
if (
|
8535
|
-
const
|
8647
|
+
if (suitableFunctions !== void 0 && suitableFunctions.length > 0) {
|
8648
|
+
const func = suitableFunctions[0];
|
8536
8649
|
result.push(
|
8537
8650
|
new SemanticToken(
|
8538
8651
|
node.propertyName.rangeWithoutTrivia,
|
8539
|
-
this.
|
8540
|
-
new SemanticTokenModifiers().setCapitalized(this.isCapitalizedName(
|
8652
|
+
this.getSemanticTokenKindForFunctionEntity(func.getEntity()),
|
8653
|
+
new SemanticTokenModifiers().setCapitalized(this.isCapitalizedName(func.getName()))
|
8541
8654
|
)
|
8542
8655
|
);
|
8543
8656
|
}
|
@@ -8558,23 +8671,27 @@ var SemanticTokensService = class {
|
|
8558
8671
|
)
|
8559
8672
|
);
|
8560
8673
|
}
|
8561
|
-
if (node.kind === 27 /*
|
8674
|
+
if (node.kind === 27 /* PackageFunctionDeclaration */) {
|
8562
8675
|
result.push(
|
8563
8676
|
new SemanticToken(
|
8564
8677
|
node.name.rangeWithoutTrivia,
|
8565
|
-
4 /*
|
8678
|
+
4 /* PackageFunction */,
|
8566
8679
|
new SemanticTokenModifiers().makeDeclaration().setCapitalized(this.isCapitalizedName(node.name.value))
|
8567
8680
|
)
|
8568
8681
|
);
|
8569
8682
|
}
|
8570
|
-
if (node.kind === 58 /*
|
8683
|
+
if (node.kind === 58 /* NestedFunctionDeclaration */) {
|
8571
8684
|
result.push(
|
8572
|
-
new SemanticToken(
|
8685
|
+
new SemanticToken(
|
8686
|
+
node.name.rangeWithoutTrivia,
|
8687
|
+
5 /* NestedFunction */,
|
8688
|
+
new SemanticTokenModifiers().makeDeclaration().setCapitalized(this.isCapitalizedName(node.name.value))
|
8689
|
+
)
|
8573
8690
|
);
|
8574
8691
|
}
|
8575
|
-
if (node.kind === 52 /*
|
8692
|
+
if (node.kind === 52 /* MethodDeclaration */) {
|
8576
8693
|
result.push(
|
8577
|
-
new SemanticToken(node.name.rangeWithoutTrivia, 6 /*
|
8694
|
+
new SemanticToken(node.name.rangeWithoutTrivia, 6 /* Method */, new SemanticTokenModifiers().makeDeclaration().setCapitalized(this.isCapitalizedName(node.name.value)))
|
8578
8695
|
);
|
8579
8696
|
}
|
8580
8697
|
if (node.kind === 53 /* OperatorDeclaration */) {
|
@@ -8590,14 +8707,14 @@ var SemanticTokensService = class {
|
|
8590
8707
|
rangesOverlap(range1, range2) {
|
8591
8708
|
return range1.start < range2.end && range1.end > range2.start;
|
8592
8709
|
}
|
8593
|
-
|
8710
|
+
getSemanticTokenKindForFunctionEntity(entity) {
|
8594
8711
|
switch (entity.subkind) {
|
8595
8712
|
case "package":
|
8596
|
-
return 4 /*
|
8597
|
-
case "
|
8598
|
-
return 6 /*
|
8713
|
+
return 4 /* PackageFunction */;
|
8714
|
+
case "method":
|
8715
|
+
return 6 /* Method */;
|
8599
8716
|
case "nested":
|
8600
|
-
return 5 /*
|
8717
|
+
return 5 /* NestedFunction */;
|
8601
8718
|
default:
|
8602
8719
|
Debug.never(entity);
|
8603
8720
|
}
|
@@ -8652,13 +8769,13 @@ var SemanticTokenModifiers = class {
|
|
8652
8769
|
}
|
8653
8770
|
};
|
8654
8771
|
var supportedSemanticTokens = [
|
8655
|
-
0 /*
|
8772
|
+
0 /* FunctionBlockLiteralParameter */,
|
8656
8773
|
1 /* SpecialVariable */,
|
8657
8774
|
2 /* SpecialMethod */,
|
8658
8775
|
3 /* Variant */,
|
8659
|
-
4 /*
|
8660
|
-
5 /*
|
8661
|
-
6 /*
|
8776
|
+
4 /* PackageFunction */,
|
8777
|
+
5 /* NestedFunction */,
|
8778
|
+
6 /* Method */,
|
8662
8779
|
7 /* Operator */
|
8663
8780
|
];
|
8664
8781
|
var supportedSemanticTokenModifiers = [
|
@@ -8802,11 +8919,11 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8802
8919
|
const lastQualifier = resolutionResult.resolvedQualifiers[resolutionResult.resolvedQualifiers.length - 1];
|
8803
8920
|
if (lastQualifier.kind === "type") {
|
8804
8921
|
return Query.from(lastQualifier.candidates).mapAndFilter((t) => this.getSignatureForNamedType(t.value)).toArray();
|
8805
|
-
} else if (lastQualifier.kind === "
|
8806
|
-
if (resolutionResult.meaning.kind === "tag-
|
8922
|
+
} else if (lastQualifier.kind === "function") {
|
8923
|
+
if (resolutionResult.meaning.kind === "tag-function") {
|
8807
8924
|
return Query.from(resolutionResult.meaning.candidates).mapAndFilter((d) => {
|
8808
|
-
if (d.value.kind === "substituted-
|
8809
|
-
return this.
|
8925
|
+
if (d.value.kind === "substituted-function") {
|
8926
|
+
return this.getSignatureForSubstitutedFunction(d.value.value, d.localization);
|
8810
8927
|
}
|
8811
8928
|
return void 0;
|
8812
8929
|
}).toArray();
|
@@ -8821,10 +8938,10 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8821
8938
|
const expression = unwrapParenthesizedExpressions(node.expression);
|
8822
8939
|
if (expression.kind === 88 /* IdentifierExpression */) {
|
8823
8940
|
const meaning = this._analyzer.resolveIdentifierExpression(expression).meaning;
|
8824
|
-
if (meaning.kind === "
|
8941
|
+
if (meaning.kind === "function-access") {
|
8825
8942
|
return Query.from(meaning.candidates).mapAndFilter((o) => {
|
8826
|
-
if (o.value.kind === "substituted-
|
8827
|
-
return this.
|
8943
|
+
if (o.value.kind === "substituted-function") {
|
8944
|
+
return this.getSignatureForSubstitutedFunction(o.value.value, o.localization);
|
8828
8945
|
}
|
8829
8946
|
return void 0;
|
8830
8947
|
}).toArray();
|
@@ -8834,20 +8951,20 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8834
8951
|
}
|
8835
8952
|
return void 0;
|
8836
8953
|
}
|
8837
|
-
if (expression.kind === 78 /*
|
8838
|
-
const meaning = this._analyzer.
|
8839
|
-
let
|
8954
|
+
if (expression.kind === 78 /* MemberAccessExpression */) {
|
8955
|
+
const meaning = this._analyzer.resolveMemberAccessExpression(expression).meaning;
|
8956
|
+
let accessedFunctions;
|
8840
8957
|
if (meaning.kind === "instance-method-access") {
|
8841
|
-
|
8958
|
+
accessedFunctions = meaning.candidates;
|
8842
8959
|
} else if (meaning.kind === "static-method-access") {
|
8843
|
-
|
8844
|
-
} else if (meaning.kind === "package-
|
8845
|
-
|
8846
|
-
}
|
8847
|
-
if (
|
8848
|
-
return Query.from(
|
8849
|
-
if (o.value.kind === "substituted-
|
8850
|
-
return this.
|
8960
|
+
accessedFunctions = meaning.candidates;
|
8961
|
+
} else if (meaning.kind === "package-function-access") {
|
8962
|
+
accessedFunctions = meaning.candidates;
|
8963
|
+
}
|
8964
|
+
if (accessedFunctions !== void 0) {
|
8965
|
+
return Query.from(accessedFunctions).mapAndFilter((o) => {
|
8966
|
+
if (o.value.kind === "substituted-function") {
|
8967
|
+
return this.getSignatureForSubstitutedFunction(o.value.value, o.localization);
|
8851
8968
|
}
|
8852
8969
|
return void 0;
|
8853
8970
|
}).toArray();
|
@@ -8859,21 +8976,21 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8859
8976
|
}
|
8860
8977
|
return void 0;
|
8861
8978
|
}
|
8862
|
-
|
8979
|
+
getSignatureForSubstitutedFunction(func, localization) {
|
8863
8980
|
let result = void 0;
|
8864
|
-
switch (
|
8981
|
+
switch (func.kind) {
|
8865
8982
|
case "entity":
|
8866
|
-
if (
|
8867
|
-
result = new
|
8983
|
+
if (func.entity.getTypeParametersArity() > 0) {
|
8984
|
+
result = new FunctionEntitySignature(this.signatureContext, func.entity, localization);
|
8868
8985
|
}
|
8869
8986
|
break;
|
8870
8987
|
case "type-member":
|
8871
|
-
if (
|
8872
|
-
result = new
|
8988
|
+
if (func.method.getTypeParametersArity() > 0) {
|
8989
|
+
result = new MethodSignature(this.signatureContext, func.method, localization);
|
8873
8990
|
}
|
8874
8991
|
break;
|
8875
8992
|
default:
|
8876
|
-
Debug.never(
|
8993
|
+
Debug.never(func);
|
8877
8994
|
}
|
8878
8995
|
return result;
|
8879
8996
|
}
|
@@ -8885,9 +9002,9 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8885
9002
|
result = new StructuredTypeSignature(this.signatureContext, type);
|
8886
9003
|
}
|
8887
9004
|
break;
|
8888
|
-
case 0 /*
|
9005
|
+
case 0 /* Function */:
|
8889
9006
|
if (type.getArity() > 0) {
|
8890
|
-
result = new
|
9007
|
+
result = new FunctionTypeSignature2(this.signatureContext, type);
|
8891
9008
|
}
|
8892
9009
|
break;
|
8893
9010
|
case 3 /* Variant */:
|
@@ -8915,36 +9032,36 @@ var NodeWithTypeArgumentsInfo = class {
|
|
8915
9032
|
this.argumentCount = argumentCount;
|
8916
9033
|
}
|
8917
9034
|
};
|
8918
|
-
var
|
8919
|
-
constructor(ctx,
|
9035
|
+
var FunctionEntitySignature = class {
|
9036
|
+
constructor(ctx, func, localization) {
|
8920
9037
|
this.ctx = ctx;
|
8921
|
-
this.
|
9038
|
+
this.func = func;
|
8922
9039
|
this.localization = localization;
|
8923
|
-
this.kind = "
|
9040
|
+
this.kind = "function-entity";
|
8924
9041
|
}
|
8925
9042
|
getArity() {
|
8926
|
-
return this.
|
9043
|
+
return this.func.getTypeParametersArity();
|
8927
9044
|
}
|
8928
9045
|
getDisplayParts() {
|
8929
|
-
const
|
8930
|
-
const displayParts = this.ctx.displayService.
|
8931
|
-
return this.ctx.
|
9046
|
+
const func = new FunctionDeclaration_entity(this.func, this.localization);
|
9047
|
+
const displayParts = this.ctx.displayService.getFunctionDeclarationDisplayParts(func);
|
9048
|
+
return this.ctx.convertFunctionDisplayParts(displayParts);
|
8932
9049
|
}
|
8933
9050
|
};
|
8934
|
-
var
|
9051
|
+
var MethodSignature = class {
|
8935
9052
|
constructor(ctx, method, localization) {
|
8936
9053
|
this.ctx = ctx;
|
8937
9054
|
this.method = method;
|
8938
9055
|
this.localization = localization;
|
8939
|
-
this.kind = "
|
9056
|
+
this.kind = "method";
|
8940
9057
|
}
|
8941
9058
|
getArity() {
|
8942
9059
|
return this.method.getTypeParametersArity();
|
8943
9060
|
}
|
8944
9061
|
getDisplayParts() {
|
8945
|
-
const
|
8946
|
-
const displayParts = this.ctx.displayService.
|
8947
|
-
return this.ctx.
|
9062
|
+
const func = new FunctionDeclaration_typeMember(this.method, this.localization);
|
9063
|
+
const displayParts = this.ctx.displayService.getFunctionDeclarationDisplayParts(func);
|
9064
|
+
return this.ctx.convertFunctionDisplayParts(displayParts);
|
8948
9065
|
}
|
8949
9066
|
};
|
8950
9067
|
var StructuredTypeSignature = class {
|
@@ -8977,7 +9094,7 @@ var VariantTypeSignature = class {
|
|
8977
9094
|
return this.ctx.convertNamedTypeDisplayParts(displayParts);
|
8978
9095
|
}
|
8979
9096
|
};
|
8980
|
-
var
|
9097
|
+
var FunctionTypeSignature2 = class {
|
8981
9098
|
constructor(ctx, type) {
|
8982
9099
|
this.ctx = ctx;
|
8983
9100
|
this.type = type;
|
@@ -8987,7 +9104,7 @@ var MethodTypeSignature2 = class {
|
|
8987
9104
|
return this.type.getArity();
|
8988
9105
|
}
|
8989
9106
|
getDisplayParts() {
|
8990
|
-
const type = new
|
9107
|
+
const type = new NamedType_function(this.type);
|
8991
9108
|
const displayParts = this.ctx.displayService.getNamedTypeDisplayParts(type);
|
8992
9109
|
return this.ctx.convertNamedTypeDisplayParts(displayParts);
|
8993
9110
|
}
|
@@ -9011,7 +9128,7 @@ var SignatureContext = class {
|
|
9011
9128
|
constructor(displayService) {
|
9012
9129
|
this.displayService = displayService;
|
9013
9130
|
}
|
9014
|
-
|
9131
|
+
convertFunctionDisplayParts(parts) {
|
9015
9132
|
const prefix = parts.asyncKeywordWithWhitespace + parts.functionKeyword + parts.whitespaceAfterFunctionKeyword + parts.container + parts.name + parts.typeParametersStart;
|
9016
9133
|
const postfix = parts.typeParametersEnd + parts.valueParametersStart + parts.valueParameters.map((p) => p.toString()).join(parts.valueParameterSeparator) + parts.valueParametersEnd + parts.returnTypeAnnotationColon + parts.returnType;
|
9017
9134
|
return new SignatureDisplayParts(prefix, parts.typeParameters, parts.typeParameterSeparator, postfix);
|
@@ -9139,17 +9256,17 @@ var ValueParametersSignatureHelpProvider = class {
|
|
9139
9256
|
}
|
9140
9257
|
getSignatureDisplayParts(signature) {
|
9141
9258
|
switch (signature.kind) {
|
9142
|
-
case "accessed-
|
9143
|
-
const
|
9144
|
-
signature.
|
9145
|
-
signature.
|
9259
|
+
case "accessed-function": {
|
9260
|
+
const func = new FunctionDeclaration_accessedFunction(
|
9261
|
+
signature.func.value,
|
9262
|
+
signature.func.localization
|
9146
9263
|
);
|
9147
|
-
const displayParts = this.signatureContext.displayService.
|
9148
|
-
return this.signatureContext.
|
9264
|
+
const displayParts = this.signatureContext.displayService.getFunctionDeclarationDisplayParts(func);
|
9265
|
+
return this.signatureContext.convertFunctionDisplayParts(displayParts);
|
9149
9266
|
}
|
9150
|
-
case "
|
9151
|
-
const displayParts = this.signatureContext.displayService.
|
9152
|
-
return this.signatureContext.
|
9267
|
+
case "function-type": {
|
9268
|
+
const displayParts = this.signatureContext.displayService.getFunctionTypeBodyDisplayParts(signature.functionType);
|
9269
|
+
return this.signatureContext.convertFunctionTypeBodyDisplayParts(displayParts);
|
9153
9270
|
}
|
9154
9271
|
case "constructor": {
|
9155
9272
|
const constructor = new ConstructorDeclaration_typeMember(
|
@@ -9181,13 +9298,13 @@ var SignatureContext2 = class {
|
|
9181
9298
|
constructor(displayService) {
|
9182
9299
|
this.displayService = displayService;
|
9183
9300
|
}
|
9184
|
-
|
9301
|
+
convertFunctionDisplayParts(parts) {
|
9185
9302
|
const prefix = parts.asyncKeywordWithWhitespace + parts.functionKeyword + parts.whitespaceAfterFunctionKeyword + parts.container + parts.name + parts.typeParametersStart + parts.typeParameters.join(parts.typeParameterSeparator) + parts.typeParametersEnd + parts.valueParametersStart;
|
9186
9303
|
const valueParameters = parts.valueParameters.map((p) => p.toString());
|
9187
9304
|
const postfix = parts.valueParametersEnd + parts.returnTypeAnnotationColon + parts.returnType;
|
9188
9305
|
return new SignatureDisplayParts(prefix, valueParameters, parts.valueParameterSeparator, postfix);
|
9189
9306
|
}
|
9190
|
-
|
9307
|
+
convertFunctionTypeBodyDisplayParts(parts) {
|
9191
9308
|
const prefix = parts.asyncKeywordWithWhitespace + parts.functionKeyword + parts.valueParametersStart;
|
9192
9309
|
const valueParameters = parts.valueParameters.map((p) => p.toString());
|
9193
9310
|
const postfix = parts.valueParametersEnd + parts.returnTypeAnnotationColon + parts.returnType;
|
@@ -11623,8 +11740,8 @@ var EntityToSyntax = class {
|
|
11623
11740
|
switch (entity.kind) {
|
11624
11741
|
case 0 /* Variable */:
|
11625
11742
|
return this.convertPackageVariable(entity);
|
11626
|
-
case 1 /*
|
11627
|
-
return this.
|
11743
|
+
case 1 /* Function */:
|
11744
|
+
return this.convertPackageFunction(entity);
|
11628
11745
|
case 2 /* Type */:
|
11629
11746
|
return this.convertPackageType(entity);
|
11630
11747
|
default:
|
@@ -11633,8 +11750,8 @@ var EntityToSyntax = class {
|
|
11633
11750
|
}
|
11634
11751
|
convertPackageType(entity) {
|
11635
11752
|
switch (entity.typeEntityKind) {
|
11636
|
-
case 0 /*
|
11637
|
-
return this.
|
11753
|
+
case 0 /* Function */:
|
11754
|
+
return this.convertPackageFunctionType(entity);
|
11638
11755
|
case 1 /* Structured */:
|
11639
11756
|
return this.convertPackageStructuredType(entity);
|
11640
11757
|
case 3 /* Variant */:
|
@@ -11686,7 +11803,7 @@ var EntityToSyntax = class {
|
|
11686
11803
|
}
|
11687
11804
|
return result;
|
11688
11805
|
}
|
11689
|
-
|
11806
|
+
convertPackageFunction(entity) {
|
11690
11807
|
const tags = this.convertTags(entity.getTags());
|
11691
11808
|
const modifiers = new Array();
|
11692
11809
|
if (entity.isAsync()) {
|
@@ -11700,7 +11817,7 @@ var EntityToSyntax = class {
|
|
11700
11817
|
const typeParameters = this.convertTypeParameters(entity.getTypeParameters());
|
11701
11818
|
const valueParameters = this.convertValueParameters(entity.getValueParameters());
|
11702
11819
|
const returnType = this.convertType(entity.getReturnType());
|
11703
|
-
return SyntaxFactory.
|
11820
|
+
return SyntaxFactory.packageFunctionDeclaration(
|
11704
11821
|
tags,
|
11705
11822
|
modifiers,
|
11706
11823
|
name,
|
@@ -11746,7 +11863,7 @@ var EntityToSyntax = class {
|
|
11746
11863
|
const body = this.createVariantTypeDeclarationBody(entity);
|
11747
11864
|
return SyntaxFactory.packageVariantTypeDeclaration(tags, modifiers, name, typeParameters, body);
|
11748
11865
|
}
|
11749
|
-
|
11866
|
+
convertPackageFunctionType(entity) {
|
11750
11867
|
const tags = this.convertTags(entity.getTags());
|
11751
11868
|
const modifiers = new Array();
|
11752
11869
|
const isHidden = entity.isHidden();
|
@@ -11755,18 +11872,18 @@ var EntityToSyntax = class {
|
|
11755
11872
|
}
|
11756
11873
|
const name = this.getEntityName(entity);
|
11757
11874
|
const typeParameters = this.convertTypeParameters(entity.getTypeParameters());
|
11758
|
-
const body = this.
|
11759
|
-
return SyntaxFactory.
|
11875
|
+
const body = this.createFunctionTypeDeclarationBody(entity);
|
11876
|
+
return SyntaxFactory.packageFunctionTypeDeclaration(tags, modifiers, name, typeParameters, body);
|
11760
11877
|
}
|
11761
11878
|
convertTypeEntityMembers(members) {
|
11762
|
-
const variables = members.getNamedMembers().filter((m) => m.kind === 0 /* Variable */).flatMap((m) => this.
|
11763
|
-
const methods = members.getNamedMembers().filter((m) => m.kind !== 0 /* Variable */).map((m) => this.
|
11764
|
-
const constructors = members.getConstructors().map((c) => this.
|
11765
|
-
const destructors = members.getDestructors().map((d) => this.
|
11766
|
-
const indexers = members.getIndexers().flatMap((i) => this.
|
11879
|
+
const variables = members.getNamedMembers().filter((m) => m.kind === 0 /* Variable */).flatMap((m) => this.convertField(m));
|
11880
|
+
const methods = members.getNamedMembers().filter((m) => m.kind !== 0 /* Variable */).map((m) => this.convertMethod(m));
|
11881
|
+
const constructors = members.getConstructors().map((c) => this.convertConstructor(c));
|
11882
|
+
const destructors = members.getDestructors().map((d) => this.convertDestructor(d));
|
11883
|
+
const indexers = members.getIndexers().flatMap((i) => this.convertIndexer(i));
|
11767
11884
|
return variables.concat(indexers, constructors, methods, destructors);
|
11768
11885
|
}
|
11769
|
-
|
11886
|
+
convertField(entity) {
|
11770
11887
|
if (entity.isVariant()) {
|
11771
11888
|
return this.convertVariant(entity);
|
11772
11889
|
}
|
@@ -11799,7 +11916,7 @@ var EntityToSyntax = class {
|
|
11799
11916
|
if (isHidden !== void 0) {
|
11800
11917
|
modifiers.push(this.createHidingModifier(isHidden));
|
11801
11918
|
}
|
11802
|
-
result.push(SyntaxFactory.
|
11919
|
+
result.push(SyntaxFactory.fieldGetterDeclaration(tags, modifiers, name, type, void 0));
|
11803
11920
|
}
|
11804
11921
|
const setterEntity = entity.getSetter();
|
11805
11922
|
if (setterEntity !== void 0) {
|
@@ -11809,7 +11926,7 @@ var EntityToSyntax = class {
|
|
11809
11926
|
if (isHidden !== void 0) {
|
11810
11927
|
modifiers.push(this.createHidingModifier(isHidden));
|
11811
11928
|
}
|
11812
|
-
result.push(SyntaxFactory.
|
11929
|
+
result.push(SyntaxFactory.fieldSetterDeclaration(tags, modifiers, name, void 0));
|
11813
11930
|
}
|
11814
11931
|
} else {
|
11815
11932
|
const tags = this.convertTags(entity.getTags());
|
@@ -11818,11 +11935,11 @@ var EntityToSyntax = class {
|
|
11818
11935
|
if (isHidden !== void 0) {
|
11819
11936
|
modifiers.push(this.createHidingModifier(isHidden));
|
11820
11937
|
}
|
11821
|
-
result = SyntaxFactory.
|
11938
|
+
result = SyntaxFactory.fieldDeclaration(tags, commonModifiers, name, type);
|
11822
11939
|
}
|
11823
11940
|
return result;
|
11824
11941
|
}
|
11825
|
-
|
11942
|
+
convertMethod(entity) {
|
11826
11943
|
const tags = this.convertTags(entity.getTags());
|
11827
11944
|
const modifiers = new Array();
|
11828
11945
|
const isHidden = entity.isHidden();
|
@@ -11845,9 +11962,9 @@ var EntityToSyntax = class {
|
|
11845
11962
|
const typeParameters = this.convertTypeParameters(entity.getTypeParameters());
|
11846
11963
|
const parameters = this.convertValueParameters(entity.getValueParameters());
|
11847
11964
|
const returnType = this.convertType(entity.getReturnType());
|
11848
|
-
return SyntaxFactory.
|
11965
|
+
return SyntaxFactory.methodDeclaration(tags, modifiers, name, typeParameters, parameters, returnType, void 0);
|
11849
11966
|
}
|
11850
|
-
|
11967
|
+
convertConstructor(entity) {
|
11851
11968
|
const tags = this.convertTags(entity.getTags());
|
11852
11969
|
const modifiers = new Array();
|
11853
11970
|
const isHidden = entity.isHidden();
|
@@ -11858,9 +11975,9 @@ var EntityToSyntax = class {
|
|
11858
11975
|
modifiers.push(SyntaxFactory.modifier(37 /* Abstract */));
|
11859
11976
|
}
|
11860
11977
|
const parameters = this.convertValueParameters(entity.getValueParameters());
|
11861
|
-
return SyntaxFactory.
|
11978
|
+
return SyntaxFactory.constructorDeclaration(tags, modifiers, parameters, void 0);
|
11862
11979
|
}
|
11863
|
-
|
11980
|
+
convertDestructor(entity) {
|
11864
11981
|
const tags = this.convertTags(entity.getTags());
|
11865
11982
|
const modifiers = new Array();
|
11866
11983
|
const isHidden = entity.isHidden();
|
@@ -11871,9 +11988,9 @@ var EntityToSyntax = class {
|
|
11871
11988
|
modifiers.push(SyntaxFactory.modifier(37 /* Abstract */));
|
11872
11989
|
}
|
11873
11990
|
const parameters = this.convertValueParameters(entity.getValueParameters());
|
11874
|
-
return SyntaxFactory.
|
11991
|
+
return SyntaxFactory.destructorDeclaration(tags, modifiers, parameters, void 0);
|
11875
11992
|
}
|
11876
|
-
|
11993
|
+
convertIndexer(entity) {
|
11877
11994
|
const commonModifiers = new Array();
|
11878
11995
|
if (entity.isStatic()) {
|
11879
11996
|
commonModifiers.push(SyntaxFactory.modifier(41 /* Static */));
|
@@ -11892,14 +12009,14 @@ var EntityToSyntax = class {
|
|
11892
12009
|
modifiers.push(this.createHidingModifier(isHidden));
|
11893
12010
|
}
|
11894
12011
|
const type = this.convertType(entity.getType());
|
11895
|
-
const declaration = SyntaxFactory.
|
12012
|
+
const declaration = SyntaxFactory.indexedElementGetterDeclaration(tags, modifiers, parameters, type, void 0);
|
11896
12013
|
result.push(declaration);
|
11897
12014
|
}
|
11898
12015
|
const setterEntity = entity.getSetter();
|
11899
12016
|
if (setterEntity !== void 0) {
|
11900
12017
|
const tags = this.convertTags(setterEntity.getTags());
|
11901
12018
|
const modifiers = Array.from(commonModifiers);
|
11902
|
-
const declaration = SyntaxFactory.
|
12019
|
+
const declaration = SyntaxFactory.indexedElementSetterDeclaration(tags, modifiers, parameters, void 0);
|
11903
12020
|
result.push(declaration);
|
11904
12021
|
}
|
11905
12022
|
return result;
|
@@ -11951,10 +12068,10 @@ var EntityToSyntax = class {
|
|
11951
12068
|
const members = this.convertTypeEntityMembers(entity.getMembers());
|
11952
12069
|
return SyntaxFactory.variantTypeDeclarationBody(members);
|
11953
12070
|
}
|
11954
|
-
|
12071
|
+
createFunctionTypeDeclarationBody(entity) {
|
11955
12072
|
const parameters = this.convertValueParameters(entity.getValueParameters());
|
11956
12073
|
const returnType = this.convertType(entity.getReturnType());
|
11957
|
-
return SyntaxFactory.
|
12074
|
+
return SyntaxFactory.functionTypeDeclarationBody(parameters, returnType);
|
11958
12075
|
}
|
11959
12076
|
convertTypeParameters(entities) {
|
11960
12077
|
if (entities.length === 0) {
|
@@ -12021,14 +12138,16 @@ var EntityToSyntax = class {
|
|
12021
12138
|
return this.convertStructuredType(type);
|
12022
12139
|
case "variant":
|
12023
12140
|
return this.convertVariantType(type);
|
12024
|
-
case "
|
12025
|
-
return this.
|
12141
|
+
case "function":
|
12142
|
+
return this.convertFunctionType(type);
|
12026
12143
|
case "alias":
|
12027
12144
|
return this.convertAliasType(type);
|
12028
12145
|
case "parameter":
|
12029
12146
|
return this.convertParameterType(type);
|
12030
12147
|
case "union":
|
12031
12148
|
return this.convertUnionType(type);
|
12149
|
+
case "intersection":
|
12150
|
+
return this.convertIntersectionType(type);
|
12032
12151
|
case "unresolved":
|
12033
12152
|
return this.convertUnresolvedType(type);
|
12034
12153
|
default:
|
@@ -12055,14 +12174,14 @@ var EntityToSyntax = class {
|
|
12055
12174
|
return SyntaxFactory.anonymousVariantTypeSpecifier(body);
|
12056
12175
|
}
|
12057
12176
|
}
|
12058
|
-
|
12177
|
+
convertFunctionType(type) {
|
12059
12178
|
const entity = type.getEntity();
|
12060
12179
|
if (entity.subkind === "package") {
|
12061
12180
|
const name = this.getEntityName(entity);
|
12062
12181
|
return this.createNamedTypeSpecifier(name, type.getSubstitutions());
|
12063
12182
|
} else {
|
12064
|
-
const body = this.
|
12065
|
-
return SyntaxFactory.
|
12183
|
+
const body = this.createFunctionTypeDeclarationBody(entity);
|
12184
|
+
return SyntaxFactory.anonymousFunctionTypeSpecifier(body);
|
12066
12185
|
}
|
12067
12186
|
}
|
12068
12187
|
convertAliasType(type) {
|
@@ -12085,6 +12204,10 @@ var EntityToSyntax = class {
|
|
12085
12204
|
const constituentTypes = type.originalTypes.map((t) => this.convertType(t));
|
12086
12205
|
return SyntaxFactory.unionTypeSpecifier(constituentTypes);
|
12087
12206
|
}
|
12207
|
+
convertIntersectionType(type) {
|
12208
|
+
const constituentTypes = type.originalTypes.map((t) => this.convertType(t));
|
12209
|
+
return SyntaxFactory.intersectionTypeSpecifier(constituentTypes);
|
12210
|
+
}
|
12088
12211
|
convertUnresolvedType(_type) {
|
12089
12212
|
return SyntaxFactory.namedTypeSpecifier("~\u041E\u0431\u044A\u0435\u043A\u0442");
|
12090
12213
|
}
|
@@ -12249,7 +12372,7 @@ var SourceGenerationService = class extends TriggeringObject7 {
|
|
12249
12372
|
case 0 /* Variable */:
|
12250
12373
|
if (entity.subkind === "package") {
|
12251
12374
|
return true;
|
12252
|
-
} else if (entity.subkind === "
|
12375
|
+
} else if (entity.subkind === "field") {
|
12253
12376
|
return this.checkIfEntityOfKindIsPresentInGeneratedCode(entity.getContainer().getEntity());
|
12254
12377
|
} else if (entity.subkind === "parameter") {
|
12255
12378
|
const container = entity.getContainer();
|
@@ -12257,10 +12380,10 @@ var SourceGenerationService = class extends TriggeringObject7 {
|
|
12257
12380
|
} else {
|
12258
12381
|
return false;
|
12259
12382
|
}
|
12260
|
-
case 1 /*
|
12383
|
+
case 1 /* Function */:
|
12261
12384
|
if (entity.subkind === "package") {
|
12262
12385
|
return true;
|
12263
|
-
} else if (entity.subkind === "
|
12386
|
+
} else if (entity.subkind === "method") {
|
12264
12387
|
return this.checkIfEntityOfKindIsPresentInGeneratedCode(entity.getContainer().getEntity());
|
12265
12388
|
} else {
|
12266
12389
|
return false;
|
@@ -12269,7 +12392,7 @@ var SourceGenerationService = class extends TriggeringObject7 {
|
|
12269
12392
|
switch (entity.typeEntityKind) {
|
12270
12393
|
case 1 /* Structured */:
|
12271
12394
|
case 3 /* Variant */:
|
12272
|
-
case 0 /*
|
12395
|
+
case 0 /* Function */: {
|
12273
12396
|
if (entity.subkind === "package") {
|
12274
12397
|
return true;
|
12275
12398
|
}
|
@@ -12338,13 +12461,13 @@ var EntityFinder = class {
|
|
12338
12461
|
switch (entity.kind) {
|
12339
12462
|
case 0 /* Variable */:
|
12340
12463
|
return this.findVariableEntity(entity);
|
12341
|
-
case 1 /*
|
12342
|
-
return this.
|
12464
|
+
case 1 /* Function */:
|
12465
|
+
return this.findFunctionEntity(entity);
|
12343
12466
|
case 2 /* Type */:
|
12344
12467
|
switch (entity.typeEntityKind) {
|
12345
12468
|
case 3 /* Variant */:
|
12346
12469
|
case 1 /* Structured */:
|
12347
|
-
case 0 /*
|
12470
|
+
case 0 /* Function */: {
|
12348
12471
|
if (entity.subkind === "package") {
|
12349
12472
|
return this.findPackageTypeEntityByNameAndArity(this.getEntityName(entity), entity.getArity());
|
12350
12473
|
}
|
@@ -12380,7 +12503,7 @@ var EntityFinder = class {
|
|
12380
12503
|
findVariableEntity(entity) {
|
12381
12504
|
if (entity.subkind === "package") {
|
12382
12505
|
return this._packageEntity.getMembers().getNamedMembersByName(this.getEntityName(entity)).at(0);
|
12383
|
-
} else if (entity.subkind === "
|
12506
|
+
} else if (entity.subkind === "field") {
|
12384
12507
|
const containingType = this.findEntity(entity.getContainer().getEntity());
|
12385
12508
|
if (containingType !== void 0 && isTypeEntity(containingType) && isTypeEntityWithMembers(containingType)) {
|
12386
12509
|
return containingType.getMembers().getNamedMembersByName(this.getEntityName(entity))[0];
|
@@ -12397,10 +12520,10 @@ var EntityFinder = class {
|
|
12397
12520
|
}
|
12398
12521
|
return void 0;
|
12399
12522
|
}
|
12400
|
-
|
12523
|
+
findFunctionEntity(entity) {
|
12401
12524
|
switch (entity.subkind) {
|
12402
12525
|
case "package": {
|
12403
|
-
const members = this._packageEntity.getMembers().getNamedMembersByName(this.getEntityName(entity)).filter((m) => m.kind === 1 /*
|
12526
|
+
const members = this._packageEntity.getMembers().getNamedMembersByName(this.getEntityName(entity)).filter((m) => m.kind === 1 /* Function */);
|
12404
12527
|
if (members.length === 0) {
|
12405
12528
|
return void 0;
|
12406
12529
|
} else if (members.length === 1) {
|
@@ -12415,12 +12538,12 @@ var EntityFinder = class {
|
|
12415
12538
|
return index >= 0 ? members[index] : void 0;
|
12416
12539
|
}
|
12417
12540
|
}
|
12418
|
-
case "
|
12541
|
+
case "method": {
|
12419
12542
|
const containingType = this.findEntity(entity.getContainer().getEntity());
|
12420
12543
|
if (!(containingType !== void 0 && isTypeEntity(containingType) && isTypeEntityWithMembers(containingType))) {
|
12421
12544
|
return void 0;
|
12422
12545
|
}
|
12423
|
-
const members = containingType.getMembers().getNamedMembersByName(this.getEntityName(entity)).filter((m) => m.kind === 1 /*
|
12546
|
+
const members = containingType.getMembers().getNamedMembersByName(this.getEntityName(entity)).filter((m) => m.kind === 1 /* Function */);
|
12424
12547
|
if (members.length === 0) {
|
12425
12548
|
return void 0;
|
12426
12549
|
} else if (members.length === 1) {
|
@@ -12537,7 +12660,7 @@ var EntityFinder = class {
|
|
12537
12660
|
}
|
12538
12661
|
ifEntityWithParametersThenParameters(entity) {
|
12539
12662
|
switch (entity.kind) {
|
12540
|
-
case 1 /*
|
12663
|
+
case 1 /* Function */:
|
12541
12664
|
return entity.getValueParameters();
|
12542
12665
|
case 5 /* Indexer */:
|
12543
12666
|
return entity.getValueParameters();
|
@@ -12546,7 +12669,7 @@ var EntityFinder = class {
|
|
12546
12669
|
case 8 /* Destructor */:
|
12547
12670
|
return entity.getValueParameters();
|
12548
12671
|
case 2 /* Type */: {
|
12549
|
-
if (entity.typeEntityKind === 0 /*
|
12672
|
+
if (entity.typeEntityKind === 0 /* Function */) {
|
12550
12673
|
return entity.getValueParameters();
|
12551
12674
|
}
|
12552
12675
|
return void 0;
|
@@ -12567,7 +12690,7 @@ var EntityFinder = class {
|
|
12567
12690
|
}
|
12568
12691
|
ifEntityWithTypeParametersThenParameters(entity) {
|
12569
12692
|
switch (entity.kind) {
|
12570
|
-
case 1 /*
|
12693
|
+
case 1 /* Function */:
|
12571
12694
|
return entity.getTypeParameters();
|
12572
12695
|
case 2 /* Type */: {
|
12573
12696
|
if (entity.typeEntityKind !== 2 /* Parameter */) {
|
@@ -13161,7 +13284,7 @@ var LanguageServer = class {
|
|
13161
13284
|
}
|
13162
13285
|
convertSourceFileItemKind(kind) {
|
13163
13286
|
switch (kind) {
|
13164
|
-
case 4 /*
|
13287
|
+
case 4 /* PackageFunction */:
|
13165
13288
|
return ls3.SymbolKind.Function;
|
13166
13289
|
case 1 /* PackageVariable */:
|
13167
13290
|
case 2 /* PackageVariableGetter */:
|
@@ -13169,23 +13292,23 @@ var LanguageServer = class {
|
|
13169
13292
|
return ls3.SymbolKind.Variable;
|
13170
13293
|
case 5 /* StructuredType */:
|
13171
13294
|
return ls3.SymbolKind.Class;
|
13172
|
-
case 12 /*
|
13295
|
+
case 12 /* Field */:
|
13173
13296
|
return ls3.SymbolKind.Field;
|
13174
|
-
case 13 /*
|
13175
|
-
case 14 /*
|
13297
|
+
case 13 /* FieldGetter */:
|
13298
|
+
case 14 /* FieldSetter */:
|
13176
13299
|
return ls3.SymbolKind.Property;
|
13177
|
-
case 15 /*
|
13300
|
+
case 15 /* Method */:
|
13178
13301
|
return ls3.SymbolKind.Method;
|
13179
|
-
case 10 /*
|
13302
|
+
case 10 /* Constructor */:
|
13180
13303
|
return ls3.SymbolKind.Constructor;
|
13181
|
-
case 11 /*
|
13304
|
+
case 11 /* Destructor */:
|
13182
13305
|
return ls3.SymbolKind.Method;
|
13183
|
-
case 16 /*
|
13184
|
-
case 17 /*
|
13306
|
+
case 16 /* IndexedElementGetter */:
|
13307
|
+
case 17 /* IndexedElementSetter */:
|
13185
13308
|
return ls3.SymbolKind.Property;
|
13186
13309
|
case 18 /* TypeParameter */:
|
13187
13310
|
return ls3.SymbolKind.TypeParameter;
|
13188
|
-
case 19 /*
|
13311
|
+
case 19 /* NestedFunction */:
|
13189
13312
|
return ls3.SymbolKind.Function;
|
13190
13313
|
case 7 /* VariantType */:
|
13191
13314
|
return ls3.SymbolKind.Enum;
|
@@ -13193,7 +13316,7 @@ var LanguageServer = class {
|
|
13193
13316
|
return ls3.SymbolKind.EnumMember;
|
13194
13317
|
case 8 /* InvalidType */:
|
13195
13318
|
return ls3.SymbolKind.Class;
|
13196
|
-
case 6 /*
|
13319
|
+
case 6 /* FunctionType */:
|
13197
13320
|
return ls3.SymbolKind.Class;
|
13198
13321
|
case 0 /* PackageAlias */:
|
13199
13322
|
return ls3.SymbolKind.Module;
|
@@ -13501,25 +13624,25 @@ ${e}`);
|
|
13501
13624
|
return ls3.CompletionItemKind.Module;
|
13502
13625
|
case 1 /* PackageAlias */:
|
13503
13626
|
return ls3.CompletionItemKind.Module;
|
13504
|
-
case 2 /*
|
13627
|
+
case 2 /* Field */:
|
13505
13628
|
return ls3.CompletionItemKind.Property;
|
13506
|
-
case 3 /*
|
13629
|
+
case 3 /* Method */:
|
13507
13630
|
return ls3.CompletionItemKind.Method;
|
13508
|
-
case 5 /*
|
13631
|
+
case 5 /* Indexer */:
|
13509
13632
|
return ls3.CompletionItemKind.Property;
|
13510
|
-
case 6 /*
|
13633
|
+
case 6 /* Constructor */:
|
13511
13634
|
return ls3.CompletionItemKind.Constructor;
|
13512
13635
|
case 12 /* Variant */:
|
13513
13636
|
return ls3.CompletionItemKind.EnumMember;
|
13514
13637
|
case 7 /* PackageVariable */:
|
13515
13638
|
return ls3.CompletionItemKind.Variable;
|
13516
|
-
case 8 /*
|
13639
|
+
case 8 /* PackageFunction */:
|
13517
13640
|
return ls3.CompletionItemKind.Function;
|
13518
13641
|
case 9 /* LocalVariable */:
|
13519
13642
|
return ls3.CompletionItemKind.Variable;
|
13520
13643
|
case 10 /* ParameterVariable */:
|
13521
13644
|
return ls3.CompletionItemKind.Variable;
|
13522
|
-
case 11 /*
|
13645
|
+
case 11 /* NestedFunction */:
|
13523
13646
|
return ls3.CompletionItemKind.Function;
|
13524
13647
|
case 13 /* RefObjectType */:
|
13525
13648
|
return ls3.CompletionItemKind.Class;
|
@@ -13531,7 +13654,7 @@ ${e}`);
|
|
13531
13654
|
return ls3.CompletionItemKind.Enum;
|
13532
13655
|
case 17 /* TypeParameter */:
|
13533
13656
|
return ls3.CompletionItemKind.TypeParameter;
|
13534
|
-
case 18 /*
|
13657
|
+
case 18 /* FunctionType */:
|
13535
13658
|
return ls3.CompletionItemKind.Function;
|
13536
13659
|
case 19 /* AliasType */:
|
13537
13660
|
return ls3.CompletionItemKind.Class;
|
@@ -13617,7 +13740,7 @@ ${e}`);
|
|
13617
13740
|
}
|
13618
13741
|
convertSemanticTokenKind(kind) {
|
13619
13742
|
switch (kind) {
|
13620
|
-
case 0 /*
|
13743
|
+
case 0 /* FunctionBlockLiteralParameter */:
|
13621
13744
|
return "keyword.art";
|
13622
13745
|
case 1 /* SpecialVariable */:
|
13623
13746
|
return "keyword.art";
|
@@ -13625,11 +13748,11 @@ ${e}`);
|
|
13625
13748
|
return "keyword.art";
|
13626
13749
|
case 3 /* Variant */:
|
13627
13750
|
return ls3.SemanticTokenTypes.enumMember;
|
13628
|
-
case 4 /*
|
13751
|
+
case 4 /* PackageFunction */:
|
13629
13752
|
return ls3.SemanticTokenTypes.function;
|
13630
|
-
case 5 /*
|
13753
|
+
case 5 /* NestedFunction */:
|
13631
13754
|
return ls3.SemanticTokenTypes.function;
|
13632
|
-
case 6 /*
|
13755
|
+
case 6 /* Method */:
|
13633
13756
|
return ls3.SemanticTokenTypes.method;
|
13634
13757
|
case 7 /* Operator */:
|
13635
13758
|
return ls3.SemanticTokenTypes.operator;
|