@artel/artc 0.6.25235 → 0.6.25237
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 +2 -2
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +355 -355
- package/build/{chunk-WCUH2V67.js → chunk-EKYI2NSW.js} +2 -2
- package/build/{chunk-PGJQFLPG.js → chunk-PDVQZURU.js} +1417 -1385
- package/build/{chunk-CJSS6VI7.js → chunk-VCUYTN3R.js} +1 -1
- package/build/types/diagnostic/DiagnosticCode.d.ts +1 -0
- package/build/types/project/configuration/types/PackageConfigurationEn.d.ts +3 -3
- package/build/types/project/configuration/types/PackageConfigurationRu.d.ts +3 -3
- package/build/types/tree/NodeKind.d.ts +104 -104
- package/build/types/tree/green/Nodes.d.ts +36 -34
- package/build/types/tree/red/Nodes.d.ts +35 -34
- package/package.json +1 -1
package/build/api/ApiServices.js
CHANGED
@@ -182,7 +182,7 @@ import {
|
|
182
182
|
unwrapParenthesizedExpressions,
|
183
183
|
visitChildren,
|
184
184
|
yieldExecution
|
185
|
-
} from "../chunk-
|
185
|
+
} from "../chunk-PDVQZURU.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 !==
|
305
|
+
if (assignmentNode.left.kind !== 76 /* MemberAccessExpression */) {
|
306
306
|
return void 0;
|
307
307
|
}
|
308
308
|
const propertyReceiver = assignmentNode.left.expression;
|
@@ -319,7 +319,7 @@ var AddPropertyAssignmentService = class {
|
|
319
319
|
const reassignmentText = `${leftValueText} = ${value}`;
|
320
320
|
const subprogramBody = this.ifShouldBeAssignedAtTheEndOfSubprogramThenBody(assignmentNode);
|
321
321
|
if (subprogramBody !== void 0) {
|
322
|
-
const lastStatement = subprogramBody.expressionOrStatementList.kind ===
|
322
|
+
const lastStatement = subprogramBody.expressionOrStatementList.kind === 90 /* StatementList */ ? subprogramBody.expressionOrStatementList?.statements.last() : subprogramBody.expressionOrStatementList;
|
323
323
|
let editRangeStart;
|
324
324
|
let indentationText;
|
325
325
|
if (lastStatement !== void 0) {
|
@@ -351,9 +351,9 @@ var AddPropertyAssignmentService = class {
|
|
351
351
|
ifShouldBeAssignedAtTheEndOfSubprogramThenBody(node) {
|
352
352
|
const parent = node.parent.parent;
|
353
353
|
switch (parent.kind) {
|
354
|
-
case
|
354
|
+
case 91 /* StatementBlock */:
|
355
355
|
return this.getContainingSubprogram(parent)?.block;
|
356
|
-
case
|
356
|
+
case 92 /* FunctionBlock */:
|
357
357
|
return void 0;
|
358
358
|
default:
|
359
359
|
Debug.never(parent);
|
@@ -372,23 +372,23 @@ var AddPropertyAssignmentService = class {
|
|
372
372
|
};
|
373
373
|
function isSubprogramDeclaration(node) {
|
374
374
|
switch (node.kind) {
|
375
|
-
case
|
376
|
-
case
|
377
|
-
case
|
378
|
-
case
|
379
|
-
case
|
380
|
-
case
|
381
|
-
case
|
382
|
-
case
|
383
|
-
case
|
384
|
-
case
|
385
|
-
case
|
386
|
-
case
|
387
|
-
case
|
388
|
-
case
|
389
|
-
case
|
390
|
-
case
|
391
|
-
case
|
375
|
+
case 23 /* PackageConstructorDeclaration */:
|
376
|
+
case 24 /* PackageEntryPointDeclaration */:
|
377
|
+
case 25 /* PackageFunctionDeclaration */:
|
378
|
+
case 34 /* PackageVariableGetterDeclaration */:
|
379
|
+
case 35 /* PackageVariableSetterDeclaration */:
|
380
|
+
case 43 /* ConstructorDeclaration */:
|
381
|
+
case 44 /* DestructorDeclaration */:
|
382
|
+
case 45 /* IndexedElementGetterDeclaration */:
|
383
|
+
case 46 /* IndexedElementSetterDeclaration */:
|
384
|
+
case 48 /* DereferencedVariableGetterDeclaration */:
|
385
|
+
case 49 /* DereferencedVariableSetterDeclaration */:
|
386
|
+
case 50 /* MethodDeclaration */:
|
387
|
+
case 53 /* FieldGetterDeclaration */:
|
388
|
+
case 54 /* FieldSetterDeclaration */:
|
389
|
+
case 56 /* NestedFunctionDeclaration */:
|
390
|
+
case 65 /* FunctionBlockLiteral */:
|
391
|
+
case 72 /* FunctionLiteral */:
|
392
392
|
return true;
|
393
393
|
default:
|
394
394
|
Debug.typeIsAssignableTo();
|
@@ -1619,10 +1619,10 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1619
1619
|
return true;
|
1620
1620
|
case 15 /* AnonymousTypeSpecifier */: {
|
1621
1621
|
switch (node.typeDeclaration.body.kind) {
|
1622
|
-
case
|
1622
|
+
case 27 /* FunctionTypeDeclarationBody */:
|
1623
1623
|
return true;
|
1624
|
-
case
|
1625
|
-
case
|
1624
|
+
case 32 /* StructuredTypeDeclarationBody */:
|
1625
|
+
case 37 /* VariantTypeDeclarationBody */:
|
1626
1626
|
return false;
|
1627
1627
|
default:
|
1628
1628
|
Debug.never(node.typeDeclaration.body);
|
@@ -1645,10 +1645,10 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1645
1645
|
return true;
|
1646
1646
|
case 15 /* AnonymousTypeSpecifier */: {
|
1647
1647
|
switch (node.typeDeclaration.body.kind) {
|
1648
|
-
case
|
1648
|
+
case 27 /* FunctionTypeDeclarationBody */:
|
1649
1649
|
return true;
|
1650
|
-
case
|
1651
|
-
case
|
1650
|
+
case 32 /* StructuredTypeDeclarationBody */:
|
1651
|
+
case 37 /* VariantTypeDeclarationBody */:
|
1652
1652
|
return false;
|
1653
1653
|
default:
|
1654
1654
|
Debug.never(node.typeDeclaration.body);
|
@@ -1697,7 +1697,7 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1697
1697
|
this.writeNodeDefault(node);
|
1698
1698
|
}
|
1699
1699
|
writeDeclarationBody(node, addLeadingNewLineOrWhitespace = true) {
|
1700
|
-
if (node.expressionOrStatementList.kind !==
|
1700
|
+
if (node.expressionOrStatementList.kind !== 90 /* StatementList */ || node.expressionOrStatementList.elements.length === 0) {
|
1701
1701
|
this.writeWhitespace();
|
1702
1702
|
this.writeFunctionBlock(node, false);
|
1703
1703
|
} else {
|
@@ -2010,36 +2010,36 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
2010
2010
|
[13 /* ParenthesizedTypeSpecifier */]: this.prototype.writeParenthesizedTypeSpecifier,
|
2011
2011
|
[14 /* NullableTypeSpecifier */]: this.prototype.writeNullableTypeSpecifier,
|
2012
2012
|
[15 /* AnonymousTypeSpecifier */]: this.prototype.writeAnonymousTypeSpecifier,
|
2013
|
-
[
|
2014
|
-
[
|
2015
|
-
[
|
2016
|
-
[
|
2017
|
-
[
|
2018
|
-
[
|
2019
|
-
[
|
2020
|
-
[
|
2021
|
-
[
|
2022
|
-
[
|
2023
|
-
[
|
2024
|
-
[
|
2025
|
-
[
|
2026
|
-
[
|
2027
|
-
[
|
2028
|
-
[
|
2029
|
-
[
|
2030
|
-
[
|
2031
|
-
[
|
2032
|
-
[
|
2033
|
-
[
|
2034
|
-
[
|
2035
|
-
[
|
2036
|
-
[
|
2037
|
-
[
|
2038
|
-
[
|
2039
|
-
[
|
2040
|
-
[
|
2041
|
-
[
|
2042
|
-
[
|
2013
|
+
[20 /* PackageAliasTypeDeclaration */]: this.prototype.writePackageAliasTypeDeclaration,
|
2014
|
+
[22 /* PackageMemberGroupDeclaration */]: this.prototype.writePackageMemberGroupDeclaration,
|
2015
|
+
[23 /* PackageConstructorDeclaration */]: this.prototype.writePackageConstructorDeclaration,
|
2016
|
+
[24 /* PackageEntryPointDeclaration */]: this.prototype.writePackageEntryPointDeclaration,
|
2017
|
+
[25 /* PackageFunctionDeclaration */]: this.prototype.writePackageFunctionDeclaration,
|
2018
|
+
[26 /* PackageFunctionTypeDeclaration */]: this.prototype.writePackageFunctionTypeDeclaration,
|
2019
|
+
[27 /* FunctionTypeDeclarationBody */]: this.prototype.writeFunctionTypeDeclarationBody,
|
2020
|
+
[28 /* BaseTypeList */]: this.prototype.writeBaseTypeList,
|
2021
|
+
[30 /* TypeMemberDeclarationBlock */]: this.prototype.writeTypeMemberDeclarationBlock,
|
2022
|
+
[31 /* PackageStructuredTypeDeclaration */]: this.prototype.writePackageStructuredTypeDeclaration,
|
2023
|
+
[32 /* StructuredTypeDeclarationBody */]: this.prototype.writeStructuredTypeDeclarationBody,
|
2024
|
+
[33 /* PackageVariableDeclaration */]: this.prototype.writePackageVariableDeclaration,
|
2025
|
+
[34 /* PackageVariableGetterDeclaration */]: this.prototype.writePackageVariableGetterDeclaration,
|
2026
|
+
[35 /* PackageVariableSetterDeclaration */]: this.prototype.writePackageVariableSetterDeclaration,
|
2027
|
+
[36 /* PackageVariantTypeDeclaration */]: this.prototype.writePackageVariantTypeDeclaration,
|
2028
|
+
[37 /* VariantTypeDeclarationBody */]: this.prototype.writeVariantTypeDeclarationBody,
|
2029
|
+
[42 /* TypeMemberGroupDeclaration */]: this.prototype.writeTypeMemberGroupDeclaration,
|
2030
|
+
[43 /* ConstructorDeclaration */]: this.prototype.writeConstructorDeclaration,
|
2031
|
+
[44 /* DestructorDeclaration */]: this.prototype.writeDestructorDeclaration,
|
2032
|
+
[45 /* IndexedElementGetterDeclaration */]: this.prototype.writeIndexedElementGetterDeclaration,
|
2033
|
+
[46 /* IndexedElementSetterDeclaration */]: this.prototype.writeIndexedElementSetterDeclaration,
|
2034
|
+
[48 /* DereferencedVariableGetterDeclaration */]: this.prototype.writeDereferencedVariableGetterDeclaration,
|
2035
|
+
[49 /* DereferencedVariableSetterDeclaration */]: this.prototype.writeDereferencedVariableSetterDeclaration,
|
2036
|
+
[50 /* MethodDeclaration */]: this.prototype.writeMethodDeclaration,
|
2037
|
+
[51 /* OperatorDeclaration */]: this.prototype.writeOperatorDeclaration,
|
2038
|
+
[52 /* FieldDeclaration */]: this.prototype.writeFieldDeclaration,
|
2039
|
+
[53 /* FieldGetterDeclaration */]: this.prototype.writeFieldGetterDeclaration,
|
2040
|
+
[54 /* FieldSetterDeclaration */]: this.prototype.writeFieldSetterDeclaration,
|
2041
|
+
[91 /* StatementBlock */]: this.prototype.writeStatementBlock,
|
2042
|
+
[92 /* FunctionBlock */]: this.prototype.writeFunctionBlock,
|
2043
2043
|
[135 /* QualifiedName */]: this.prototype.writeQualifiedName,
|
2044
2044
|
[142 /* VariantDeclaration */]: this.prototype.writeVariantDeclaration,
|
2045
2045
|
[143 /* TypeParameterDeclaration */]: this.prototype.writeTypeParameterDeclaration,
|
@@ -2057,80 +2057,80 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
2057
2057
|
[6 /* PackageGroupImportDirective */]: this.prototype.writeNodeDefault,
|
2058
2058
|
[7 /* PackageImportList */]: this.prototype.writeNodeDefault,
|
2059
2059
|
[16 /* InvalidTypeSpecifier */]: this.prototype.writeNodeDefault,
|
2060
|
-
[
|
2061
|
-
[
|
2062
|
-
[
|
2063
|
-
[
|
2064
|
-
[
|
2065
|
-
[
|
2066
|
-
[
|
2067
|
-
[
|
2068
|
-
[
|
2069
|
-
[
|
2070
|
-
[
|
2071
|
-
[
|
2072
|
-
[
|
2073
|
-
[
|
2074
|
-
[
|
2075
|
-
[
|
2076
|
-
[
|
2077
|
-
[
|
2078
|
-
[
|
2079
|
-
[
|
2080
|
-
[
|
2081
|
-
[
|
2082
|
-
[
|
2083
|
-
[
|
2084
|
-
[
|
2085
|
-
[
|
2086
|
-
[
|
2087
|
-
[
|
2088
|
-
[
|
2089
|
-
[
|
2090
|
-
[
|
2091
|
-
[
|
2092
|
-
[
|
2093
|
-
[
|
2094
|
-
[
|
2095
|
-
[
|
2096
|
-
[
|
2097
|
-
[
|
2098
|
-
[
|
2099
|
-
[
|
2100
|
-
[
|
2101
|
-
[
|
2102
|
-
[
|
2103
|
-
[
|
2104
|
-
[
|
2105
|
-
[
|
2106
|
-
[
|
2107
|
-
[
|
2108
|
-
[
|
2109
|
-
[
|
2110
|
-
[
|
2111
|
-
[
|
2112
|
-
[
|
2113
|
-
[
|
2114
|
-
[
|
2115
|
-
[
|
2116
|
-
[
|
2117
|
-
[
|
2118
|
-
[
|
2119
|
-
[
|
2120
|
-
[
|
2121
|
-
[
|
2122
|
-
[
|
2123
|
-
[
|
2124
|
-
[
|
2125
|
-
[
|
2126
|
-
[
|
2127
|
-
[
|
2128
|
-
[
|
2129
|
-
[
|
2130
|
-
[
|
2131
|
-
[
|
2132
|
-
[
|
2133
|
-
[
|
2060
|
+
[123 /* TopLevelTranslationList */]: this.prototype.writeNodeDefault,
|
2061
|
+
[122 /* TranslationsDeclaration */]: this.prototype.writeTranslationsDeclaration,
|
2062
|
+
[21 /* AliasTypeDeclarationBody */]: this.prototype.writeNodeDefault,
|
2063
|
+
[29 /* TypeMemberDeclarationList */]: this.prototype.writeNodeDefault,
|
2064
|
+
[38 /* TypeExtensionDeclaration */]: this.prototype.writeNodeDefault,
|
2065
|
+
[39 /* ExtendedTypeClauseCommaList */]: this.prototype.writeNodeDefault,
|
2066
|
+
[40 /* ExtendedTypeClause */]: this.prototype.writeNodeDefault,
|
2067
|
+
[41 /* InvalidPackageMemberDeclaration */]: this.prototype.writeNodeDefault,
|
2068
|
+
[47 /* IndexParameterClause */]: this.prototype.writeNodeDefault,
|
2069
|
+
[55 /* InvalidTypeMemberDeclaration */]: this.prototype.writeNodeDefault,
|
2070
|
+
[56 /* NestedFunctionDeclaration */]: this.prototype.writeNodeDefault,
|
2071
|
+
[57 /* LocalVariableDeclaration */]: this.prototype.writeNodeDefault,
|
2072
|
+
[58 /* EnumerationVariableDeclaration */]: this.prototype.writeNodeDefault,
|
2073
|
+
[59 /* ArrayLiteral */]: this.prototype.writeNodeDefault,
|
2074
|
+
[60 /* ArrayLiteralElementList */]: this.prototype.writeNodeDefault,
|
2075
|
+
[61 /* AssertionExpression */]: this.prototype.writeNodeDefault,
|
2076
|
+
[62 /* AssumptionExpression */]: this.prototype.writeNodeDefault,
|
2077
|
+
[63 /* AsExpression */]: this.prototype.writeNodeDefault,
|
2078
|
+
[64 /* BinaryExpression */]: this.prototype.writeNodeDefault,
|
2079
|
+
[65 /* FunctionBlockLiteral */]: this.prototype.writeNodeDefault,
|
2080
|
+
[66 /* ArgumentList */]: this.prototype.writeNodeDefault,
|
2081
|
+
[67 /* CallExpression */]: this.prototype.writeNodeDefault,
|
2082
|
+
[68 /* AutotypeCallExpression */]: this.prototype.writeNodeDefault,
|
2083
|
+
[69 /* IndexedAccessExpression */]: this.prototype.writeNodeDefault,
|
2084
|
+
[70 /* InvalidExpression */]: this.prototype.writeNodeDefault,
|
2085
|
+
[71 /* IsExpression */]: this.prototype.writeNodeDefault,
|
2086
|
+
[72 /* FunctionLiteral */]: this.prototype.writeNodeDefault,
|
2087
|
+
[73 /* ParenthesizedExpression */]: this.prototype.writeNodeDefault,
|
2088
|
+
[74 /* ConditionalExpression */]: this.prototype.writeNodeDefault,
|
2089
|
+
[75 /* PrefixUnaryExpression */]: this.prototype.writeNodeDefault,
|
2090
|
+
[76 /* MemberAccessExpression */]: this.prototype.writeNodeDefault,
|
2091
|
+
[77 /* ReferenceExpression */]: this.prototype.writeNodeDefault,
|
2092
|
+
[78 /* DereferenceExpression */]: this.prototype.writeNodeDefault,
|
2093
|
+
[79 /* TextTemplateLiteral */]: this.prototype.writeNodeDefault,
|
2094
|
+
[80 /* TextTemplateSpanList */]: this.prototype.writeNodeDefault,
|
2095
|
+
[81 /* TextTemplateSpan */]: this.prototype.writeNodeDefault,
|
2096
|
+
[82 /* TokenExpression */]: this.prototype.writeNodeDefault,
|
2097
|
+
[83 /* KeywordExpression */]: this.prototype.writeNodeDefault,
|
2098
|
+
[84 /* ObjectExpression */]: this.prototype.writeNodeDefault,
|
2099
|
+
[85 /* BaseExpression */]: this.prototype.writeNodeDefault,
|
2100
|
+
[86 /* IdentifierExpression */]: this.prototype.writeNodeDefault,
|
2101
|
+
[87 /* GenericSpecializationExpression */]: this.prototype.writeNodeDefault,
|
2102
|
+
[88 /* DefaultMatchExpression */]: this.prototype.writeNodeDefault,
|
2103
|
+
[89 /* AssignmentStatement */]: this.prototype.writeNodeDefault,
|
2104
|
+
[90 /* StatementList */]: this.prototype.writeNodeDefault,
|
2105
|
+
[93 /* BreakLoopStatement */]: this.prototype.writeNodeDefault,
|
2106
|
+
[94 /* ContinueLoopStatement */]: this.prototype.writeNodeDefault,
|
2107
|
+
[95 /* DisposeStatement */]: this.prototype.writeNodeDefault,
|
2108
|
+
[96 /* RunStatement */]: this.prototype.writeNodeDefault,
|
2109
|
+
[97 /* TryStatement */]: this.prototype.writeNodeDefault,
|
2110
|
+
[98 /* CatchClause */]: this.prototype.writeNodeDefault,
|
2111
|
+
[99 /* ErrorVariableDeclaration */]: this.prototype.writeNodeDefault,
|
2112
|
+
[100 /* FinallyClause */]: this.prototype.writeNodeDefault,
|
2113
|
+
[101 /* EmptyStatement */]: this.prototype.writeNodeDefault,
|
2114
|
+
[102 /* ErrorStatement */]: this.prototype.writeNodeDefault,
|
2115
|
+
[103 /* ImportantStatement */]: this.prototype.writeNodeDefault,
|
2116
|
+
[104 /* ExpressionStatement */]: this.prototype.writeNodeDefault,
|
2117
|
+
[105 /* EnumerationVariableList */]: this.prototype.writeNodeDefault,
|
2118
|
+
[106 /* ForStatement */]: this.prototype.writeNodeDefault,
|
2119
|
+
[107 /* IfStatement */]: this.prototype.writeNodeDefault,
|
2120
|
+
[108 /* ElseIfClauseList */]: this.prototype.writeNodeDefault,
|
2121
|
+
[109 /* ElseIfClause */]: this.prototype.writeNodeDefault,
|
2122
|
+
[110 /* ElseClause */]: this.prototype.writeNodeDefault,
|
2123
|
+
[111 /* InvalidStatement */]: this.prototype.writeNodeDefault,
|
2124
|
+
[112 /* NestedFunctionDeclarationStatement */]: this.prototype.writeNodeDefault,
|
2125
|
+
[113 /* LocalVariableDeclarationStatement */]: this.prototype.writeNodeDefault,
|
2126
|
+
[114 /* LoopStatement */]: this.prototype.writeNodeDefault,
|
2127
|
+
[115 /* ReturnStatement */]: this.prototype.writeNodeDefault,
|
2128
|
+
[116 /* CaseClauseList */]: this.prototype.writeNodeDefault,
|
2129
|
+
[117 /* SwitchStatement */]: this.prototype.writeNodeDefault,
|
2130
|
+
[118 /* MatchExpressionList */]: this.prototype.writeNodeDefault,
|
2131
|
+
[119 /* CaseClause */]: this.prototype.writeNodeDefault,
|
2132
|
+
[120 /* WhileStatement */]: this.prototype.writeNodeDefault,
|
2133
|
+
[121 /* YieldStatement */]: this.prototype.writeNodeDefault,
|
2134
2134
|
[124 /* TranslationParameterList */]: this.prototype.writeNodeDefault,
|
2135
2135
|
[125 /* TranslationParameterClause */]: this.prototype.writeTranslationParameterClause,
|
2136
2136
|
[126 /* ConstructorTranslation */]: this.prototype.writeConstructorTranslation,
|
@@ -2348,7 +2348,7 @@ var TranslationsGenerationService = class {
|
|
2348
2348
|
result = generator.generateMissingTypeMemberTranslations(tokenOrKeyword.parent);
|
2349
2349
|
}
|
2350
2350
|
}
|
2351
|
-
if (result === void 0 && tokenOrKeyword.isKeyword(55 /* Translations */) && tokenOrKeyword.parent.kind ===
|
2351
|
+
if (result === void 0 && tokenOrKeyword.isKeyword(55 /* Translations */) && tokenOrKeyword.parent.kind === 122 /* TranslationsDeclaration */) {
|
2352
2352
|
const translationPackage = analyzer.getAnalyzedTranslationPackageIfTargetResolved(sourceFile.package);
|
2353
2353
|
if (translationPackage !== void 0) {
|
2354
2354
|
const generator = new TranslationsGenerator(
|
@@ -2374,7 +2374,7 @@ var TranslationsGenerationService = class {
|
|
2374
2374
|
if (tokenOrKeyword === void 0) {
|
2375
2375
|
return false;
|
2376
2376
|
}
|
2377
|
-
if (!(tokenOrKeyword.isKeyword(55 /* Translations */) && tokenOrKeyword.parent.kind ===
|
2377
|
+
if (!(tokenOrKeyword.isKeyword(55 /* Translations */) && tokenOrKeyword.parent.kind === 122 /* TranslationsDeclaration */)) {
|
2378
2378
|
return false;
|
2379
2379
|
}
|
2380
2380
|
const translationPackage = analyzer.getAnalyzedTranslationPackageIfTargetResolved(sourceFile.package);
|
@@ -2542,7 +2542,7 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2542
2542
|
indentationStepSize = tryDetectIndentationStepSizeUsingTypeTranslation(node, this._sourceFile);
|
2543
2543
|
}
|
2544
2544
|
if (indentationStepSize === void 0) {
|
2545
|
-
const translationsDeclarations = node.kind ===
|
2545
|
+
const translationsDeclarations = node.kind === 122 /* TranslationsDeclaration */ ? node : node.parent.parent;
|
2546
2546
|
for (const member of translationsDeclarations.translationList.translationDeclarations) {
|
2547
2547
|
if (member.kind === 139 /* TypeTranslation */) {
|
2548
2548
|
indentationStepSize = tryDetectIndentationStepSizeUsingTypeTranslation(member, this._sourceFile);
|
@@ -2825,11 +2825,11 @@ var ValueArgumentFactory = class _ValueArgumentFactory {
|
|
2825
2825
|
var SignatureForNode = class _SignatureForNode {
|
2826
2826
|
static getSignaturesForNode(analyzer, node) {
|
2827
2827
|
switch (node.kind) {
|
2828
|
-
case
|
2828
|
+
case 67 /* CallExpression */:
|
2829
2829
|
return _SignatureForNode.getSignaturesForCallExpression(analyzer, node);
|
2830
|
-
case
|
2830
|
+
case 68 /* AutotypeCallExpression */:
|
2831
2831
|
return _SignatureForNode.getSignaturesForAutotypeCallExpression(analyzer, node);
|
2832
|
-
case
|
2832
|
+
case 69 /* IndexedAccessExpression */:
|
2833
2833
|
return _SignatureForNode.getSignaturesForIndexedAccessExpression(analyzer, node);
|
2834
2834
|
case 147 /* Tag */:
|
2835
2835
|
return _SignatureForNode.getSignaturesForTag(analyzer, node);
|
@@ -2969,7 +2969,7 @@ var SimplifiedOverloadResolver = class _SimplifiedOverloadResolver {
|
|
2969
2969
|
result = false;
|
2970
2970
|
break;
|
2971
2971
|
}
|
2972
|
-
if (argument.expression === void 0 || argument.expression.kind ===
|
2972
|
+
if (argument.expression === void 0 || argument.expression.kind === 70 /* InvalidExpression */) {
|
2973
2973
|
continue;
|
2974
2974
|
}
|
2975
2975
|
const targetParameterType = targetParameter.getType();
|
@@ -3207,7 +3207,7 @@ var CompletionService = class {
|
|
3207
3207
|
if (syntaxContext.isInComment || syntaxContext.isInStringOrChar) {
|
3208
3208
|
return { kind: "none" };
|
3209
3209
|
}
|
3210
|
-
if (syntaxContext.isInQuotedIdentifier !== void 0 && (syntaxContext.isInQuotedIdentifier.parent.kind ===
|
3210
|
+
if (syntaxContext.isInQuotedIdentifier !== void 0 && (syntaxContext.isInQuotedIdentifier.parent.kind === 51 /* OperatorDeclaration */ || syntaxContext.isInQuotedIdentifier.parent.kind === 50 /* MethodDeclaration */)) {
|
3211
3211
|
return new OperatorNameCompletionContext(syntaxContext.isInQuotedIdentifier);
|
3212
3212
|
}
|
3213
3213
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
@@ -3225,7 +3225,7 @@ var CompletionService = class {
|
|
3225
3225
|
if (tokenOrKeyword.isToken(44 /* OpenBrace */) && tokenOrKeyword.parent.kind === 6 /* PackageGroupImportDirective */ || this.tokenOrKeywordIsPackageImportListChild(tokenOrKeyword)) {
|
3226
3226
|
return new PackageImportCompletionContext([], void 0);
|
3227
3227
|
}
|
3228
|
-
if (tokenOrKeyword.isToken(27 /* Dot */) && tokenOrKeyword.parent.kind ===
|
3228
|
+
if (tokenOrKeyword.isToken(27 /* Dot */) && tokenOrKeyword.parent.kind === 76 /* MemberAccessExpression */) {
|
3229
3229
|
const memberAccess = tokenOrKeyword.parent;
|
3230
3230
|
{
|
3231
3231
|
const info = this._analyzer.checkExpressionDenotesPackageNameSegment(memberAccess.expression);
|
@@ -3273,7 +3273,7 @@ var CompletionService = class {
|
|
3273
3273
|
);
|
3274
3274
|
if (segmentIndex < resolutionResult.resolvedQualifiers.length) {
|
3275
3275
|
let completionInIsOrAsExpressionInfo;
|
3276
|
-
if (namedTypeSpecifier.parent.kind ===
|
3276
|
+
if (namedTypeSpecifier.parent.kind === 71 /* IsExpression */ || namedTypeSpecifier.parent.kind === 63 /* AsExpression */) {
|
3277
3277
|
completionInIsOrAsExpressionInfo = {
|
3278
3278
|
expressionType: this._analyzer.type.ofExpression(namedTypeSpecifier.parent.expression)
|
3279
3279
|
};
|
@@ -3345,7 +3345,7 @@ var CompletionService = class {
|
|
3345
3345
|
}
|
3346
3346
|
if (syntaxContext.isUnqualifiedTypeContext !== void 0) {
|
3347
3347
|
let completionInIsOrAsExpressionInfo;
|
3348
|
-
if (tokenOrKeyword.parent.kind ===
|
3348
|
+
if (tokenOrKeyword.parent.kind === 71 /* IsExpression */ || tokenOrKeyword.parent.kind === 63 /* AsExpression */) {
|
3349
3349
|
completionInIsOrAsExpressionInfo = {
|
3350
3350
|
expressionType: this._analyzer.type.ofExpression(tokenOrKeyword.parent.expression)
|
3351
3351
|
};
|
@@ -3494,11 +3494,11 @@ var CompletionService = class {
|
|
3494
3494
|
let signatures;
|
3495
3495
|
let valueArguments;
|
3496
3496
|
switch (role.argumentList.parent.kind) {
|
3497
|
-
case
|
3497
|
+
case 67 /* CallExpression */:
|
3498
3498
|
signatures = SignatureForNode.getSignaturesForCallExpression(this._analyzer, role.argumentList.parent);
|
3499
3499
|
valueArguments = ValueArgumentFactory.createValueArgumentsOfCallExpression(role.argumentList.parent);
|
3500
3500
|
break;
|
3501
|
-
case
|
3501
|
+
case 68 /* AutotypeCallExpression */:
|
3502
3502
|
signatures = SignatureForNode.getSignaturesForAutotypeCallExpression(this._analyzer, role.argumentList.parent);
|
3503
3503
|
valueArguments = ValueArgumentFactory.createValueArgumentsOfAutotypeCallExpression(
|
3504
3504
|
role.argumentList.parent
|
@@ -3508,7 +3508,7 @@ var CompletionService = class {
|
|
3508
3508
|
signatures = SignatureForNode.getSignaturesForTag(this._analyzer, role.argumentList.parent);
|
3509
3509
|
valueArguments = ValueArgumentFactory.createValueArgumentsOfTag(role.argumentList.parent);
|
3510
3510
|
break;
|
3511
|
-
case
|
3511
|
+
case 69 /* IndexedAccessExpression */:
|
3512
3512
|
signatures = SignatureForNode.getSignaturesForIndexedAccessExpression(
|
3513
3513
|
this._analyzer,
|
3514
3514
|
role.argumentList.parent
|
@@ -3705,7 +3705,7 @@ var CompletionService = class {
|
|
3705
3705
|
if (syntaxContext.isUnqualifiedTypeContext?.allowsAnonymousTypes === true) {
|
3706
3706
|
kinds.add(5 /* PlainObject */).add(4 /* Object */).add(6 /* Variant */).add(3 /* Aspect */).add(12 /* Function */).add(40 /* Async */);
|
3707
3707
|
}
|
3708
|
-
if (positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isKeyword(40 /* Async */) && (positionDescription.tokenOrKeyword.parent.kind ===
|
3708
|
+
if (positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isKeyword(40 /* Async */) && (positionDescription.tokenOrKeyword.parent.kind === 56 /* NestedFunctionDeclaration */ || positionDescription.tokenOrKeyword.parent.kind === 72 /* FunctionLiteral */ || positionDescription.tokenOrKeyword.parent.kind === 27 /* FunctionTypeDeclarationBody */)) {
|
3709
3709
|
kinds.add(12 /* Function */);
|
3710
3710
|
}
|
3711
3711
|
return Query.from(kinds.values()).map(
|
@@ -3717,7 +3717,7 @@ var CompletionService = class {
|
|
3717
3717
|
return false;
|
3718
3718
|
}
|
3719
3719
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3720
|
-
return tokenOrKeyword.isToken(21 /* CloseBrace */) && tokenOrKeyword.parent.kind ===
|
3720
|
+
return tokenOrKeyword.isToken(21 /* CloseBrace */) && tokenOrKeyword.parent.kind === 91 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 114 /* LoopStatement */;
|
3721
3721
|
}
|
3722
3722
|
isModifierLevelContext(positionDescription) {
|
3723
3723
|
if (positionDescription.kind !== "after-token-or-keyword") {
|
@@ -3731,21 +3731,21 @@ var CompletionService = class {
|
|
3731
3731
|
return false;
|
3732
3732
|
}
|
3733
3733
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3734
|
-
return tokenOrKeyword.isToken(21 /* CloseBrace */) && tokenOrKeyword.parent.kind ===
|
3734
|
+
return tokenOrKeyword.isToken(21 /* CloseBrace */) && tokenOrKeyword.parent.kind === 91 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind === 107 /* IfStatement */ && tokenOrKeyword.parent === tokenOrKeyword.parent.parent.block || tokenOrKeyword.parent.parent.kind === 109 /* ElseIfClause */);
|
3735
3735
|
}
|
3736
3736
|
isCatchKeywordContext(positionDescription) {
|
3737
3737
|
if (positionDescription.kind !== "after-token-or-keyword") {
|
3738
3738
|
return false;
|
3739
3739
|
}
|
3740
3740
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3741
|
-
return tokenOrKeyword.isToken(21 /* CloseBrace */) && tokenOrKeyword.parent.kind ===
|
3741
|
+
return tokenOrKeyword.isToken(21 /* CloseBrace */) && tokenOrKeyword.parent.kind === 91 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 97 /* TryStatement */;
|
3742
3742
|
}
|
3743
3743
|
isFinallyKeywordContext(positionDescription) {
|
3744
3744
|
if (positionDescription.kind !== "after-token-or-keyword") {
|
3745
3745
|
return false;
|
3746
3746
|
}
|
3747
3747
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3748
|
-
return tokenOrKeyword.isToken(21 /* CloseBrace */) && tokenOrKeyword.parent.kind ===
|
3748
|
+
return tokenOrKeyword.isToken(21 /* CloseBrace */) && tokenOrKeyword.parent.kind === 91 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind === 97 /* TryStatement */ || tokenOrKeyword.parent.parent.kind === 98 /* CatchClause */);
|
3749
3749
|
}
|
3750
3750
|
isTypeKindCompletionContext(positionDescription) {
|
3751
3751
|
return positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isToken(58 /* Equals */) && NodeTypeUtils.isPackageTypeDeclaration(positionDescription.tokenOrKeyword.parent);
|
@@ -3755,17 +3755,17 @@ var CompletionService = class {
|
|
3755
3755
|
return false;
|
3756
3756
|
}
|
3757
3757
|
const token = positionDescription.tokenOrKeyword.value;
|
3758
|
-
return token.parent.kind ===
|
3758
|
+
return token.parent.kind === 58 /* EnumerationVariableDeclaration */ && (token.parent.parent.elements.length > 0 && token.parent.parent.elements[token.parent.parent.elements.length - 1] === token.parent || token.parent.parent.elements.length > 1 && token.parent.parent.elements[token.parent.parent.elements.length - 2] === token.parent);
|
3759
3759
|
}
|
3760
3760
|
isCaseKeywordContext(positionDescription, syntaxContext) {
|
3761
3761
|
if (positionDescription.kind !== "after-token-or-keyword") {
|
3762
3762
|
return false;
|
3763
3763
|
}
|
3764
3764
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3765
|
-
if (tokenOrKeyword.isToken(21 /* CloseBrace */) && tokenOrKeyword.parent.kind ===
|
3765
|
+
if (tokenOrKeyword.isToken(21 /* CloseBrace */) && tokenOrKeyword.parent.kind === 91 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 119 /* CaseClause */) {
|
3766
3766
|
return true;
|
3767
3767
|
}
|
3768
|
-
if (syntaxContext.precedingExpression !== void 0 && syntaxContext.precedingExpression.parent.kind ===
|
3768
|
+
if (syntaxContext.precedingExpression !== void 0 && syntaxContext.precedingExpression.parent.kind === 117 /* SwitchStatement */) {
|
3769
3769
|
return true;
|
3770
3770
|
}
|
3771
3771
|
return false;
|
@@ -4413,10 +4413,10 @@ function getRightmostChildExcludingValidEmptyNodes(node) {
|
|
4413
4413
|
}
|
4414
4414
|
function isInvalidNode(node) {
|
4415
4415
|
switch (node.kind) {
|
4416
|
-
case
|
4417
|
-
case
|
4418
|
-
case
|
4419
|
-
case
|
4416
|
+
case 70 /* InvalidExpression */:
|
4417
|
+
case 41 /* InvalidPackageMemberDeclaration */:
|
4418
|
+
case 111 /* InvalidStatement */:
|
4419
|
+
case 55 /* InvalidTypeMemberDeclaration */:
|
4420
4420
|
case 16 /* InvalidTypeSpecifier */:
|
4421
4421
|
return true;
|
4422
4422
|
case 0 /* Token */:
|
@@ -5273,19 +5273,19 @@ var SyntaxContextFactory = class {
|
|
5273
5273
|
}
|
5274
5274
|
static isExpressionOrStatementContext(tokenOrKeyword) {
|
5275
5275
|
if (tokenOrKeyword.isToken(58 /* Equals */)) {
|
5276
|
-
if (tokenOrKeyword.parent.kind ===
|
5276
|
+
if (tokenOrKeyword.parent.kind === 89 /* AssignmentStatement */) {
|
5277
5277
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.right);
|
5278
5278
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5279
5279
|
}
|
5280
|
-
if (tokenOrKeyword.parent.kind ===
|
5280
|
+
if (tokenOrKeyword.parent.kind === 57 /* LocalVariableDeclaration */) {
|
5281
5281
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.initializer);
|
5282
5282
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5283
5283
|
}
|
5284
|
-
if (tokenOrKeyword.parent.kind ===
|
5284
|
+
if (tokenOrKeyword.parent.kind === 33 /* PackageVariableDeclaration */) {
|
5285
5285
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.initializer);
|
5286
5286
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5287
5287
|
}
|
5288
|
-
if (tokenOrKeyword.parent.kind ===
|
5288
|
+
if (tokenOrKeyword.parent.kind === 52 /* FieldDeclaration */) {
|
5289
5289
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.initializer);
|
5290
5290
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5291
5291
|
}
|
@@ -5302,23 +5302,23 @@ var SyntaxContextFactory = class {
|
|
5302
5302
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5303
5303
|
}
|
5304
5304
|
}
|
5305
|
-
if (tokenOrKeyword.parent.kind ===
|
5305
|
+
if (tokenOrKeyword.parent.kind === 89 /* AssignmentStatement */) {
|
5306
5306
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.right);
|
5307
5307
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5308
5308
|
}
|
5309
|
-
if (tokenOrKeyword.parent.kind ===
|
5309
|
+
if (tokenOrKeyword.parent.kind === 75 /* PrefixUnaryExpression */) {
|
5310
5310
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.operand);
|
5311
5311
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5312
5312
|
}
|
5313
|
-
if (tokenOrKeyword.parent.kind ===
|
5313
|
+
if (tokenOrKeyword.parent.kind === 64 /* BinaryExpression */) {
|
5314
5314
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.right);
|
5315
5315
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5316
5316
|
}
|
5317
|
-
if (tokenOrKeyword.isToken(7 /* TextTemplateHead */) && tokenOrKeyword.parent.kind ===
|
5317
|
+
if (tokenOrKeyword.isToken(7 /* TextTemplateHead */) && tokenOrKeyword.parent.kind === 79 /* TextTemplateLiteral */) {
|
5318
5318
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.spanList.spans.at(0)?.expression);
|
5319
5319
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5320
5320
|
}
|
5321
|
-
if (tokenOrKeyword.isToken(8 /* TextTemplatePart */) && tokenOrKeyword.parent.kind ===
|
5321
|
+
if (tokenOrKeyword.isToken(8 /* TextTemplatePart */) && tokenOrKeyword.parent.kind === 81 /* TextTemplateSpan */) {
|
5322
5322
|
let expressionForTargetType;
|
5323
5323
|
const spanList = tokenOrKeyword.parent.parent;
|
5324
5324
|
const spanIndex = spanList.spans.indexOf(tokenOrKeyword.parent);
|
@@ -5330,12 +5330,12 @@ var SyntaxContextFactory = class {
|
|
5330
5330
|
isStatementContext: false
|
5331
5331
|
};
|
5332
5332
|
}
|
5333
|
-
if (tokenOrKeyword.isToken(44 /* OpenBrace */) && tokenOrKeyword.parent.kind ===
|
5333
|
+
if (tokenOrKeyword.isToken(44 /* OpenBrace */) && tokenOrKeyword.parent.kind === 91 /* StatementBlock */) {
|
5334
5334
|
return { isExpressionContext: { expressionRole: new ExpressionRole_other(void 0) }, isStatementContext: true };
|
5335
5335
|
}
|
5336
|
-
if (tokenOrKeyword.isToken(44 /* OpenBrace */) && tokenOrKeyword.parent.kind ===
|
5336
|
+
if (tokenOrKeyword.isToken(44 /* OpenBrace */) && tokenOrKeyword.parent.kind === 92 /* FunctionBlock */) {
|
5337
5337
|
const block = tokenOrKeyword.parent;
|
5338
|
-
if (block.expressionOrStatementList.kind !==
|
5338
|
+
if (block.expressionOrStatementList.kind !== 90 /* StatementList */ || block.expressionOrStatementList.statements.count() === 0) {
|
5339
5339
|
return {
|
5340
5340
|
isExpressionContext: { expressionRole: new ExpressionRole_functionBlockExpression(block) },
|
5341
5341
|
isStatementContext: true
|
@@ -5347,23 +5347,23 @@ var SyntaxContextFactory = class {
|
|
5347
5347
|
};
|
5348
5348
|
}
|
5349
5349
|
}
|
5350
|
-
if (tokenOrKeyword.isToken(52 /* Semicolon */) && tokenOrKeyword.parent.kind ===
|
5350
|
+
if (tokenOrKeyword.isToken(52 /* Semicolon */) && tokenOrKeyword.parent.kind === 90 /* StatementList */) {
|
5351
5351
|
return { isExpressionContext: { expressionRole: new ExpressionRole_other(void 0) }, isStatementContext: true };
|
5352
5352
|
}
|
5353
5353
|
if (tokenOrKeyword.isToken(45 /* OpenParenthesis */)) {
|
5354
|
-
if (tokenOrKeyword.parent.kind ===
|
5354
|
+
if (tokenOrKeyword.parent.kind === 73 /* ParenthesizedExpression */) {
|
5355
5355
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5356
5356
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5357
5357
|
}
|
5358
|
-
if (tokenOrKeyword.parent.kind ===
|
5358
|
+
if (tokenOrKeyword.parent.kind === 77 /* ReferenceExpression */) {
|
5359
5359
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5360
5360
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5361
5361
|
}
|
5362
|
-
if (tokenOrKeyword.parent.kind ===
|
5362
|
+
if (tokenOrKeyword.parent.kind === 67 /* CallExpression */) {
|
5363
5363
|
const expressionRole = new ExpressionRole_argument(tokenOrKeyword.parent.argumentList, 0);
|
5364
5364
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5365
5365
|
}
|
5366
|
-
if (tokenOrKeyword.parent.kind ===
|
5366
|
+
if (tokenOrKeyword.parent.kind === 68 /* AutotypeCallExpression */) {
|
5367
5367
|
const expressionRole = new ExpressionRole_argument(tokenOrKeyword.parent.argumentList, 0);
|
5368
5368
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5369
5369
|
}
|
@@ -5374,21 +5374,21 @@ var SyntaxContextFactory = class {
|
|
5374
5374
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5375
5375
|
}
|
5376
5376
|
}
|
5377
|
-
if (tokenOrKeyword.parent.kind ===
|
5377
|
+
if (tokenOrKeyword.parent.kind === 74 /* ConditionalExpression */) {
|
5378
5378
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5379
5379
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5380
5380
|
}
|
5381
5381
|
}
|
5382
|
-
if (tokenOrKeyword.isToken(46 /* OpenSquareBracket */) && tokenOrKeyword.parent.kind ===
|
5382
|
+
if (tokenOrKeyword.isToken(46 /* OpenSquareBracket */) && tokenOrKeyword.parent.kind === 69 /* IndexedAccessExpression */) {
|
5383
5383
|
const expressionRole = new ExpressionRole_argument(tokenOrKeyword.parent.argumentList, 0);
|
5384
5384
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5385
5385
|
}
|
5386
|
-
if (tokenOrKeyword.isToken(46 /* OpenSquareBracket */) && tokenOrKeyword.parent.kind ===
|
5386
|
+
if (tokenOrKeyword.isToken(46 /* OpenSquareBracket */) && tokenOrKeyword.parent.kind === 59 /* ArrayLiteral */) {
|
5387
5387
|
const expressionRole = new ExpressionRole_arrayElement(tokenOrKeyword.parent);
|
5388
5388
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5389
5389
|
}
|
5390
5390
|
if (tokenOrKeyword.isToken(25 /* Comma */)) {
|
5391
|
-
if (tokenOrKeyword.parent.kind ===
|
5391
|
+
if (tokenOrKeyword.parent.kind === 66 /* ArgumentList */) {
|
5392
5392
|
const argumentList = tokenOrKeyword.parent;
|
5393
5393
|
let index = 0;
|
5394
5394
|
for (const element of argumentList.elements) {
|
@@ -5402,15 +5402,15 @@ var SyntaxContextFactory = class {
|
|
5402
5402
|
const expressionRole = new ExpressionRole_argument(argumentList, index);
|
5403
5403
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5404
5404
|
}
|
5405
|
-
if (tokenOrKeyword.parent.kind ===
|
5405
|
+
if (tokenOrKeyword.parent.kind === 118 /* MatchExpressionList */) {
|
5406
5406
|
const expressionRole = new ExpressionRole_matchListElement(tokenOrKeyword.parent.parent.parent.parent);
|
5407
5407
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5408
5408
|
}
|
5409
|
-
if (tokenOrKeyword.parent.kind ===
|
5409
|
+
if (tokenOrKeyword.parent.kind === 60 /* ArrayLiteralElementList */) {
|
5410
5410
|
const expressionRole = new ExpressionRole_arrayElement(tokenOrKeyword.parent.parent);
|
5411
5411
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5412
5412
|
}
|
5413
|
-
if (tokenOrKeyword.parent.kind ===
|
5413
|
+
if (tokenOrKeyword.parent.kind === 74 /* ConditionalExpression */) {
|
5414
5414
|
if (tokenOrKeyword.value === tokenOrKeyword.parent.firstComma) {
|
5415
5415
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.firstExpression);
|
5416
5416
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
@@ -5422,51 +5422,51 @@ var SyntaxContextFactory = class {
|
|
5422
5422
|
return { isExpressionContext: void 0, isStatementContext: false };
|
5423
5423
|
}
|
5424
5424
|
}
|
5425
|
-
if (tokenOrKeyword.isKeyword(45 /* Case */) && tokenOrKeyword.parent.kind ===
|
5425
|
+
if (tokenOrKeyword.isKeyword(45 /* Case */) && tokenOrKeyword.parent.kind === 119 /* CaseClause */) {
|
5426
5426
|
const expressionRole = new ExpressionRole_matchListElement(tokenOrKeyword.parent.parent.parent);
|
5427
5427
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5428
5428
|
}
|
5429
|
-
if (tokenOrKeyword.isKeyword(15 /* Return */) && tokenOrKeyword.parent.kind ===
|
5429
|
+
if (tokenOrKeyword.isKeyword(15 /* Return */) && tokenOrKeyword.parent.kind === 115 /* ReturnStatement */) {
|
5430
5430
|
const expressionRole = new ExpressionRole_returnedValue(tokenOrKeyword.parent);
|
5431
5431
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5432
5432
|
}
|
5433
|
-
if (tokenOrKeyword.isKeyword(20 /* Error */) && tokenOrKeyword.parent.kind ===
|
5433
|
+
if (tokenOrKeyword.isKeyword(20 /* Error */) && tokenOrKeyword.parent.kind === 102 /* ErrorStatement */) {
|
5434
5434
|
const expressionRole = new ExpressionRole_errorValue(tokenOrKeyword.parent);
|
5435
5435
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5436
5436
|
}
|
5437
|
-
if (tokenOrKeyword.isKeyword(19 /* Important */) && tokenOrKeyword.parent.kind ===
|
5437
|
+
if (tokenOrKeyword.isKeyword(19 /* Important */) && tokenOrKeyword.parent.kind === 103 /* ImportantStatement */) {
|
5438
5438
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5439
5439
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5440
5440
|
}
|
5441
|
-
if (tokenOrKeyword.isKeyword(44 /* Switch */) && tokenOrKeyword.parent.kind ===
|
5441
|
+
if (tokenOrKeyword.isKeyword(44 /* Switch */) && tokenOrKeyword.parent.kind === 117 /* SwitchStatement */) {
|
5442
5442
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5443
5443
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5444
5444
|
}
|
5445
|
-
if (tokenOrKeyword.isKeyword(13 /* If */) && tokenOrKeyword.parent.kind ===
|
5445
|
+
if (tokenOrKeyword.isKeyword(13 /* If */) && tokenOrKeyword.parent.kind === 107 /* IfStatement */) {
|
5446
5446
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5447
5447
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5448
5448
|
}
|
5449
|
-
if (tokenOrKeyword.isKeyword(11 /* ElseIf */) && tokenOrKeyword.parent.kind ===
|
5449
|
+
if (tokenOrKeyword.isKeyword(11 /* ElseIf */) && tokenOrKeyword.parent.kind === 109 /* ElseIfClause */) {
|
5450
5450
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5451
5451
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5452
5452
|
}
|
5453
|
-
if (tokenOrKeyword.isKeyword(9 /* From */) && tokenOrKeyword.parent.kind ===
|
5453
|
+
if (tokenOrKeyword.isKeyword(9 /* From */) && tokenOrKeyword.parent.kind === 106 /* ForStatement */) {
|
5454
5454
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.enumeratedExpression);
|
5455
5455
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5456
5456
|
}
|
5457
|
-
if (tokenOrKeyword.isKeyword(25 /* While */) && tokenOrKeyword.parent.kind ===
|
5457
|
+
if (tokenOrKeyword.isKeyword(25 /* While */) && tokenOrKeyword.parent.kind === 120 /* WhileStatement */) {
|
5458
5458
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5459
5459
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5460
5460
|
}
|
5461
|
-
if (tokenOrKeyword.isKeyword(27 /* RepeatWhile */) && tokenOrKeyword.parent.kind ===
|
5461
|
+
if (tokenOrKeyword.isKeyword(27 /* RepeatWhile */) && tokenOrKeyword.parent.kind === 114 /* LoopStatement */) {
|
5462
5462
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5463
5463
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5464
5464
|
}
|
5465
|
-
if (tokenOrKeyword.isKeyword(28 /* Yield */) && tokenOrKeyword.parent.kind ===
|
5465
|
+
if (tokenOrKeyword.isKeyword(28 /* Yield */) && tokenOrKeyword.parent.kind === 121 /* YieldStatement */) {
|
5466
5466
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5467
5467
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5468
5468
|
}
|
5469
|
-
if (tokenOrKeyword.isKeyword(30 /* Cond */) && tokenOrKeyword.parent.kind ===
|
5469
|
+
if (tokenOrKeyword.isKeyword(30 /* Cond */) && tokenOrKeyword.parent.kind === 74 /* ConditionalExpression */) {
|
5470
5470
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5471
5471
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5472
5472
|
}
|
@@ -5485,19 +5485,19 @@ var SyntaxContextFactory = class {
|
|
5485
5485
|
if (tokenOrKeyword.isToken(52 /* Semicolon */) && (tokenOrKeyword.parent.kind === 2 /* PackageMemberDeclarationList */ || tokenOrKeyword.parent.kind === 4 /* PackageImportDirectiveList */)) {
|
5486
5486
|
return true;
|
5487
5487
|
}
|
5488
|
-
if (tokenOrKeyword.isToken(21 /* CloseBrace */) && tokenOrKeyword.parent.kind ===
|
5488
|
+
if (tokenOrKeyword.isToken(21 /* CloseBrace */) && tokenOrKeyword.parent.kind === 30 /* TypeMemberDeclarationBlock */ && (tokenOrKeyword.parent.parent.kind === 38 /* TypeExtensionDeclaration */ || tokenOrKeyword.parent.parent.parent.kind === 31 /* PackageStructuredTypeDeclaration */ || tokenOrKeyword.parent.parent.parent.kind === 36 /* PackageVariantTypeDeclaration */ || tokenOrKeyword.parent.parent.parent.kind === 20 /* PackageAliasTypeDeclaration */)) {
|
5489
5489
|
return true;
|
5490
5490
|
}
|
5491
|
-
if (tokenOrKeyword.isToken(21 /* CloseBrace */) && (tokenOrKeyword.parent.kind ===
|
5491
|
+
if (tokenOrKeyword.isToken(21 /* CloseBrace */) && (tokenOrKeyword.parent.kind === 122 /* TranslationsDeclaration */ || tokenOrKeyword.parent.kind === 22 /* PackageMemberGroupDeclaration */ || tokenOrKeyword.parent.kind === 6 /* PackageGroupImportDirective */ || tokenOrKeyword.parent.kind === 92 /* FunctionBlock */ && (tokenOrKeyword.parent.parent.kind === 23 /* PackageConstructorDeclaration */ || tokenOrKeyword.parent.parent.kind === 24 /* PackageEntryPointDeclaration */ || tokenOrKeyword.parent.parent.kind === 25 /* PackageFunctionDeclaration */))) {
|
5492
5492
|
return true;
|
5493
5493
|
}
|
5494
|
-
if (tokenOrKeyword.isToken(44 /* OpenBrace */) && tokenOrKeyword.parent.kind ===
|
5494
|
+
if (tokenOrKeyword.isToken(44 /* OpenBrace */) && tokenOrKeyword.parent.kind === 22 /* PackageMemberGroupDeclaration */) {
|
5495
5495
|
return true;
|
5496
5496
|
}
|
5497
|
-
if (SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 5 /* SinglePackageImportDirective */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword,
|
5497
|
+
if (SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 5 /* SinglePackageImportDirective */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 25 /* PackageFunctionDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 26 /* PackageFunctionTypeDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 20 /* PackageAliasTypeDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 33 /* PackageVariableDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
|
5498
5498
|
tokenOrKeyword,
|
5499
|
-
|
5500
|
-
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword,
|
5499
|
+
34 /* PackageVariableGetterDeclaration */
|
5500
|
+
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 35 /* PackageVariableSetterDeclaration */)) {
|
5501
5501
|
return true;
|
5502
5502
|
}
|
5503
5503
|
if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind === 149 /* Modifier */ && tokenOrKeyword.value === tokenOrKeyword.parent.value && tokenOrKeyword.parent.openParenthesisToken === void 0 && NodeTypeUtils.isPackageMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
|
@@ -5513,28 +5513,28 @@ var SyntaxContextFactory = class {
|
|
5513
5513
|
return false;
|
5514
5514
|
}
|
5515
5515
|
static isTypeMemberDeclarationListContext(tokenOrKeyword) {
|
5516
|
-
if (tokenOrKeyword.isToken(52 /* Semicolon */) && tokenOrKeyword.parent.kind ===
|
5516
|
+
if (tokenOrKeyword.isToken(52 /* Semicolon */) && tokenOrKeyword.parent.kind === 29 /* TypeMemberDeclarationList */) {
|
5517
5517
|
return true;
|
5518
5518
|
}
|
5519
|
-
if (tokenOrKeyword.isToken(44 /* OpenBrace */) && tokenOrKeyword.parent.kind ===
|
5519
|
+
if (tokenOrKeyword.isToken(44 /* OpenBrace */) && tokenOrKeyword.parent.kind === 30 /* TypeMemberDeclarationBlock */) {
|
5520
5520
|
return true;
|
5521
5521
|
}
|
5522
|
-
if (tokenOrKeyword.isToken(21 /* CloseBrace */) && tokenOrKeyword.parent.kind ===
|
5522
|
+
if (tokenOrKeyword.isToken(21 /* CloseBrace */) && tokenOrKeyword.parent.kind === 30 /* TypeMemberDeclarationBlock */ && tokenOrKeyword.parent.parent.kind === 42 /* TypeMemberGroupDeclaration */) {
|
5523
5523
|
return true;
|
5524
5524
|
}
|
5525
|
-
if (SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword,
|
5525
|
+
if (SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 52 /* FieldDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 53 /* FieldGetterDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 54 /* FieldSetterDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
|
5526
5526
|
tokenOrKeyword,
|
5527
|
-
|
5527
|
+
45 /* IndexedElementGetterDeclaration */
|
5528
5528
|
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
|
5529
5529
|
tokenOrKeyword,
|
5530
|
-
|
5530
|
+
46 /* IndexedElementSetterDeclaration */
|
5531
5531
|
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
|
5532
5532
|
tokenOrKeyword,
|
5533
|
-
|
5533
|
+
48 /* DereferencedVariableGetterDeclaration */
|
5534
5534
|
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
|
5535
5535
|
tokenOrKeyword,
|
5536
|
-
|
5537
|
-
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword,
|
5536
|
+
49 /* DereferencedVariableSetterDeclaration */
|
5537
|
+
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 50 /* MethodDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 51 /* OperatorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 43 /* ConstructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 44 /* DestructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 142 /* VariantDeclaration */)) {
|
5538
5538
|
return true;
|
5539
5539
|
}
|
5540
5540
|
if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind === 149 /* Modifier */ && tokenOrKeyword.value === tokenOrKeyword.parent.value && tokenOrKeyword.parent.openParenthesisToken === void 0 && NodeTypeUtils.isTypeMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
|
@@ -5584,16 +5584,16 @@ var SyntaxContextFactory = class {
|
|
5584
5584
|
if (tokenOrKeyword.isToken(24 /* Colon */) && tokenOrKeyword.parent.kind === 156 /* TypeAnnotation */) {
|
5585
5585
|
return { allowsAnonymousTypes: true };
|
5586
5586
|
}
|
5587
|
-
if ((tokenOrKeyword.isKeyword(4 /* Object */) || tokenOrKeyword.isKeyword(5 /* PlainObject */) || tokenOrKeyword.isKeyword(3 /* Aspect */)) && tokenOrKeyword.parent.kind ===
|
5587
|
+
if ((tokenOrKeyword.isKeyword(4 /* Object */) || tokenOrKeyword.isKeyword(5 /* PlainObject */) || tokenOrKeyword.isKeyword(3 /* Aspect */)) && tokenOrKeyword.parent.kind === 32 /* StructuredTypeDeclarationBody */) {
|
5588
5588
|
return { allowsAnonymousTypes: false };
|
5589
5589
|
}
|
5590
|
-
if (tokenOrKeyword.isKeyword(16 /* Type */) && (NodeTypeUtils.isPackageTypeDeclaration(tokenOrKeyword.parent) || tokenOrKeyword.parent.kind ===
|
5590
|
+
if (tokenOrKeyword.isKeyword(16 /* Type */) && (NodeTypeUtils.isPackageTypeDeclaration(tokenOrKeyword.parent) || tokenOrKeyword.parent.kind === 38 /* TypeExtensionDeclaration */)) {
|
5591
5591
|
return { allowsAnonymousTypes: false };
|
5592
5592
|
}
|
5593
5593
|
if (tokenOrKeyword.isToken(37 /* LessThan */) && tokenOrKeyword.parent.kind === 152 /* TypeArgumentClause */) {
|
5594
5594
|
return { allowsAnonymousTypes: true };
|
5595
5595
|
}
|
5596
|
-
if (tokenOrKeyword.isToken(25 /* Comma */) && (tokenOrKeyword.parent.kind ===
|
5596
|
+
if (tokenOrKeyword.isToken(25 /* Comma */) && (tokenOrKeyword.parent.kind === 28 /* BaseTypeList */ || tokenOrKeyword.parent.kind === 153 /* TypeArgumentList */)) {
|
5597
5597
|
return { allowsAnonymousTypes: tokenOrKeyword.parent.kind === 153 /* TypeArgumentList */ };
|
5598
5598
|
}
|
5599
5599
|
if (tokenOrKeyword.isToken(36 /* HashSign */) && tokenOrKeyword.parent.kind === 147 /* Tag */) {
|
@@ -5602,13 +5602,13 @@ var SyntaxContextFactory = class {
|
|
5602
5602
|
if ((tokenOrKeyword.isToken(24 /* Colon */) || tokenOrKeyword.isToken(58 /* Equals */)) && tokenOrKeyword.parent.kind === 143 /* TypeParameterDeclaration */) {
|
5603
5603
|
return { allowsAnonymousTypes: false };
|
5604
5604
|
}
|
5605
|
-
if (tokenOrKeyword.isToken(58 /* Equals */) && tokenOrKeyword.parent.kind ===
|
5605
|
+
if (tokenOrKeyword.isToken(58 /* Equals */) && tokenOrKeyword.parent.kind === 20 /* PackageAliasTypeDeclaration */) {
|
5606
5606
|
return { allowsAnonymousTypes: false };
|
5607
5607
|
}
|
5608
|
-
if (tokenOrKeyword.isKeyword(14 /* Is */) && tokenOrKeyword.parent.kind ===
|
5608
|
+
if (tokenOrKeyword.isKeyword(14 /* Is */) && tokenOrKeyword.parent.kind === 71 /* IsExpression */) {
|
5609
5609
|
return { allowsAnonymousTypes: true };
|
5610
5610
|
}
|
5611
|
-
if (tokenOrKeyword.isKeyword(42 /* As */) && tokenOrKeyword.parent.kind ===
|
5611
|
+
if (tokenOrKeyword.isKeyword(42 /* As */) && tokenOrKeyword.parent.kind === 63 /* AsExpression */) {
|
5612
5612
|
return { allowsAnonymousTypes: true };
|
5613
5613
|
}
|
5614
5614
|
if (tokenOrKeyword.isToken(18 /* Bar */) && tokenOrKeyword.parent.kind === 11 /* UnionTypeSpecifier */) {
|
@@ -5623,10 +5623,10 @@ var SyntaxContextFactory = class {
|
|
5623
5623
|
return void 0;
|
5624
5624
|
}
|
5625
5625
|
static isTopLevelTranslationListContext(tokenOrKeyword) {
|
5626
|
-
if (tokenOrKeyword.isToken(52 /* Semicolon */) && tokenOrKeyword.parent.kind ===
|
5626
|
+
if (tokenOrKeyword.isToken(52 /* Semicolon */) && tokenOrKeyword.parent.kind === 123 /* TopLevelTranslationList */) {
|
5627
5627
|
return { translationsDeclaration: tokenOrKeyword.parent.parent };
|
5628
5628
|
}
|
5629
|
-
if (tokenOrKeyword.isToken(44 /* OpenBrace */) && tokenOrKeyword.parent.kind ===
|
5629
|
+
if (tokenOrKeyword.isToken(44 /* OpenBrace */) && tokenOrKeyword.parent.kind === 122 /* TranslationsDeclaration */) {
|
5630
5630
|
return { translationsDeclaration: tokenOrKeyword.parent };
|
5631
5631
|
}
|
5632
5632
|
const packageImport = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
@@ -5803,29 +5803,29 @@ var NodeSemanticInfoService = class {
|
|
5803
5803
|
static ofTokenOrKeyword(analyzer, tokenOrKeyword, options6) {
|
5804
5804
|
if (isIdentifier(tokenOrKeyword.value)) {
|
5805
5805
|
return this.ofNonKeywordIdentifier(analyzer, tokenOrKeyword.value, options6);
|
5806
|
-
} else if (tokenOrKeyword.isKeyword(2 /* Autotype */) && tokenOrKeyword.parent.kind ===
|
5806
|
+
} else if (tokenOrKeyword.isKeyword(2 /* Autotype */) && tokenOrKeyword.parent.kind === 68 /* AutotypeCallExpression */) {
|
5807
5807
|
return this.ofAutotypeCallExpression(analyzer, tokenOrKeyword.parent, options6);
|
5808
|
-
} else if (tokenOrKeyword.parent.kind ===
|
5808
|
+
} else if (tokenOrKeyword.parent.kind === 75 /* PrefixUnaryExpression */) {
|
5809
5809
|
return this.ofPrefixUnaryExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
|
5810
|
-
} else if (tokenOrKeyword.parent.kind ===
|
5810
|
+
} else if (tokenOrKeyword.parent.kind === 64 /* BinaryExpression */) {
|
5811
5811
|
return this.ofBinaryExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
|
5812
|
-
} else if (tokenOrKeyword.isToken(20 /* Caret */) && (tokenOrKeyword.parent.kind ===
|
5812
|
+
} else if (tokenOrKeyword.isToken(20 /* Caret */) && (tokenOrKeyword.parent.kind === 48 /* DereferencedVariableGetterDeclaration */ || tokenOrKeyword.parent.kind === 49 /* DereferencedVariableSetterDeclaration */)) {
|
5813
5813
|
return this.ofDereferenceOperatorDeclaration(analyzer, tokenOrKeyword.parent);
|
5814
|
-
} else if (tokenOrKeyword.isToken(20 /* Caret */) && tokenOrKeyword.parent.kind ===
|
5814
|
+
} else if (tokenOrKeyword.isToken(20 /* Caret */) && tokenOrKeyword.parent.kind === 78 /* DereferenceExpression */) {
|
5815
5815
|
return this.ofDereferenceExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
|
5816
|
-
} else if (tokenOrKeyword.parent.kind ===
|
5816
|
+
} else if (tokenOrKeyword.parent.kind === 89 /* AssignmentStatement */) {
|
5817
5817
|
return this.ofAssignmentStatementOperator(analyzer, tokenOrKeyword.parent, options6);
|
5818
|
-
} else if (tokenOrKeyword.isKeyword(31 /* Creation */) && tokenOrKeyword.parent.kind ===
|
5818
|
+
} else if (tokenOrKeyword.isKeyword(31 /* Creation */) && tokenOrKeyword.parent.kind === 43 /* ConstructorDeclaration */) {
|
5819
5819
|
return this.ofConstructorDeclaration(analyzer, tokenOrKeyword.parent);
|
5820
|
-
} else if (tokenOrKeyword.isToken(14 /* Asterisk */) && tokenOrKeyword.parent.kind ===
|
5820
|
+
} else if (tokenOrKeyword.isToken(14 /* Asterisk */) && tokenOrKeyword.parent.kind === 88 /* DefaultMatchExpression */) {
|
5821
5821
|
return this.ofDefaultMatchExpression(analyzer, tokenOrKeyword.parent);
|
5822
|
-
} else if (tokenOrKeyword.isKeyword(4 /* Object */) && tokenOrKeyword.parent.kind ===
|
5822
|
+
} else if (tokenOrKeyword.isKeyword(4 /* Object */) && tokenOrKeyword.parent.kind === 84 /* ObjectExpression */) {
|
5823
5823
|
return this.ofObjectExpression(analyzer, tokenOrKeyword.parent, options6);
|
5824
|
-
} else if (tokenOrKeyword.isKeyword(56 /* Base */) && tokenOrKeyword.parent.kind ===
|
5824
|
+
} else if (tokenOrKeyword.isKeyword(56 /* Base */) && tokenOrKeyword.parent.kind === 85 /* BaseExpression */) {
|
5825
5825
|
return this.ofBaseExpression(analyzer, tokenOrKeyword.parent, options6);
|
5826
|
-
} else if ((tokenOrKeyword.isToken(46 /* OpenSquareBracket */) || tokenOrKeyword.isToken(23 /* CloseSquareBracket */)) && tokenOrKeyword.parent.kind ===
|
5826
|
+
} else if ((tokenOrKeyword.isToken(46 /* OpenSquareBracket */) || tokenOrKeyword.isToken(23 /* CloseSquareBracket */)) && tokenOrKeyword.parent.kind === 47 /* IndexParameterClause */) {
|
5827
5827
|
return this.ofIndexedElementAccessorDeclaration(analyzer, tokenOrKeyword.parent.parent);
|
5828
|
-
} else if ((tokenOrKeyword.isToken(46 /* OpenSquareBracket */) || tokenOrKeyword.isToken(23 /* CloseSquareBracket */)) && tokenOrKeyword.parent.kind ===
|
5828
|
+
} else if ((tokenOrKeyword.isToken(46 /* OpenSquareBracket */) || tokenOrKeyword.isToken(23 /* CloseSquareBracket */)) && tokenOrKeyword.parent.kind === 69 /* IndexedAccessExpression */) {
|
5829
5829
|
return this.ofIndexedAccessExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
|
5830
5830
|
}
|
5831
5831
|
return void 0;
|
@@ -5856,37 +5856,37 @@ var NodeSemanticInfoService = class {
|
|
5856
5856
|
}
|
5857
5857
|
break;
|
5858
5858
|
}
|
5859
|
-
case
|
5859
|
+
case 58 /* EnumerationVariableDeclaration */:
|
5860
5860
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofEnumerationVariableDeclaration(parent));
|
5861
5861
|
break;
|
5862
|
-
case
|
5862
|
+
case 99 /* ErrorVariableDeclaration */:
|
5863
5863
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofErrorVariableDeclaration(parent));
|
5864
5864
|
break;
|
5865
|
-
case
|
5865
|
+
case 20 /* PackageAliasTypeDeclaration */:
|
5866
5866
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageAliasTypeDeclaration(parent));
|
5867
5867
|
break;
|
5868
|
-
case
|
5868
|
+
case 25 /* PackageFunctionDeclaration */:
|
5869
5869
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageFunctionDeclaration(parent));
|
5870
5870
|
break;
|
5871
|
-
case
|
5871
|
+
case 26 /* PackageFunctionTypeDeclaration */:
|
5872
5872
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageFunctionTypeDeclaration(parent));
|
5873
5873
|
break;
|
5874
|
-
case
|
5874
|
+
case 31 /* PackageStructuredTypeDeclaration */:
|
5875
5875
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageStructuredTypeDeclaration(parent));
|
5876
5876
|
break;
|
5877
|
-
case
|
5877
|
+
case 33 /* PackageVariableDeclaration */:
|
5878
5878
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageVariableDeclaration(parent));
|
5879
5879
|
break;
|
5880
|
-
case
|
5880
|
+
case 36 /* PackageVariantTypeDeclaration */:
|
5881
5881
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageVariantTypeDeclaration(parent));
|
5882
5882
|
break;
|
5883
|
-
case
|
5883
|
+
case 86 /* IdentifierExpression */:
|
5884
5884
|
result = this.ofIdentifierExpression(analyzer, parent, options6);
|
5885
5885
|
break;
|
5886
|
-
case
|
5886
|
+
case 56 /* NestedFunctionDeclaration */:
|
5887
5887
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofNestedFunctionDeclaration(parent));
|
5888
5888
|
break;
|
5889
|
-
case
|
5889
|
+
case 57 /* LocalVariableDeclaration */:
|
5890
5890
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofLocalVariableDeclaration(parent));
|
5891
5891
|
break;
|
5892
5892
|
case 135 /* QualifiedName */:
|
@@ -6033,16 +6033,16 @@ var NodeSemanticInfoService = class {
|
|
6033
6033
|
case 9 /* PackageName */:
|
6034
6034
|
result = void 0;
|
6035
6035
|
break;
|
6036
|
-
case
|
6036
|
+
case 76 /* MemberAccessExpression */:
|
6037
6037
|
result = this.ofMember(analyzer, parent, options6);
|
6038
6038
|
break;
|
6039
|
-
case
|
6039
|
+
case 50 /* MethodDeclaration */:
|
6040
6040
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofMethodDeclaration(parent));
|
6041
6041
|
break;
|
6042
|
-
case
|
6042
|
+
case 51 /* OperatorDeclaration */:
|
6043
6043
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofOperatorDeclaration(parent));
|
6044
6044
|
break;
|
6045
|
-
case
|
6045
|
+
case 52 /* FieldDeclaration */:
|
6046
6046
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofFieldDeclaration(parent));
|
6047
6047
|
break;
|
6048
6048
|
case 143 /* TypeParameterDeclaration */:
|
@@ -6051,12 +6051,12 @@ var NodeSemanticInfoService = class {
|
|
6051
6051
|
case 142 /* VariantDeclaration */:
|
6052
6052
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofVariantDeclaration(parent));
|
6053
6053
|
break;
|
6054
|
-
case
|
6055
|
-
case
|
6054
|
+
case 34 /* PackageVariableGetterDeclaration */:
|
6055
|
+
case 35 /* PackageVariableSetterDeclaration */:
|
6056
6056
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofComputedPackageVariableDeclaration(parent));
|
6057
6057
|
break;
|
6058
|
-
case
|
6059
|
-
case
|
6058
|
+
case 53 /* FieldGetterDeclaration */:
|
6059
|
+
case 54 /* FieldSetterDeclaration */:
|
6060
6060
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofComputedFieldDeclaration(parent));
|
6061
6061
|
break;
|
6062
6062
|
case 3 /* Keyword */:
|
@@ -6186,7 +6186,7 @@ var NodeSemanticInfoService = class {
|
|
6186
6186
|
return this.ofNamedTypeSpecifierNameQualifier(analyzer, node.parent, qualifier, options6);
|
6187
6187
|
case 147 /* Tag */:
|
6188
6188
|
return this.ofTagNameQualifier(analyzer, node.parent, qualifier, options6);
|
6189
|
-
case
|
6189
|
+
case 40 /* ExtendedTypeClause */:
|
6190
6190
|
case 134 /* PackageImportTranslation */:
|
6191
6191
|
return void 0;
|
6192
6192
|
default:
|
@@ -6650,7 +6650,7 @@ var NodeSemanticInfoService = class {
|
|
6650
6650
|
}
|
6651
6651
|
static ofPackageNameSegmentAccess(analyzer, packageTreeNode, node) {
|
6652
6652
|
let parent = getParentSkippingParenthesizedExpressions(node);
|
6653
|
-
while (parent.kind ===
|
6653
|
+
while (parent.kind === 76 /* MemberAccessExpression */) {
|
6654
6654
|
const meaning = analyzer.resolveMemberAccessExpression(parent).meaning;
|
6655
6655
|
if (meaning.kind === "package-name-segment-access") {
|
6656
6656
|
packageTreeNode = meaning.packageTreeNode;
|
@@ -6689,11 +6689,11 @@ var NodeSemanticInfoService = class {
|
|
6689
6689
|
}
|
6690
6690
|
const parent = getParentSkippingParenthesizedExpressions(typeAccessExpression);
|
6691
6691
|
let parentCallExpression;
|
6692
|
-
if (parent.kind ===
|
6692
|
+
if (parent.kind === 67 /* CallExpression */) {
|
6693
6693
|
parentCallExpression = parent;
|
6694
|
-
} else if (parent.kind ===
|
6694
|
+
} else if (parent.kind === 87 /* GenericSpecializationExpression */) {
|
6695
6695
|
const grandParent = getParentSkippingParenthesizedExpressions(parent);
|
6696
|
-
if (grandParent.kind ===
|
6696
|
+
if (grandParent.kind === 67 /* CallExpression */) {
|
6697
6697
|
parentCallExpression = grandParent;
|
6698
6698
|
}
|
6699
6699
|
}
|
@@ -6949,52 +6949,52 @@ function getEntitySourceLocations(analyzer, entity) {
|
|
6949
6949
|
case 19 /* AnonymousVariantTypeDeclaration */:
|
6950
6950
|
range = node.rangeWithoutTrivia;
|
6951
6951
|
break;
|
6952
|
-
case
|
6953
|
-
case
|
6954
|
-
case
|
6955
|
-
case
|
6956
|
-
case
|
6957
|
-
case
|
6958
|
-
case
|
6952
|
+
case 20 /* PackageAliasTypeDeclaration */:
|
6953
|
+
case 25 /* PackageFunctionDeclaration */:
|
6954
|
+
case 26 /* PackageFunctionTypeDeclaration */:
|
6955
|
+
case 31 /* PackageStructuredTypeDeclaration */:
|
6956
|
+
case 36 /* PackageVariantTypeDeclaration */:
|
6957
|
+
case 56 /* NestedFunctionDeclaration */:
|
6958
|
+
case 50 /* MethodDeclaration */:
|
6959
6959
|
case 143 /* TypeParameterDeclaration */:
|
6960
|
-
case
|
6960
|
+
case 51 /* OperatorDeclaration */:
|
6961
6961
|
range = node.name.rangeWithoutTrivia;
|
6962
6962
|
break;
|
6963
|
-
case
|
6963
|
+
case 43 /* ConstructorDeclaration */:
|
6964
6964
|
range = node.creationKeyword.rangeWithoutTrivia;
|
6965
6965
|
break;
|
6966
|
-
case
|
6966
|
+
case 44 /* DestructorDeclaration */:
|
6967
6967
|
range = node.destructionKeyword.rangeWithoutTrivia;
|
6968
6968
|
break;
|
6969
6969
|
case 8 /* PackageImport */:
|
6970
6970
|
Debug.assertNotNull(node.alias);
|
6971
6971
|
range = node.alias.rangeWithoutTrivia;
|
6972
6972
|
break;
|
6973
|
-
case
|
6973
|
+
case 38 /* TypeExtensionDeclaration */:
|
6974
6974
|
range = node.plusEqualsToken.rangeWithoutTrivia;
|
6975
6975
|
break;
|
6976
|
-
case
|
6976
|
+
case 34 /* PackageVariableGetterDeclaration */:
|
6977
6977
|
range = node.getKeyword.rangeWithoutTrivia;
|
6978
6978
|
break;
|
6979
|
-
case
|
6979
|
+
case 35 /* PackageVariableSetterDeclaration */:
|
6980
6980
|
range = node.setKeyword.rangeWithoutTrivia;
|
6981
6981
|
break;
|
6982
|
-
case
|
6982
|
+
case 53 /* FieldGetterDeclaration */:
|
6983
6983
|
range = node.getKeyword.rangeWithoutTrivia;
|
6984
6984
|
break;
|
6985
|
-
case
|
6985
|
+
case 54 /* FieldSetterDeclaration */:
|
6986
6986
|
range = node.setKeyword.rangeWithoutTrivia;
|
6987
6987
|
break;
|
6988
|
-
case
|
6988
|
+
case 45 /* IndexedElementGetterDeclaration */:
|
6989
6989
|
range = node.parameterClause.rangeWithoutTrivia;
|
6990
6990
|
break;
|
6991
|
-
case
|
6991
|
+
case 46 /* IndexedElementSetterDeclaration */:
|
6992
6992
|
range = node.parameterClause.rangeWithoutTrivia;
|
6993
6993
|
break;
|
6994
|
-
case
|
6994
|
+
case 48 /* DereferencedVariableGetterDeclaration */:
|
6995
6995
|
range = node.caretToken.rangeWithoutTrivia;
|
6996
6996
|
break;
|
6997
|
-
case
|
6997
|
+
case 49 /* DereferencedVariableSetterDeclaration */:
|
6998
6998
|
range = node.caretToken.rangeWithoutTrivia;
|
6999
6999
|
break;
|
7000
7000
|
default:
|
@@ -7205,42 +7205,42 @@ var DefinitionService = class {
|
|
7205
7205
|
getSourceLocationOfSubprogramNode(analyzer, node) {
|
7206
7206
|
let range;
|
7207
7207
|
switch (node.kind) {
|
7208
|
-
case
|
7209
|
-
case
|
7210
|
-
case
|
7211
|
-
case
|
7212
|
-
case
|
7213
|
-
case
|
7214
|
-
case
|
7208
|
+
case 25 /* PackageFunctionDeclaration */:
|
7209
|
+
case 34 /* PackageVariableGetterDeclaration */:
|
7210
|
+
case 35 /* PackageVariableSetterDeclaration */:
|
7211
|
+
case 50 /* MethodDeclaration */:
|
7212
|
+
case 53 /* FieldGetterDeclaration */:
|
7213
|
+
case 54 /* FieldSetterDeclaration */:
|
7214
|
+
case 56 /* NestedFunctionDeclaration */:
|
7215
7215
|
range = node.name.rangeWithoutTrivia;
|
7216
7216
|
break;
|
7217
|
-
case
|
7217
|
+
case 23 /* PackageConstructorDeclaration */:
|
7218
7218
|
range = node.creationKeyword.rangeWithoutTrivia;
|
7219
7219
|
break;
|
7220
|
-
case
|
7220
|
+
case 24 /* PackageEntryPointDeclaration */:
|
7221
7221
|
range = node.runKeyword.rangeWithoutTrivia;
|
7222
7222
|
break;
|
7223
|
-
case
|
7223
|
+
case 43 /* ConstructorDeclaration */:
|
7224
7224
|
range = node.creationKeyword.rangeWithoutTrivia;
|
7225
7225
|
break;
|
7226
|
-
case
|
7226
|
+
case 44 /* DestructorDeclaration */:
|
7227
7227
|
range = node.destructionKeyword.rangeWithoutTrivia;
|
7228
7228
|
break;
|
7229
|
-
case
|
7230
|
-
case
|
7229
|
+
case 45 /* IndexedElementGetterDeclaration */:
|
7230
|
+
case 46 /* IndexedElementSetterDeclaration */:
|
7231
7231
|
range = node.parameterClause.rangeWithoutTrivia;
|
7232
7232
|
break;
|
7233
|
-
case
|
7234
|
-
case
|
7233
|
+
case 48 /* DereferencedVariableGetterDeclaration */:
|
7234
|
+
case 49 /* DereferencedVariableSetterDeclaration */:
|
7235
7235
|
range = node.caretToken.rangeWithoutTrivia;
|
7236
7236
|
break;
|
7237
|
-
case
|
7237
|
+
case 51 /* OperatorDeclaration */:
|
7238
7238
|
range = node.name.rangeWithoutTrivia;
|
7239
7239
|
break;
|
7240
|
-
case
|
7240
|
+
case 65 /* FunctionBlockLiteral */:
|
7241
7241
|
range = node.block.openBraceToken.rangeWithoutTrivia;
|
7242
7242
|
break;
|
7243
|
-
case
|
7243
|
+
case 72 /* FunctionLiteral */: {
|
7244
7244
|
const rangeStart = node.functionKeyword.rangeWithoutTrivia.start;
|
7245
7245
|
const rangeEnd = node.parameterClause.rangeWithoutTrivia.end;
|
7246
7246
|
range = new Range(rangeStart, rangeEnd);
|
@@ -7316,7 +7316,7 @@ var ReferencesService = class {
|
|
7316
7316
|
}
|
7317
7317
|
}
|
7318
7318
|
if (!options6.onlyNamed) {
|
7319
|
-
if (node.kind ===
|
7319
|
+
if (node.kind === 68 /* AutotypeCallExpression */ && restrictions.canBeAutotypeCall) {
|
7320
7320
|
const semanticInfo = NodeSemanticInfoService.ofAutotypeCallExpression(analyzer, node, semanticInfoOptions);
|
7321
7321
|
const referenceKind = this.ifReferenceToDefinitionThenKind(
|
7322
7322
|
definition,
|
@@ -7328,7 +7328,7 @@ var ReferencesService = class {
|
|
7328
7328
|
result.push(new Reference(sourceFile2, node.autotypeKeyword.rangeWithoutTrivia, referenceKind));
|
7329
7329
|
}
|
7330
7330
|
}
|
7331
|
-
if (node.kind ===
|
7331
|
+
if (node.kind === 75 /* PrefixUnaryExpression */ && restrictions.canBePrefixUnaryOperator) {
|
7332
7332
|
const semanticInfo = NodeSemanticInfoService.ofPrefixUnaryExpressionOperator(
|
7333
7333
|
analyzer,
|
7334
7334
|
node,
|
@@ -7344,7 +7344,7 @@ var ReferencesService = class {
|
|
7344
7344
|
result.push(new Reference(sourceFile2, node.operator.rangeWithoutTrivia, referenceKind));
|
7345
7345
|
}
|
7346
7346
|
}
|
7347
|
-
if (node.kind ===
|
7347
|
+
if (node.kind === 64 /* BinaryExpression */ && restrictions.canBeBinaryExpressionOperator) {
|
7348
7348
|
const semanticInfo = NodeSemanticInfoService.ofBinaryExpressionOperator(
|
7349
7349
|
analyzer,
|
7350
7350
|
node,
|
@@ -7360,7 +7360,7 @@ var ReferencesService = class {
|
|
7360
7360
|
result.push(new Reference(sourceFile2, node.operator.rangeWithoutTrivia, referenceKind));
|
7361
7361
|
}
|
7362
7362
|
}
|
7363
|
-
if ((node.kind ===
|
7363
|
+
if ((node.kind === 48 /* DereferencedVariableGetterDeclaration */ || node.kind === 49 /* DereferencedVariableSetterDeclaration */) && restrictions.canBeDereferenceOperator) {
|
7364
7364
|
const semanticInfo = NodeSemanticInfoService.ofDereferenceOperatorDeclaration(analyzer, node);
|
7365
7365
|
const referenceKind = this.ifReferenceToDefinitionThenKind(
|
7366
7366
|
definition,
|
@@ -7372,7 +7372,7 @@ var ReferencesService = class {
|
|
7372
7372
|
result.push(new Reference(sourceFile2, node.caretToken.rangeWithoutTrivia, referenceKind));
|
7373
7373
|
}
|
7374
7374
|
}
|
7375
|
-
if (node.kind ===
|
7375
|
+
if (node.kind === 78 /* DereferenceExpression */ && restrictions.canBeDereferenceOperator) {
|
7376
7376
|
const semanticInfo = NodeSemanticInfoService.ofDereferenceExpressionOperator(
|
7377
7377
|
analyzer,
|
7378
7378
|
node,
|
@@ -7388,7 +7388,7 @@ var ReferencesService = class {
|
|
7388
7388
|
result.push(new Reference(sourceFile2, node.caretToken.rangeWithoutTrivia, referenceKind));
|
7389
7389
|
}
|
7390
7390
|
}
|
7391
|
-
if (node.kind ===
|
7391
|
+
if (node.kind === 89 /* AssignmentStatement */ && restrictions.canBeAssignmentStatementOperator) {
|
7392
7392
|
const semanticInfo = NodeSemanticInfoService.ofAssignmentStatementOperator(
|
7393
7393
|
analyzer,
|
7394
7394
|
node,
|
@@ -7404,7 +7404,7 @@ var ReferencesService = class {
|
|
7404
7404
|
result.push(new Reference(sourceFile2, node.operator.rangeWithoutTrivia, referenceKind));
|
7405
7405
|
}
|
7406
7406
|
}
|
7407
|
-
if (node.kind ===
|
7407
|
+
if (node.kind === 43 /* ConstructorDeclaration */ && restrictions.canBeConstructorDeclaration) {
|
7408
7408
|
const semanticInfo = NodeSemanticInfoService.ofConstructorDeclaration(analyzer, node);
|
7409
7409
|
const referenceKind = this.ifReferenceToDefinitionThenKind(
|
7410
7410
|
definition,
|
@@ -7416,7 +7416,7 @@ var ReferencesService = class {
|
|
7416
7416
|
result.push(new Reference(sourceFile2, node.creationKeyword.rangeWithoutTrivia, referenceKind));
|
7417
7417
|
}
|
7418
7418
|
}
|
7419
|
-
if (node.kind ===
|
7419
|
+
if (node.kind === 84 /* ObjectExpression */ && restrictions.canBeObjectExpression) {
|
7420
7420
|
const semanticInfo = NodeSemanticInfoService.ofObjectExpression(analyzer, node, semanticInfoOptions);
|
7421
7421
|
const referenceKind = this.ifReferenceToDefinitionThenKind(
|
7422
7422
|
definition,
|
@@ -7428,7 +7428,7 @@ var ReferencesService = class {
|
|
7428
7428
|
result.push(new Reference(sourceFile2, node.keyword.rangeWithoutTrivia, referenceKind));
|
7429
7429
|
}
|
7430
7430
|
}
|
7431
|
-
if (node.kind ===
|
7431
|
+
if (node.kind === 85 /* BaseExpression */ && restrictions.canBeBaseExpression) {
|
7432
7432
|
const semanticInfo = NodeSemanticInfoService.ofBaseExpression(analyzer, node, semanticInfoOptions);
|
7433
7433
|
const referenceKind = this.ifReferenceToDefinitionThenKind(
|
7434
7434
|
definition,
|
@@ -7440,7 +7440,7 @@ var ReferencesService = class {
|
|
7440
7440
|
result.push(new Reference(sourceFile2, node.keyword.rangeWithoutTrivia, referenceKind));
|
7441
7441
|
}
|
7442
7442
|
}
|
7443
|
-
if ((node.kind ===
|
7443
|
+
if ((node.kind === 45 /* IndexedElementGetterDeclaration */ || node.kind === 46 /* IndexedElementSetterDeclaration */) && restrictions.canBeIndexer) {
|
7444
7444
|
const semanticInfo = NodeSemanticInfoService.ofIndexedElementAccessorDeclaration(analyzer, node);
|
7445
7445
|
const referenceKind = this.ifReferenceToDefinitionThenKind(
|
7446
7446
|
definition,
|
@@ -7452,7 +7452,7 @@ var ReferencesService = class {
|
|
7452
7452
|
result.push(new Reference(sourceFile2, node.parameterClause.rangeWithoutTrivia, referenceKind));
|
7453
7453
|
}
|
7454
7454
|
}
|
7455
|
-
if (node.kind ===
|
7455
|
+
if (node.kind === 69 /* IndexedAccessExpression */ && restrictions.canBeIndexer) {
|
7456
7456
|
const semanticInfo = NodeSemanticInfoService.ofIndexedAccessExpressionOperator(
|
7457
7457
|
analyzer,
|
7458
7458
|
node,
|
@@ -7834,9 +7834,9 @@ var EvaluatableExpressionService = class {
|
|
7834
7834
|
getEvaluatableExpressionForIdentifier(node) {
|
7835
7835
|
const parent = node.parent;
|
7836
7836
|
switch (parent.kind) {
|
7837
|
-
case
|
7837
|
+
case 86 /* IdentifierExpression */:
|
7838
7838
|
return parent;
|
7839
|
-
case
|
7839
|
+
case 76 /* MemberAccessExpression */:
|
7840
7840
|
if (this.isEvaluatableReceiver(parent.expression)) {
|
7841
7841
|
return parent;
|
7842
7842
|
}
|
@@ -7857,9 +7857,9 @@ var EvaluatableExpressionService = class {
|
|
7857
7857
|
}
|
7858
7858
|
isEvaluatableReceiver(expression) {
|
7859
7859
|
switch (expression.kind) {
|
7860
|
-
case
|
7860
|
+
case 86 /* IdentifierExpression */:
|
7861
7861
|
return true;
|
7862
|
-
case
|
7862
|
+
case 76 /* MemberAccessExpression */:
|
7863
7863
|
return this.isEvaluatableReceiver(expression.expression);
|
7864
7864
|
default:
|
7865
7865
|
return false;
|
@@ -7867,35 +7867,35 @@ var EvaluatableExpressionService = class {
|
|
7867
7867
|
}
|
7868
7868
|
isNamedDeclaration(node) {
|
7869
7869
|
switch (node.kind) {
|
7870
|
-
case
|
7870
|
+
case 58 /* EnumerationVariableDeclaration */:
|
7871
7871
|
return { nameIdentifier: node.name };
|
7872
|
-
case
|
7872
|
+
case 20 /* PackageAliasTypeDeclaration */:
|
7873
7873
|
return { nameIdentifier: node.name };
|
7874
|
-
case
|
7874
|
+
case 25 /* PackageFunctionDeclaration */:
|
7875
7875
|
return { nameIdentifier: node.name };
|
7876
|
-
case
|
7876
|
+
case 26 /* PackageFunctionTypeDeclaration */:
|
7877
7877
|
return { nameIdentifier: node.name };
|
7878
|
-
case
|
7878
|
+
case 31 /* PackageStructuredTypeDeclaration */:
|
7879
7879
|
return { nameIdentifier: node.name };
|
7880
|
-
case
|
7880
|
+
case 33 /* PackageVariableDeclaration */:
|
7881
7881
|
return { nameIdentifier: node.name };
|
7882
|
-
case
|
7882
|
+
case 36 /* PackageVariantTypeDeclaration */:
|
7883
7883
|
return { nameIdentifier: node.name };
|
7884
|
-
case
|
7884
|
+
case 56 /* NestedFunctionDeclaration */:
|
7885
7885
|
return { nameIdentifier: node.name };
|
7886
|
-
case
|
7886
|
+
case 57 /* LocalVariableDeclaration */:
|
7887
7887
|
return { nameIdentifier: node.name };
|
7888
7888
|
case 144 /* ParameterDeclaration */:
|
7889
7889
|
return { nameIdentifier: node.name };
|
7890
|
-
case
|
7890
|
+
case 50 /* MethodDeclaration */:
|
7891
7891
|
return { nameIdentifier: node.name };
|
7892
|
-
case
|
7892
|
+
case 52 /* FieldDeclaration */:
|
7893
7893
|
return { nameIdentifier: node.name };
|
7894
7894
|
case 143 /* TypeParameterDeclaration */:
|
7895
7895
|
return { nameIdentifier: node.name };
|
7896
7896
|
case 142 /* VariantDeclaration */:
|
7897
7897
|
return { nameIdentifier: node.name };
|
7898
|
-
case
|
7898
|
+
case 99 /* ErrorVariableDeclaration */:
|
7899
7899
|
return { nameIdentifier: node.name };
|
7900
7900
|
default:
|
7901
7901
|
return void 0;
|
@@ -8154,7 +8154,7 @@ var SourceFileItemsService = class {
|
|
8154
8154
|
}
|
8155
8155
|
break;
|
8156
8156
|
}
|
8157
|
-
case
|
8157
|
+
case 33 /* PackageVariableDeclaration */: {
|
8158
8158
|
result.push(
|
8159
8159
|
this.createItem(
|
8160
8160
|
1 /* PackageVariable */,
|
@@ -8166,7 +8166,7 @@ var SourceFileItemsService = class {
|
|
8166
8166
|
);
|
8167
8167
|
break;
|
8168
8168
|
}
|
8169
|
-
case
|
8169
|
+
case 34 /* PackageVariableGetterDeclaration */: {
|
8170
8170
|
result.push(
|
8171
8171
|
this.createItem(
|
8172
8172
|
2 /* PackageVariableGetter */,
|
@@ -8178,7 +8178,7 @@ var SourceFileItemsService = class {
|
|
8178
8178
|
);
|
8179
8179
|
break;
|
8180
8180
|
}
|
8181
|
-
case
|
8181
|
+
case 35 /* PackageVariableSetterDeclaration */: {
|
8182
8182
|
result.push(
|
8183
8183
|
this.createItem(
|
8184
8184
|
3 /* PackageVariableSetter */,
|
@@ -8190,7 +8190,7 @@ var SourceFileItemsService = class {
|
|
8190
8190
|
);
|
8191
8191
|
break;
|
8192
8192
|
}
|
8193
|
-
case
|
8193
|
+
case 25 /* PackageFunctionDeclaration */: {
|
8194
8194
|
result.push(
|
8195
8195
|
this.createItem(
|
8196
8196
|
4 /* PackageFunction */,
|
@@ -8202,7 +8202,7 @@ var SourceFileItemsService = class {
|
|
8202
8202
|
);
|
8203
8203
|
break;
|
8204
8204
|
}
|
8205
|
-
case
|
8205
|
+
case 31 /* PackageStructuredTypeDeclaration */: {
|
8206
8206
|
result.push(
|
8207
8207
|
this.createItem(
|
8208
8208
|
5 /* StructuredType */,
|
@@ -8214,7 +8214,7 @@ var SourceFileItemsService = class {
|
|
8214
8214
|
);
|
8215
8215
|
break;
|
8216
8216
|
}
|
8217
|
-
case
|
8217
|
+
case 52 /* FieldDeclaration */: {
|
8218
8218
|
result.push(
|
8219
8219
|
this.createItem(
|
8220
8220
|
12 /* Field */,
|
@@ -8226,7 +8226,7 @@ var SourceFileItemsService = class {
|
|
8226
8226
|
);
|
8227
8227
|
break;
|
8228
8228
|
}
|
8229
|
-
case
|
8229
|
+
case 53 /* FieldGetterDeclaration */: {
|
8230
8230
|
result.push(
|
8231
8231
|
this.createItem(
|
8232
8232
|
13 /* FieldGetter */,
|
@@ -8238,7 +8238,7 @@ var SourceFileItemsService = class {
|
|
8238
8238
|
);
|
8239
8239
|
break;
|
8240
8240
|
}
|
8241
|
-
case
|
8241
|
+
case 54 /* FieldSetterDeclaration */: {
|
8242
8242
|
result.push(
|
8243
8243
|
this.createItem(
|
8244
8244
|
14 /* FieldSetter */,
|
@@ -8250,7 +8250,7 @@ var SourceFileItemsService = class {
|
|
8250
8250
|
);
|
8251
8251
|
break;
|
8252
8252
|
}
|
8253
|
-
case
|
8253
|
+
case 50 /* MethodDeclaration */: {
|
8254
8254
|
result.push(
|
8255
8255
|
this.createItem(
|
8256
8256
|
15 /* Method */,
|
@@ -8262,7 +8262,7 @@ var SourceFileItemsService = class {
|
|
8262
8262
|
);
|
8263
8263
|
break;
|
8264
8264
|
}
|
8265
|
-
case
|
8265
|
+
case 43 /* ConstructorDeclaration */: {
|
8266
8266
|
result.push(
|
8267
8267
|
this.createItem(
|
8268
8268
|
10 /* Constructor */,
|
@@ -8274,7 +8274,7 @@ var SourceFileItemsService = class {
|
|
8274
8274
|
);
|
8275
8275
|
break;
|
8276
8276
|
}
|
8277
|
-
case
|
8277
|
+
case 44 /* DestructorDeclaration */: {
|
8278
8278
|
result.push(this.createItem(
|
8279
8279
|
11 /* Destructor */,
|
8280
8280
|
void 0,
|
@@ -8284,7 +8284,7 @@ var SourceFileItemsService = class {
|
|
8284
8284
|
));
|
8285
8285
|
break;
|
8286
8286
|
}
|
8287
|
-
case
|
8287
|
+
case 45 /* IndexedElementGetterDeclaration */: {
|
8288
8288
|
result.push(
|
8289
8289
|
this.createItem(
|
8290
8290
|
16 /* IndexedElementGetter */,
|
@@ -8296,7 +8296,7 @@ var SourceFileItemsService = class {
|
|
8296
8296
|
);
|
8297
8297
|
break;
|
8298
8298
|
}
|
8299
|
-
case
|
8299
|
+
case 46 /* IndexedElementSetterDeclaration */: {
|
8300
8300
|
result.push(
|
8301
8301
|
this.createItem(
|
8302
8302
|
17 /* IndexedElementSetter */,
|
@@ -8308,7 +8308,7 @@ var SourceFileItemsService = class {
|
|
8308
8308
|
);
|
8309
8309
|
break;
|
8310
8310
|
}
|
8311
|
-
case
|
8311
|
+
case 26 /* PackageFunctionTypeDeclaration */: {
|
8312
8312
|
result.push(
|
8313
8313
|
this.createItem(
|
8314
8314
|
6 /* FunctionType */,
|
@@ -8320,7 +8320,7 @@ var SourceFileItemsService = class {
|
|
8320
8320
|
);
|
8321
8321
|
break;
|
8322
8322
|
}
|
8323
|
-
case
|
8323
|
+
case 36 /* PackageVariantTypeDeclaration */: {
|
8324
8324
|
result.push(
|
8325
8325
|
this.createItem(
|
8326
8326
|
7 /* VariantType */,
|
@@ -8356,7 +8356,7 @@ var SourceFileItemsService = class {
|
|
8356
8356
|
);
|
8357
8357
|
break;
|
8358
8358
|
}
|
8359
|
-
case
|
8359
|
+
case 56 /* NestedFunctionDeclaration */: {
|
8360
8360
|
result.push(
|
8361
8361
|
this.createItem(
|
8362
8362
|
19 /* NestedFunction */,
|
@@ -8581,7 +8581,7 @@ var SelectionRangeService = class {
|
|
8581
8581
|
if (!this.nodeShouldBeSkipped(child) && !child.rangeWithoutTrivia.equals(result.range)) {
|
8582
8582
|
result = new SelectionRange(child.rangeWithoutTrivia, result);
|
8583
8583
|
}
|
8584
|
-
if (child.kind === 0 /* Token */ && (child.tokenKind === 6 /* TextLiteral */ || child.tokenKind === 7 /* TextTemplateHead */ || child.tokenKind === 8 /* TextTemplatePart */ || child.tokenKind === 9 /* TextTemplateTail */ || child.tokenKind === 5 /* CharLiteral */) || child.kind ===
|
8584
|
+
if (child.kind === 0 /* Token */ && (child.tokenKind === 6 /* TextLiteral */ || child.tokenKind === 7 /* TextTemplateHead */ || child.tokenKind === 8 /* TextTemplatePart */ || child.tokenKind === 9 /* TextTemplateTail */ || child.tokenKind === 5 /* CharLiteral */) || child.kind === 79 /* TextTemplateLiteral */) {
|
8585
8585
|
const textContentStart = child.rangeWithoutTrivia.start + 1;
|
8586
8586
|
const textContentEnd = child.rangeWithoutTrivia.end - 1;
|
8587
8587
|
if (offset >= textContentStart && offset < textContentEnd) {
|
@@ -8613,12 +8613,12 @@ var SelectionRangeService = class {
|
|
8613
8613
|
}
|
8614
8614
|
switch (node.kind) {
|
8615
8615
|
case 156 /* TypeAnnotation */:
|
8616
|
-
case
|
8617
|
-
case
|
8618
|
-
case
|
8619
|
-
case
|
8620
|
-
case
|
8621
|
-
case
|
8616
|
+
case 32 /* StructuredTypeDeclarationBody */:
|
8617
|
+
case 37 /* VariantTypeDeclarationBody */:
|
8618
|
+
case 21 /* AliasTypeDeclarationBody */:
|
8619
|
+
case 27 /* FunctionTypeDeclarationBody */:
|
8620
|
+
case 81 /* TextTemplateSpan */:
|
8621
|
+
case 80 /* TextTemplateSpanList */:
|
8622
8622
|
return true;
|
8623
8623
|
default:
|
8624
8624
|
return false;
|
@@ -8656,7 +8656,7 @@ var SemanticTokensService = class {
|
|
8656
8656
|
controller.stopChildrenTraverse();
|
8657
8657
|
return;
|
8658
8658
|
}
|
8659
|
-
if (node.kind ===
|
8659
|
+
if (node.kind === 86 /* IdentifierExpression */) {
|
8660
8660
|
const meaning = analyzer.resolveIdentifierExpression(node).meaning;
|
8661
8661
|
if (meaning.kind === "variable-access") {
|
8662
8662
|
const variable = meaning.variable.value.getEntity();
|
@@ -8712,7 +8712,7 @@ var SemanticTokensService = class {
|
|
8712
8712
|
));
|
8713
8713
|
}
|
8714
8714
|
}
|
8715
|
-
if (node.kind ===
|
8715
|
+
if (node.kind === 76 /* MemberAccessExpression */) {
|
8716
8716
|
const meaning = analyzer.resolveMemberAccessExpression(node).meaning;
|
8717
8717
|
if (meaning.kind === "static-field-access") {
|
8718
8718
|
const entity = meaning.field.value.getEntity();
|
@@ -8765,7 +8765,7 @@ var SemanticTokensService = class {
|
|
8765
8765
|
)
|
8766
8766
|
);
|
8767
8767
|
}
|
8768
|
-
if (node.kind ===
|
8768
|
+
if (node.kind === 25 /* PackageFunctionDeclaration */) {
|
8769
8769
|
result.push(
|
8770
8770
|
new SemanticToken(
|
8771
8771
|
node.name.rangeWithoutTrivia,
|
@@ -8774,7 +8774,7 @@ var SemanticTokensService = class {
|
|
8774
8774
|
)
|
8775
8775
|
);
|
8776
8776
|
}
|
8777
|
-
if (node.kind ===
|
8777
|
+
if (node.kind === 56 /* NestedFunctionDeclaration */) {
|
8778
8778
|
result.push(
|
8779
8779
|
new SemanticToken(
|
8780
8780
|
node.name.rangeWithoutTrivia,
|
@@ -8783,12 +8783,12 @@ var SemanticTokensService = class {
|
|
8783
8783
|
)
|
8784
8784
|
);
|
8785
8785
|
}
|
8786
|
-
if (node.kind ===
|
8786
|
+
if (node.kind === 50 /* MethodDeclaration */) {
|
8787
8787
|
result.push(
|
8788
8788
|
new SemanticToken(node.name.rangeWithoutTrivia, 6 /* Method */, new SemanticTokenModifiers().makeDeclaration().setCapitalized(this.isCapitalizedName(node.name.value)))
|
8789
8789
|
);
|
8790
8790
|
}
|
8791
|
-
if (node.kind ===
|
8791
|
+
if (node.kind === 51 /* OperatorDeclaration */) {
|
8792
8792
|
result.push(
|
8793
8793
|
new SemanticToken(node.name.rangeWithoutTrivia, 7 /* Operator */, new SemanticTokenModifiers().makeDeclaration())
|
8794
8794
|
);
|
@@ -8989,7 +8989,7 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8989
8989
|
switch (node.kind) {
|
8990
8990
|
case 10 /* NamedTypeSpecifier */:
|
8991
8991
|
return this.getSignaturesForNamedTypeSpecifier(node);
|
8992
|
-
case
|
8992
|
+
case 87 /* GenericSpecializationExpression */:
|
8993
8993
|
return this.getSignaturesForGenericSpecializationExpression(node);
|
8994
8994
|
case 147 /* Tag */:
|
8995
8995
|
return this.getSignaturesForTag(node);
|
@@ -9030,7 +9030,7 @@ var TypeParameterSignatureHelpProvider = class {
|
|
9030
9030
|
}
|
9031
9031
|
getSignaturesForGenericSpecializationExpression(node) {
|
9032
9032
|
const expression = unwrapParenthesizedExpressions(node.expression);
|
9033
|
-
if (expression.kind ===
|
9033
|
+
if (expression.kind === 86 /* IdentifierExpression */) {
|
9034
9034
|
const meaning = this._analyzer.resolveIdentifierExpression(expression).meaning;
|
9035
9035
|
if (meaning.kind === "function-access") {
|
9036
9036
|
return Query.from(meaning.candidates).mapAndFilter((o) => {
|
@@ -9045,7 +9045,7 @@ var TypeParameterSignatureHelpProvider = class {
|
|
9045
9045
|
}
|
9046
9046
|
return void 0;
|
9047
9047
|
}
|
9048
|
-
if (expression.kind ===
|
9048
|
+
if (expression.kind === 76 /* MemberAccessExpression */) {
|
9049
9049
|
const meaning = this._analyzer.resolveMemberAccessExpression(expression).meaning;
|
9050
9050
|
let accessedFunctions;
|
9051
9051
|
if (meaning.kind === "instance-method-access") {
|
@@ -9298,7 +9298,7 @@ var ValueParametersSignatureHelpProvider = class {
|
|
9298
9298
|
let node = token.parent;
|
9299
9299
|
while (node !== void 0) {
|
9300
9300
|
switch (node.kind) {
|
9301
|
-
case
|
9301
|
+
case 67 /* CallExpression */: {
|
9302
9302
|
if (this._offset >= node.openParenthesisToken.rangeWithoutTrivia.end && (node.closeParenthesisToken.rangeWithoutTrivia.isEmpty || this._offset <= node.closeParenthesisToken.rangeWithoutTrivia.start)) {
|
9303
9303
|
const valueArguments = ValueArgumentFactory.createValueArgumentsOfCallExpression(node);
|
9304
9304
|
const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
|
@@ -9306,7 +9306,7 @@ var ValueParametersSignatureHelpProvider = class {
|
|
9306
9306
|
}
|
9307
9307
|
break;
|
9308
9308
|
}
|
9309
|
-
case
|
9309
|
+
case 68 /* AutotypeCallExpression */: {
|
9310
9310
|
if (this._offset >= node.openParenthesisToken.rangeWithoutTrivia.end && (node.closeParenthesisToken.rangeWithoutTrivia.isEmpty || this._offset <= node.closeParenthesisToken.rangeWithoutTrivia.start)) {
|
9311
9311
|
const valueArguments = ValueArgumentFactory.createValueArgumentsOfAutotypeCallExpression(node);
|
9312
9312
|
const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
|
@@ -9314,7 +9314,7 @@ var ValueParametersSignatureHelpProvider = class {
|
|
9314
9314
|
}
|
9315
9315
|
break;
|
9316
9316
|
}
|
9317
|
-
case
|
9317
|
+
case 69 /* IndexedAccessExpression */: {
|
9318
9318
|
if (this._offset >= node.openSquareBracketToken.rangeWithoutTrivia.end && (node.closeSquareBracketToken.rangeWithoutTrivia.isEmpty || this._offset <= node.closeSquareBracketToken.rangeWithoutTrivia.start)) {
|
9319
9319
|
const valueArguments = ValueArgumentFactory.createValueArgumentsOfIndexedAccessExpression(node);
|
9320
9320
|
const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
|
@@ -13486,7 +13486,7 @@ var LanguageServer = class {
|
|
13486
13486
|
const sourceFileContext = yield this.getSourceFileContext(uri, token);
|
13487
13487
|
if (sourceFileContext !== void 0) {
|
13488
13488
|
const node = NodePath.parse(uri.fragment).getNode(sourceFileContext.sourceFile.getSyntaxNode());
|
13489
|
-
if (node?.kind ===
|
13489
|
+
if (node?.kind === 89 /* AssignmentStatement */) {
|
13490
13490
|
const sourceFileEdit = this._addPropertyAssignmentService.createEditWithAssignment(
|
13491
13491
|
sourceFileContext.sourceFile,
|
13492
13492
|
node,
|
@@ -13523,7 +13523,7 @@ var LanguageServer = class {
|
|
13523
13523
|
const node = NodePath.parse(uri.fragment).getNode(sourceFileContext.sourceFile.getSyntaxNode());
|
13524
13524
|
if (node !== void 0) {
|
13525
13525
|
let nodeForRange = node;
|
13526
|
-
if (node.kind ===
|
13526
|
+
if (node.kind === 89 /* AssignmentStatement */) {
|
13527
13527
|
nodeForRange = node.right;
|
13528
13528
|
}
|
13529
13529
|
result = this.convertSourceFileRange(sourceFileContext.sourceFile, nodeForRange.rangeWithoutTrivia);
|