@artel/artc 0.6.25218 → 0.6.25219
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 +8 -6
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +157 -158
- package/build/{chunk-FI6LW2RD.js → chunk-AIY75NR5.js} +1 -1
- package/build/{chunk-SK7ZBC3X.js → chunk-IYSH7MAQ.js} +878 -1003
- package/build/{chunk-TQDMVKTN.js → chunk-QLTGS2V2.js} +2 -2
- package/build/types/analysis/Analyzer.d.ts +1 -1
- package/build/types/analysis/ArgumentToParameterMatchResult.d.ts +3 -3
- package/build/types/analysis/SemanticContext.d.ts +7 -7
- package/build/types/analysis/Tags.d.ts +18 -6
- package/build/types/analysis/Utils.d.ts +4 -3
- package/build/types/diagnostic/DiagnosticCode.d.ts +2 -2
- package/build/types/emitter/IrToJs.d.ts +1 -1
- package/build/types/emitter/Transformer.d.ts +2 -2
- package/build/types/emitter/ir/Nodes.d.ts +66 -69
- package/build/types/emitter/ir/types.d.ts +2 -2
- package/build/types/tree/NodeKind.d.ts +57 -58
- package/build/types/tree/green/Nodes.d.ts +7 -20
- package/build/types/tree/red/Nodes.d.ts +8 -24
- package/package.json +1 -1
package/build/api/ApiServices.js
CHANGED
@@ -180,7 +180,7 @@ import {
|
|
180
180
|
unwrapParenthesizedExpressions,
|
181
181
|
visitChildren,
|
182
182
|
yieldExecution
|
183
|
-
} from "../chunk-
|
183
|
+
} from "../chunk-IYSH7MAQ.js";
|
184
184
|
|
185
185
|
// source/services/CustomCommand.ts
|
186
186
|
import * as ls from "vscode-languageserver";
|
@@ -368,17 +368,17 @@ var AddPropertyAssignmentService = class {
|
|
368
368
|
case 74 /* MethodLiteral */:
|
369
369
|
case 53 /* OperatorDeclaration */:
|
370
370
|
return void 0;
|
371
|
-
case
|
371
|
+
case 97 /* RunStatement */:
|
372
372
|
return this.ifShouldBeAssignedAtTheEndOfSubprogramThenBody(parent);
|
373
|
-
case
|
374
|
-
case
|
375
|
-
case
|
376
|
-
case
|
377
|
-
case
|
378
|
-
case
|
379
|
-
case
|
380
|
-
case
|
381
|
-
case
|
373
|
+
case 98 /* TryStatement */:
|
374
|
+
case 99 /* CatchClause */:
|
375
|
+
case 101 /* FinallyClause */:
|
376
|
+
case 106 /* ForStatement */:
|
377
|
+
case 107 /* IfStatement */:
|
378
|
+
case 109 /* ElseIfClause */:
|
379
|
+
case 113 /* LoopStatement */:
|
380
|
+
case 118 /* SwitchStatementCaseClause */:
|
381
|
+
case 119 /* WhileStatement */:
|
382
382
|
return this.getContainingSubprogram(parent)?.body;
|
383
383
|
default:
|
384
384
|
Debug.never(parent);
|
@@ -1995,17 +1995,17 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
1995
1995
|
[55 /* TypeVariableGetterDeclaration */]: this.prototype.writeTypeVariableGetterDeclaration,
|
1996
1996
|
[56 /* TypeVariableSetterDeclaration */]: this.prototype.writeTypeVariableSetterDeclaration,
|
1997
1997
|
[93 /* StatementBlock */]: this.prototype.writeStatementBlock,
|
1998
|
-
[
|
1999
|
-
[
|
2000
|
-
[
|
2001
|
-
[
|
2002
|
-
[
|
2003
|
-
[
|
2004
|
-
[
|
2005
|
-
[
|
2006
|
-
[
|
2007
|
-
[
|
2008
|
-
[
|
1998
|
+
[132 /* QualifiedName */]: this.prototype.writeQualifiedName,
|
1999
|
+
[139 /* VariantDeclaration */]: this.prototype.writeVariantDeclaration,
|
2000
|
+
[140 /* TypeParameterDeclaration */]: this.prototype.writeTypeParameterDeclaration,
|
2001
|
+
[141 /* ParameterDeclaration */]: this.prototype.writeParameterDeclaration,
|
2002
|
+
[142 /* Argument */]: this.prototype.writeArgument,
|
2003
|
+
[144 /* Tag */]: this.prototype.writeTag,
|
2004
|
+
[146 /* Modifier */]: this.prototype.writeModifier,
|
2005
|
+
[147 /* ParameterClause */]: this.prototype.writeParameterClause,
|
2006
|
+
[148 /* ParameterList */]: this.prototype.writeParameterList,
|
2007
|
+
[149 /* TypeArgumentClause */]: this.prototype.writeTypeArgumentClause,
|
2008
|
+
[151 /* TypeParameterClause */]: this.prototype.writeTypeParameterClause,
|
2009
2009
|
[17 /* AnonymousMethodTypeDeclaration */]: this.prototype.writeAnonymousMethodTypeDeclaration,
|
2010
2010
|
[18 /* AnonymousStructuredTypeDeclaration */]: this.prototype.writeAnonymousStructuredTypeDeclaration,
|
2011
2011
|
[19 /* AnonymousVariantTypeDeclaration */]: this.prototype.writeAnonymousVariantTypeDeclaration,
|
@@ -2061,53 +2061,52 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
2061
2061
|
[94 /* BreakLoopStatement */]: this.prototype.writeNodeDefault,
|
2062
2062
|
[95 /* ContinueLoopStatement */]: this.prototype.writeNodeDefault,
|
2063
2063
|
[96 /* DisposeStatement */]: this.prototype.writeNodeDefault,
|
2064
|
-
[97 /*
|
2065
|
-
[98 /*
|
2066
|
-
[99 /*
|
2067
|
-
[100 /*
|
2068
|
-
[101 /*
|
2069
|
-
[102 /*
|
2070
|
-
[103 /*
|
2071
|
-
[104 /*
|
2072
|
-
[105 /*
|
2073
|
-
[106 /*
|
2074
|
-
[107 /*
|
2075
|
-
[108 /*
|
2076
|
-
[109 /*
|
2077
|
-
[110 /*
|
2078
|
-
[111 /*
|
2079
|
-
[112 /*
|
2080
|
-
[113 /*
|
2081
|
-
[114 /*
|
2082
|
-
[115 /*
|
2083
|
-
[116 /*
|
2084
|
-
[117 /*
|
2085
|
-
[118 /*
|
2086
|
-
[119 /*
|
2087
|
-
[120 /*
|
2088
|
-
[121 /*
|
2089
|
-
[122 /*
|
2090
|
-
[123 /*
|
2091
|
-
[124 /*
|
2092
|
-
[125 /*
|
2093
|
-
[126 /*
|
2094
|
-
[127 /*
|
2095
|
-
[128 /*
|
2096
|
-
[129 /*
|
2097
|
-
[130 /*
|
2098
|
-
[131 /*
|
2099
|
-
[
|
2100
|
-
[134 /*
|
2101
|
-
[135 /*
|
2102
|
-
[136 /*
|
2103
|
-
[137 /*
|
2104
|
-
[138 /*
|
2105
|
-
[
|
2106
|
-
[
|
2107
|
-
[
|
2108
|
-
[
|
2109
|
-
[153 /*
|
2110
|
-
[154 /* TypeAnnotation */]: this.prototype.writeNodeDefault
|
2064
|
+
[97 /* RunStatement */]: this.prototype.writeNodeDefault,
|
2065
|
+
[98 /* TryStatement */]: this.prototype.writeNodeDefault,
|
2066
|
+
[99 /* CatchClause */]: this.prototype.writeNodeDefault,
|
2067
|
+
[100 /* ErrorVariableDeclaration */]: this.prototype.writeNodeDefault,
|
2068
|
+
[101 /* FinallyClause */]: this.prototype.writeNodeDefault,
|
2069
|
+
[102 /* EmptyStatement */]: this.prototype.writeNodeDefault,
|
2070
|
+
[103 /* ErrorStatement */]: this.prototype.writeNodeDefault,
|
2071
|
+
[104 /* ExpressionStatement */]: this.prototype.writeNodeDefault,
|
2072
|
+
[105 /* EnumerationVariableList */]: this.prototype.writeNodeDefault,
|
2073
|
+
[106 /* ForStatement */]: this.prototype.writeNodeDefault,
|
2074
|
+
[107 /* IfStatement */]: this.prototype.writeNodeDefault,
|
2075
|
+
[108 /* ElseIfClauseList */]: this.prototype.writeNodeDefault,
|
2076
|
+
[109 /* ElseIfClause */]: this.prototype.writeNodeDefault,
|
2077
|
+
[110 /* InvalidStatement */]: this.prototype.writeNodeDefault,
|
2078
|
+
[111 /* NestedMethodDeclarationStatement */]: this.prototype.writeNodeDefault,
|
2079
|
+
[112 /* LocalVariableDeclarationStatement */]: this.prototype.writeNodeDefault,
|
2080
|
+
[113 /* LoopStatement */]: this.prototype.writeNodeDefault,
|
2081
|
+
[114 /* ReturnStatement */]: this.prototype.writeNodeDefault,
|
2082
|
+
[115 /* CaseClauseList */]: this.prototype.writeNodeDefault,
|
2083
|
+
[116 /* SwitchStatement */]: this.prototype.writeNodeDefault,
|
2084
|
+
[117 /* MatchExpressionList */]: this.prototype.writeNodeDefault,
|
2085
|
+
[118 /* SwitchStatementCaseClause */]: this.prototype.writeNodeDefault,
|
2086
|
+
[119 /* WhileStatement */]: this.prototype.writeNodeDefault,
|
2087
|
+
[120 /* YieldStatement */]: this.prototype.writeNodeDefault,
|
2088
|
+
[121 /* TranslationParameterList */]: this.prototype.writeNodeDefault,
|
2089
|
+
[122 /* TranslationParameterClause */]: this.prototype.writeTranslationParameterClause,
|
2090
|
+
[123 /* ConstructorTranslation */]: this.prototype.writeConstructorTranslation,
|
2091
|
+
[124 /* IndexerTranslationParameterClause */]: this.prototype.writeIndexerTranslationParameterClause,
|
2092
|
+
[125 /* IndexerTranslation */]: this.prototype.writeIndexerTranslation,
|
2093
|
+
[126 /* TranslationTypeParameterList */]: this.prototype.writeNodeDefault,
|
2094
|
+
[127 /* TranslationTypeParameterClause */]: this.prototype.writeTranslationTypeParameterClause,
|
2095
|
+
[128 /* PackageMethodTranslation */]: this.prototype.writePackageMethodTranslation,
|
2096
|
+
[129 /* TypeMethodTranslation */]: this.prototype.writeTypeMethodTranslation,
|
2097
|
+
[130 /* MethodTypeTranslation */]: this.prototype.writeMethodTypeTranslation,
|
2098
|
+
[131 /* PackageImportTranslation */]: this.prototype.writePackageImportTranslation,
|
2099
|
+
[133 /* PackageVariableTranslation */]: this.prototype.writePackageVariableTranslation,
|
2100
|
+
[134 /* TypeVariableOrVariantTranslation */]: this.prototype.writeTypeVariableOrVariantTranslation,
|
2101
|
+
[135 /* TypeMemberTranslationList */]: this.prototype.writeNodeDefault,
|
2102
|
+
[136 /* TypeTranslation */]: this.prototype.writeTypeTranslation,
|
2103
|
+
[137 /* TextLiteralTranslation */]: this.prototype.writeNodeDefault,
|
2104
|
+
[138 /* TextTemplateLiteralTranslation */]: this.prototype.writeNodeDefault,
|
2105
|
+
[143 /* TagList */]: this.prototype.writeNodeDefault,
|
2106
|
+
[145 /* ModifierList */]: this.prototype.writeNodeDefault,
|
2107
|
+
[150 /* TypeArgumentList */]: this.prototype.writeNodeDefault,
|
2108
|
+
[152 /* TypeParameterList */]: this.prototype.writeNodeDefault,
|
2109
|
+
[153 /* TypeAnnotation */]: this.prototype.writeNodeDefault
|
2111
2110
|
};
|
2112
2111
|
return writeFunctions;
|
2113
2112
|
}
|
@@ -2293,7 +2292,7 @@ var TranslationsGenerationService = class {
|
|
2293
2292
|
return void 0;
|
2294
2293
|
}
|
2295
2294
|
let result;
|
2296
|
-
if (tokenOrKeyword.isToken(63 /* Identifier */) && tokenOrKeyword.parent.kind ===
|
2295
|
+
if (tokenOrKeyword.isToken(63 /* Identifier */) && tokenOrKeyword.parent.kind === 136 /* TypeTranslation */ && tokenOrKeyword.value === tokenOrKeyword.parent.sourceName) {
|
2297
2296
|
const translationPackage = analyzer.getAnalyzedTranslationPackageIfTargetResolved(sourceFile.package);
|
2298
2297
|
if (translationPackage !== void 0) {
|
2299
2298
|
const generator = new TranslationsGenerator(
|
@@ -2339,7 +2338,7 @@ var TranslationsGenerationService = class {
|
|
2339
2338
|
return false;
|
2340
2339
|
}
|
2341
2340
|
const generator = new TranslationsGenerator(analyzer, sourceFile, translationPackage, sourceFile.package.dialect);
|
2342
|
-
return Query.from(tokenOrKeyword.parent.translationList.translationDeclarations).filter((t) => t.kind ===
|
2341
|
+
return Query.from(tokenOrKeyword.parent.translationList.translationDeclarations).filter((t) => t.kind === 136 /* TypeTranslation */).mapAndFilter((t) => translationPackage.getTypeTranslationTarget(t).target).any((t) => generator.collectNotTranslatedTypeMembers(t).length > 0);
|
2343
2342
|
}
|
2344
2343
|
};
|
2345
2344
|
var TranslationsGenerator = class _TranslationsGenerator {
|
@@ -2366,7 +2365,7 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2366
2365
|
};
|
2367
2366
|
const memberTranslationsCode = Query.from(memberEntities).mapAndFilter((m) => this.createPackageMemberTranslationNode(m)).uniqueWithComparator(compareNodes).map((n) => {
|
2368
2367
|
const code = new SyntaxToCode(n, syntaxToCodeOptions).convert();
|
2369
|
-
if (n.kind ===
|
2368
|
+
if (n.kind === 136 /* TypeTranslation */) {
|
2370
2369
|
const startOffset = Math.max(code.indexOf(newLine), 0);
|
2371
2370
|
return this.addNewLineBeforeArrowsInTranslation(
|
2372
2371
|
code,
|
@@ -2398,7 +2397,7 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2398
2397
|
generateMissingTranslationsForPartiallyTranslatedTypes(translationsDeclaration) {
|
2399
2398
|
const result = new Array();
|
2400
2399
|
for (const translation of translationsDeclaration.translationList.translationDeclarations) {
|
2401
|
-
if (translation.kind ===
|
2400
|
+
if (translation.kind === 136 /* TypeTranslation */) {
|
2402
2401
|
const edits = this.generateMissingTypeMemberTranslations(translation);
|
2403
2402
|
if (edits !== void 0) {
|
2404
2403
|
result.push(...edits);
|
@@ -2495,13 +2494,13 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2495
2494
|
}
|
2496
2495
|
detectIndentationStepForTypeMemberTranslations(node) {
|
2497
2496
|
let indentationStepSize;
|
2498
|
-
if (node.kind ===
|
2497
|
+
if (node.kind === 136 /* TypeTranslation */) {
|
2499
2498
|
indentationStepSize = tryDetectIndentationStepSizeUsingTypeTranslation(node, this._sourceFile);
|
2500
2499
|
}
|
2501
2500
|
if (indentationStepSize === void 0) {
|
2502
2501
|
const translationsDeclarations = node.kind === 21 /* TranslationsDeclaration */ ? node : node.parent.parent;
|
2503
2502
|
for (const member of translationsDeclarations.translationList.translationDeclarations) {
|
2504
|
-
if (member.kind ===
|
2503
|
+
if (member.kind === 136 /* TypeTranslation */) {
|
2505
2504
|
indentationStepSize = tryDetectIndentationStepSizeUsingTypeTranslation(member, this._sourceFile);
|
2506
2505
|
if (indentationStepSize !== void 0) {
|
2507
2506
|
break;
|
@@ -2788,7 +2787,7 @@ var SignatureForNode = class _SignatureForNode {
|
|
2788
2787
|
return _SignatureForNode.getSignaturesForAutotypeCallExpression(analyzer, node);
|
2789
2788
|
case 71 /* IndexedAccessExpression */:
|
2790
2789
|
return _SignatureForNode.getSignaturesForIndexedAccessExpression(analyzer, node);
|
2791
|
-
case
|
2790
|
+
case 144 /* Tag */:
|
2792
2791
|
return _SignatureForNode.getSignaturesForTag(analyzer, node);
|
2793
2792
|
default:
|
2794
2793
|
Debug.never(node);
|
@@ -3223,7 +3222,7 @@ var CompletionService = class {
|
|
3223
3222
|
typeExtensionLookup
|
3224
3223
|
);
|
3225
3224
|
}
|
3226
|
-
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind ===
|
3225
|
+
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 132 /* QualifiedName */ && tokenOrKeyword.parent.parent.kind === 10 /* NamedTypeSpecifier */) {
|
3227
3226
|
const namedTypeSpecifier = tokenOrKeyword.parent.parent;
|
3228
3227
|
const resolutionResult = this._analyzer.resolveNamedTypeSpecifier(namedTypeSpecifier);
|
3229
3228
|
const segmentIndex = Math.floor(
|
@@ -3265,7 +3264,7 @@ var CompletionService = class {
|
|
3265
3264
|
}
|
3266
3265
|
return { kind: "none" };
|
3267
3266
|
}
|
3268
|
-
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind ===
|
3267
|
+
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 132 /* QualifiedName */ && tokenOrKeyword.parent.parent.kind === 144 /* Tag */) {
|
3269
3268
|
const tag = tokenOrKeyword.parent.parent;
|
3270
3269
|
const resolutionResult = this._analyzer.resolveTag(tag);
|
3271
3270
|
const segmentIndex = Math.floor(
|
@@ -3358,17 +3357,17 @@ var CompletionService = class {
|
|
3358
3357
|
translationKind = 0 /* Any */;
|
3359
3358
|
hasPrecedingKeyword = false;
|
3360
3359
|
}
|
3361
|
-
if (tokenOrKeyword.isKeyword(18 /* Import */) && tokenOrKeyword.parent.kind ===
|
3360
|
+
if (tokenOrKeyword.isKeyword(18 /* Import */) && tokenOrKeyword.parent.kind === 131 /* PackageImportTranslation */) {
|
3362
3361
|
translationsDeclaration = tokenOrKeyword.parent.parent.parent;
|
3363
3362
|
translationKind = 1 /* PackageImport */;
|
3364
3363
|
hasPrecedingKeyword = true;
|
3365
3364
|
}
|
3366
|
-
if (tokenOrKeyword.isKeyword(16 /* Type */) && (tokenOrKeyword.parent.kind ===
|
3365
|
+
if (tokenOrKeyword.isKeyword(16 /* Type */) && (tokenOrKeyword.parent.kind === 136 /* TypeTranslation */ || tokenOrKeyword.parent.kind === 130 /* MethodTypeTranslation */)) {
|
3367
3366
|
translationsDeclaration = tokenOrKeyword.parent.parent.parent;
|
3368
3367
|
translationKind = 3 /* Type */;
|
3369
3368
|
hasPrecedingKeyword = true;
|
3370
3369
|
}
|
3371
|
-
if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind ===
|
3370
|
+
if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 128 /* PackageMethodTranslation */) {
|
3372
3371
|
translationsDeclaration = tokenOrKeyword.parent.parent.parent;
|
3373
3372
|
translationKind = 2 /* Method */;
|
3374
3373
|
hasPrecedingKeyword = true;
|
@@ -3388,9 +3387,9 @@ var CompletionService = class {
|
|
3388
3387
|
hasPrecedingKeyword
|
3389
3388
|
);
|
3390
3389
|
}
|
3391
|
-
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind ===
|
3390
|
+
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 132 /* QualifiedName */) {
|
3392
3391
|
const qualifiedName = tokenOrKeyword.parent;
|
3393
|
-
if (qualifiedName.parent.kind ===
|
3392
|
+
if (qualifiedName.parent.kind === 131 /* PackageImportTranslation */ && qualifiedName === qualifiedName.parent.sourceName) {
|
3394
3393
|
const precedingSegmentNames = qualifiedName.qualifiers.takeWhile((s) => s.rangeStart < tokenOrKeyword.value.rangeStart).map((p) => this._analyzer.createNameFromIdentifier(p)).toArray();
|
3395
3394
|
const sourceLocale = translationPackage.getTranslatedPackage().getLocale();
|
3396
3395
|
return new PackageImportCompletionContext(precedingSegmentNames, { sourceLocale });
|
@@ -3415,12 +3414,12 @@ var CompletionService = class {
|
|
3415
3414
|
translationKind = 0 /* Any */;
|
3416
3415
|
hasPrecedingKeyword = false;
|
3417
3416
|
}
|
3418
|
-
if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind ===
|
3417
|
+
if (tokenOrKeyword.isKeyword(12 /* Function */) && tokenOrKeyword.parent.kind === 129 /* TypeMethodTranslation */) {
|
3419
3418
|
typeTranslation = tokenOrKeyword.parent.parent.parent;
|
3420
3419
|
translationKind = 1 /* Method */;
|
3421
3420
|
hasPrecedingKeyword = true;
|
3422
3421
|
}
|
3423
|
-
if (tokenOrKeyword.isKeyword(29 /* Creation */) && tokenOrKeyword.parent.kind ===
|
3422
|
+
if (tokenOrKeyword.isKeyword(29 /* Creation */) && tokenOrKeyword.parent.kind === 123 /* ConstructorTranslation */) {
|
3424
3423
|
typeTranslation = tokenOrKeyword.parent.parent.parent;
|
3425
3424
|
translationKind = 3 /* Constructor */;
|
3426
3425
|
hasPrecedingKeyword = true;
|
@@ -3460,7 +3459,7 @@ var CompletionService = class {
|
|
3460
3459
|
role.argumentList.parent
|
3461
3460
|
);
|
3462
3461
|
break;
|
3463
|
-
case
|
3462
|
+
case 144 /* Tag */:
|
3464
3463
|
signatures = SignatureForNode.getSignaturesForTag(this._analyzer, role.argumentList.parent);
|
3465
3464
|
valueArguments = ValueArgumentFactory.createValueArgumentsOfTag(role.argumentList.parent);
|
3466
3465
|
break;
|
@@ -3658,28 +3657,28 @@ var CompletionService = class {
|
|
3658
3657
|
return false;
|
3659
3658
|
}
|
3660
3659
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3661
|
-
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind ===
|
3660
|
+
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 113 /* LoopStatement */;
|
3662
3661
|
}
|
3663
3662
|
isModifierLevelContext(positionDescription) {
|
3664
3663
|
if (positionDescription.kind !== "after-token-or-keyword") {
|
3665
3664
|
return false;
|
3666
3665
|
}
|
3667
3666
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3668
|
-
return tokenOrKeyword.isToken(44 /* OpenParenthesis */) && tokenOrKeyword.parent.kind ===
|
3667
|
+
return tokenOrKeyword.isToken(44 /* OpenParenthesis */) && tokenOrKeyword.parent.kind === 146 /* Modifier */;
|
3669
3668
|
}
|
3670
3669
|
isElseOrElseIfKeywordContext(positionDescription) {
|
3671
3670
|
if (positionDescription.kind !== "after-token-or-keyword") {
|
3672
3671
|
return false;
|
3673
3672
|
}
|
3674
3673
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3675
|
-
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind ===
|
3674
|
+
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind === 107 /* IfStatement */ && tokenOrKeyword.parent === tokenOrKeyword.parent.parent.thenBlock || tokenOrKeyword.parent.parent.kind === 109 /* ElseIfClause */);
|
3676
3675
|
}
|
3677
3676
|
isRunStatementAccessorListContext(positionDescription) {
|
3678
3677
|
if (positionDescription.kind !== "after-token-or-keyword") {
|
3679
3678
|
return false;
|
3680
3679
|
}
|
3681
3680
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3682
|
-
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind ===
|
3681
|
+
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind === 97 /* RunStatement */ || tokenOrKeyword.parent.parent.kind === 99 /* CatchClause */ || tokenOrKeyword.parent.parent.kind === 101 /* FinallyClause */);
|
3683
3682
|
}
|
3684
3683
|
isTypeKindCompletionContext(positionDescription) {
|
3685
3684
|
return positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isToken(57 /* Equals */) && NodeTypeUtils.isPackageTypeDeclaration(positionDescription.tokenOrKeyword.parent);
|
@@ -3696,10 +3695,10 @@ var CompletionService = class {
|
|
3696
3695
|
return false;
|
3697
3696
|
}
|
3698
3697
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3699
|
-
if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind ===
|
3698
|
+
if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 93 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 118 /* SwitchStatementCaseClause */) {
|
3700
3699
|
return true;
|
3701
3700
|
}
|
3702
|
-
if (syntaxContext.precedingExpression !== void 0 && syntaxContext.precedingExpression.parent.kind ===
|
3701
|
+
if (syntaxContext.precedingExpression !== void 0 && syntaxContext.precedingExpression.parent.kind === 116 /* SwitchStatement */) {
|
3703
3702
|
return true;
|
3704
3703
|
}
|
3705
3704
|
return false;
|
@@ -4367,7 +4366,7 @@ function isInvalidNode(node) {
|
|
4367
4366
|
switch (node.kind) {
|
4368
4367
|
case 72 /* InvalidExpression */:
|
4369
4368
|
case 43 /* InvalidPackageMemberDeclaration */:
|
4370
|
-
case
|
4369
|
+
case 110 /* InvalidStatement */:
|
4371
4370
|
case 57 /* InvalidTypeMemberDeclaration */:
|
4372
4371
|
case 16 /* InvalidTypeSpecifier */:
|
4373
4372
|
return true;
|
@@ -5187,7 +5186,7 @@ var SyntaxContextFactory = class {
|
|
5187
5186
|
if (positionDescription.kind === "after-token-or-keyword") {
|
5188
5187
|
isUnqualifiedTypeContext = this.isUnqualifiedTypeContext(positionDescription.tokenOrKeyword);
|
5189
5188
|
}
|
5190
|
-
const isUnqualifiedTagNameCompletionContext = positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isToken(35 /* HashSign */) && positionDescription.tokenOrKeyword.parent.kind ===
|
5189
|
+
const isUnqualifiedTagNameCompletionContext = positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isToken(35 /* HashSign */) && positionDescription.tokenOrKeyword.parent.kind === 144 /* Tag */;
|
5191
5190
|
let isTopLevelTranslationListContext;
|
5192
5191
|
if (positionDescription.kind === "after-token-or-keyword") {
|
5193
5192
|
isTopLevelTranslationListContext = this.isTopLevelTranslationListContext(positionDescription.tokenOrKeyword);
|
@@ -5229,15 +5228,15 @@ var SyntaxContextFactory = class {
|
|
5229
5228
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.initializer);
|
5230
5229
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5231
5230
|
}
|
5232
|
-
if (tokenOrKeyword.parent.kind ===
|
5231
|
+
if (tokenOrKeyword.parent.kind === 141 /* ParameterDeclaration */) {
|
5233
5232
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.defaultValue);
|
5234
5233
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5235
5234
|
}
|
5236
|
-
if (tokenOrKeyword.parent.kind ===
|
5235
|
+
if (tokenOrKeyword.parent.kind === 142 /* Argument */) {
|
5237
5236
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.value);
|
5238
5237
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5239
5238
|
}
|
5240
|
-
if (tokenOrKeyword.parent.kind ===
|
5239
|
+
if (tokenOrKeyword.parent.kind === 139 /* VariantDeclaration */) {
|
5241
5240
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.value);
|
5242
5241
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5243
5242
|
}
|
@@ -5293,7 +5292,7 @@ var SyntaxContextFactory = class {
|
|
5293
5292
|
const expressionRole = new ExpressionRole_argument(tokenOrKeyword.parent.argumentList, 0);
|
5294
5293
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5295
5294
|
}
|
5296
|
-
if (tokenOrKeyword.parent.kind ===
|
5295
|
+
if (tokenOrKeyword.parent.kind === 144 /* Tag */) {
|
5297
5296
|
const argumentList = tokenOrKeyword.parent.argumentList;
|
5298
5297
|
if (argumentList !== void 0) {
|
5299
5298
|
const expressionRole = new ExpressionRole_argument(argumentList, 0);
|
@@ -5324,7 +5323,7 @@ var SyntaxContextFactory = class {
|
|
5324
5323
|
const expressionRole = new ExpressionRole_argument(argumentList, index);
|
5325
5324
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5326
5325
|
}
|
5327
|
-
if (tokenOrKeyword.parent.kind ===
|
5326
|
+
if (tokenOrKeyword.parent.kind === 117 /* MatchExpressionList */) {
|
5328
5327
|
const expressionRole = new ExpressionRole_matchListElement(tokenOrKeyword.parent.parent.parent.parent);
|
5329
5328
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5330
5329
|
}
|
@@ -5333,39 +5332,39 @@ var SyntaxContextFactory = class {
|
|
5333
5332
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5334
5333
|
}
|
5335
5334
|
}
|
5336
|
-
if (tokenOrKeyword.isKeyword(44 /* Case */) && tokenOrKeyword.parent.kind ===
|
5335
|
+
if (tokenOrKeyword.isKeyword(44 /* Case */) && tokenOrKeyword.parent.kind === 118 /* SwitchStatementCaseClause */) {
|
5337
5336
|
const expressionRole = new ExpressionRole_matchListElement(tokenOrKeyword.parent.parent.parent);
|
5338
5337
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5339
5338
|
}
|
5340
|
-
if (tokenOrKeyword.isKeyword(15 /* Return */) && tokenOrKeyword.parent.kind ===
|
5339
|
+
if (tokenOrKeyword.isKeyword(15 /* Return */) && tokenOrKeyword.parent.kind === 114 /* ReturnStatement */) {
|
5341
5340
|
const expressionRole = new ExpressionRole_returnedValue(tokenOrKeyword.parent);
|
5342
5341
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5343
5342
|
}
|
5344
|
-
if (tokenOrKeyword.isKeyword(43 /* Switch */) && tokenOrKeyword.parent.kind ===
|
5343
|
+
if (tokenOrKeyword.isKeyword(43 /* Switch */) && tokenOrKeyword.parent.kind === 116 /* SwitchStatement */) {
|
5345
5344
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5346
5345
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5347
5346
|
}
|
5348
|
-
if (tokenOrKeyword.isKeyword(13 /* If */) && tokenOrKeyword.parent.kind ===
|
5347
|
+
if (tokenOrKeyword.isKeyword(13 /* If */) && tokenOrKeyword.parent.kind === 107 /* IfStatement */) {
|
5349
5348
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5350
5349
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5351
5350
|
}
|
5352
|
-
if (tokenOrKeyword.isKeyword(11 /* ElseIf */) && tokenOrKeyword.parent.kind ===
|
5351
|
+
if (tokenOrKeyword.isKeyword(11 /* ElseIf */) && tokenOrKeyword.parent.kind === 109 /* ElseIfClause */) {
|
5353
5352
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5354
5353
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5355
5354
|
}
|
5356
|
-
if (tokenOrKeyword.isKeyword(9 /* From */) && tokenOrKeyword.parent.kind ===
|
5355
|
+
if (tokenOrKeyword.isKeyword(9 /* From */) && tokenOrKeyword.parent.kind === 106 /* ForStatement */) {
|
5357
5356
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.enumeratedExpression);
|
5358
5357
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5359
5358
|
}
|
5360
|
-
if (tokenOrKeyword.isKeyword(24 /* While */) && tokenOrKeyword.parent.kind ===
|
5359
|
+
if (tokenOrKeyword.isKeyword(24 /* While */) && tokenOrKeyword.parent.kind === 119 /* WhileStatement */) {
|
5361
5360
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5362
5361
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5363
5362
|
}
|
5364
|
-
if (tokenOrKeyword.isKeyword(26 /* RepeatWhile */) && tokenOrKeyword.parent.kind ===
|
5363
|
+
if (tokenOrKeyword.isKeyword(26 /* RepeatWhile */) && tokenOrKeyword.parent.kind === 113 /* LoopStatement */) {
|
5365
5364
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5366
5365
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5367
5366
|
}
|
5368
|
-
if (tokenOrKeyword.isKeyword(27 /* Yield */) && tokenOrKeyword.parent.kind ===
|
5367
|
+
if (tokenOrKeyword.isKeyword(27 /* Yield */) && tokenOrKeyword.parent.kind === 120 /* YieldStatement */) {
|
5369
5368
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5370
5369
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5371
5370
|
}
|
@@ -5407,10 +5406,10 @@ var SyntaxContextFactory = class {
|
|
5407
5406
|
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 37 /* PackageVariableSetterDeclaration */)) {
|
5408
5407
|
return true;
|
5409
5408
|
}
|
5410
|
-
if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind ===
|
5409
|
+
if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind === 146 /* Modifier */ && tokenOrKeyword.value === tokenOrKeyword.parent.value && tokenOrKeyword.parent.openParenthesisToken === void 0 && NodeTypeUtils.isPackageMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
|
5411
5410
|
return true;
|
5412
5411
|
}
|
5413
|
-
if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind ===
|
5412
|
+
if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind === 146 /* Modifier */ && NodeTypeUtils.isPackageMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
|
5414
5413
|
return true;
|
5415
5414
|
}
|
5416
5415
|
return false;
|
@@ -5431,13 +5430,13 @@ var SyntaxContextFactory = class {
|
|
5431
5430
|
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
|
5432
5431
|
tokenOrKeyword,
|
5433
5432
|
51 /* TypeDereferencedVariableSetterDeclaration */
|
5434
|
-
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 52 /* TypeMethodDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 53 /* OperatorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 45 /* TypeConstructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 46 /* TypeDestructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword,
|
5433
|
+
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 52 /* TypeMethodDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 53 /* OperatorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 45 /* TypeConstructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 46 /* TypeDestructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 139 /* VariantDeclaration */)) {
|
5435
5434
|
return true;
|
5436
5435
|
}
|
5437
|
-
if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind ===
|
5436
|
+
if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind === 146 /* Modifier */ && tokenOrKeyword.value === tokenOrKeyword.parent.value && tokenOrKeyword.parent.openParenthesisToken === void 0 && NodeTypeUtils.isTypeMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
|
5438
5437
|
return true;
|
5439
5438
|
}
|
5440
|
-
if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind ===
|
5439
|
+
if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind === 146 /* Modifier */ && NodeTypeUtils.isTypeMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
|
5441
5440
|
return true;
|
5442
5441
|
}
|
5443
5442
|
return false;
|
@@ -5474,7 +5473,7 @@ var SyntaxContextFactory = class {
|
|
5474
5473
|
return result;
|
5475
5474
|
}
|
5476
5475
|
static isUnqualifiedTypeContext(tokenOrKeyword) {
|
5477
|
-
if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind ===
|
5476
|
+
if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind === 153 /* TypeAnnotation */) {
|
5478
5477
|
return { allowsAnonymousTypes: true };
|
5479
5478
|
}
|
5480
5479
|
if ((tokenOrKeyword.isKeyword(4 /* Object */) || tokenOrKeyword.isKeyword(5 /* PlainObject */) || tokenOrKeyword.isKeyword(3 /* Aspect */)) && tokenOrKeyword.parent.kind === 34 /* StructuredTypeDeclarationBody */) {
|
@@ -5483,16 +5482,16 @@ var SyntaxContextFactory = class {
|
|
5483
5482
|
if (tokenOrKeyword.isKeyword(16 /* Type */) && (NodeTypeUtils.isPackageTypeDeclaration(tokenOrKeyword.parent) || tokenOrKeyword.parent.kind === 40 /* TypeExtensionDeclaration */)) {
|
5484
5483
|
return { allowsAnonymousTypes: false };
|
5485
5484
|
}
|
5486
|
-
if (tokenOrKeyword.isToken(36 /* LessThan */) && tokenOrKeyword.parent.kind ===
|
5485
|
+
if (tokenOrKeyword.isToken(36 /* LessThan */) && tokenOrKeyword.parent.kind === 149 /* TypeArgumentClause */) {
|
5487
5486
|
return { allowsAnonymousTypes: true };
|
5488
5487
|
}
|
5489
|
-
if (tokenOrKeyword.isToken(24 /* Comma */) && (tokenOrKeyword.parent.kind === 30 /* BaseTypeList */ || tokenOrKeyword.parent.kind ===
|
5490
|
-
return { allowsAnonymousTypes: tokenOrKeyword.parent.kind ===
|
5488
|
+
if (tokenOrKeyword.isToken(24 /* Comma */) && (tokenOrKeyword.parent.kind === 30 /* BaseTypeList */ || tokenOrKeyword.parent.kind === 150 /* TypeArgumentList */)) {
|
5489
|
+
return { allowsAnonymousTypes: tokenOrKeyword.parent.kind === 150 /* TypeArgumentList */ };
|
5491
5490
|
}
|
5492
|
-
if (tokenOrKeyword.isToken(35 /* HashSign */) && tokenOrKeyword.parent.kind ===
|
5491
|
+
if (tokenOrKeyword.isToken(35 /* HashSign */) && tokenOrKeyword.parent.kind === 144 /* Tag */) {
|
5493
5492
|
return { allowsAnonymousTypes: false };
|
5494
5493
|
}
|
5495
|
-
if ((tokenOrKeyword.isToken(23 /* Colon */) || tokenOrKeyword.isToken(57 /* Equals */)) && tokenOrKeyword.parent.kind ===
|
5494
|
+
if ((tokenOrKeyword.isToken(23 /* Colon */) || tokenOrKeyword.isToken(57 /* Equals */)) && tokenOrKeyword.parent.kind === 140 /* TypeParameterDeclaration */) {
|
5496
5495
|
return { allowsAnonymousTypes: false };
|
5497
5496
|
}
|
5498
5497
|
if (tokenOrKeyword.isToken(57 /* Equals */) && tokenOrKeyword.parent.kind === 22 /* PackageAliasTypeDeclaration */) {
|
@@ -5518,32 +5517,32 @@ var SyntaxContextFactory = class {
|
|
5518
5517
|
}
|
5519
5518
|
const packageImport = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5520
5519
|
tokenOrKeyword,
|
5521
|
-
|
5520
|
+
131 /* PackageImportTranslation */
|
5522
5521
|
);
|
5523
5522
|
if (packageImport !== void 0) {
|
5524
5523
|
return { translationsDeclaration: packageImport.parent.parent };
|
5525
5524
|
}
|
5526
|
-
const type = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword,
|
5525
|
+
const type = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 136 /* TypeTranslation */);
|
5527
5526
|
if (type !== void 0) {
|
5528
5527
|
return { translationsDeclaration: type.parent.parent };
|
5529
5528
|
}
|
5530
5529
|
const methodType = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5531
5530
|
tokenOrKeyword,
|
5532
|
-
|
5531
|
+
130 /* MethodTypeTranslation */
|
5533
5532
|
);
|
5534
5533
|
if (methodType !== void 0) {
|
5535
5534
|
return { translationsDeclaration: methodType.parent.parent };
|
5536
5535
|
}
|
5537
5536
|
const variable = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5538
5537
|
tokenOrKeyword,
|
5539
|
-
|
5538
|
+
133 /* PackageVariableTranslation */
|
5540
5539
|
);
|
5541
5540
|
if (variable !== void 0) {
|
5542
5541
|
return { translationsDeclaration: variable.parent.parent };
|
5543
5542
|
}
|
5544
5543
|
const method = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5545
5544
|
tokenOrKeyword,
|
5546
|
-
|
5545
|
+
128 /* PackageMethodTranslation */
|
5547
5546
|
);
|
5548
5547
|
if (method !== void 0) {
|
5549
5548
|
return { translationsDeclaration: method.parent.parent };
|
@@ -5551,33 +5550,33 @@ var SyntaxContextFactory = class {
|
|
5551
5550
|
return void 0;
|
5552
5551
|
}
|
5553
5552
|
static isTypeMemberTranslationListContext(tokenOrKeyword) {
|
5554
|
-
if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind ===
|
5553
|
+
if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 135 /* TypeMemberTranslationList */) {
|
5555
5554
|
return { typeTranslation: tokenOrKeyword.parent.parent };
|
5556
5555
|
}
|
5557
|
-
if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind ===
|
5556
|
+
if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 136 /* TypeTranslation */) {
|
5558
5557
|
return { typeTranslation: tokenOrKeyword.parent };
|
5559
5558
|
}
|
5560
|
-
const indexer = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword,
|
5559
|
+
const indexer = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 125 /* IndexerTranslation */);
|
5561
5560
|
if (indexer !== void 0) {
|
5562
5561
|
return { typeTranslation: indexer.parent.parent };
|
5563
5562
|
}
|
5564
5563
|
const constructor = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5565
5564
|
tokenOrKeyword,
|
5566
|
-
|
5565
|
+
123 /* ConstructorTranslation */
|
5567
5566
|
);
|
5568
5567
|
if (constructor !== void 0) {
|
5569
5568
|
return { typeTranslation: constructor.parent.parent };
|
5570
5569
|
}
|
5571
5570
|
const variableOrVariant = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5572
5571
|
tokenOrKeyword,
|
5573
|
-
|
5572
|
+
134 /* TypeVariableOrVariantTranslation */
|
5574
5573
|
);
|
5575
5574
|
if (variableOrVariant !== void 0) {
|
5576
5575
|
return { typeTranslation: variableOrVariant.parent.parent };
|
5577
5576
|
}
|
5578
5577
|
const method = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5579
5578
|
tokenOrKeyword,
|
5580
|
-
|
5579
|
+
129 /* TypeMethodTranslation */
|
5581
5580
|
);
|
5582
5581
|
if (method !== void 0) {
|
5583
5582
|
return { typeTranslation: method.parent.parent };
|
@@ -5725,11 +5724,11 @@ var NodeSemanticInfoService = class {
|
|
5725
5724
|
let result;
|
5726
5725
|
const parent = node.parent;
|
5727
5726
|
switch (parent.kind) {
|
5728
|
-
case
|
5727
|
+
case 126 /* TranslationTypeParameterList */:
|
5729
5728
|
break;
|
5730
|
-
case
|
5729
|
+
case 121 /* TranslationParameterList */:
|
5731
5730
|
break;
|
5732
|
-
case
|
5731
|
+
case 142 /* Argument */: {
|
5733
5732
|
const respectiveParameter = analyzer.getRespectiveParameter(parent);
|
5734
5733
|
if (respectiveParameter !== void 0) {
|
5735
5734
|
const target = new SimpleWithLocalization(
|
@@ -5746,7 +5745,7 @@ var NodeSemanticInfoService = class {
|
|
5746
5745
|
case 60 /* EnumerationVariableDeclaration */:
|
5747
5746
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofEnumerationVariableDeclaration(parent));
|
5748
5747
|
break;
|
5749
|
-
case
|
5748
|
+
case 100 /* ErrorVariableDeclaration */:
|
5750
5749
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofErrorVariableDeclaration(parent));
|
5751
5750
|
break;
|
5752
5751
|
case 22 /* PackageAliasTypeDeclaration */:
|
@@ -5776,10 +5775,10 @@ var NodeSemanticInfoService = class {
|
|
5776
5775
|
case 59 /* LocalVariableDeclaration */:
|
5777
5776
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofLocalVariableDeclaration(parent));
|
5778
5777
|
break;
|
5779
|
-
case
|
5778
|
+
case 132 /* QualifiedName */:
|
5780
5779
|
result = this.ofQualifiedNameQualifier(analyzer, parent, node, options6);
|
5781
5780
|
break;
|
5782
|
-
case
|
5781
|
+
case 133 /* PackageVariableTranslation */: {
|
5783
5782
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5784
5783
|
const getTargetResult = translationPackage?.getPackageVariableTranslationTarget(parent);
|
5785
5784
|
if (translationPackage !== void 0 && getTargetResult?.target !== void 0) {
|
@@ -5799,7 +5798,7 @@ var NodeSemanticInfoService = class {
|
|
5799
5798
|
}
|
5800
5799
|
break;
|
5801
5800
|
}
|
5802
|
-
case
|
5801
|
+
case 134 /* TypeVariableOrVariantTranslation */: {
|
5803
5802
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5804
5803
|
const getTargetsResult = translationPackage?.getTypeVariableOrVariantTranslationTargets(parent);
|
5805
5804
|
if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
|
@@ -5823,7 +5822,7 @@ var NodeSemanticInfoService = class {
|
|
5823
5822
|
}
|
5824
5823
|
break;
|
5825
5824
|
}
|
5826
|
-
case
|
5825
|
+
case 128 /* PackageMethodTranslation */: {
|
5827
5826
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5828
5827
|
const getTargetsResult = translationPackage?.getPackageMethodTranslationTargets(parent);
|
5829
5828
|
if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
|
@@ -5847,7 +5846,7 @@ var NodeSemanticInfoService = class {
|
|
5847
5846
|
}
|
5848
5847
|
break;
|
5849
5848
|
}
|
5850
|
-
case
|
5849
|
+
case 129 /* TypeMethodTranslation */: {
|
5851
5850
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5852
5851
|
const getTargetsResult = translationPackage?.getTypeMethodTranslationTargets(parent);
|
5853
5852
|
if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
|
@@ -5871,7 +5870,7 @@ var NodeSemanticInfoService = class {
|
|
5871
5870
|
}
|
5872
5871
|
break;
|
5873
5872
|
}
|
5874
|
-
case
|
5873
|
+
case 136 /* TypeTranslation */: {
|
5875
5874
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5876
5875
|
const getTargetResult = translationPackage?.getTypeTranslationTarget(parent);
|
5877
5876
|
if (translationPackage !== void 0 && getTargetResult?.target !== void 0) {
|
@@ -5891,7 +5890,7 @@ var NodeSemanticInfoService = class {
|
|
5891
5890
|
}
|
5892
5891
|
break;
|
5893
5892
|
}
|
5894
|
-
case
|
5893
|
+
case 130 /* MethodTypeTranslation */: {
|
5895
5894
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5896
5895
|
const getTargetResult = translationPackage?.getMethodTypeTranslationTarget(parent);
|
5897
5896
|
if (translationPackage !== void 0 && getTargetResult?.target !== void 0) {
|
@@ -5911,7 +5910,7 @@ var NodeSemanticInfoService = class {
|
|
5911
5910
|
}
|
5912
5911
|
break;
|
5913
5912
|
}
|
5914
|
-
case
|
5913
|
+
case 141 /* ParameterDeclaration */:
|
5915
5914
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofParameterDeclaration(parent));
|
5916
5915
|
break;
|
5917
5916
|
case 8 /* PackageImport */:
|
@@ -5932,10 +5931,10 @@ var NodeSemanticInfoService = class {
|
|
5932
5931
|
case 54 /* TypeVariableDeclaration */:
|
5933
5932
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofTypeVariableDeclaration(parent));
|
5934
5933
|
break;
|
5935
|
-
case
|
5934
|
+
case 140 /* TypeParameterDeclaration */:
|
5936
5935
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofTypeParameterDeclaration(parent));
|
5937
5936
|
break;
|
5938
|
-
case
|
5937
|
+
case 139 /* VariantDeclaration */:
|
5939
5938
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofVariantDeclaration(parent));
|
5940
5939
|
break;
|
5941
5940
|
case 36 /* PackageVariableGetterDeclaration */:
|
@@ -6046,10 +6045,10 @@ var NodeSemanticInfoService = class {
|
|
6046
6045
|
switch (node.parent.kind) {
|
6047
6046
|
case 10 /* NamedTypeSpecifier */:
|
6048
6047
|
return this.ofNamedTypeSpecifierNameQualifier(analyzer, node.parent, qualifier, options6);
|
6049
|
-
case
|
6048
|
+
case 144 /* Tag */:
|
6050
6049
|
return this.ofTagNameQualifier(analyzer, node.parent, qualifier, options6);
|
6051
6050
|
case 42 /* ExtendedTypeClause */:
|
6052
|
-
case
|
6051
|
+
case 131 /* PackageImportTranslation */:
|
6053
6052
|
return void 0;
|
6054
6053
|
default:
|
6055
6054
|
Debug.never(node.parent);
|
@@ -6783,7 +6782,7 @@ function getEntitySourceLocations(analyzer, entity) {
|
|
6783
6782
|
case 38 /* PackageVariantTypeDeclaration */:
|
6784
6783
|
case 58 /* NestedMethodDeclaration */:
|
6785
6784
|
case 52 /* TypeMethodDeclaration */:
|
6786
|
-
case
|
6785
|
+
case 140 /* TypeParameterDeclaration */:
|
6787
6786
|
case 53 /* OperatorDeclaration */:
|
6788
6787
|
range = node.name.rangeWithoutTrivia;
|
6789
6788
|
break;
|
@@ -7624,17 +7623,17 @@ var EvaluatableExpressionService = class {
|
|
7624
7623
|
return { nameIdentifier: node.name };
|
7625
7624
|
case 59 /* LocalVariableDeclaration */:
|
7626
7625
|
return { nameIdentifier: node.name };
|
7627
|
-
case
|
7626
|
+
case 141 /* ParameterDeclaration */:
|
7628
7627
|
return { nameIdentifier: node.name };
|
7629
7628
|
case 52 /* TypeMethodDeclaration */:
|
7630
7629
|
return { nameIdentifier: node.name };
|
7631
7630
|
case 54 /* TypeVariableDeclaration */:
|
7632
7631
|
return { nameIdentifier: node.name };
|
7633
|
-
case
|
7632
|
+
case 140 /* TypeParameterDeclaration */:
|
7634
7633
|
return { nameIdentifier: node.name };
|
7635
|
-
case
|
7634
|
+
case 139 /* VariantDeclaration */:
|
7636
7635
|
return { nameIdentifier: node.name };
|
7637
|
-
case
|
7636
|
+
case 100 /* ErrorVariableDeclaration */:
|
7638
7637
|
return { nameIdentifier: node.name };
|
7639
7638
|
default:
|
7640
7639
|
return void 0;
|
@@ -8047,7 +8046,7 @@ var SourceFileItemsService = class {
|
|
8047
8046
|
);
|
8048
8047
|
break;
|
8049
8048
|
}
|
8050
|
-
case
|
8049
|
+
case 139 /* VariantDeclaration */: {
|
8051
8050
|
result.push(
|
8052
8051
|
this.createItem(
|
8053
8052
|
9 /* Variant */,
|
@@ -8059,7 +8058,7 @@ var SourceFileItemsService = class {
|
|
8059
8058
|
);
|
8060
8059
|
break;
|
8061
8060
|
}
|
8062
|
-
case
|
8061
|
+
case 140 /* TypeParameterDeclaration */: {
|
8063
8062
|
result.push(
|
8064
8063
|
this.createItem(
|
8065
8064
|
18 /* TypeParameter */,
|
@@ -8322,7 +8321,7 @@ var SelectionRangeService = class {
|
|
8322
8321
|
}
|
8323
8322
|
}
|
8324
8323
|
switch (node.kind) {
|
8325
|
-
case
|
8324
|
+
case 153 /* TypeAnnotation */:
|
8326
8325
|
case 34 /* StructuredTypeDeclarationBody */:
|
8327
8326
|
case 39 /* VariantTypeDeclarationBody */:
|
8328
8327
|
case 23 /* AliasTypeDeclarationBody */:
|
@@ -8466,7 +8465,7 @@ var SemanticTokensService = class {
|
|
8466
8465
|
));
|
8467
8466
|
}
|
8468
8467
|
}
|
8469
|
-
if (node.kind ===
|
8468
|
+
if (node.kind === 139 /* VariantDeclaration */) {
|
8470
8469
|
result.push(
|
8471
8470
|
new SemanticToken(
|
8472
8471
|
node.name.rangeWithoutTrivia,
|
@@ -8650,7 +8649,7 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8650
8649
|
}
|
8651
8650
|
let node = token.parent;
|
8652
8651
|
while (node !== void 0) {
|
8653
|
-
if (node.kind ===
|
8652
|
+
if (node.kind === 149 /* TypeArgumentClause */ && this._offset >= node.lessThanToken.rangeWithoutTrivia.end && (node.greaterThanToken.rangeWithoutTrivia.isEmpty || this._offset <= node.greaterThanToken.rangeWithoutTrivia.start)) {
|
8654
8653
|
const argumentIndex = this.getArgumentIndex(node.typeArgumentList, this._offset);
|
8655
8654
|
const argumentCount = this.countArguments(node.typeArgumentList);
|
8656
8655
|
return new NodeWithTypeArgumentsInfo(node.parent, argumentIndex, argumentCount);
|
@@ -8697,7 +8696,7 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8697
8696
|
return this.getSignaturesForNamedTypeSpecifier(node);
|
8698
8697
|
case 89 /* GenericSpecializationExpression */:
|
8699
8698
|
return this.getSignaturesForGenericSpecializationExpression(node);
|
8700
|
-
case
|
8699
|
+
case 144 /* Tag */:
|
8701
8700
|
return this.getSignaturesForTag(node);
|
8702
8701
|
default:
|
8703
8702
|
Debug.never(node);
|
@@ -9028,7 +9027,7 @@ var ValueParametersSignatureHelpProvider = class {
|
|
9028
9027
|
}
|
9029
9028
|
break;
|
9030
9029
|
}
|
9031
|
-
case
|
9030
|
+
case 144 /* Tag */: {
|
9032
9031
|
if (node.openParenthesisToken !== void 0 && this._offset >= node.openParenthesisToken.rangeWithoutTrivia.end && node.argumentList !== void 0 && (node.closeParenthesisToken === void 0 || node.closeParenthesisToken.rangeWithoutTrivia.isEmpty || this._offset <= node.closeParenthesisToken.rangeWithoutTrivia.start)) {
|
9033
9032
|
const argumentIndex = this.getArgumentIndexInList(node.argumentList.elements, this._offset);
|
9034
9033
|
const valueArguments = ValueArgumentFactory.createValueArgumentsOfTag(node);
|