@artel/artc 0.6.25214 → 0.6.25215
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 +6 -4
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +227 -267
- package/build/{chunk-ZFBZFTRR.js → chunk-DZ66PBHU.js} +6079 -6321
- package/build/{chunk-SKJMYOQR.js → chunk-GEFYL4SZ.js} +1 -1
- package/build/{chunk-YCHDDDYS.js → chunk-TT3Q66WU.js} +2 -2
- package/build/types/analysis/Analyzer.d.ts +1 -4
- package/build/types/analysis/{PrefixUnaryOperatorResolver.d.ts → UserDefinableUnaryOperatorResolver.d.ts} +3 -5
- package/build/types/analysis/Utils.d.ts +2 -2
- package/build/types/emitter/EmitterContext.d.ts +2 -0
- package/build/types/emitter/IrBuilder.d.ts +0 -1
- package/build/types/emitter/IrToJs.d.ts +0 -1
- package/build/types/emitter/Transformer.d.ts +158 -97
- package/build/types/emitter/ir/Nodes.d.ts +4 -11
- package/build/types/emitter/ir/types.d.ts +2 -2
- package/build/types/parser/UnescapeText.d.ts +1 -0
- package/build/types/services/NodeSemanticInfo.d.ts +0 -1
- package/build/types/tree/NodeKind.d.ts +82 -83
- package/build/types/tree/TokenKind.d.ts +2 -2
- package/build/types/tree/green/Nodes.d.ts +3 -19
- package/build/types/tree/red/Nodes.d.ts +4 -18
- package/package.json +1 -1
- package/build/types/emitter/BlockStatementTransformationResult.d.ts +0 -10
- package/build/types/emitter/ExpressionTransformationResult.d.ts +0 -17
- package/build/types/emitter/Internal.d.ts +0 -9
- package/build/types/emitter/PackageMemberDeclarationTransformationResult.d.ts +0 -17
- package/build/types/emitter/SimpleTransformationResult.d.ts +0 -14
- package/build/types/emitter/StatementTransformationResult.d.ts +0 -21
- package/build/types/emitter/StructuredTypeMemberDeclarationTransformationResult.d.ts +0 -13
- package/build/types/emitter/TransformationContinuationAction.d.ts +0 -4
- package/build/types/emitter/TypeAccessExpressionTransformationResult.d.ts +0 -12
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-DZ66PBHU.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 !== 79 /* PropertyAccessExpression */) {
|
306
306
|
return void 0;
|
307
307
|
}
|
308
308
|
const propertyReceiver = assignmentNode.left.expression;
|
@@ -367,19 +367,19 @@ var AddPropertyAssignmentService = class {
|
|
367
367
|
case 56 /* TypeVariableSetterDeclaration */:
|
368
368
|
case 58 /* NestedMethodDeclaration */:
|
369
369
|
case 67 /* MethodBlockLiteral */:
|
370
|
-
case
|
370
|
+
case 75 /* MethodLiteral */:
|
371
371
|
case 53 /* OperatorDeclaration */:
|
372
372
|
return void 0;
|
373
|
-
case
|
373
|
+
case 99 /* RunStatement */:
|
374
374
|
return this.ifShouldBeAssignedAtTheEndOfSubprogramThenBody(parent);
|
375
|
-
case
|
376
|
-
case
|
377
|
-
case
|
378
|
-
case
|
379
|
-
case
|
380
|
-
case
|
381
|
-
case
|
382
|
-
case
|
375
|
+
case 100 /* OnErrorClause */:
|
376
|
+
case 102 /* FinallyClause */:
|
377
|
+
case 107 /* ForStatement */:
|
378
|
+
case 108 /* IfStatement */:
|
379
|
+
case 110 /* ElseIfClause */:
|
380
|
+
case 114 /* LoopStatement */:
|
381
|
+
case 119 /* SwitchStatementCaseClause */:
|
382
|
+
case 120 /* WhileStatement */:
|
383
383
|
return this.getContainingSubprogram(parent)?.body;
|
384
384
|
default:
|
385
385
|
Debug.never(parent);
|
@@ -414,7 +414,7 @@ function isSubprogramDeclaration(node) {
|
|
414
414
|
case 56 /* TypeVariableSetterDeclaration */:
|
415
415
|
case 58 /* NestedMethodDeclaration */:
|
416
416
|
case 67 /* MethodBlockLiteral */:
|
417
|
-
case
|
417
|
+
case 75 /* MethodLiteral */:
|
418
418
|
return true;
|
419
419
|
default:
|
420
420
|
Debug.typeIsAssignableTo();
|
@@ -2032,19 +2032,19 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
2032
2032
|
[54 /* TypeVariableDeclaration */]: this.prototype.writeTypeVariableDeclaration,
|
2033
2033
|
[55 /* TypeVariableGetterDeclaration */]: this.prototype.writeTypeVariableGetterDeclaration,
|
2034
2034
|
[56 /* TypeVariableSetterDeclaration */]: this.prototype.writeTypeVariableSetterDeclaration,
|
2035
|
-
[
|
2036
|
-
[
|
2037
|
-
[
|
2038
|
-
[
|
2039
|
-
[
|
2040
|
-
[
|
2041
|
-
[
|
2042
|
-
[
|
2043
|
-
[
|
2044
|
-
[
|
2045
|
-
[
|
2046
|
-
[
|
2047
|
-
[
|
2035
|
+
[94 /* StatementBlock */]: this.prototype.writeStatementBlock,
|
2036
|
+
[133 /* QualifiedName */]: this.prototype.writeQualifiedName,
|
2037
|
+
[140 /* VariantDeclaration */]: this.prototype.writeVariantDeclaration,
|
2038
|
+
[141 /* TypeParameterDeclaration */]: this.prototype.writeTypeParameterDeclaration,
|
2039
|
+
[142 /* ParameterDeclaration */]: this.prototype.writeParameterDeclaration,
|
2040
|
+
[143 /* CallArgument */]: this.prototype.writeCallArgument,
|
2041
|
+
[145 /* Tag */]: this.prototype.writeTag,
|
2042
|
+
[147 /* Modifier */]: this.prototype.writeModifier,
|
2043
|
+
[148 /* ParameterClause */]: this.prototype.writeParameterClause,
|
2044
|
+
[149 /* ParameterList */]: this.prototype.writeParameterList,
|
2045
|
+
[150 /* SetterParameterClause */]: this.prototype.writeSetterParameterClause,
|
2046
|
+
[152 /* TypeArgumentClause */]: this.prototype.writeTypeArgumentClause,
|
2047
|
+
[154 /* TypeParameterClause */]: this.prototype.writeTypeParameterClause,
|
2048
2048
|
[17 /* AnonymousMethodTypeDeclaration */]: this.prototype.writeAnonymousMethodTypeDeclaration,
|
2049
2049
|
[18 /* AnonymousStructuredTypeDeclaration */]: this.prototype.writeAnonymousStructuredTypeDeclaration,
|
2050
2050
|
[19 /* AnonymousVariantTypeDeclaration */]: this.prototype.writeAnonymousVariantTypeDeclaration,
|
@@ -2079,76 +2079,75 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
2079
2079
|
[72 /* IndexedAccessExpression */]: this.prototype.writeNodeDefault,
|
2080
2080
|
[73 /* InvalidExpression */]: this.prototype.writeNodeDefault,
|
2081
2081
|
[74 /* IsExpression */]: this.prototype.writeNodeDefault,
|
2082
|
-
[75 /*
|
2083
|
-
[76 /*
|
2084
|
-
[77 /*
|
2085
|
-
[78 /*
|
2086
|
-
[79 /*
|
2087
|
-
[80 /*
|
2088
|
-
[81 /*
|
2089
|
-
[82 /*
|
2090
|
-
[83 /*
|
2091
|
-
[84 /*
|
2092
|
-
[85 /*
|
2093
|
-
[86 /*
|
2094
|
-
[87 /*
|
2095
|
-
[88 /*
|
2096
|
-
[89 /*
|
2097
|
-
[90 /*
|
2098
|
-
[91 /*
|
2099
|
-
[92 /*
|
2100
|
-
[93 /*
|
2101
|
-
[
|
2102
|
-
[96 /*
|
2103
|
-
[97 /*
|
2104
|
-
[98 /*
|
2105
|
-
[99 /*
|
2106
|
-
[100 /*
|
2107
|
-
[101 /*
|
2108
|
-
[102 /*
|
2109
|
-
[103 /*
|
2110
|
-
[104 /*
|
2111
|
-
[105 /*
|
2112
|
-
[106 /*
|
2113
|
-
[107 /*
|
2114
|
-
[108 /*
|
2115
|
-
[109 /*
|
2116
|
-
[110 /*
|
2117
|
-
[111 /*
|
2118
|
-
[112 /*
|
2119
|
-
[113 /*
|
2120
|
-
[114 /*
|
2121
|
-
[115 /*
|
2122
|
-
[116 /*
|
2123
|
-
[117 /*
|
2124
|
-
[118 /*
|
2125
|
-
[119 /*
|
2126
|
-
[120 /*
|
2127
|
-
[121 /*
|
2128
|
-
[122 /*
|
2129
|
-
[123 /*
|
2130
|
-
[124 /*
|
2131
|
-
[125 /*
|
2132
|
-
[126 /*
|
2133
|
-
[127 /*
|
2134
|
-
[128 /*
|
2135
|
-
[129 /*
|
2136
|
-
[130 /*
|
2137
|
-
[131 /*
|
2138
|
-
[132 /*
|
2139
|
-
[
|
2140
|
-
[135 /*
|
2141
|
-
[136 /*
|
2142
|
-
[137 /*
|
2143
|
-
[138 /*
|
2144
|
-
[139 /*
|
2145
|
-
[
|
2146
|
-
[
|
2147
|
-
[
|
2148
|
-
[
|
2149
|
-
[
|
2150
|
-
[156 /*
|
2151
|
-
[157 /* TypeAnnotation */]: this.prototype.writeNodeDefault
|
2082
|
+
[75 /* MethodLiteral */]: this.prototype.writeNodeDefault,
|
2083
|
+
[76 /* ParenthesizedExpression */]: this.prototype.writeNodeDefault,
|
2084
|
+
[77 /* WhenTernaryExpression */]: this.prototype.writeNodeDefault,
|
2085
|
+
[78 /* PrefixUnaryExpression */]: this.prototype.writeNodeDefault,
|
2086
|
+
[79 /* PropertyAccessExpression */]: this.prototype.writeNodeDefault,
|
2087
|
+
[80 /* ReferenceExpression */]: this.prototype.writeNodeDefault,
|
2088
|
+
[81 /* DereferenceExpression */]: this.prototype.writeNodeDefault,
|
2089
|
+
[82 /* TextTemplateLiteral */]: this.prototype.writeNodeDefault,
|
2090
|
+
[83 /* TextTemplateSpanList */]: this.prototype.writeNodeDefault,
|
2091
|
+
[84 /* TextTemplateSpan */]: this.prototype.writeNodeDefault,
|
2092
|
+
[85 /* TokenExpression */]: this.prototype.writeNodeDefault,
|
2093
|
+
[86 /* KeywordExpression */]: this.prototype.writeNodeDefault,
|
2094
|
+
[87 /* ObjectExpression */]: this.prototype.writeNodeDefault,
|
2095
|
+
[88 /* BaseExpression */]: this.prototype.writeNodeDefault,
|
2096
|
+
[89 /* IdentifierExpression */]: this.prototype.writeNodeDefault,
|
2097
|
+
[90 /* GenericSpecializationExpression */]: this.prototype.writeNodeDefault,
|
2098
|
+
[91 /* DefaultMatchExpression */]: this.prototype.writeNodeDefault,
|
2099
|
+
[92 /* AssignmentStatement */]: this.prototype.writeNodeDefault,
|
2100
|
+
[93 /* StatementList */]: this.prototype.writeNodeDefault,
|
2101
|
+
[95 /* BreakLoopStatement */]: this.prototype.writeNodeDefault,
|
2102
|
+
[96 /* ContinueLoopStatement */]: this.prototype.writeNodeDefault,
|
2103
|
+
[97 /* DisposeStatement */]: this.prototype.writeNodeDefault,
|
2104
|
+
[98 /* RunStatementClauseList */]: this.prototype.writeNodeDefault,
|
2105
|
+
[99 /* RunStatement */]: this.prototype.writeNodeDefault,
|
2106
|
+
[100 /* OnErrorClause */]: this.prototype.writeNodeDefault,
|
2107
|
+
[101 /* ErrorVariableDeclaration */]: this.prototype.writeNodeDefault,
|
2108
|
+
[102 /* FinallyClause */]: this.prototype.writeNodeDefault,
|
2109
|
+
[103 /* EmptyStatement */]: this.prototype.writeNodeDefault,
|
2110
|
+
[104 /* ErrorStatement */]: this.prototype.writeNodeDefault,
|
2111
|
+
[105 /* ExpressionStatement */]: this.prototype.writeNodeDefault,
|
2112
|
+
[106 /* EnumerationVariableList */]: this.prototype.writeNodeDefault,
|
2113
|
+
[107 /* ForStatement */]: this.prototype.writeNodeDefault,
|
2114
|
+
[108 /* IfStatement */]: this.prototype.writeNodeDefault,
|
2115
|
+
[109 /* ElseIfClauseList */]: this.prototype.writeNodeDefault,
|
2116
|
+
[110 /* ElseIfClause */]: this.prototype.writeNodeDefault,
|
2117
|
+
[111 /* InvalidStatement */]: this.prototype.writeNodeDefault,
|
2118
|
+
[112 /* NestedMethodDeclarationStatement */]: this.prototype.writeNodeDefault,
|
2119
|
+
[113 /* LocalVariableDeclarationStatement */]: this.prototype.writeNodeDefault,
|
2120
|
+
[114 /* LoopStatement */]: this.prototype.writeNodeDefault,
|
2121
|
+
[115 /* ReturnStatement */]: this.prototype.writeNodeDefault,
|
2122
|
+
[116 /* CaseClauseList */]: this.prototype.writeNodeDefault,
|
2123
|
+
[117 /* SwitchStatement */]: this.prototype.writeNodeDefault,
|
2124
|
+
[118 /* MatchExpressionList */]: this.prototype.writeNodeDefault,
|
2125
|
+
[119 /* SwitchStatementCaseClause */]: this.prototype.writeNodeDefault,
|
2126
|
+
[120 /* WhileStatement */]: this.prototype.writeNodeDefault,
|
2127
|
+
[121 /* YieldStatement */]: this.prototype.writeNodeDefault,
|
2128
|
+
[122 /* TranslationParameterList */]: this.prototype.writeNodeDefault,
|
2129
|
+
[123 /* TranslationParameterClause */]: this.prototype.writeTranslationParameterClause,
|
2130
|
+
[124 /* ConstructorTranslation */]: this.prototype.writeConstructorTranslation,
|
2131
|
+
[125 /* IndexerTranslationParameterClause */]: this.prototype.writeIndexerTranslationParameterClause,
|
2132
|
+
[126 /* IndexerTranslation */]: this.prototype.writeIndexerTranslation,
|
2133
|
+
[127 /* TranslationTypeParameterList */]: this.prototype.writeNodeDefault,
|
2134
|
+
[128 /* TranslationTypeParameterClause */]: this.prototype.writeTranslationTypeParameterClause,
|
2135
|
+
[129 /* PackageMethodTranslation */]: this.prototype.writePackageMethodTranslation,
|
2136
|
+
[130 /* TypeMethodTranslation */]: this.prototype.writeTypeMethodTranslation,
|
2137
|
+
[131 /* MethodTypeTranslation */]: this.prototype.writeMethodTypeTranslation,
|
2138
|
+
[132 /* PackageImportTranslation */]: this.prototype.writePackageImportTranslation,
|
2139
|
+
[134 /* PackageVariableTranslation */]: this.prototype.writePackageVariableTranslation,
|
2140
|
+
[135 /* TypeVariableOrVariantTranslation */]: this.prototype.writeTypeVariableOrVariantTranslation,
|
2141
|
+
[136 /* TypeMemberTranslationList */]: this.prototype.writeNodeDefault,
|
2142
|
+
[137 /* TypeTranslation */]: this.prototype.writeTypeTranslation,
|
2143
|
+
[138 /* TextLiteralTranslation */]: this.prototype.writeNodeDefault,
|
2144
|
+
[139 /* TextTemplateLiteralTranslation */]: this.prototype.writeNodeDefault,
|
2145
|
+
[144 /* TagList */]: this.prototype.writeNodeDefault,
|
2146
|
+
[146 /* ModifierList */]: this.prototype.writeNodeDefault,
|
2147
|
+
[151 /* SetterParameterDeclaration */]: this.prototype.writeNodeDefault,
|
2148
|
+
[153 /* TypeArgumentList */]: this.prototype.writeNodeDefault,
|
2149
|
+
[155 /* TypeParameterList */]: this.prototype.writeNodeDefault,
|
2150
|
+
[156 /* TypeAnnotation */]: this.prototype.writeNodeDefault
|
2152
2151
|
};
|
2153
2152
|
return writeFunctions;
|
2154
2153
|
}
|
@@ -2334,7 +2333,7 @@ var TranslationsGenerationService = class {
|
|
2334
2333
|
return void 0;
|
2335
2334
|
}
|
2336
2335
|
let result;
|
2337
|
-
if (tokenOrKeyword.isToken(63 /* Identifier */) && tokenOrKeyword.parent.kind ===
|
2336
|
+
if (tokenOrKeyword.isToken(63 /* Identifier */) && tokenOrKeyword.parent.kind === 137 /* TypeTranslation */ && tokenOrKeyword.value === tokenOrKeyword.parent.sourceName) {
|
2338
2337
|
const translationPackage = analyzer.getAnalyzedTranslationPackageIfTargetResolved(sourceFile.package);
|
2339
2338
|
if (translationPackage !== void 0) {
|
2340
2339
|
const generator = new TranslationsGenerator(
|
@@ -2380,7 +2379,7 @@ var TranslationsGenerationService = class {
|
|
2380
2379
|
return false;
|
2381
2380
|
}
|
2382
2381
|
const generator = new TranslationsGenerator(analyzer, sourceFile, translationPackage, sourceFile.package.dialect);
|
2383
|
-
return Query.from(tokenOrKeyword.parent.translationList.translationDeclarations).filter((t) => t.kind ===
|
2382
|
+
return Query.from(tokenOrKeyword.parent.translationList.translationDeclarations).filter((t) => t.kind === 137 /* TypeTranslation */).mapAndFilter((t) => translationPackage.getTypeTranslationTarget(t).target).any((t) => generator.collectNotTranslatedTypeMembers(t).length > 0);
|
2384
2383
|
}
|
2385
2384
|
};
|
2386
2385
|
var TranslationsGenerator = class _TranslationsGenerator {
|
@@ -2407,7 +2406,7 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2407
2406
|
};
|
2408
2407
|
const memberTranslationsCode = Query.from(memberEntities).mapAndFilter((m) => this.createPackageMemberTranslationNode(m)).uniqueWithComparator(compareNodes).map((n) => {
|
2409
2408
|
const code = new SyntaxToCode(n, syntaxToCodeOptions).convert();
|
2410
|
-
if (n.kind ===
|
2409
|
+
if (n.kind === 137 /* TypeTranslation */) {
|
2411
2410
|
const startOffset = Math.max(code.indexOf(newLine), 0);
|
2412
2411
|
return this.addNewLineBeforeArrowsInTranslation(
|
2413
2412
|
code,
|
@@ -2439,7 +2438,7 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2439
2438
|
generateMissingTranslationsForPartiallyTranslatedTypes(translationsDeclaration) {
|
2440
2439
|
const result = new Array();
|
2441
2440
|
for (const translation of translationsDeclaration.translationList.translationDeclarations) {
|
2442
|
-
if (translation.kind ===
|
2441
|
+
if (translation.kind === 137 /* TypeTranslation */) {
|
2443
2442
|
const edits = this.generateMissingTypeMemberTranslations(translation);
|
2444
2443
|
if (edits !== void 0) {
|
2445
2444
|
result.push(...edits);
|
@@ -2547,13 +2546,13 @@ var TranslationsGenerator = class _TranslationsGenerator {
|
|
2547
2546
|
}
|
2548
2547
|
detectIndentationStepForTypeMemberTranslations(node) {
|
2549
2548
|
let indentationStepSize;
|
2550
|
-
if (node.kind ===
|
2549
|
+
if (node.kind === 137 /* TypeTranslation */) {
|
2551
2550
|
indentationStepSize = tryDetectIndentationStepSizeUsingTypeTranslation(node, this._sourceFile);
|
2552
2551
|
}
|
2553
2552
|
if (indentationStepSize === void 0) {
|
2554
2553
|
const translationsDeclarations = node.kind === 21 /* TranslationsDeclaration */ ? node : node.parent.parent;
|
2555
2554
|
for (const member of translationsDeclarations.translationList.translationDeclarations) {
|
2556
|
-
if (member.kind ===
|
2555
|
+
if (member.kind === 137 /* TypeTranslation */) {
|
2557
2556
|
indentationStepSize = tryDetectIndentationStepSizeUsingTypeTranslation(member, this._sourceFile);
|
2558
2557
|
if (indentationStepSize !== void 0) {
|
2559
2558
|
break;
|
@@ -2864,7 +2863,7 @@ var SignatureForNode = class _SignatureForNode {
|
|
2864
2863
|
return _SignatureForNode.getSignaturesForAutotypeCallExpression(analyzer, node);
|
2865
2864
|
case 72 /* IndexedAccessExpression */:
|
2866
2865
|
return _SignatureForNode.getSignaturesForIndexedAccessExpression(analyzer, node);
|
2867
|
-
case
|
2866
|
+
case 145 /* Tag */:
|
2868
2867
|
return _SignatureForNode.getSignaturesForTag(analyzer, node);
|
2869
2868
|
default:
|
2870
2869
|
Debug.never(node);
|
@@ -3298,7 +3297,7 @@ var CompletionService = class {
|
|
3298
3297
|
if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 6 /* PackageGroupImportDirective */ || this.tokenOrKeywordIsPackageImportListChild(tokenOrKeyword)) {
|
3299
3298
|
return new PackageImportCompletionContext([], void 0);
|
3300
3299
|
}
|
3301
|
-
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind ===
|
3300
|
+
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 79 /* PropertyAccessExpression */) {
|
3302
3301
|
const propertyAccess = tokenOrKeyword.parent;
|
3303
3302
|
{
|
3304
3303
|
const info = this._analyzer.checkExpressionDenotesPackageNameSegment(propertyAccess.expression);
|
@@ -3339,7 +3338,7 @@ var CompletionService = class {
|
|
3339
3338
|
typeExtensionLookup
|
3340
3339
|
);
|
3341
3340
|
}
|
3342
|
-
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind ===
|
3341
|
+
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 133 /* QualifiedName */ && tokenOrKeyword.parent.parent.kind === 10 /* NamedTypeSpecifier */) {
|
3343
3342
|
const namedTypeSpecifier = tokenOrKeyword.parent.parent;
|
3344
3343
|
const resolutionResult = this._analyzer.resolveNamedTypeSpecifier(namedTypeSpecifier);
|
3345
3344
|
const segmentIndex = Math.floor(
|
@@ -3433,17 +3432,17 @@ var CompletionService = class {
|
|
3433
3432
|
translationKind = 0 /* Any */;
|
3434
3433
|
hasPrecedingKeyword = false;
|
3435
3434
|
}
|
3436
|
-
if (tokenOrKeyword.isKeyword(17 /* Import */) && tokenOrKeyword.parent.kind ===
|
3435
|
+
if (tokenOrKeyword.isKeyword(17 /* Import */) && tokenOrKeyword.parent.kind === 132 /* PackageImportTranslation */) {
|
3437
3436
|
translationsDeclaration = tokenOrKeyword.parent.parent.parent;
|
3438
3437
|
translationKind = 1 /* PackageImport */;
|
3439
3438
|
hasPrecedingKeyword = true;
|
3440
3439
|
}
|
3441
|
-
if (tokenOrKeyword.isKeyword(15 /* Type */) && (tokenOrKeyword.parent.kind ===
|
3440
|
+
if (tokenOrKeyword.isKeyword(15 /* Type */) && (tokenOrKeyword.parent.kind === 137 /* TypeTranslation */ || tokenOrKeyword.parent.kind === 131 /* MethodTypeTranslation */)) {
|
3442
3441
|
translationsDeclaration = tokenOrKeyword.parent.parent.parent;
|
3443
3442
|
translationKind = 3 /* Type */;
|
3444
3443
|
hasPrecedingKeyword = true;
|
3445
3444
|
}
|
3446
|
-
if (tokenOrKeyword.isKeyword(11 /* Function */) && tokenOrKeyword.parent.kind ===
|
3445
|
+
if (tokenOrKeyword.isKeyword(11 /* Function */) && tokenOrKeyword.parent.kind === 129 /* PackageMethodTranslation */) {
|
3447
3446
|
translationsDeclaration = tokenOrKeyword.parent.parent.parent;
|
3448
3447
|
translationKind = 2 /* Method */;
|
3449
3448
|
hasPrecedingKeyword = true;
|
@@ -3463,9 +3462,9 @@ var CompletionService = class {
|
|
3463
3462
|
hasPrecedingKeyword
|
3464
3463
|
);
|
3465
3464
|
}
|
3466
|
-
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind ===
|
3465
|
+
if (tokenOrKeyword.isToken(26 /* Dot */) && tokenOrKeyword.parent.kind === 133 /* QualifiedName */) {
|
3467
3466
|
const qualifiedName = tokenOrKeyword.parent;
|
3468
|
-
if (qualifiedName.parent.kind ===
|
3467
|
+
if (qualifiedName.parent.kind === 132 /* PackageImportTranslation */ && qualifiedName === qualifiedName.parent.sourceName) {
|
3469
3468
|
const precedingSegmentNames = qualifiedName.qualifiers.takeWhile((s) => s.rangeStart < tokenOrKeyword.value.rangeStart).map((p) => this._analyzer.createNameFromIdentifier(p)).toArray();
|
3470
3469
|
const sourceLocale = translationPackage.getTranslatedPackage().getLocale();
|
3471
3470
|
return new PackageImportCompletionContext(precedingSegmentNames, { sourceLocale });
|
@@ -3490,12 +3489,12 @@ var CompletionService = class {
|
|
3490
3489
|
translationKind = 0 /* Any */;
|
3491
3490
|
hasPrecedingKeyword = false;
|
3492
3491
|
}
|
3493
|
-
if (tokenOrKeyword.isKeyword(11 /* Function */) && tokenOrKeyword.parent.kind ===
|
3492
|
+
if (tokenOrKeyword.isKeyword(11 /* Function */) && tokenOrKeyword.parent.kind === 130 /* TypeMethodTranslation */) {
|
3494
3493
|
typeTranslation = tokenOrKeyword.parent.parent.parent;
|
3495
3494
|
translationKind = 1 /* Method */;
|
3496
3495
|
hasPrecedingKeyword = true;
|
3497
3496
|
}
|
3498
|
-
if (tokenOrKeyword.isKeyword(28 /* Creation */) && tokenOrKeyword.parent.kind ===
|
3497
|
+
if (tokenOrKeyword.isKeyword(28 /* Creation */) && tokenOrKeyword.parent.kind === 124 /* ConstructorTranslation */) {
|
3499
3498
|
typeTranslation = tokenOrKeyword.parent.parent.parent;
|
3500
3499
|
translationKind = 3 /* Constructor */;
|
3501
3500
|
hasPrecedingKeyword = true;
|
@@ -3535,7 +3534,7 @@ var CompletionService = class {
|
|
3535
3534
|
role.argumentList.parent
|
3536
3535
|
);
|
3537
3536
|
break;
|
3538
|
-
case
|
3537
|
+
case 145 /* Tag */:
|
3539
3538
|
signatures = SignatureForNode.getSignaturesForTag(this._analyzer, role.argumentList.parent);
|
3540
3539
|
valueArguments = ValueArgumentFactory.createValueArgumentsOfTag(role.argumentList.parent);
|
3541
3540
|
break;
|
@@ -3725,7 +3724,7 @@ var CompletionService = class {
|
|
3725
3724
|
if (syntaxContext.isUnqualifiedTypeContext?.allowsAnonymousTypes === true) {
|
3726
3725
|
kinds.add(5 /* PlainObject */).add(4 /* Object */).add(6 /* Variant */).add(3 /* Aspect */).add(11 /* Function */).add(38 /* Async */);
|
3727
3726
|
}
|
3728
|
-
if (positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isKeyword(38 /* Async */) && (positionDescription.tokenOrKeyword.parent.kind === 58 /* NestedMethodDeclaration */ || positionDescription.tokenOrKeyword.parent.kind ===
|
3727
|
+
if (positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isKeyword(38 /* Async */) && (positionDescription.tokenOrKeyword.parent.kind === 58 /* NestedMethodDeclaration */ || positionDescription.tokenOrKeyword.parent.kind === 75 /* MethodLiteral */ || positionDescription.tokenOrKeyword.parent.kind === 29 /* MethodTypeDeclarationBody */)) {
|
3729
3728
|
kinds.add(11 /* Function */);
|
3730
3729
|
}
|
3731
3730
|
return Query.from(kinds.values()).map(
|
@@ -3737,28 +3736,28 @@ var CompletionService = class {
|
|
3737
3736
|
return false;
|
3738
3737
|
}
|
3739
3738
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3740
|
-
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind ===
|
3739
|
+
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 94 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 114 /* LoopStatement */;
|
3741
3740
|
}
|
3742
3741
|
isModifierLevelContext(positionDescription) {
|
3743
3742
|
if (positionDescription.kind !== "after-token-or-keyword") {
|
3744
3743
|
return false;
|
3745
3744
|
}
|
3746
3745
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3747
|
-
return tokenOrKeyword.isToken(44 /* OpenParenthesis */) && tokenOrKeyword.parent.kind ===
|
3746
|
+
return tokenOrKeyword.isToken(44 /* OpenParenthesis */) && tokenOrKeyword.parent.kind === 147 /* Modifier */;
|
3748
3747
|
}
|
3749
3748
|
isElseOrElseIfKeywordContext(positionDescription) {
|
3750
3749
|
if (positionDescription.kind !== "after-token-or-keyword") {
|
3751
3750
|
return false;
|
3752
3751
|
}
|
3753
3752
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3754
|
-
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind ===
|
3753
|
+
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 94 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind === 108 /* IfStatement */ && tokenOrKeyword.parent === tokenOrKeyword.parent.parent.thenBlock || tokenOrKeyword.parent.parent.kind === 110 /* ElseIfClause */);
|
3755
3754
|
}
|
3756
3755
|
isRunStatementAccessorListContext(positionDescription) {
|
3757
3756
|
if (positionDescription.kind !== "after-token-or-keyword") {
|
3758
3757
|
return false;
|
3759
3758
|
}
|
3760
3759
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3761
|
-
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind ===
|
3760
|
+
return tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 94 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind === 99 /* RunStatement */ || tokenOrKeyword.parent.parent.kind === 100 /* OnErrorClause */ || tokenOrKeyword.parent.parent.kind === 102 /* FinallyClause */);
|
3762
3761
|
}
|
3763
3762
|
isTypeKindCompletionContext(positionDescription) {
|
3764
3763
|
return positionDescription.kind === "after-token-or-keyword" && positionDescription.tokenOrKeyword.isToken(57 /* Equals */) && NodeTypeUtils.isPackageTypeDeclaration(positionDescription.tokenOrKeyword.parent);
|
@@ -3775,10 +3774,10 @@ var CompletionService = class {
|
|
3775
3774
|
return false;
|
3776
3775
|
}
|
3777
3776
|
const tokenOrKeyword = positionDescription.tokenOrKeyword;
|
3778
|
-
if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind ===
|
3777
|
+
if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 94 /* StatementBlock */ && tokenOrKeyword.parent.parent.kind === 119 /* SwitchStatementCaseClause */) {
|
3779
3778
|
return true;
|
3780
3779
|
}
|
3781
|
-
if (syntaxContext.precedingExpression !== void 0 && syntaxContext.precedingExpression.parent.kind ===
|
3780
|
+
if (syntaxContext.precedingExpression !== void 0 && syntaxContext.precedingExpression.parent.kind === 117 /* SwitchStatement */) {
|
3782
3781
|
return true;
|
3783
3782
|
}
|
3784
3783
|
return false;
|
@@ -4414,7 +4413,7 @@ function isInvalidNode(node) {
|
|
4414
4413
|
switch (node.kind) {
|
4415
4414
|
case 73 /* InvalidExpression */:
|
4416
4415
|
case 43 /* InvalidPackageMemberDeclaration */:
|
4417
|
-
case
|
4416
|
+
case 111 /* InvalidStatement */:
|
4418
4417
|
case 57 /* InvalidTypeMemberDeclaration */:
|
4419
4418
|
case 16 /* InvalidTypeSpecifier */:
|
4420
4419
|
return true;
|
@@ -5285,7 +5284,7 @@ var SyntaxContextFactory = class {
|
|
5285
5284
|
}
|
5286
5285
|
static isExpressionOrStatementContext(tokenOrKeyword) {
|
5287
5286
|
if (tokenOrKeyword.isToken(57 /* Equals */)) {
|
5288
|
-
if (tokenOrKeyword.parent.kind ===
|
5287
|
+
if (tokenOrKeyword.parent.kind === 92 /* AssignmentStatement */) {
|
5289
5288
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.right);
|
5290
5289
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5291
5290
|
}
|
@@ -5301,24 +5300,24 @@ var SyntaxContextFactory = class {
|
|
5301
5300
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.initializer);
|
5302
5301
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5303
5302
|
}
|
5304
|
-
if (tokenOrKeyword.parent.kind ===
|
5303
|
+
if (tokenOrKeyword.parent.kind === 142 /* ParameterDeclaration */) {
|
5305
5304
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.defaultValue);
|
5306
5305
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5307
5306
|
}
|
5308
|
-
if (tokenOrKeyword.parent.kind ===
|
5307
|
+
if (tokenOrKeyword.parent.kind === 143 /* CallArgument */) {
|
5309
5308
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.value);
|
5310
5309
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5311
5310
|
}
|
5312
|
-
if (tokenOrKeyword.parent.kind ===
|
5311
|
+
if (tokenOrKeyword.parent.kind === 140 /* VariantDeclaration */) {
|
5313
5312
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.value);
|
5314
5313
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5315
5314
|
}
|
5316
5315
|
}
|
5317
|
-
if (tokenOrKeyword.parent.kind ===
|
5316
|
+
if (tokenOrKeyword.parent.kind === 92 /* AssignmentStatement */) {
|
5318
5317
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.right);
|
5319
5318
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5320
5319
|
}
|
5321
|
-
if (tokenOrKeyword.parent.kind ===
|
5320
|
+
if (tokenOrKeyword.parent.kind === 78 /* PrefixUnaryExpression */) {
|
5322
5321
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.operand);
|
5323
5322
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5324
5323
|
}
|
@@ -5326,11 +5325,11 @@ var SyntaxContextFactory = class {
|
|
5326
5325
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.right);
|
5327
5326
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5328
5327
|
}
|
5329
|
-
if (tokenOrKeyword.isToken(7 /* TextTemplateHead */) && tokenOrKeyword.parent.kind ===
|
5328
|
+
if (tokenOrKeyword.isToken(7 /* TextTemplateHead */) && tokenOrKeyword.parent.kind === 82 /* TextTemplateLiteral */) {
|
5330
5329
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.spanList.spans.at(0)?.expression);
|
5331
5330
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5332
5331
|
}
|
5333
|
-
if (tokenOrKeyword.isToken(8 /* TextTemplatePart */) && tokenOrKeyword.parent.kind ===
|
5332
|
+
if (tokenOrKeyword.isToken(8 /* TextTemplatePart */) && tokenOrKeyword.parent.kind === 84 /* TextTemplateSpan */) {
|
5334
5333
|
let expressionForTargetType;
|
5335
5334
|
const spanList = tokenOrKeyword.parent.parent;
|
5336
5335
|
const spanIndex = spanList.spans.indexOf(tokenOrKeyword.parent);
|
@@ -5342,22 +5341,18 @@ var SyntaxContextFactory = class {
|
|
5342
5341
|
isStatementContext: false
|
5343
5342
|
};
|
5344
5343
|
}
|
5345
|
-
if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind ===
|
5344
|
+
if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 94 /* StatementBlock */) {
|
5346
5345
|
return { isExpressionContext: { expressionRole: new ExpressionRole_other(void 0) }, isStatementContext: true };
|
5347
5346
|
}
|
5348
|
-
if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind ===
|
5347
|
+
if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 93 /* StatementList */) {
|
5349
5348
|
return { isExpressionContext: { expressionRole: new ExpressionRole_other(void 0) }, isStatementContext: true };
|
5350
5349
|
}
|
5351
5350
|
if (tokenOrKeyword.isToken(44 /* OpenParenthesis */)) {
|
5352
|
-
if (tokenOrKeyword.parent.kind ===
|
5351
|
+
if (tokenOrKeyword.parent.kind === 76 /* ParenthesizedExpression */) {
|
5353
5352
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5354
5353
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5355
5354
|
}
|
5356
|
-
if (tokenOrKeyword.parent.kind ===
|
5357
|
-
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5358
|
-
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5359
|
-
}
|
5360
|
-
if (tokenOrKeyword.parent.kind === 81 /* ReferenceExpression */) {
|
5355
|
+
if (tokenOrKeyword.parent.kind === 80 /* ReferenceExpression */) {
|
5361
5356
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5362
5357
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5363
5358
|
}
|
@@ -5369,7 +5364,7 @@ var SyntaxContextFactory = class {
|
|
5369
5364
|
const expressionRole = new ExpressionRole_callArgument(tokenOrKeyword.parent.callArgumentList, 0);
|
5370
5365
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5371
5366
|
}
|
5372
|
-
if (tokenOrKeyword.parent.kind ===
|
5367
|
+
if (tokenOrKeyword.parent.kind === 145 /* Tag */) {
|
5373
5368
|
const callArgumentList = tokenOrKeyword.parent.callArgumentList;
|
5374
5369
|
if (callArgumentList !== void 0) {
|
5375
5370
|
const expressionRole = new ExpressionRole_callArgument(callArgumentList, 0);
|
@@ -5414,7 +5409,7 @@ var SyntaxContextFactory = class {
|
|
5414
5409
|
const expressionRole = new ExpressionRole_indexedAccessArgument(argumentList, index);
|
5415
5410
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5416
5411
|
}
|
5417
|
-
if (tokenOrKeyword.parent.kind ===
|
5412
|
+
if (tokenOrKeyword.parent.kind === 118 /* MatchExpressionList */) {
|
5418
5413
|
const expressionRole = new ExpressionRole_matchListElement(tokenOrKeyword.parent.parent.parent.parent);
|
5419
5414
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5420
5415
|
}
|
@@ -5423,47 +5418,47 @@ var SyntaxContextFactory = class {
|
|
5423
5418
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5424
5419
|
}
|
5425
5420
|
}
|
5426
|
-
if (tokenOrKeyword.isKeyword(43 /* Case */) && tokenOrKeyword.parent.kind ===
|
5421
|
+
if (tokenOrKeyword.isKeyword(43 /* Case */) && tokenOrKeyword.parent.kind === 119 /* SwitchStatementCaseClause */) {
|
5427
5422
|
const expressionRole = new ExpressionRole_matchListElement(tokenOrKeyword.parent.parent.parent);
|
5428
5423
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5429
5424
|
}
|
5430
|
-
if (tokenOrKeyword.isKeyword(14 /* Return */) && tokenOrKeyword.parent.kind ===
|
5425
|
+
if (tokenOrKeyword.isKeyword(14 /* Return */) && tokenOrKeyword.parent.kind === 115 /* ReturnStatement */) {
|
5431
5426
|
const expressionRole = new ExpressionRole_returnedValue(tokenOrKeyword.parent);
|
5432
5427
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5433
5428
|
}
|
5434
|
-
if (tokenOrKeyword.isKeyword(42 /* Switch */) && tokenOrKeyword.parent.kind ===
|
5429
|
+
if (tokenOrKeyword.isKeyword(42 /* Switch */) && tokenOrKeyword.parent.kind === 117 /* SwitchStatement */) {
|
5435
5430
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5436
5431
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5437
5432
|
}
|
5438
|
-
if (tokenOrKeyword.isKeyword(12 /* If */) && tokenOrKeyword.parent.kind ===
|
5433
|
+
if (tokenOrKeyword.isKeyword(12 /* If */) && tokenOrKeyword.parent.kind === 108 /* IfStatement */) {
|
5439
5434
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5440
5435
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5441
5436
|
}
|
5442
|
-
if (tokenOrKeyword.isKeyword(10 /* ElseIf */) && tokenOrKeyword.parent.kind ===
|
5437
|
+
if (tokenOrKeyword.isKeyword(10 /* ElseIf */) && tokenOrKeyword.parent.kind === 110 /* ElseIfClause */) {
|
5443
5438
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5444
5439
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5445
5440
|
}
|
5446
|
-
if (tokenOrKeyword.isKeyword(8 /* From */) && tokenOrKeyword.parent.kind ===
|
5441
|
+
if (tokenOrKeyword.isKeyword(8 /* From */) && tokenOrKeyword.parent.kind === 107 /* ForStatement */) {
|
5447
5442
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.enumeratedExpression);
|
5448
5443
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5449
5444
|
}
|
5450
|
-
if (tokenOrKeyword.isKeyword(23 /* While */) && tokenOrKeyword.parent.kind ===
|
5445
|
+
if (tokenOrKeyword.isKeyword(23 /* While */) && tokenOrKeyword.parent.kind === 120 /* WhileStatement */) {
|
5451
5446
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5452
5447
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5453
5448
|
}
|
5454
|
-
if (tokenOrKeyword.isKeyword(25 /* RepeatWhile */) && tokenOrKeyword.parent.kind ===
|
5449
|
+
if (tokenOrKeyword.isKeyword(25 /* RepeatWhile */) && tokenOrKeyword.parent.kind === 114 /* LoopStatement */) {
|
5455
5450
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5456
5451
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5457
5452
|
}
|
5458
|
-
if (tokenOrKeyword.isKeyword(26 /* Yield */) && tokenOrKeyword.parent.kind ===
|
5453
|
+
if (tokenOrKeyword.isKeyword(26 /* Yield */) && tokenOrKeyword.parent.kind === 121 /* YieldStatement */) {
|
5459
5454
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.expression);
|
5460
5455
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5461
5456
|
}
|
5462
|
-
if (tokenOrKeyword.isKeyword(27 /* When */) && tokenOrKeyword.parent.kind ===
|
5457
|
+
if (tokenOrKeyword.isKeyword(27 /* When */) && tokenOrKeyword.parent.kind === 77 /* WhenTernaryExpression */) {
|
5463
5458
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.condition);
|
5464
5459
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5465
5460
|
}
|
5466
|
-
if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind ===
|
5461
|
+
if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind === 77 /* WhenTernaryExpression */) {
|
5467
5462
|
const expressionRole = new ExpressionRole_other(tokenOrKeyword.parent.secondExpression);
|
5468
5463
|
return { isExpressionContext: { expressionRole }, isStatementContext: false };
|
5469
5464
|
}
|
@@ -5485,7 +5480,7 @@ var SyntaxContextFactory = class {
|
|
5485
5480
|
if (tokenOrKeyword.isToken(20 /* CloseBrace */) && tokenOrKeyword.parent.kind === 32 /* TypeMemberDeclarationBlock */ && (tokenOrKeyword.parent.parent.kind === 40 /* TypeExtensionDeclaration */ || tokenOrKeyword.parent.parent.parent.kind === 33 /* PackageStructuredTypeDeclaration */ || tokenOrKeyword.parent.parent.parent.kind === 38 /* PackageVariantTypeDeclaration */ || tokenOrKeyword.parent.parent.parent.kind === 22 /* PackageAliasTypeDeclaration */)) {
|
5486
5481
|
return true;
|
5487
5482
|
}
|
5488
|
-
if (tokenOrKeyword.isToken(20 /* CloseBrace */) && (tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */ || tokenOrKeyword.parent.kind === 24 /* PackageMemberGroupDeclaration */ || tokenOrKeyword.parent.kind === 6 /* PackageGroupImportDirective */ || tokenOrKeyword.parent.kind ===
|
5483
|
+
if (tokenOrKeyword.isToken(20 /* CloseBrace */) && (tokenOrKeyword.parent.kind === 21 /* TranslationsDeclaration */ || tokenOrKeyword.parent.kind === 24 /* PackageMemberGroupDeclaration */ || tokenOrKeyword.parent.kind === 6 /* PackageGroupImportDirective */ || tokenOrKeyword.parent.kind === 94 /* StatementBlock */ && (tokenOrKeyword.parent.parent.kind === 25 /* PackageConstructorDeclaration */ || tokenOrKeyword.parent.parent.kind === 26 /* PackageEntryPointDeclaration */ || tokenOrKeyword.parent.parent.kind === 27 /* PackageMethodDeclaration */))) {
|
5489
5484
|
return true;
|
5490
5485
|
}
|
5491
5486
|
if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 24 /* PackageMemberGroupDeclaration */) {
|
@@ -5497,10 +5492,10 @@ var SyntaxContextFactory = class {
|
|
5497
5492
|
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 37 /* PackageVariableSetterDeclaration */)) {
|
5498
5493
|
return true;
|
5499
5494
|
}
|
5500
|
-
if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind ===
|
5495
|
+
if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind === 147 /* Modifier */ && tokenOrKeyword.value === tokenOrKeyword.parent.value && tokenOrKeyword.parent.openParenthesisToken === void 0 && NodeTypeUtils.isPackageMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
|
5501
5496
|
return true;
|
5502
5497
|
}
|
5503
|
-
if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind ===
|
5498
|
+
if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind === 147 /* Modifier */ && NodeTypeUtils.isPackageMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
|
5504
5499
|
return true;
|
5505
5500
|
}
|
5506
5501
|
return false;
|
@@ -5521,13 +5516,13 @@ var SyntaxContextFactory = class {
|
|
5521
5516
|
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(
|
5522
5517
|
tokenOrKeyword,
|
5523
5518
|
51 /* TypeDereferencedVariableSetterDeclaration */
|
5524
|
-
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 52 /* TypeMethodDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 53 /* OperatorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 45 /* TypeConstructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 46 /* TypeDestructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword,
|
5519
|
+
) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 52 /* TypeMethodDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 53 /* OperatorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 45 /* TypeConstructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 46 /* TypeDestructorDeclaration */) || SyntaxContextUtils.tokenOrKeywordIsValidEndOfNode(tokenOrKeyword, 140 /* VariantDeclaration */)) {
|
5525
5520
|
return true;
|
5526
5521
|
}
|
5527
|
-
if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind ===
|
5522
|
+
if (tokenOrKeyword.isKeyword() && tokenOrKeyword.parent.kind === 147 /* Modifier */ && tokenOrKeyword.value === tokenOrKeyword.parent.value && tokenOrKeyword.parent.openParenthesisToken === void 0 && NodeTypeUtils.isTypeMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
|
5528
5523
|
return true;
|
5529
5524
|
}
|
5530
|
-
if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind ===
|
5525
|
+
if (tokenOrKeyword.isToken(21 /* CloseParenthesis */) && tokenOrKeyword.parent.kind === 147 /* Modifier */ && NodeTypeUtils.isTypeMemberDeclaration(tokenOrKeyword.parent.parent.parent)) {
|
5531
5526
|
return true;
|
5532
5527
|
}
|
5533
5528
|
return false;
|
@@ -5564,7 +5559,7 @@ var SyntaxContextFactory = class {
|
|
5564
5559
|
return result;
|
5565
5560
|
}
|
5566
5561
|
static isUnqualifiedTypeContext(tokenOrKeyword) {
|
5567
|
-
if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind ===
|
5562
|
+
if (tokenOrKeyword.isToken(23 /* Colon */) && tokenOrKeyword.parent.kind === 156 /* TypeAnnotation */) {
|
5568
5563
|
return { allowsAnonymousTypes: true };
|
5569
5564
|
}
|
5570
5565
|
if ((tokenOrKeyword.isKeyword(4 /* Object */) || tokenOrKeyword.isKeyword(5 /* PlainObject */) || tokenOrKeyword.isKeyword(3 /* Aspect */)) && tokenOrKeyword.parent.kind === 34 /* StructuredTypeDeclarationBody */) {
|
@@ -5573,16 +5568,16 @@ var SyntaxContextFactory = class {
|
|
5573
5568
|
if (tokenOrKeyword.isKeyword(15 /* Type */) && (NodeTypeUtils.isPackageTypeDeclaration(tokenOrKeyword.parent) || tokenOrKeyword.parent.kind === 40 /* TypeExtensionDeclaration */)) {
|
5574
5569
|
return { allowsAnonymousTypes: false };
|
5575
5570
|
}
|
5576
|
-
if (tokenOrKeyword.isToken(36 /* LessThan */) && tokenOrKeyword.parent.kind ===
|
5571
|
+
if (tokenOrKeyword.isToken(36 /* LessThan */) && tokenOrKeyword.parent.kind === 152 /* TypeArgumentClause */) {
|
5577
5572
|
return { allowsAnonymousTypes: true };
|
5578
5573
|
}
|
5579
|
-
if (tokenOrKeyword.isToken(24 /* Comma */) && (tokenOrKeyword.parent.kind === 30 /* BaseTypeList */ || tokenOrKeyword.parent.kind ===
|
5580
|
-
return { allowsAnonymousTypes: tokenOrKeyword.parent.kind ===
|
5574
|
+
if (tokenOrKeyword.isToken(24 /* Comma */) && (tokenOrKeyword.parent.kind === 30 /* BaseTypeList */ || tokenOrKeyword.parent.kind === 153 /* TypeArgumentList */)) {
|
5575
|
+
return { allowsAnonymousTypes: tokenOrKeyword.parent.kind === 153 /* TypeArgumentList */ };
|
5581
5576
|
}
|
5582
|
-
if (tokenOrKeyword.isToken(35 /* HashSign */) && tokenOrKeyword.parent.kind ===
|
5577
|
+
if (tokenOrKeyword.isToken(35 /* HashSign */) && tokenOrKeyword.parent.kind === 145 /* Tag */) {
|
5583
5578
|
return { allowsAnonymousTypes: false };
|
5584
5579
|
}
|
5585
|
-
if ((tokenOrKeyword.isToken(23 /* Colon */) || tokenOrKeyword.isToken(57 /* Equals */)) && tokenOrKeyword.parent.kind ===
|
5580
|
+
if ((tokenOrKeyword.isToken(23 /* Colon */) || tokenOrKeyword.isToken(57 /* Equals */)) && tokenOrKeyword.parent.kind === 141 /* TypeParameterDeclaration */) {
|
5586
5581
|
return { allowsAnonymousTypes: false };
|
5587
5582
|
}
|
5588
5583
|
if (tokenOrKeyword.isToken(57 /* Equals */) && tokenOrKeyword.parent.kind === 22 /* PackageAliasTypeDeclaration */) {
|
@@ -5608,32 +5603,32 @@ var SyntaxContextFactory = class {
|
|
5608
5603
|
}
|
5609
5604
|
const packageImport = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5610
5605
|
tokenOrKeyword,
|
5611
|
-
|
5606
|
+
132 /* PackageImportTranslation */
|
5612
5607
|
);
|
5613
5608
|
if (packageImport !== void 0) {
|
5614
5609
|
return { translationsDeclaration: packageImport.parent.parent };
|
5615
5610
|
}
|
5616
|
-
const type = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword,
|
5611
|
+
const type = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 137 /* TypeTranslation */);
|
5617
5612
|
if (type !== void 0) {
|
5618
5613
|
return { translationsDeclaration: type.parent.parent };
|
5619
5614
|
}
|
5620
5615
|
const methodType = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5621
5616
|
tokenOrKeyword,
|
5622
|
-
|
5617
|
+
131 /* MethodTypeTranslation */
|
5623
5618
|
);
|
5624
5619
|
if (methodType !== void 0) {
|
5625
5620
|
return { translationsDeclaration: methodType.parent.parent };
|
5626
5621
|
}
|
5627
5622
|
const variable = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5628
5623
|
tokenOrKeyword,
|
5629
|
-
|
5624
|
+
134 /* PackageVariableTranslation */
|
5630
5625
|
);
|
5631
5626
|
if (variable !== void 0) {
|
5632
5627
|
return { translationsDeclaration: variable.parent.parent };
|
5633
5628
|
}
|
5634
5629
|
const method = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5635
5630
|
tokenOrKeyword,
|
5636
|
-
|
5631
|
+
129 /* PackageMethodTranslation */
|
5637
5632
|
);
|
5638
5633
|
if (method !== void 0) {
|
5639
5634
|
return { translationsDeclaration: method.parent.parent };
|
@@ -5641,33 +5636,33 @@ var SyntaxContextFactory = class {
|
|
5641
5636
|
return void 0;
|
5642
5637
|
}
|
5643
5638
|
static isTypeMemberTranslationListContext(tokenOrKeyword) {
|
5644
|
-
if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind ===
|
5639
|
+
if (tokenOrKeyword.isToken(51 /* Semicolon */) && tokenOrKeyword.parent.kind === 136 /* TypeMemberTranslationList */) {
|
5645
5640
|
return { typeTranslation: tokenOrKeyword.parent.parent };
|
5646
5641
|
}
|
5647
|
-
if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind ===
|
5642
|
+
if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 137 /* TypeTranslation */) {
|
5648
5643
|
return { typeTranslation: tokenOrKeyword.parent };
|
5649
5644
|
}
|
5650
|
-
const indexer = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword,
|
5645
|
+
const indexer = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(tokenOrKeyword, 126 /* IndexerTranslation */);
|
5651
5646
|
if (indexer !== void 0) {
|
5652
5647
|
return { typeTranslation: indexer.parent.parent };
|
5653
5648
|
}
|
5654
5649
|
const constructor = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5655
5650
|
tokenOrKeyword,
|
5656
|
-
|
5651
|
+
124 /* ConstructorTranslation */
|
5657
5652
|
);
|
5658
5653
|
if (constructor !== void 0) {
|
5659
5654
|
return { typeTranslation: constructor.parent.parent };
|
5660
5655
|
}
|
5661
5656
|
const variableOrVariant = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5662
5657
|
tokenOrKeyword,
|
5663
|
-
|
5658
|
+
135 /* TypeVariableOrVariantTranslation */
|
5664
5659
|
);
|
5665
5660
|
if (variableOrVariant !== void 0) {
|
5666
5661
|
return { typeTranslation: variableOrVariant.parent.parent };
|
5667
5662
|
}
|
5668
5663
|
const method = SyntaxContextUtils.ifTokenIsValidEndOfNodeThenNode(
|
5669
5664
|
tokenOrKeyword,
|
5670
|
-
|
5665
|
+
130 /* TypeMethodTranslation */
|
5671
5666
|
);
|
5672
5667
|
if (method !== void 0) {
|
5673
5668
|
return { typeTranslation: method.parent.parent };
|
@@ -5782,25 +5777,23 @@ var NodeSemanticInfoService = class {
|
|
5782
5777
|
return this.ofNonKeywordIdentifier(analyzer, tokenOrKeyword.value, options6);
|
5783
5778
|
} else if (tokenOrKeyword.isKeyword(2 /* Autotype */) && tokenOrKeyword.parent.kind === 70 /* AutotypeCallExpression */) {
|
5784
5779
|
return this.ofAutotypeCallExpression(analyzer, tokenOrKeyword.parent, options6);
|
5785
|
-
} else if (tokenOrKeyword.parent.kind ===
|
5780
|
+
} else if (tokenOrKeyword.parent.kind === 78 /* PrefixUnaryExpression */) {
|
5786
5781
|
return this.ofPrefixUnaryExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
|
5787
|
-
} else if (tokenOrKeyword.isKeyword(41 /* Not */) && tokenOrKeyword.parent.kind === 75 /* NotExpression */) {
|
5788
|
-
return this.ofNotExpressionNotKeyword(analyzer, tokenOrKeyword.parent, options6);
|
5789
5782
|
} else if (tokenOrKeyword.parent.kind === 66 /* BinaryExpression */) {
|
5790
5783
|
return this.ofBinaryExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
|
5791
5784
|
} else if (tokenOrKeyword.isToken(19 /* Caret */) && (tokenOrKeyword.parent.kind === 50 /* TypeDereferencedVariableGetterDeclaration */ || tokenOrKeyword.parent.kind === 51 /* TypeDereferencedVariableSetterDeclaration */)) {
|
5792
5785
|
return this.ofDereferenceOperatorDeclaration(analyzer, tokenOrKeyword.parent);
|
5793
|
-
} else if (tokenOrKeyword.isToken(19 /* Caret */) && tokenOrKeyword.parent.kind ===
|
5786
|
+
} else if (tokenOrKeyword.isToken(19 /* Caret */) && tokenOrKeyword.parent.kind === 81 /* DereferenceExpression */) {
|
5794
5787
|
return this.ofDereferenceExpressionOperator(analyzer, tokenOrKeyword.parent, options6);
|
5795
|
-
} else if (tokenOrKeyword.parent.kind ===
|
5788
|
+
} else if (tokenOrKeyword.parent.kind === 92 /* AssignmentStatement */) {
|
5796
5789
|
return this.ofAssignmentStatementOperator(analyzer, tokenOrKeyword.parent, options6);
|
5797
5790
|
} else if (tokenOrKeyword.isKeyword(28 /* Creation */) && tokenOrKeyword.parent.kind === 45 /* TypeConstructorDeclaration */) {
|
5798
5791
|
return this.ofTypeConstructorDeclaration(analyzer, tokenOrKeyword.parent);
|
5799
|
-
} else if (tokenOrKeyword.isToken(13 /* Asterisk */) && tokenOrKeyword.parent.kind ===
|
5792
|
+
} else if (tokenOrKeyword.isToken(13 /* Asterisk */) && tokenOrKeyword.parent.kind === 91 /* DefaultMatchExpression */) {
|
5800
5793
|
return this.ofDefaultMatchExpression(analyzer, tokenOrKeyword.parent);
|
5801
|
-
} else if (tokenOrKeyword.isKeyword(4 /* Object */) && tokenOrKeyword.parent.kind ===
|
5794
|
+
} else if (tokenOrKeyword.isKeyword(4 /* Object */) && tokenOrKeyword.parent.kind === 87 /* ObjectExpression */) {
|
5802
5795
|
return this.ofObjectExpression(analyzer, tokenOrKeyword.parent, options6);
|
5803
|
-
} else if (tokenOrKeyword.isKeyword(55 /* Base */) && tokenOrKeyword.parent.kind ===
|
5796
|
+
} else if (tokenOrKeyword.isKeyword(55 /* Base */) && tokenOrKeyword.parent.kind === 88 /* BaseExpression */) {
|
5804
5797
|
return this.ofBaseExpression(analyzer, tokenOrKeyword.parent, options6);
|
5805
5798
|
} else if ((tokenOrKeyword.isToken(45 /* OpenSquareBracket */) || tokenOrKeyword.isToken(22 /* CloseSquareBracket */)) && tokenOrKeyword.parent.kind === 49 /* TypeIndexerParameterClause */) {
|
5806
5799
|
return this.ofTypeIndexerDeclaration(analyzer, tokenOrKeyword.parent.parent);
|
@@ -5817,11 +5810,11 @@ var NodeSemanticInfoService = class {
|
|
5817
5810
|
let result;
|
5818
5811
|
const parent = node.parent;
|
5819
5812
|
switch (parent.kind) {
|
5820
|
-
case
|
5813
|
+
case 127 /* TranslationTypeParameterList */:
|
5821
5814
|
break;
|
5822
|
-
case
|
5815
|
+
case 122 /* TranslationParameterList */:
|
5823
5816
|
break;
|
5824
|
-
case
|
5817
|
+
case 143 /* CallArgument */: {
|
5825
5818
|
const respectiveParameter = analyzer.getRespectiveParameter(parent);
|
5826
5819
|
if (respectiveParameter !== void 0) {
|
5827
5820
|
const target = new SimpleWithLocalization(
|
@@ -5838,7 +5831,7 @@ var NodeSemanticInfoService = class {
|
|
5838
5831
|
case 60 /* EnumerationVariableDeclaration */:
|
5839
5832
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofEnumerationVariableDeclaration(parent));
|
5840
5833
|
break;
|
5841
|
-
case
|
5834
|
+
case 101 /* ErrorVariableDeclaration */:
|
5842
5835
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofErrorVariableDeclaration(parent));
|
5843
5836
|
break;
|
5844
5837
|
case 22 /* PackageAliasTypeDeclaration */:
|
@@ -5859,7 +5852,7 @@ var NodeSemanticInfoService = class {
|
|
5859
5852
|
case 38 /* PackageVariantTypeDeclaration */:
|
5860
5853
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofPackageVariantTypeDeclaration(parent));
|
5861
5854
|
break;
|
5862
|
-
case
|
5855
|
+
case 89 /* IdentifierExpression */:
|
5863
5856
|
result = this.ofIdentifierExpression(analyzer, parent, options6);
|
5864
5857
|
break;
|
5865
5858
|
case 58 /* NestedMethodDeclaration */:
|
@@ -5868,10 +5861,10 @@ var NodeSemanticInfoService = class {
|
|
5868
5861
|
case 59 /* LocalVariableDeclaration */:
|
5869
5862
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofLocalVariableDeclaration(parent));
|
5870
5863
|
break;
|
5871
|
-
case
|
5864
|
+
case 133 /* QualifiedName */:
|
5872
5865
|
result = this.ofQualifiedNameQualifier(analyzer, parent, node, options6);
|
5873
5866
|
break;
|
5874
|
-
case
|
5867
|
+
case 134 /* PackageVariableTranslation */: {
|
5875
5868
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5876
5869
|
const getTargetResult = translationPackage?.getPackageVariableTranslationTarget(parent);
|
5877
5870
|
if (translationPackage !== void 0 && getTargetResult?.target !== void 0) {
|
@@ -5891,7 +5884,7 @@ var NodeSemanticInfoService = class {
|
|
5891
5884
|
}
|
5892
5885
|
break;
|
5893
5886
|
}
|
5894
|
-
case
|
5887
|
+
case 135 /* TypeVariableOrVariantTranslation */: {
|
5895
5888
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5896
5889
|
const getTargetsResult = translationPackage?.getTypeVariableOrVariantTranslationTargets(parent);
|
5897
5890
|
if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
|
@@ -5915,7 +5908,7 @@ var NodeSemanticInfoService = class {
|
|
5915
5908
|
}
|
5916
5909
|
break;
|
5917
5910
|
}
|
5918
|
-
case
|
5911
|
+
case 129 /* PackageMethodTranslation */: {
|
5919
5912
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5920
5913
|
const getTargetsResult = translationPackage?.getPackageMethodTranslationTargets(parent);
|
5921
5914
|
if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
|
@@ -5939,7 +5932,7 @@ var NodeSemanticInfoService = class {
|
|
5939
5932
|
}
|
5940
5933
|
break;
|
5941
5934
|
}
|
5942
|
-
case
|
5935
|
+
case 130 /* TypeMethodTranslation */: {
|
5943
5936
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5944
5937
|
const getTargetsResult = translationPackage?.getTypeMethodTranslationTargets(parent);
|
5945
5938
|
if (translationPackage !== void 0 && isNonEmptyArray(getTargetsResult?.targets)) {
|
@@ -5963,7 +5956,7 @@ var NodeSemanticInfoService = class {
|
|
5963
5956
|
}
|
5964
5957
|
break;
|
5965
5958
|
}
|
5966
|
-
case
|
5959
|
+
case 137 /* TypeTranslation */: {
|
5967
5960
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5968
5961
|
const getTargetResult = translationPackage?.getTypeTranslationTarget(parent);
|
5969
5962
|
if (translationPackage !== void 0 && getTargetResult?.target !== void 0) {
|
@@ -5983,7 +5976,7 @@ var NodeSemanticInfoService = class {
|
|
5983
5976
|
}
|
5984
5977
|
break;
|
5985
5978
|
}
|
5986
|
-
case
|
5979
|
+
case 131 /* MethodTypeTranslation */: {
|
5987
5980
|
const translationPackage = this.getContainingTranslationPackage(analyzer, node);
|
5988
5981
|
const getTargetResult = translationPackage?.getMethodTypeTranslationTarget(parent);
|
5989
5982
|
if (translationPackage !== void 0 && getTargetResult?.target !== void 0) {
|
@@ -6003,7 +5996,7 @@ var NodeSemanticInfoService = class {
|
|
6003
5996
|
}
|
6004
5997
|
break;
|
6005
5998
|
}
|
6006
|
-
case
|
5999
|
+
case 142 /* ParameterDeclaration */:
|
6007
6000
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofParameterDeclaration(parent));
|
6008
6001
|
break;
|
6009
6002
|
case 8 /* PackageImport */:
|
@@ -6012,7 +6005,7 @@ var NodeSemanticInfoService = class {
|
|
6012
6005
|
case 9 /* PackagePath */:
|
6013
6006
|
result = void 0;
|
6014
6007
|
break;
|
6015
|
-
case
|
6008
|
+
case 79 /* PropertyAccessExpression */:
|
6016
6009
|
result = this.ofProperty(analyzer, parent, options6);
|
6017
6010
|
break;
|
6018
6011
|
case 52 /* TypeMethodDeclaration */:
|
@@ -6024,10 +6017,10 @@ var NodeSemanticInfoService = class {
|
|
6024
6017
|
case 54 /* TypeVariableDeclaration */:
|
6025
6018
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofTypeVariableDeclaration(parent));
|
6026
6019
|
break;
|
6027
|
-
case
|
6020
|
+
case 141 /* TypeParameterDeclaration */:
|
6028
6021
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofTypeParameterDeclaration(parent));
|
6029
6022
|
break;
|
6030
|
-
case
|
6023
|
+
case 140 /* VariantDeclaration */:
|
6031
6024
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofVariantDeclaration(parent));
|
6032
6025
|
break;
|
6033
6026
|
case 36 /* PackageVariableGetterDeclaration */:
|
@@ -6038,7 +6031,7 @@ var NodeSemanticInfoService = class {
|
|
6038
6031
|
case 56 /* TypeVariableSetterDeclaration */:
|
6039
6032
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofComputedTypeVariableDeclaration(parent));
|
6040
6033
|
break;
|
6041
|
-
case
|
6034
|
+
case 151 /* SetterParameterDeclaration */:
|
6042
6035
|
result = new DefinitionNodeSemanticInfo(analyzer.entity.ofSetterParameterDeclaration(parent));
|
6043
6036
|
break;
|
6044
6037
|
case 3 /* Keyword */:
|
@@ -6192,7 +6185,7 @@ var NodeSemanticInfoService = class {
|
|
6192
6185
|
return result;
|
6193
6186
|
}
|
6194
6187
|
case 42 /* ExtendedTypeClause */:
|
6195
|
-
case
|
6188
|
+
case 132 /* PackageImportTranslation */:
|
6196
6189
|
return void 0;
|
6197
6190
|
default:
|
6198
6191
|
Debug.never(node.parent);
|
@@ -6369,23 +6362,8 @@ var NodeSemanticInfoService = class {
|
|
6369
6362
|
}
|
6370
6363
|
return void 0;
|
6371
6364
|
}
|
6372
|
-
static ofNotExpressionNotKeyword(analyzer, node, options6) {
|
6373
|
-
const operator = analyzer.resolveNotExpressionOperator(node);
|
6374
|
-
if (operator.kind === "ok") {
|
6375
|
-
const target = new SimpleWithLocalization(
|
6376
|
-
new OperatorReferenceTarget(operator.value.value),
|
6377
|
-
operator.value.localization
|
6378
|
-
);
|
6379
|
-
let result = new ReferenceNodeSemanticInfo([target], false);
|
6380
|
-
if (options6.includeBetterReferenceTargets) {
|
6381
|
-
result = this.getBetterReferenceTargetsOrPreserve(result);
|
6382
|
-
}
|
6383
|
-
return result;
|
6384
|
-
}
|
6385
|
-
return void 0;
|
6386
|
-
}
|
6387
6365
|
static ofPrefixUnaryExpressionOperator(analyzer, node, options6) {
|
6388
|
-
const operator = analyzer.
|
6366
|
+
const operator = analyzer.resolvePrefixUnaryExpressionUserDefinableOperator(node);
|
6389
6367
|
if (operator.kind === "ok") {
|
6390
6368
|
const target = new SimpleWithLocalization(
|
6391
6369
|
new OperatorReferenceTarget(operator.value.value),
|
@@ -6521,7 +6499,7 @@ var NodeSemanticInfoService = class {
|
|
6521
6499
|
}
|
6522
6500
|
static ofPackageNameSegmentAccess(analyzer, packageTreeNode, node) {
|
6523
6501
|
let parent = getParentSkippingParenthesizedExpressions(node);
|
6524
|
-
while (parent.kind ===
|
6502
|
+
while (parent.kind === 79 /* PropertyAccessExpression */) {
|
6525
6503
|
const meaning = analyzer.resolvePropertyAccessExpression(parent).meaning;
|
6526
6504
|
if (meaning.kind === "package-name-segment-access") {
|
6527
6505
|
packageTreeNode = meaning.packageTreeNode;
|
@@ -6562,7 +6540,7 @@ var NodeSemanticInfoService = class {
|
|
6562
6540
|
let parentCallExpression;
|
6563
6541
|
if (parent.kind === 69 /* CallExpression */) {
|
6564
6542
|
parentCallExpression = parent;
|
6565
|
-
} else if (parent.kind ===
|
6543
|
+
} else if (parent.kind === 90 /* GenericSpecializationExpression */) {
|
6566
6544
|
const grandParent = getParentSkippingParenthesizedExpressions(parent);
|
6567
6545
|
if (grandParent.kind === 69 /* CallExpression */) {
|
6568
6546
|
parentCallExpression = grandParent;
|
@@ -6814,7 +6792,7 @@ function getEntitySourceLocations(analyzer, entity) {
|
|
6814
6792
|
case 18 /* AnonymousStructuredTypeDeclaration */:
|
6815
6793
|
case 19 /* AnonymousVariantTypeDeclaration */:
|
6816
6794
|
case 67 /* MethodBlockLiteral */:
|
6817
|
-
case
|
6795
|
+
case 75 /* MethodLiteral */:
|
6818
6796
|
range = node.rangeWithoutTrivia;
|
6819
6797
|
break;
|
6820
6798
|
case 22 /* PackageAliasTypeDeclaration */:
|
@@ -6824,8 +6802,8 @@ function getEntitySourceLocations(analyzer, entity) {
|
|
6824
6802
|
case 38 /* PackageVariantTypeDeclaration */:
|
6825
6803
|
case 58 /* NestedMethodDeclaration */:
|
6826
6804
|
case 52 /* TypeMethodDeclaration */:
|
6827
|
-
case
|
6828
|
-
case
|
6805
|
+
case 141 /* TypeParameterDeclaration */:
|
6806
|
+
case 140 /* VariantDeclaration */:
|
6829
6807
|
case 53 /* OperatorDeclaration */:
|
6830
6808
|
range = node.name.rangeWithoutTrivia;
|
6831
6809
|
break;
|
@@ -7114,7 +7092,7 @@ var ReferencesService = class {
|
|
7114
7092
|
result.push(new Reference(sourceFile2, node.autotypeKeyword.rangeWithoutTrivia, referenceKind));
|
7115
7093
|
}
|
7116
7094
|
}
|
7117
|
-
if (node.kind ===
|
7095
|
+
if (node.kind === 78 /* PrefixUnaryExpression */ && restrictions.canBePrefixUnaryOperator) {
|
7118
7096
|
const semanticInfo = NodeSemanticInfoService.ofPrefixUnaryExpressionOperator(
|
7119
7097
|
analyzer,
|
7120
7098
|
node,
|
@@ -7130,22 +7108,6 @@ var ReferencesService = class {
|
|
7130
7108
|
result.push(new Reference(sourceFile2, node.operator.rangeWithoutTrivia, referenceKind));
|
7131
7109
|
}
|
7132
7110
|
}
|
7133
|
-
if (node.kind === 75 /* NotExpression */ && restrictions.canBeNotExpression) {
|
7134
|
-
const semanticInfo = NodeSemanticInfoService.ofNotExpressionNotKeyword(
|
7135
|
-
analyzer,
|
7136
|
-
node,
|
7137
|
-
semanticInfoOptions
|
7138
|
-
);
|
7139
|
-
const referenceKind = this.ifReferenceToDefinitionThenKind(
|
7140
|
-
definition,
|
7141
|
-
semanticInfo,
|
7142
|
-
onlyWithSameTranslation,
|
7143
|
-
allowAmbiguous
|
7144
|
-
);
|
7145
|
-
if (referenceKind !== void 0) {
|
7146
|
-
result.push(new Reference(sourceFile2, node.notKeyword.rangeWithoutTrivia, referenceKind));
|
7147
|
-
}
|
7148
|
-
}
|
7149
7111
|
if (node.kind === 66 /* BinaryExpression */ && restrictions.canBeBinaryExpressionOperator) {
|
7150
7112
|
const semanticInfo = NodeSemanticInfoService.ofBinaryExpressionOperator(
|
7151
7113
|
analyzer,
|
@@ -7174,7 +7136,7 @@ var ReferencesService = class {
|
|
7174
7136
|
result.push(new Reference(sourceFile2, node.caretToken.rangeWithoutTrivia, referenceKind));
|
7175
7137
|
}
|
7176
7138
|
}
|
7177
|
-
if (node.kind ===
|
7139
|
+
if (node.kind === 81 /* DereferenceExpression */ && restrictions.canBeDereferenceOperator) {
|
7178
7140
|
const semanticInfo = NodeSemanticInfoService.ofDereferenceExpressionOperator(
|
7179
7141
|
analyzer,
|
7180
7142
|
node,
|
@@ -7190,7 +7152,7 @@ var ReferencesService = class {
|
|
7190
7152
|
result.push(new Reference(sourceFile2, node.caretToken.rangeWithoutTrivia, referenceKind));
|
7191
7153
|
}
|
7192
7154
|
}
|
7193
|
-
if (node.kind ===
|
7155
|
+
if (node.kind === 92 /* AssignmentStatement */ && restrictions.canBeAssignmentStatementOperator) {
|
7194
7156
|
const semanticInfo = NodeSemanticInfoService.ofAssignmentStatementOperator(
|
7195
7157
|
analyzer,
|
7196
7158
|
node,
|
@@ -7218,7 +7180,7 @@ var ReferencesService = class {
|
|
7218
7180
|
result.push(new Reference(sourceFile2, node.creationKeyword.rangeWithoutTrivia, referenceKind));
|
7219
7181
|
}
|
7220
7182
|
}
|
7221
|
-
if (node.kind ===
|
7183
|
+
if (node.kind === 87 /* ObjectExpression */ && restrictions.canBeObjectExpression) {
|
7222
7184
|
const semanticInfo = NodeSemanticInfoService.ofObjectExpression(analyzer, node, semanticInfoOptions);
|
7223
7185
|
const referenceKind = this.ifReferenceToDefinitionThenKind(
|
7224
7186
|
definition,
|
@@ -7230,7 +7192,7 @@ var ReferencesService = class {
|
|
7230
7192
|
result.push(new Reference(sourceFile2, node.keyword.rangeWithoutTrivia, referenceKind));
|
7231
7193
|
}
|
7232
7194
|
}
|
7233
|
-
if (node.kind ===
|
7195
|
+
if (node.kind === 88 /* BaseExpression */ && restrictions.canBeBaseExpression) {
|
7234
7196
|
const semanticInfo = NodeSemanticInfoService.ofBaseExpression(analyzer, node, semanticInfoOptions);
|
7235
7197
|
const referenceKind = this.ifReferenceToDefinitionThenKind(
|
7236
7198
|
definition,
|
@@ -7427,7 +7389,6 @@ var ReferencesService = class {
|
|
7427
7389
|
const operatorKind = definition.value.getOperatorKind();
|
7428
7390
|
if (isUnaryOperator(operatorKind)) {
|
7429
7391
|
result.canBePrefixUnaryOperator = true;
|
7430
|
-
result.canBeNotExpression = true;
|
7431
7392
|
} else {
|
7432
7393
|
result.canBeBinaryExpressionOperator = true;
|
7433
7394
|
result.canBeAssignmentStatementOperator = true;
|
@@ -7542,7 +7503,6 @@ var ReferenceRestrictions = class {
|
|
7542
7503
|
this.canBeIdentifier = false;
|
7543
7504
|
this.canBeAutotypeCall = false;
|
7544
7505
|
this.canBePrefixUnaryOperator = false;
|
7545
|
-
this.canBeNotExpression = false;
|
7546
7506
|
this.canBeBinaryExpressionOperator = false;
|
7547
7507
|
this.canBeDereferenceOperator = false;
|
7548
7508
|
this.canBeAssignmentStatementOperator = false;
|
@@ -7629,9 +7589,9 @@ var EvaluatableExpressionService = class {
|
|
7629
7589
|
getEvaluatableExpressionForIdentifier(node) {
|
7630
7590
|
const parent = node.parent;
|
7631
7591
|
switch (parent.kind) {
|
7632
|
-
case
|
7592
|
+
case 89 /* IdentifierExpression */:
|
7633
7593
|
return parent;
|
7634
|
-
case
|
7594
|
+
case 79 /* PropertyAccessExpression */:
|
7635
7595
|
if (this.isEvaluatableReceiver(parent.expression)) {
|
7636
7596
|
return parent;
|
7637
7597
|
}
|
@@ -7652,9 +7612,9 @@ var EvaluatableExpressionService = class {
|
|
7652
7612
|
}
|
7653
7613
|
isEvaluatableReceiver(expression) {
|
7654
7614
|
switch (expression.kind) {
|
7655
|
-
case
|
7615
|
+
case 89 /* IdentifierExpression */:
|
7656
7616
|
return true;
|
7657
|
-
case
|
7617
|
+
case 79 /* PropertyAccessExpression */:
|
7658
7618
|
return this.isEvaluatableReceiver(expression.expression);
|
7659
7619
|
default:
|
7660
7620
|
return false;
|
@@ -7680,17 +7640,17 @@ var EvaluatableExpressionService = class {
|
|
7680
7640
|
return { nameIdentifier: node.name };
|
7681
7641
|
case 59 /* LocalVariableDeclaration */:
|
7682
7642
|
return { nameIdentifier: node.name };
|
7683
|
-
case
|
7643
|
+
case 142 /* ParameterDeclaration */:
|
7684
7644
|
return { nameIdentifier: node.name };
|
7685
7645
|
case 52 /* TypeMethodDeclaration */:
|
7686
7646
|
return { nameIdentifier: node.name };
|
7687
7647
|
case 54 /* TypeVariableDeclaration */:
|
7688
7648
|
return { nameIdentifier: node.name };
|
7689
|
-
case
|
7649
|
+
case 141 /* TypeParameterDeclaration */:
|
7690
7650
|
return { nameIdentifier: node.name };
|
7691
|
-
case
|
7651
|
+
case 140 /* VariantDeclaration */:
|
7692
7652
|
return { nameIdentifier: node.name };
|
7693
|
-
case
|
7653
|
+
case 101 /* ErrorVariableDeclaration */:
|
7694
7654
|
return { nameIdentifier: node.name };
|
7695
7655
|
default:
|
7696
7656
|
return void 0;
|
@@ -8103,7 +8063,7 @@ var SourceFileItemsService = class {
|
|
8103
8063
|
);
|
8104
8064
|
break;
|
8105
8065
|
}
|
8106
|
-
case
|
8066
|
+
case 140 /* VariantDeclaration */: {
|
8107
8067
|
result.push(
|
8108
8068
|
this.createItem(
|
8109
8069
|
9 /* Variant */,
|
@@ -8115,7 +8075,7 @@ var SourceFileItemsService = class {
|
|
8115
8075
|
);
|
8116
8076
|
break;
|
8117
8077
|
}
|
8118
|
-
case
|
8078
|
+
case 141 /* TypeParameterDeclaration */: {
|
8119
8079
|
result.push(
|
8120
8080
|
this.createItem(
|
8121
8081
|
18 /* TypeParameter */,
|
@@ -8347,7 +8307,7 @@ var SelectionRangeService = class {
|
|
8347
8307
|
if (!this.nodeShouldBeSkipped(child) && !child.rangeWithoutTrivia.equals(result.range)) {
|
8348
8308
|
result = new SelectionRange(child.rangeWithoutTrivia, result);
|
8349
8309
|
}
|
8350
|
-
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 ===
|
8310
|
+
if (child.kind === 0 /* Token */ && (child.tokenKind === 6 /* TextLiteral */ || child.tokenKind === 7 /* TextTemplateHead */ || child.tokenKind === 8 /* TextTemplatePart */ || child.tokenKind === 9 /* TextTemplateTail */ || child.tokenKind === 5 /* CharLiteral */) || child.kind === 82 /* TextTemplateLiteral */) {
|
8351
8311
|
const textContentStart = child.rangeWithoutTrivia.start + 1;
|
8352
8312
|
const textContentEnd = child.rangeWithoutTrivia.end - 1;
|
8353
8313
|
if (offset >= textContentStart && offset < textContentEnd) {
|
@@ -8378,13 +8338,13 @@ var SelectionRangeService = class {
|
|
8378
8338
|
}
|
8379
8339
|
}
|
8380
8340
|
switch (node.kind) {
|
8381
|
-
case
|
8341
|
+
case 156 /* TypeAnnotation */:
|
8382
8342
|
case 34 /* StructuredTypeDeclarationBody */:
|
8383
8343
|
case 39 /* VariantTypeDeclarationBody */:
|
8384
8344
|
case 23 /* AliasTypeDeclarationBody */:
|
8385
8345
|
case 29 /* MethodTypeDeclarationBody */:
|
8386
|
-
case
|
8387
|
-
case
|
8346
|
+
case 84 /* TextTemplateSpan */:
|
8347
|
+
case 83 /* TextTemplateSpanList */:
|
8388
8348
|
return true;
|
8389
8349
|
default:
|
8390
8350
|
return false;
|
@@ -8422,7 +8382,7 @@ var SemanticTokensService = class {
|
|
8422
8382
|
controller.stopChildrenTraverse();
|
8423
8383
|
return;
|
8424
8384
|
}
|
8425
|
-
if (node.kind ===
|
8385
|
+
if (node.kind === 89 /* IdentifierExpression */) {
|
8426
8386
|
const meaning = analyzer.resolveIdentifierExpression(node).meaning;
|
8427
8387
|
if (meaning.kind === "variable-access") {
|
8428
8388
|
const variable = meaning.variable.value.getEntity();
|
@@ -8479,7 +8439,7 @@ var SemanticTokensService = class {
|
|
8479
8439
|
));
|
8480
8440
|
}
|
8481
8441
|
}
|
8482
|
-
if (node.kind ===
|
8442
|
+
if (node.kind === 79 /* PropertyAccessExpression */) {
|
8483
8443
|
const meaning = analyzer.resolvePropertyAccessExpression(node).meaning;
|
8484
8444
|
if (meaning.kind === "variant-access") {
|
8485
8445
|
result.push(
|
@@ -8520,7 +8480,7 @@ var SemanticTokensService = class {
|
|
8520
8480
|
));
|
8521
8481
|
}
|
8522
8482
|
}
|
8523
|
-
if (node.kind ===
|
8483
|
+
if (node.kind === 140 /* VariantDeclaration */) {
|
8524
8484
|
result.push(
|
8525
8485
|
new SemanticToken(
|
8526
8486
|
node.name.rangeWithoutTrivia,
|
@@ -8704,7 +8664,7 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8704
8664
|
}
|
8705
8665
|
let node = token.parent;
|
8706
8666
|
while (node !== void 0) {
|
8707
|
-
if (node.kind ===
|
8667
|
+
if (node.kind === 152 /* TypeArgumentClause */ && this._offset >= node.lessThanToken.rangeWithoutTrivia.end && (node.greaterThanToken.rangeWithoutTrivia.isEmpty || this._offset <= node.greaterThanToken.rangeWithoutTrivia.start)) {
|
8708
8668
|
const argumentIndex = this.getArgumentIndex(node.typeArgumentList, this._offset);
|
8709
8669
|
const argumentCount = this.countArguments(node.typeArgumentList);
|
8710
8670
|
return new NodeWithTypeArgumentsInfo(node.parent, argumentIndex, argumentCount);
|
@@ -8749,7 +8709,7 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8749
8709
|
switch (node.kind) {
|
8750
8710
|
case 10 /* NamedTypeSpecifier */:
|
8751
8711
|
return this.getSignaturesForNamedTypeSpecifier(node);
|
8752
|
-
case
|
8712
|
+
case 90 /* GenericSpecializationExpression */:
|
8753
8713
|
return this.getSignaturesForGenericSpecializationExpression(node);
|
8754
8714
|
default:
|
8755
8715
|
Debug.never(node);
|
@@ -8767,7 +8727,7 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8767
8727
|
}
|
8768
8728
|
getSignaturesForGenericSpecializationExpression(node) {
|
8769
8729
|
const expression = unwrapParenthesizedExpressions(node.expression);
|
8770
|
-
if (expression.kind ===
|
8730
|
+
if (expression.kind === 89 /* IdentifierExpression */) {
|
8771
8731
|
const meaning = this._analyzer.resolveIdentifierExpression(expression).meaning;
|
8772
8732
|
if (meaning.kind === "method-access") {
|
8773
8733
|
return Query.from(meaning.candidates).mapAndFilter((o) => {
|
@@ -8782,7 +8742,7 @@ var TypeParameterSignatureHelpProvider = class {
|
|
8782
8742
|
}
|
8783
8743
|
return void 0;
|
8784
8744
|
}
|
8785
|
-
if (expression.kind ===
|
8745
|
+
if (expression.kind === 79 /* PropertyAccessExpression */) {
|
8786
8746
|
const meaning = this._analyzer.resolvePropertyAccessExpression(expression).meaning;
|
8787
8747
|
let accessedMethods;
|
8788
8748
|
if (meaning.kind === "instance-method-access") {
|
@@ -9059,7 +9019,7 @@ var ValueParametersSignatureHelpProvider = class {
|
|
9059
9019
|
}
|
9060
9020
|
break;
|
9061
9021
|
}
|
9062
|
-
case
|
9022
|
+
case 145 /* Tag */: {
|
9063
9023
|
if (node.openParenthesisToken !== void 0 && this._offset >= node.openParenthesisToken.rangeWithoutTrivia.end && node.callArgumentList !== void 0 && (node.closeParenthesisToken === void 0 || node.closeParenthesisToken.rangeWithoutTrivia.isEmpty || this._offset <= node.closeParenthesisToken.rangeWithoutTrivia.start)) {
|
9064
9024
|
const argumentIndex = this.getArgumentIndexInList(node.callArgumentList.elements, this._offset);
|
9065
9025
|
const valueArguments = ValueArgumentFactory.createValueArgumentsOfTag(node);
|
@@ -13141,7 +13101,7 @@ var LanguageServer = class {
|
|
13141
13101
|
const sourceFileContext = yield this.getSourceFileContext(uri, token);
|
13142
13102
|
if (sourceFileContext !== void 0) {
|
13143
13103
|
const node = NodePath.parse(uri.fragment).getNode(sourceFileContext.sourceFile.getSyntaxNode());
|
13144
|
-
if (node?.kind ===
|
13104
|
+
if (node?.kind === 92 /* AssignmentStatement */) {
|
13145
13105
|
const sourceFileEdit = this._addPropertyAssignmentService.createEditWithAssignment(
|
13146
13106
|
sourceFileContext.sourceFile,
|
13147
13107
|
node,
|
@@ -13178,7 +13138,7 @@ var LanguageServer = class {
|
|
13178
13138
|
const node = NodePath.parse(uri.fragment).getNode(sourceFileContext.sourceFile.getSyntaxNode());
|
13179
13139
|
if (node !== void 0) {
|
13180
13140
|
let nodeForRange = node;
|
13181
|
-
if (node.kind ===
|
13141
|
+
if (node.kind === 92 /* AssignmentStatement */) {
|
13182
13142
|
nodeForRange = node.right;
|
13183
13143
|
}
|
13184
13144
|
result = this.convertSourceFileRange(sourceFileContext.sourceFile, nodeForRange.rangeWithoutTrivia);
|