@likec4/language-server 1.19.1 → 1.19.2
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/dist/generated/ast.d.ts +22 -9
- package/dist/generated/ast.js +23 -2
- package/dist/generated/grammar.js +1 -1
- package/dist/like-c4.langium +4 -1
- package/dist/model/model-parser.d.ts +5 -0
- package/dist/model/parser/DeploymentModelParser.d.ts +1 -0
- package/dist/model/parser/DeploymentViewParser.d.ts +2 -1
- package/dist/model/parser/DeploymentViewParser.js +3 -0
- package/dist/model/parser/FqnRefParser.d.ts +1 -0
- package/dist/model/parser/FqnRefParser.js +13 -0
- package/dist/model/parser/GlobalsParser.d.ts +1 -0
- package/dist/model/parser/ViewsParser.d.ts +1 -0
- package/dist/validation/index.d.ts +1 -1
- package/package.json +7 -7
- package/src/generated/ast.ts +47 -11
- package/src/generated/grammar.ts +1 -1
- package/src/like-c4.langium +4 -1
- package/src/model/parser/DeploymentViewParser.ts +10 -7
- package/src/model/parser/FqnRefParser.ts +14 -0
package/dist/like-c4.langium
CHANGED
|
@@ -620,10 +620,13 @@ DeploymentViewRulePredicateExpression:
|
|
|
620
620
|
;
|
|
621
621
|
|
|
622
622
|
ExpressionV2:
|
|
623
|
-
|
|
623
|
+
RelationPredicateOrWhereV2 |
|
|
624
624
|
FqnExpr
|
|
625
625
|
;
|
|
626
626
|
|
|
627
|
+
RelationPredicateOrWhereV2:
|
|
628
|
+
RelationExpr ({infer RelationPredicateWhereV2.subject=current} 'where' where=WhereRelationExpression?)?
|
|
629
|
+
;
|
|
627
630
|
|
|
628
631
|
FqnExpr:
|
|
629
632
|
{infer WildcardExpression} isWildcard?='*' |
|
|
@@ -60,6 +60,7 @@ declare const DocumentParserFromMixins: {
|
|
|
60
60
|
parseFqnExpr(astNode: import("../generated/ast").FqnExpr): invariant;
|
|
61
61
|
parseFqnRefExpr(astNode: import("../generated/ast").FqnRefExpr): invariant;
|
|
62
62
|
parseFqnExpressions(astNode: import("../generated/ast").FqnExpressions): invariant[];
|
|
63
|
+
parseRelationWhereExpr(astNode: import("../generated/ast").RelationPredicateWhereV2): invariant;
|
|
63
64
|
parseRelationExpr(astNode: import("../generated/ast").RelationExpr): invariant;
|
|
64
65
|
parseDeployment(): void;
|
|
65
66
|
parseDeploymentNode(astNode: import("../generated/ast").DeploymentNode): import("../ast").ParsedAstDeployment.Node;
|
|
@@ -117,6 +118,7 @@ declare const DocumentParserFromMixins: {
|
|
|
117
118
|
parseFqnExpr(astNode: import("../generated/ast").FqnExpr): invariant;
|
|
118
119
|
parseFqnRefExpr(astNode: import("../generated/ast").FqnRefExpr): invariant;
|
|
119
120
|
parseFqnExpressions(astNode: import("../generated/ast").FqnExpressions): invariant[];
|
|
121
|
+
parseRelationWhereExpr(astNode: import("../generated/ast").RelationPredicateWhereV2): invariant;
|
|
120
122
|
parseRelationExpr(astNode: import("../generated/ast").RelationExpr): invariant;
|
|
121
123
|
parseDeployment(): void;
|
|
122
124
|
parseDeploymentNode(astNode: import("../generated/ast").DeploymentNode): import("../ast").ParsedAstDeployment.Node;
|
|
@@ -183,6 +185,7 @@ declare const DocumentParserFromMixins: {
|
|
|
183
185
|
parseFqnExpr(astNode: import("../generated/ast").FqnExpr): invariant;
|
|
184
186
|
parseFqnRefExpr(astNode: import("../generated/ast").FqnRefExpr): invariant;
|
|
185
187
|
parseFqnExpressions(astNode: import("../generated/ast").FqnExpressions): invariant[];
|
|
188
|
+
parseRelationWhereExpr(astNode: import("../generated/ast").RelationPredicateWhereV2): invariant;
|
|
186
189
|
parseRelationExpr(astNode: import("../generated/ast").RelationExpr): invariant;
|
|
187
190
|
isValid: import("../validation").IsValidFn;
|
|
188
191
|
readonly services: LikeC4Services;
|
|
@@ -215,6 +218,7 @@ declare const DocumentParserFromMixins: {
|
|
|
215
218
|
parseFqnExpr(astNode: import("../generated/ast").FqnExpr): invariant;
|
|
216
219
|
parseFqnRefExpr(astNode: import("../generated/ast").FqnRefExpr): invariant;
|
|
217
220
|
parseFqnExpressions(astNode: import("../generated/ast").FqnExpressions): invariant[];
|
|
221
|
+
parseRelationWhereExpr(astNode: import("../generated/ast").RelationPredicateWhereV2): invariant;
|
|
218
222
|
parseRelationExpr(astNode: import("../generated/ast").RelationExpr): invariant;
|
|
219
223
|
isValid: import("../validation").IsValidFn;
|
|
220
224
|
readonly services: LikeC4Services;
|
|
@@ -261,6 +265,7 @@ declare const DocumentParserFromMixins: {
|
|
|
261
265
|
parseFqnExpr(astNode: import("../generated/ast").FqnExpr): invariant;
|
|
262
266
|
parseFqnRefExpr(astNode: import("../generated/ast").FqnRefExpr): invariant;
|
|
263
267
|
parseFqnExpressions(astNode: import("../generated/ast").FqnExpressions): invariant[];
|
|
268
|
+
parseRelationWhereExpr(astNode: import("../generated/ast").RelationPredicateWhereV2): invariant;
|
|
264
269
|
parseRelationExpr(astNode: import("../generated/ast").RelationExpr): invariant;
|
|
265
270
|
isValid: import("../validation").IsValidFn;
|
|
266
271
|
readonly services: LikeC4Services;
|
|
@@ -12,6 +12,7 @@ export declare function DeploymentModelParser<TBase extends WithExpressionV2>(B:
|
|
|
12
12
|
parseFqnExpr(astNode: ast.FqnExpr): c4.FqnExpr;
|
|
13
13
|
parseFqnRefExpr(astNode: ast.FqnRefExpr): c4.FqnExpr.NonWildcard;
|
|
14
14
|
parseFqnExpressions(astNode: ast.FqnExpressions): c4.FqnExpr[];
|
|
15
|
+
parseRelationWhereExpr(astNode: ast.RelationPredicateWhereV2): c4.RelationExpr;
|
|
15
16
|
parseRelationExpr(astNode: ast.RelationExpr): c4.RelationExpr;
|
|
16
17
|
isValid: import("../../validation").IsValidFn;
|
|
17
18
|
readonly services: import("../..").LikeC4Services;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as c4 from '@likec4/core';
|
|
2
|
-
import {
|
|
2
|
+
import { type ParsedAstDeploymentView, ast } from '../../ast';
|
|
3
3
|
import type { WithDeploymentModel } from './DeploymentModelParser';
|
|
4
4
|
import type { WithExpressionV2 } from './FqnRefParser';
|
|
5
5
|
export type WithDeploymentView = ReturnType<typeof DeploymentViewParser>;
|
|
@@ -13,6 +13,7 @@ export declare function DeploymentViewParser<TBase extends WithExpressionV2 & Wi
|
|
|
13
13
|
parseFqnExpr(astNode: ast.FqnExpr): c4.FqnExpr;
|
|
14
14
|
parseFqnRefExpr(astNode: ast.FqnRefExpr): c4.FqnExpr.NonWildcard;
|
|
15
15
|
parseFqnExpressions(astNode: ast.FqnExpressions): c4.FqnExpr[];
|
|
16
|
+
parseRelationWhereExpr(astNode: ast.RelationPredicateWhereV2): c4.RelationExpr;
|
|
16
17
|
parseRelationExpr(astNode: ast.RelationExpr): c4.RelationExpr;
|
|
17
18
|
isValid: import("../../validation").IsValidFn;
|
|
18
19
|
readonly services: import("../..").LikeC4Services;
|
|
@@ -70,6 +70,9 @@ export function DeploymentViewParser(B) {
|
|
|
70
70
|
case ast.isRelationExpr(expr):
|
|
71
71
|
exprs.unshift(this.parseRelationExpr(expr));
|
|
72
72
|
break;
|
|
73
|
+
case ast.isRelationPredicateWhereV2(expr):
|
|
74
|
+
exprs.unshift(this.parseRelationWhereExpr(expr));
|
|
75
|
+
break;
|
|
73
76
|
default:
|
|
74
77
|
nonexhaustive(expr);
|
|
75
78
|
}
|
|
@@ -8,6 +8,7 @@ export declare function ExpressionV2Parser<TBase extends Base>(B: TBase): {
|
|
|
8
8
|
parseFqnExpr(astNode: ast.FqnExpr): c4.FqnExpr;
|
|
9
9
|
parseFqnRefExpr(astNode: ast.FqnRefExpr): c4.FqnExpr.NonWildcard;
|
|
10
10
|
parseFqnExpressions(astNode: ast.FqnExpressions): c4.FqnExpr[];
|
|
11
|
+
parseRelationWhereExpr(astNode: ast.RelationPredicateWhereV2): c4.RelationExpr;
|
|
11
12
|
parseRelationExpr(astNode: ast.RelationExpr): c4.RelationExpr;
|
|
12
13
|
isValid: import("../../validation").IsValidFn;
|
|
13
14
|
readonly services: import("../..").LikeC4Services;
|
|
@@ -3,6 +3,7 @@ import { isNonNullish } from "remeda";
|
|
|
3
3
|
import { ast } from "../../ast.js";
|
|
4
4
|
import { logWarnError } from "../../logger.js";
|
|
5
5
|
import { instanceRef } from "../../utils/fqnRef.js";
|
|
6
|
+
import { parseWhereClause } from "../model-parser-where.js";
|
|
6
7
|
export function ExpressionV2Parser(B) {
|
|
7
8
|
return class ExpressionV2Parser extends B {
|
|
8
9
|
parseFqnRef(astNode) {
|
|
@@ -79,7 +80,19 @@ export function ExpressionV2Parser(B) {
|
|
|
79
80
|
}
|
|
80
81
|
return exprs.reverse();
|
|
81
82
|
}
|
|
83
|
+
parseRelationWhereExpr(astNode) {
|
|
84
|
+
return {
|
|
85
|
+
where: {
|
|
86
|
+
expr: this.parseRelationExpr(astNode.subject),
|
|
87
|
+
condition: astNode.where ? parseWhereClause(astNode.where) : {
|
|
88
|
+
kind: { neq: "--always-true--" }
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
82
93
|
parseRelationExpr(astNode) {
|
|
94
|
+
if (ast.isRelationPredicateWhere(astNode)) {
|
|
95
|
+
}
|
|
83
96
|
if (ast.isDirectedRelationExpr(astNode)) {
|
|
84
97
|
return {
|
|
85
98
|
source: this.parseFqnExpr(astNode.source.from),
|
|
@@ -57,6 +57,7 @@ export declare function GlobalsParser<TBase extends WithViewsParser>(B: TBase):
|
|
|
57
57
|
parseFqnExpr(astNode: ast.FqnExpr): c4.FqnExpr;
|
|
58
58
|
parseFqnRefExpr(astNode: ast.FqnRefExpr): c4.FqnExpr.NonWildcard;
|
|
59
59
|
parseFqnExpressions(astNode: ast.FqnExpressions): c4.FqnExpr[];
|
|
60
|
+
parseRelationWhereExpr(astNode: ast.RelationPredicateWhereV2): c4.RelationExpr;
|
|
60
61
|
parseRelationExpr(astNode: ast.RelationExpr): c4.RelationExpr;
|
|
61
62
|
parseDeployment(): void;
|
|
62
63
|
parseDeploymentNode(astNode: ast.DeploymentNode): import("../../ast").ParsedAstDeployment.Node;
|
|
@@ -55,6 +55,7 @@ export declare function ViewsParser<TBase extends WithPredicates & WithDeploymen
|
|
|
55
55
|
parseFqnExpr(astNode: ast.FqnExpr): c4.FqnExpr;
|
|
56
56
|
parseFqnRefExpr(astNode: ast.FqnRefExpr): c4.FqnExpr.NonWildcard;
|
|
57
57
|
parseFqnExpressions(astNode: ast.FqnExpressions): c4.FqnExpr[];
|
|
58
|
+
parseRelationWhereExpr(astNode: ast.RelationPredicateWhereV2): c4.RelationExpr;
|
|
58
59
|
parseRelationExpr(astNode: ast.RelationExpr): c4.RelationExpr;
|
|
59
60
|
parseDeployment(): void;
|
|
60
61
|
parseDeploymentNode(astNode: ast.DeploymentNode): import("../../ast").ParsedAstDeployment.Node;
|
|
@@ -3,7 +3,7 @@ import { type LikeC4LangiumDocument, ast } from '../ast';
|
|
|
3
3
|
import type { LikeC4Services } from '../module';
|
|
4
4
|
type Guard<N extends AstNode> = (n: AstNode) => n is N;
|
|
5
5
|
type Guarded<G> = G extends Guard<infer N> ? N : never;
|
|
6
|
-
declare const isValidatableAstNode: (n: AstNode) => n is ast.DeployedInstance | ast.DeploymentNode | ast.DeploymentViewRulePredicate | ast.DeploymentViewRuleStyle | ast.ViewRuleAutoLayout | ast.DynamicViewGlobalPredicateRef | ast.DynamicViewIncludePredicate | ast.ViewRuleGlobalStyle | ast.ViewRuleStyle | ast.ElementDescedantsExpression | ast.ElementKindExpression | ast.ElementRef | ast.ElementTagExpression | ast.ExpandElementExpression | ast.WildcardExpression | ast.ElementPredicateWhere | ast.ElementPredicateWith | ast.ElementStringProperty | ast.ElementStyleProperty | ast.IconProperty | ast.LinkProperty | ast.MetadataBody | ast.FqnRefExpr | ast.DirectedRelationExpr | ast.InOutRelationExpr | ast.IncomingRelationExpr | ast.OutgoingRelationExpr | ast.Element | ast.ExtendElement | ast.DeploymentView | ast.DynamicView | ast.ElementView | ast.DirectedRelationExpression | ast.InOutRelationExpression | ast.IncomingRelationExpression | ast.OutgoingRelationExpression | ast.RelationPredicateWhere | ast.RelationPredicateWith | ast.RelationStringProperty | ast.ArrowProperty | ast.ColorProperty | ast.LineProperty | ast.MetadataAttribute | ast.NotationProperty | ast.NotesProperty | ast.SpecificationElementStringProperty | ast.SpecificationRelationshipStringProperty | ast.ViewStringProperty | ast.BorderProperty | ast.OpacityProperty | ast.ShapeProperty | ast.ViewRuleGlobalPredicateRef | ast.ViewRuleGroup | ast.ExcludePredicate | ast.IncludePredicate | ast.SpecificationRelationshipKind | ast.GlobalStyle | ast.SpecificationColor | ast.NavigateToProperty | ast.DynamicViewStep | ast.Tags | ast.DeploymentRelation | ast.SpecificationDeploymentNodeKind | ast.DynamicViewParallelSteps | ast.GlobalDynamicPredicateGroup | ast.DynamicViewPredicateIterator | ast.Relation | ast.SpecificationElementKind | ast.GlobalPredicateGroup | ast.Globals | ast.GlobalStyleGroup | ast.SpecificationRule | ast.SpecificationTag;
|
|
6
|
+
declare const isValidatableAstNode: (n: AstNode) => n is ast.DeployedInstance | ast.DeploymentNode | ast.DeploymentViewRulePredicate | ast.DeploymentViewRuleStyle | ast.ViewRuleAutoLayout | ast.DynamicViewGlobalPredicateRef | ast.DynamicViewIncludePredicate | ast.ViewRuleGlobalStyle | ast.ViewRuleStyle | ast.ElementDescedantsExpression | ast.ElementKindExpression | ast.ElementRef | ast.ElementTagExpression | ast.ExpandElementExpression | ast.WildcardExpression | ast.ElementPredicateWhere | ast.ElementPredicateWith | ast.ElementStringProperty | ast.ElementStyleProperty | ast.IconProperty | ast.LinkProperty | ast.MetadataBody | ast.FqnRefExpr | ast.DirectedRelationExpr | ast.InOutRelationExpr | ast.IncomingRelationExpr | ast.OutgoingRelationExpr | ast.RelationPredicateWhereV2 | ast.Element | ast.ExtendElement | ast.DeploymentView | ast.DynamicView | ast.ElementView | ast.DirectedRelationExpression | ast.InOutRelationExpression | ast.IncomingRelationExpression | ast.OutgoingRelationExpression | ast.RelationPredicateWhere | ast.RelationPredicateWith | ast.RelationStringProperty | ast.ArrowProperty | ast.ColorProperty | ast.LineProperty | ast.MetadataAttribute | ast.NotationProperty | ast.NotesProperty | ast.SpecificationElementStringProperty | ast.SpecificationRelationshipStringProperty | ast.ViewStringProperty | ast.BorderProperty | ast.OpacityProperty | ast.ShapeProperty | ast.ViewRuleGlobalPredicateRef | ast.ViewRuleGroup | ast.ExcludePredicate | ast.IncludePredicate | ast.SpecificationRelationshipKind | ast.GlobalStyle | ast.SpecificationColor | ast.NavigateToProperty | ast.DynamicViewStep | ast.Tags | ast.DeploymentRelation | ast.SpecificationDeploymentNodeKind | ast.DynamicViewParallelSteps | ast.GlobalDynamicPredicateGroup | ast.DynamicViewPredicateIterator | ast.Relation | ast.SpecificationElementKind | ast.GlobalPredicateGroup | ast.Globals | ast.GlobalStyleGroup | ast.SpecificationRule | ast.SpecificationTag;
|
|
7
7
|
type ValidatableAstNode = Guarded<typeof isValidatableAstNode>;
|
|
8
8
|
export declare function checksFromDiagnostics(doc: LikeC4LangiumDocument): {
|
|
9
9
|
isValid: (n: ValidatableAstNode) => boolean;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/language-server",
|
|
3
3
|
"description": "LikeC4 Language Server",
|
|
4
|
-
"version": "1.19.
|
|
4
|
+
"version": "1.19.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bugs": "https://github.com/likec4/likec4/issues",
|
|
7
7
|
"homepage": "https://likec4.dev",
|
|
@@ -82,9 +82,9 @@
|
|
|
82
82
|
"test:watch": "vitest"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@likec4/core": "1.19.
|
|
86
|
-
"@likec4/layouts": "1.19.
|
|
87
|
-
"@likec4/log": "1.19.
|
|
85
|
+
"@likec4/core": "1.19.2",
|
|
86
|
+
"@likec4/layouts": "1.19.2",
|
|
87
|
+
"@likec4/log": "1.19.2",
|
|
88
88
|
"@msgpack/msgpack": "^3.0.0-beta2",
|
|
89
89
|
"@smithy/util-base64": "^3.0.0",
|
|
90
90
|
"esm-env": "^1.2.1",
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
"which": "^4.0.0"
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
|
-
"@likec4/icons": "1.19.
|
|
109
|
-
"@likec4/tsconfig": "1.19.
|
|
108
|
+
"@likec4/icons": "1.19.2",
|
|
109
|
+
"@likec4/tsconfig": "1.19.2",
|
|
110
110
|
"@types/node": "^20.17.7",
|
|
111
111
|
"@types/which": "^3.0.4",
|
|
112
112
|
"@vitest/coverage-v8": "^2.1.8",
|
|
@@ -120,5 +120,5 @@
|
|
|
120
120
|
"unbuild": "^3.1.0",
|
|
121
121
|
"vitest": "^2.1.8"
|
|
122
122
|
},
|
|
123
|
-
"packageManager": "yarn@4.
|
|
123
|
+
"packageManager": "yarn@4.6.0"
|
|
124
124
|
}
|
package/src/generated/ast.ts
CHANGED
|
@@ -230,7 +230,7 @@ export function isElementShape(item: unknown): item is ElementShape {
|
|
|
230
230
|
return item === 'rectangle' || item === 'person' || item === 'browser' || item === 'mobile' || item === 'cylinder' || item === 'storage' || item === 'queue';
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
export type ExpressionV2 = FqnExpr |
|
|
233
|
+
export type ExpressionV2 = FqnExpr | RelationPredicateOrWhereV2;
|
|
234
234
|
|
|
235
235
|
export const ExpressionV2 = 'ExpressionV2';
|
|
236
236
|
|
|
@@ -336,6 +336,14 @@ export function isRelationPredicateOrWhere(item: unknown): item is RelationPredi
|
|
|
336
336
|
return reflection.isInstance(item, RelationPredicateOrWhere);
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
+
export type RelationPredicateOrWhereV2 = RelationExpr | RelationPredicateWhereV2;
|
|
340
|
+
|
|
341
|
+
export const RelationPredicateOrWhereV2 = 'RelationPredicateOrWhereV2';
|
|
342
|
+
|
|
343
|
+
export function isRelationPredicateOrWhereV2(item: unknown): item is RelationPredicateOrWhereV2 {
|
|
344
|
+
return reflection.isInstance(item, RelationPredicateOrWhereV2);
|
|
345
|
+
}
|
|
346
|
+
|
|
339
347
|
export type RelationProperty = LinkProperty | MetadataProperty | RelationNavigateToProperty | RelationStringProperty | RelationStyleProperty;
|
|
340
348
|
|
|
341
349
|
export const RelationProperty = 'RelationProperty';
|
|
@@ -723,7 +731,7 @@ export function isDeploymentViewRuleStyle(item: unknown): item is DeploymentView
|
|
|
723
731
|
}
|
|
724
732
|
|
|
725
733
|
export interface DirectedRelationExpr extends AstNode {
|
|
726
|
-
readonly $container: DeploymentViewRulePredicateExpression;
|
|
734
|
+
readonly $container: DeploymentViewRulePredicateExpression | RelationPredicateWhereV2;
|
|
727
735
|
readonly $type: 'DirectedRelationExpr';
|
|
728
736
|
source: OutgoingRelationExpr;
|
|
729
737
|
target: FqnExpr;
|
|
@@ -1260,7 +1268,7 @@ export function isIncludePredicate(item: unknown): item is IncludePredicate {
|
|
|
1260
1268
|
}
|
|
1261
1269
|
|
|
1262
1270
|
export interface IncomingRelationExpr extends AstNode {
|
|
1263
|
-
readonly $container: DeploymentViewRulePredicateExpression | InOutRelationExpr;
|
|
1271
|
+
readonly $container: DeploymentViewRulePredicateExpression | InOutRelationExpr | RelationPredicateWhereV2;
|
|
1264
1272
|
readonly $type: 'IncomingRelationExpr';
|
|
1265
1273
|
to: FqnExpr;
|
|
1266
1274
|
}
|
|
@@ -1284,7 +1292,7 @@ export function isIncomingRelationExpression(item: unknown): item is IncomingRel
|
|
|
1284
1292
|
}
|
|
1285
1293
|
|
|
1286
1294
|
export interface InOutRelationExpr extends AstNode {
|
|
1287
|
-
readonly $container: DeploymentViewRulePredicateExpression;
|
|
1295
|
+
readonly $container: DeploymentViewRulePredicateExpression | RelationPredicateWhereV2;
|
|
1288
1296
|
readonly $type: 'InOutRelationExpr';
|
|
1289
1297
|
inout: IncomingRelationExpr;
|
|
1290
1298
|
}
|
|
@@ -1492,7 +1500,7 @@ export function isOpacityProperty(item: unknown): item is OpacityProperty {
|
|
|
1492
1500
|
}
|
|
1493
1501
|
|
|
1494
1502
|
export interface OutgoingRelationExpr extends AstNode {
|
|
1495
|
-
readonly $container: DeploymentViewRulePredicateExpression | DirectedRelationExpr;
|
|
1503
|
+
readonly $container: DeploymentViewRulePredicateExpression | DirectedRelationExpr | RelationPredicateWhereV2;
|
|
1496
1504
|
readonly $type: 'OutgoingRelationExpr';
|
|
1497
1505
|
from: FqnExpr;
|
|
1498
1506
|
isBidirectional: boolean;
|
|
@@ -1589,6 +1597,19 @@ export function isRelationPredicateWhere(item: unknown): item is RelationPredica
|
|
|
1589
1597
|
return reflection.isInstance(item, RelationPredicateWhere);
|
|
1590
1598
|
}
|
|
1591
1599
|
|
|
1600
|
+
export interface RelationPredicateWhereV2 extends AstNode {
|
|
1601
|
+
readonly $container: DeploymentViewRulePredicateExpression;
|
|
1602
|
+
readonly $type: 'RelationPredicateWhereV2';
|
|
1603
|
+
subject: RelationExpr;
|
|
1604
|
+
where?: WhereRelationExpression;
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
export const RelationPredicateWhereV2 = 'RelationPredicateWhereV2';
|
|
1608
|
+
|
|
1609
|
+
export function isRelationPredicateWhereV2(item: unknown): item is RelationPredicateWhereV2 {
|
|
1610
|
+
return reflection.isInstance(item, RelationPredicateWhereV2);
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1592
1613
|
export interface RelationPredicateWith extends AstNode {
|
|
1593
1614
|
readonly $container: Predicates;
|
|
1594
1615
|
readonly $type: 'RelationPredicateWith';
|
|
@@ -1876,7 +1897,7 @@ export function isViewStringProperty(item: unknown): item is ViewStringProperty
|
|
|
1876
1897
|
}
|
|
1877
1898
|
|
|
1878
1899
|
export interface WhereBinaryExpression extends AstNode {
|
|
1879
|
-
readonly $container: ElementPredicateWhere | RelationPredicateWhere | WhereBinaryExpression | WhereElementNegation | WhereRelationNegation;
|
|
1900
|
+
readonly $container: ElementPredicateWhere | RelationPredicateWhere | RelationPredicateWhereV2 | WhereBinaryExpression | WhereElementNegation | WhereRelationNegation;
|
|
1880
1901
|
readonly $type: 'WhereBinaryExpression';
|
|
1881
1902
|
left: WhereElementExpression | WhereRelationExpression;
|
|
1882
1903
|
operator: 'and' | 'or';
|
|
@@ -1930,7 +1951,7 @@ export function isWhereElementTag(item: unknown): item is WhereElementTag {
|
|
|
1930
1951
|
}
|
|
1931
1952
|
|
|
1932
1953
|
export interface WhereRelationKind extends AstNode {
|
|
1933
|
-
readonly $container: RelationPredicateWhere | WhereBinaryExpression | WhereRelationNegation;
|
|
1954
|
+
readonly $container: RelationPredicateWhere | RelationPredicateWhereV2 | WhereBinaryExpression | WhereRelationNegation;
|
|
1934
1955
|
readonly $type: 'WhereRelationKind';
|
|
1935
1956
|
not: boolean;
|
|
1936
1957
|
operator: 'is' | string;
|
|
@@ -1944,7 +1965,7 @@ export function isWhereRelationKind(item: unknown): item is WhereRelationKind {
|
|
|
1944
1965
|
}
|
|
1945
1966
|
|
|
1946
1967
|
export interface WhereRelationNegation extends AstNode {
|
|
1947
|
-
readonly $container: RelationPredicateWhere | WhereBinaryExpression | WhereRelationNegation;
|
|
1968
|
+
readonly $container: RelationPredicateWhere | RelationPredicateWhereV2 | WhereBinaryExpression | WhereRelationNegation;
|
|
1948
1969
|
readonly $type: 'WhereRelationNegation';
|
|
1949
1970
|
value: WhereRelationExpression;
|
|
1950
1971
|
}
|
|
@@ -1956,7 +1977,7 @@ export function isWhereRelationNegation(item: unknown): item is WhereRelationNeg
|
|
|
1956
1977
|
}
|
|
1957
1978
|
|
|
1958
1979
|
export interface WhereRelationTag extends AstNode {
|
|
1959
|
-
readonly $container: RelationPredicateWhere | WhereBinaryExpression | WhereRelationNegation;
|
|
1980
|
+
readonly $container: RelationPredicateWhere | RelationPredicateWhereV2 | WhereBinaryExpression | WhereRelationNegation;
|
|
1960
1981
|
readonly $type: 'WhereRelationTag';
|
|
1961
1982
|
not: boolean;
|
|
1962
1983
|
operator: 'is' | string;
|
|
@@ -2083,7 +2104,9 @@ export type LikeC4AstType = {
|
|
|
2083
2104
|
RelationNavigateToProperty: RelationNavigateToProperty
|
|
2084
2105
|
RelationPredicate: RelationPredicate
|
|
2085
2106
|
RelationPredicateOrWhere: RelationPredicateOrWhere
|
|
2107
|
+
RelationPredicateOrWhereV2: RelationPredicateOrWhereV2
|
|
2086
2108
|
RelationPredicateWhere: RelationPredicateWhere
|
|
2109
|
+
RelationPredicateWhereV2: RelationPredicateWhereV2
|
|
2087
2110
|
RelationPredicateWith: RelationPredicateWith
|
|
2088
2111
|
RelationProperty: RelationProperty
|
|
2089
2112
|
RelationStringProperty: RelationStringProperty
|
|
@@ -2134,7 +2157,7 @@ export type LikeC4AstType = {
|
|
|
2134
2157
|
export class LikeC4AstReflection extends AbstractAstReflection {
|
|
2135
2158
|
|
|
2136
2159
|
getAllTypes(): string[] {
|
|
2137
|
-
return [ArrowProperty, BorderProperty, ColorProperty, CustomColor, CustomElementProperties, CustomRelationProperties, DeployedInstance, DeployedInstanceBody, DeploymentElement, DeploymentNode, DeploymentNodeBody, DeploymentNodeKind, DeploymentRelation, DeploymentRelationBody, DeploymentView, DeploymentViewBody, DeploymentViewRule, DeploymentViewRulePredicate, DeploymentViewRulePredicateExpression, DeploymentViewRuleStyle, DirectedRelationExpr, DirectedRelationExpression, DynamicView, DynamicViewBody, DynamicViewGlobalPredicateRef, DynamicViewIncludePredicate, DynamicViewParallelSteps, DynamicViewPredicateIterator, DynamicViewRef, DynamicViewRule, DynamicViewStep, Element, ElementBody, ElementDescedantsExpression, ElementExpression, ElementExpressionsIterator, ElementKind, ElementKindExpression, ElementPredicate, ElementPredicateOrWhere, ElementPredicateWhere, ElementPredicateWith, ElementProperty, ElementRef, ElementStringProperty, ElementStyleProperty, ElementTagExpression, ElementView, ElementViewBody, ElementViewRef, ExcludePredicate, ExpandElementExpression, ExpressionV2, ExtendElement, ExtendElementBody, FqnElementRef, FqnExpr, FqnExpressions, FqnRef, FqnRefExpr, FqnReferenceable, GlobalDynamicPredicateGroup, GlobalPredicateGroup, GlobalStyle, GlobalStyleGroup, GlobalStyleId, Globals, IconProperty, InOutRelationExpr, InOutRelationExpression, IncludePredicate, IncomingRelationExpr, IncomingRelationExpression, LibIcon, LikeC4Grammar, LikeC4Lib, LikeC4View, LineProperty, LinkProperty, MetadataAttribute, MetadataBody, MetadataProperty, Model, ModelDeployments, ModelViews, NavigateToProperty, NotationProperty, NotesProperty, OpacityProperty, OutgoingRelationExpr, OutgoingRelationExpression, Predicate, Predicates, Referenceable, Relation, RelationBody, RelationExpr, RelationExpression, RelationNavigateToProperty, RelationPredicate, RelationPredicateOrWhere, RelationPredicateWhere, RelationPredicateWith, RelationProperty, RelationStringProperty, RelationStyleProperty, RelationshipKind, RelationshipStyleProperty, ShapeProperty, SpecificationColor, SpecificationDeploymentNodeKind, SpecificationElementKind, SpecificationElementStringProperty, SpecificationRelationshipKind, SpecificationRelationshipStringProperty, SpecificationRule, SpecificationTag, StringProperty, StyleProperty, Tag, Tags, ViewProperty, ViewRef, ViewRule, ViewRuleAutoLayout, ViewRuleGlobalPredicateRef, ViewRuleGlobalStyle, ViewRuleGroup, ViewRulePredicate, ViewRuleStyle, ViewRuleStyleOrGlobalRef, ViewStringProperty, WhereBinaryExpression, WhereElement, WhereElementExpression, WhereElementKind, WhereElementNegation, WhereElementTag, WhereExpression, WhereKindEqual, WhereRelation, WhereRelationExpression, WhereRelationKind, WhereRelationNegation, WhereRelationTag, WhereTagEqual, WildcardExpression];
|
|
2160
|
+
return [ArrowProperty, BorderProperty, ColorProperty, CustomColor, CustomElementProperties, CustomRelationProperties, DeployedInstance, DeployedInstanceBody, DeploymentElement, DeploymentNode, DeploymentNodeBody, DeploymentNodeKind, DeploymentRelation, DeploymentRelationBody, DeploymentView, DeploymentViewBody, DeploymentViewRule, DeploymentViewRulePredicate, DeploymentViewRulePredicateExpression, DeploymentViewRuleStyle, DirectedRelationExpr, DirectedRelationExpression, DynamicView, DynamicViewBody, DynamicViewGlobalPredicateRef, DynamicViewIncludePredicate, DynamicViewParallelSteps, DynamicViewPredicateIterator, DynamicViewRef, DynamicViewRule, DynamicViewStep, Element, ElementBody, ElementDescedantsExpression, ElementExpression, ElementExpressionsIterator, ElementKind, ElementKindExpression, ElementPredicate, ElementPredicateOrWhere, ElementPredicateWhere, ElementPredicateWith, ElementProperty, ElementRef, ElementStringProperty, ElementStyleProperty, ElementTagExpression, ElementView, ElementViewBody, ElementViewRef, ExcludePredicate, ExpandElementExpression, ExpressionV2, ExtendElement, ExtendElementBody, FqnElementRef, FqnExpr, FqnExpressions, FqnRef, FqnRefExpr, FqnReferenceable, GlobalDynamicPredicateGroup, GlobalPredicateGroup, GlobalStyle, GlobalStyleGroup, GlobalStyleId, Globals, IconProperty, InOutRelationExpr, InOutRelationExpression, IncludePredicate, IncomingRelationExpr, IncomingRelationExpression, LibIcon, LikeC4Grammar, LikeC4Lib, LikeC4View, LineProperty, LinkProperty, MetadataAttribute, MetadataBody, MetadataProperty, Model, ModelDeployments, ModelViews, NavigateToProperty, NotationProperty, NotesProperty, OpacityProperty, OutgoingRelationExpr, OutgoingRelationExpression, Predicate, Predicates, Referenceable, Relation, RelationBody, RelationExpr, RelationExpression, RelationNavigateToProperty, RelationPredicate, RelationPredicateOrWhere, RelationPredicateOrWhereV2, RelationPredicateWhere, RelationPredicateWhereV2, RelationPredicateWith, RelationProperty, RelationStringProperty, RelationStyleProperty, RelationshipKind, RelationshipStyleProperty, ShapeProperty, SpecificationColor, SpecificationDeploymentNodeKind, SpecificationElementKind, SpecificationElementStringProperty, SpecificationRelationshipKind, SpecificationRelationshipStringProperty, SpecificationRule, SpecificationTag, StringProperty, StyleProperty, Tag, Tags, ViewProperty, ViewRef, ViewRule, ViewRuleAutoLayout, ViewRuleGlobalPredicateRef, ViewRuleGlobalStyle, ViewRuleGroup, ViewRulePredicate, ViewRuleStyle, ViewRuleStyleOrGlobalRef, ViewStringProperty, WhereBinaryExpression, WhereElement, WhereElementExpression, WhereElementKind, WhereElementNegation, WhereElementTag, WhereExpression, WhereKindEqual, WhereRelation, WhereRelationExpression, WhereRelationKind, WhereRelationNegation, WhereRelationTag, WhereTagEqual, WildcardExpression];
|
|
2138
2161
|
}
|
|
2139
2162
|
|
|
2140
2163
|
protected override computeIsSubtype(subtype: string, supertype: string): boolean {
|
|
@@ -2217,7 +2240,7 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
2217
2240
|
return this.isSubtype(FqnReferenceable, supertype);
|
|
2218
2241
|
}
|
|
2219
2242
|
case FqnExpr:
|
|
2220
|
-
case
|
|
2243
|
+
case RelationPredicateOrWhereV2: {
|
|
2221
2244
|
return this.isSubtype(ExpressionV2, supertype);
|
|
2222
2245
|
}
|
|
2223
2246
|
case FqnRefExpr: {
|
|
@@ -2242,6 +2265,10 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
2242
2265
|
case MetadataProperty: {
|
|
2243
2266
|
return this.isSubtype(ElementProperty, supertype) || this.isSubtype(RelationProperty, supertype);
|
|
2244
2267
|
}
|
|
2268
|
+
case RelationExpr:
|
|
2269
|
+
case RelationPredicateWhereV2: {
|
|
2270
|
+
return this.isSubtype(RelationPredicateOrWhereV2, supertype);
|
|
2271
|
+
}
|
|
2245
2272
|
case RelationExpression:
|
|
2246
2273
|
case RelationPredicateWhere: {
|
|
2247
2274
|
return this.isSubtype(RelationPredicateOrWhere, supertype);
|
|
@@ -3149,6 +3176,15 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
3149
3176
|
]
|
|
3150
3177
|
};
|
|
3151
3178
|
}
|
|
3179
|
+
case RelationPredicateWhereV2: {
|
|
3180
|
+
return {
|
|
3181
|
+
name: RelationPredicateWhereV2,
|
|
3182
|
+
properties: [
|
|
3183
|
+
{ name: 'subject' },
|
|
3184
|
+
{ name: 'where' }
|
|
3185
|
+
]
|
|
3186
|
+
};
|
|
3187
|
+
}
|
|
3152
3188
|
case RelationPredicateWith: {
|
|
3153
3189
|
return {
|
|
3154
3190
|
name: RelationPredicateWith,
|