@likec4/language-server 1.19.1 → 1.20.0
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/contrib/likec4.tmLanguage.json +1 -1
- package/dist/generated/ast.d.ts +55 -14
- package/dist/generated/ast.js +72 -4
- package/dist/generated/grammar.js +1 -1
- package/dist/like-c4.langium +13 -6
- package/dist/lsp/SemanticTokenProvider.d.ts +1 -1
- package/dist/lsp/SemanticTokenProvider.js +7 -0
- package/dist/model/model-parser-where.js +12 -6
- 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 +11 -11
- package/src/generated/ast.ts +134 -17
- package/src/generated/grammar.ts +1 -1
- package/src/like-c4.langium +13 -6
- package/src/lsp/SemanticTokenProvider.ts +51 -44
- package/src/model/model-parser-where.ts +22 -14
- package/src/model/parser/DeploymentViewParser.ts +10 -7
- package/src/model/parser/FqnRefParser.ts +14 -0
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
"name": "keyword.control.likec4",
|
|
15
|
-
"match": "\\b(BottomTop|LeftRight|RightLeft|TopBottom|amber|and|autoLayout|blue|border|browser|color|crow|cylinder|dashed|deployment|deploymentNode|description|diamond|dot|dotted|dynamic|dynamicPredicateGroup|element|element\\.kind|element\\.tag|exclude|extend|extends|global|gray|green|group|head|icon|icons|include|indigo|instance|instanceOf|is|kind|likec4lib|line|link|metadata|mobile|model|muted|navigateTo|node|none|normal|not|notation|notes|odiamond|odot|of|onormal|opacity|open|or|par|parallel|person|predicate|predicateGroup|primary|queue|rectangle|red|relationship|secondary|shape|sky|slate|solid|specification|storage|style|styleGroup|tag|tail|technology|title|vee|view|views|where|with)\\b"
|
|
15
|
+
"match": "\\b(BottomTop|LeftRight|RightLeft|TopBottom|amber|and|autoLayout|blue|border|browser|color|crow|cylinder|dashed|deployment|deploymentNode|description|diamond|dot|dotted|dynamic|dynamicPredicateGroup|element|element\\.kind|element\\.tag|exclude|extend|extends|global|gray|green|group|head|icon|icons|include|indigo|instance|instanceOf|is|kind|likec4lib|line|link|metadata|mobile|model|muted|navigateTo|node|none|normal|not|notation|notes|odiamond|odot|of|onormal|opacity|open|or|par|parallel|person|predicate|predicateGroup|primary|queue|rectangle|red|relationship|secondary|shape|sky|slate|solid|source|specification|storage|style|styleGroup|tag|tail|target|technology|title|vee|view|views|where|with)\\b"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"name": "string.quoted.double.likec4",
|
package/dist/generated/ast.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare const LikeC4Terminals: {
|
|
|
26
26
|
Hex: RegExp;
|
|
27
27
|
};
|
|
28
28
|
export type LikeC4TerminalNames = keyof typeof LikeC4Terminals;
|
|
29
|
-
export type LikeC4KeywordNames = "(" | ")" | "*" | "," | "->" | "-[" | ":" | ";" | "<-" | "<->" | "BottomTop" | "LeftRight" | "RightLeft" | "TopBottom" | "]->" | "amber" | "and" | "autoLayout" | "blue" | "border" | "browser" | "color" | "crow" | "cylinder" | "dashed" | "deployment" | "deploymentNode" | "description" | "diamond" | "dot" | "dotted" | "dynamic" | "dynamicPredicateGroup" | "element" | "element.kind" | "element.tag" | "exclude" | "extend" | "extends" | "global" | "gray" | "green" | "group" | "head" | "icon" | "icons" | "include" | "indigo" | "instance" | "instanceOf" | "is" | "kind" | "likec4lib" | "line" | "link" | "metadata" | "mobile" | "model" | "muted" | "navigateTo" | "node" | "none" | "normal" | "not" | "notation" | "notes" | "odiamond" | "odot" | "of" | "onormal" | "opacity" | "open" | "or" | "par" | "parallel" | "person" | "predicate" | "predicateGroup" | "primary" | "queue" | "rectangle" | "red" | "relationship" | "secondary" | "shape" | "sky" | "slate" | "solid" | "specification" | "storage" | "style" | "styleGroup" | "tag" | "tail" | "technology" | "title" | "vee" | "view" | "views" | "where" | "with" | "{" | "}";
|
|
29
|
+
export type LikeC4KeywordNames = "(" | ")" | "*" | "," | "->" | "-[" | ":" | ";" | "<-" | "<->" | "BottomTop" | "LeftRight" | "RightLeft" | "TopBottom" | "]->" | "amber" | "and" | "autoLayout" | "blue" | "border" | "browser" | "color" | "crow" | "cylinder" | "dashed" | "deployment" | "deploymentNode" | "description" | "diamond" | "dot" | "dotted" | "dynamic" | "dynamicPredicateGroup" | "element" | "element.kind" | "element.tag" | "exclude" | "extend" | "extends" | "global" | "gray" | "green" | "group" | "head" | "icon" | "icons" | "include" | "indigo" | "instance" | "instanceOf" | "is" | "kind" | "likec4lib" | "line" | "link" | "metadata" | "mobile" | "model" | "muted" | "navigateTo" | "node" | "none" | "normal" | "not" | "notation" | "notes" | "odiamond" | "odot" | "of" | "onormal" | "opacity" | "open" | "or" | "par" | "parallel" | "person" | "predicate" | "predicateGroup" | "primary" | "queue" | "rectangle" | "red" | "relationship" | "secondary" | "shape" | "sky" | "slate" | "solid" | "source" | "specification" | "storage" | "style" | "styleGroup" | "tag" | "tail" | "target" | "technology" | "title" | "vee" | "view" | "views" | "where" | "with" | "{" | "}";
|
|
30
30
|
export type LikeC4TokenNames = LikeC4TerminalNames | LikeC4KeywordNames;
|
|
31
31
|
export type ArrowType = 'crow' | 'diamond' | 'dot' | 'none' | 'normal' | 'odiamond' | 'odot' | 'onormal' | 'open' | 'vee';
|
|
32
32
|
export declare function isArrowType(item: unknown): item is ArrowType;
|
|
@@ -39,6 +39,9 @@ export declare function isCustomColorValue(item: unknown): item is CustomColorVa
|
|
|
39
39
|
export type DeploymentElement = DeployedInstance | DeploymentNode;
|
|
40
40
|
export declare const DeploymentElement = "DeploymentElement";
|
|
41
41
|
export declare function isDeploymentElement(item: unknown): item is DeploymentElement;
|
|
42
|
+
export type DeploymentNodeOrElementKind = DeploymentNodeKind | ElementKind;
|
|
43
|
+
export declare const DeploymentNodeOrElementKind = "DeploymentNodeOrElementKind";
|
|
44
|
+
export declare function isDeploymentNodeOrElementKind(item: unknown): item is DeploymentNodeOrElementKind;
|
|
42
45
|
export type DeploymentViewRule = DeploymentViewRulePredicate | DeploymentViewRuleStyle | ViewRuleAutoLayout;
|
|
43
46
|
export declare const DeploymentViewRule = "DeploymentViewRule";
|
|
44
47
|
export declare function isDeploymentViewRule(item: unknown): item is DeploymentViewRule;
|
|
@@ -61,7 +64,7 @@ export declare const ElementProperty = "ElementProperty";
|
|
|
61
64
|
export declare function isElementProperty(item: unknown): item is ElementProperty;
|
|
62
65
|
export type ElementShape = 'browser' | 'cylinder' | 'mobile' | 'person' | 'queue' | 'rectangle' | 'storage';
|
|
63
66
|
export declare function isElementShape(item: unknown): item is ElementShape;
|
|
64
|
-
export type ExpressionV2 = FqnExpr |
|
|
67
|
+
export type ExpressionV2 = FqnExpr | RelationPredicateOrWhereV2;
|
|
65
68
|
export declare const ExpressionV2 = "ExpressionV2";
|
|
66
69
|
export declare function isExpressionV2(item: unknown): item is ExpressionV2;
|
|
67
70
|
export type FqnExpr = FqnRefExpr | WildcardExpression;
|
|
@@ -72,7 +75,7 @@ export declare const FqnReferenceable = "FqnReferenceable";
|
|
|
72
75
|
export declare function isFqnReferenceable(item: unknown): item is FqnReferenceable;
|
|
73
76
|
export type IconId = string;
|
|
74
77
|
export declare function isIconId(item: unknown): item is IconId;
|
|
75
|
-
export type Id = 'deployment' | 'element' | 'group' | 'instance' | 'model' | 'node' | ArrowType | ElementShape | LineOptions | ThemeColor | string;
|
|
78
|
+
export type Id = 'deployment' | 'element' | 'group' | 'instance' | 'model' | 'node' | ArrowType | ElementShape | LineOptions | Participant | ThemeColor | string;
|
|
76
79
|
export declare function isId(item: unknown): item is Id;
|
|
77
80
|
export type LikeC4View = DeploymentView | DynamicView | ElementView;
|
|
78
81
|
export declare const LikeC4View = "LikeC4View";
|
|
@@ -82,6 +85,8 @@ export declare function isLineOptions(item: unknown): item is LineOptions;
|
|
|
82
85
|
export type MetadataProperty = MetadataBody;
|
|
83
86
|
export declare const MetadataProperty = "MetadataProperty";
|
|
84
87
|
export declare function isMetadataProperty(item: unknown): item is MetadataProperty;
|
|
88
|
+
export type Participant = 'source' | 'target';
|
|
89
|
+
export declare function isParticipant(item: unknown): item is Participant;
|
|
85
90
|
export type Predicate = ElementPredicate | RelationPredicate;
|
|
86
91
|
export declare const Predicate = "Predicate";
|
|
87
92
|
export declare function isPredicate(item: unknown): item is Predicate;
|
|
@@ -100,6 +105,9 @@ export declare function isRelationPredicate(item: unknown): item is RelationPred
|
|
|
100
105
|
export type RelationPredicateOrWhere = RelationExpression | RelationPredicateWhere;
|
|
101
106
|
export declare const RelationPredicateOrWhere = "RelationPredicateOrWhere";
|
|
102
107
|
export declare function isRelationPredicateOrWhere(item: unknown): item is RelationPredicateOrWhere;
|
|
108
|
+
export type RelationPredicateOrWhereV2 = RelationExpr | RelationPredicateWhereV2;
|
|
109
|
+
export declare const RelationPredicateOrWhereV2 = "RelationPredicateOrWhereV2";
|
|
110
|
+
export declare function isRelationPredicateOrWhereV2(item: unknown): item is RelationPredicateOrWhereV2;
|
|
103
111
|
export type RelationProperty = LinkProperty | MetadataProperty | RelationNavigateToProperty | RelationStringProperty | RelationStyleProperty;
|
|
104
112
|
export declare const RelationProperty = "RelationProperty";
|
|
105
113
|
export declare function isRelationProperty(item: unknown): item is RelationProperty;
|
|
@@ -141,16 +149,16 @@ export declare function isWhereElementExpression(item: unknown): item is WhereEl
|
|
|
141
149
|
export type WhereExpression = WhereElementExpression | WhereRelationExpression;
|
|
142
150
|
export declare const WhereExpression = "WhereExpression";
|
|
143
151
|
export declare function isWhereExpression(item: unknown): item is WhereExpression;
|
|
144
|
-
export type WhereKindEqual = WhereElementKind | WhereRelationKind;
|
|
152
|
+
export type WhereKindEqual = WhereElementKind | WhereRelationKind | WhereRelationParticipantKind;
|
|
145
153
|
export declare const WhereKindEqual = "WhereKindEqual";
|
|
146
154
|
export declare function isWhereKindEqual(item: unknown): item is WhereKindEqual;
|
|
147
|
-
export type WhereRelation = WhereRelationKind | WhereRelationTag;
|
|
155
|
+
export type WhereRelation = WhereRelationKind | WhereRelationParticipantKind | WhereRelationParticipantTag | WhereRelationTag;
|
|
148
156
|
export declare const WhereRelation = "WhereRelation";
|
|
149
157
|
export declare function isWhereRelation(item: unknown): item is WhereRelation;
|
|
150
158
|
export type WhereRelationExpression = WhereBinaryExpression | WhereRelation | WhereRelationNegation;
|
|
151
159
|
export declare const WhereRelationExpression = "WhereRelationExpression";
|
|
152
160
|
export declare function isWhereRelationExpression(item: unknown): item is WhereRelationExpression;
|
|
153
|
-
export type WhereTagEqual = WhereElementTag | WhereRelationTag;
|
|
161
|
+
export type WhereTagEqual = WhereElementTag | WhereRelationParticipantTag | WhereRelationTag;
|
|
154
162
|
export declare const WhereTagEqual = "WhereTagEqual";
|
|
155
163
|
export declare function isWhereTagEqual(item: unknown): item is WhereTagEqual;
|
|
156
164
|
export interface ArrowProperty extends AstNode {
|
|
@@ -306,7 +314,7 @@ export interface DeploymentViewRuleStyle extends AstNode {
|
|
|
306
314
|
export declare const DeploymentViewRuleStyle = "DeploymentViewRuleStyle";
|
|
307
315
|
export declare function isDeploymentViewRuleStyle(item: unknown): item is DeploymentViewRuleStyle;
|
|
308
316
|
export interface DirectedRelationExpr extends AstNode {
|
|
309
|
-
readonly $container: DeploymentViewRulePredicateExpression;
|
|
317
|
+
readonly $container: DeploymentViewRulePredicateExpression | RelationPredicateWhereV2;
|
|
310
318
|
readonly $type: 'DirectedRelationExpr';
|
|
311
319
|
source: OutgoingRelationExpr;
|
|
312
320
|
target: FqnExpr;
|
|
@@ -638,7 +646,7 @@ export interface IncludePredicate extends AstNode {
|
|
|
638
646
|
export declare const IncludePredicate = "IncludePredicate";
|
|
639
647
|
export declare function isIncludePredicate(item: unknown): item is IncludePredicate;
|
|
640
648
|
export interface IncomingRelationExpr extends AstNode {
|
|
641
|
-
readonly $container: DeploymentViewRulePredicateExpression | InOutRelationExpr;
|
|
649
|
+
readonly $container: DeploymentViewRulePredicateExpression | InOutRelationExpr | RelationPredicateWhereV2;
|
|
642
650
|
readonly $type: 'IncomingRelationExpr';
|
|
643
651
|
to: FqnExpr;
|
|
644
652
|
}
|
|
@@ -652,7 +660,7 @@ export interface IncomingRelationExpression extends AstNode {
|
|
|
652
660
|
export declare const IncomingRelationExpression = "IncomingRelationExpression";
|
|
653
661
|
export declare function isIncomingRelationExpression(item: unknown): item is IncomingRelationExpression;
|
|
654
662
|
export interface InOutRelationExpr extends AstNode {
|
|
655
|
-
readonly $container: DeploymentViewRulePredicateExpression;
|
|
663
|
+
readonly $container: DeploymentViewRulePredicateExpression | RelationPredicateWhereV2;
|
|
656
664
|
readonly $type: 'InOutRelationExpr';
|
|
657
665
|
inout: IncomingRelationExpr;
|
|
658
666
|
}
|
|
@@ -780,7 +788,7 @@ export interface OpacityProperty extends AstNode {
|
|
|
780
788
|
export declare const OpacityProperty = "OpacityProperty";
|
|
781
789
|
export declare function isOpacityProperty(item: unknown): item is OpacityProperty;
|
|
782
790
|
export interface OutgoingRelationExpr extends AstNode {
|
|
783
|
-
readonly $container: DeploymentViewRulePredicateExpression | DirectedRelationExpr;
|
|
791
|
+
readonly $container: DeploymentViewRulePredicateExpression | DirectedRelationExpr | RelationPredicateWhereV2;
|
|
784
792
|
readonly $type: 'OutgoingRelationExpr';
|
|
785
793
|
from: FqnExpr;
|
|
786
794
|
isBidirectional: boolean;
|
|
@@ -842,6 +850,14 @@ export interface RelationPredicateWhere extends AstNode {
|
|
|
842
850
|
}
|
|
843
851
|
export declare const RelationPredicateWhere = "RelationPredicateWhere";
|
|
844
852
|
export declare function isRelationPredicateWhere(item: unknown): item is RelationPredicateWhere;
|
|
853
|
+
export interface RelationPredicateWhereV2 extends AstNode {
|
|
854
|
+
readonly $container: DeploymentViewRulePredicateExpression;
|
|
855
|
+
readonly $type: 'RelationPredicateWhereV2';
|
|
856
|
+
subject: RelationExpr;
|
|
857
|
+
where?: WhereRelationExpression;
|
|
858
|
+
}
|
|
859
|
+
export declare const RelationPredicateWhereV2 = "RelationPredicateWhereV2";
|
|
860
|
+
export declare function isRelationPredicateWhereV2(item: unknown): item is RelationPredicateWhereV2;
|
|
845
861
|
export interface RelationPredicateWith extends AstNode {
|
|
846
862
|
readonly $container: Predicates;
|
|
847
863
|
readonly $type: 'RelationPredicateWith';
|
|
@@ -1019,7 +1035,7 @@ export interface ViewStringProperty extends AstNode {
|
|
|
1019
1035
|
export declare const ViewStringProperty = "ViewStringProperty";
|
|
1020
1036
|
export declare function isViewStringProperty(item: unknown): item is ViewStringProperty;
|
|
1021
1037
|
export interface WhereBinaryExpression extends AstNode {
|
|
1022
|
-
readonly $container: ElementPredicateWhere | RelationPredicateWhere | WhereBinaryExpression | WhereElementNegation | WhereRelationNegation;
|
|
1038
|
+
readonly $container: ElementPredicateWhere | RelationPredicateWhere | RelationPredicateWhereV2 | WhereBinaryExpression | WhereElementNegation | WhereRelationNegation;
|
|
1023
1039
|
readonly $type: 'WhereBinaryExpression';
|
|
1024
1040
|
left: WhereElementExpression | WhereRelationExpression;
|
|
1025
1041
|
operator: 'and' | 'or';
|
|
@@ -1053,7 +1069,7 @@ export interface WhereElementTag extends AstNode {
|
|
|
1053
1069
|
export declare const WhereElementTag = "WhereElementTag";
|
|
1054
1070
|
export declare function isWhereElementTag(item: unknown): item is WhereElementTag;
|
|
1055
1071
|
export interface WhereRelationKind extends AstNode {
|
|
1056
|
-
readonly $container: RelationPredicateWhere | WhereBinaryExpression | WhereRelationNegation;
|
|
1072
|
+
readonly $container: RelationPredicateWhere | RelationPredicateWhereV2 | WhereBinaryExpression | WhereRelationNegation;
|
|
1057
1073
|
readonly $type: 'WhereRelationKind';
|
|
1058
1074
|
not: boolean;
|
|
1059
1075
|
operator: 'is' | string;
|
|
@@ -1062,14 +1078,34 @@ export interface WhereRelationKind extends AstNode {
|
|
|
1062
1078
|
export declare const WhereRelationKind = "WhereRelationKind";
|
|
1063
1079
|
export declare function isWhereRelationKind(item: unknown): item is WhereRelationKind;
|
|
1064
1080
|
export interface WhereRelationNegation extends AstNode {
|
|
1065
|
-
readonly $container: RelationPredicateWhere | WhereBinaryExpression | WhereRelationNegation;
|
|
1081
|
+
readonly $container: RelationPredicateWhere | RelationPredicateWhereV2 | WhereBinaryExpression | WhereRelationNegation;
|
|
1066
1082
|
readonly $type: 'WhereRelationNegation';
|
|
1067
1083
|
value: WhereRelationExpression;
|
|
1068
1084
|
}
|
|
1069
1085
|
export declare const WhereRelationNegation = "WhereRelationNegation";
|
|
1070
1086
|
export declare function isWhereRelationNegation(item: unknown): item is WhereRelationNegation;
|
|
1087
|
+
export interface WhereRelationParticipantKind extends AstNode {
|
|
1088
|
+
readonly $container: RelationPredicateWhere | RelationPredicateWhereV2 | WhereBinaryExpression | WhereRelationNegation;
|
|
1089
|
+
readonly $type: 'WhereRelationParticipantKind';
|
|
1090
|
+
not: boolean;
|
|
1091
|
+
operator: 'is' | string;
|
|
1092
|
+
participant: Participant;
|
|
1093
|
+
value?: Reference<DeploymentNodeOrElementKind>;
|
|
1094
|
+
}
|
|
1095
|
+
export declare const WhereRelationParticipantKind = "WhereRelationParticipantKind";
|
|
1096
|
+
export declare function isWhereRelationParticipantKind(item: unknown): item is WhereRelationParticipantKind;
|
|
1097
|
+
export interface WhereRelationParticipantTag extends AstNode {
|
|
1098
|
+
readonly $container: RelationPredicateWhere | RelationPredicateWhereV2 | WhereBinaryExpression | WhereRelationNegation;
|
|
1099
|
+
readonly $type: 'WhereRelationParticipantTag';
|
|
1100
|
+
not: boolean;
|
|
1101
|
+
operator: 'is' | string;
|
|
1102
|
+
participant: Participant;
|
|
1103
|
+
value?: Reference<Tag>;
|
|
1104
|
+
}
|
|
1105
|
+
export declare const WhereRelationParticipantTag = "WhereRelationParticipantTag";
|
|
1106
|
+
export declare function isWhereRelationParticipantTag(item: unknown): item is WhereRelationParticipantTag;
|
|
1071
1107
|
export interface WhereRelationTag extends AstNode {
|
|
1072
|
-
readonly $container: RelationPredicateWhere | WhereBinaryExpression | WhereRelationNegation;
|
|
1108
|
+
readonly $container: RelationPredicateWhere | RelationPredicateWhereV2 | WhereBinaryExpression | WhereRelationNegation;
|
|
1073
1109
|
readonly $type: 'WhereRelationTag';
|
|
1074
1110
|
not: boolean;
|
|
1075
1111
|
operator: 'is' | string;
|
|
@@ -1097,6 +1133,7 @@ export type LikeC4AstType = {
|
|
|
1097
1133
|
DeploymentNode: DeploymentNode;
|
|
1098
1134
|
DeploymentNodeBody: DeploymentNodeBody;
|
|
1099
1135
|
DeploymentNodeKind: DeploymentNodeKind;
|
|
1136
|
+
DeploymentNodeOrElementKind: DeploymentNodeOrElementKind;
|
|
1100
1137
|
DeploymentRelation: DeploymentRelation;
|
|
1101
1138
|
DeploymentRelationBody: DeploymentRelationBody;
|
|
1102
1139
|
DeploymentView: DeploymentView;
|
|
@@ -1186,7 +1223,9 @@ export type LikeC4AstType = {
|
|
|
1186
1223
|
RelationNavigateToProperty: RelationNavigateToProperty;
|
|
1187
1224
|
RelationPredicate: RelationPredicate;
|
|
1188
1225
|
RelationPredicateOrWhere: RelationPredicateOrWhere;
|
|
1226
|
+
RelationPredicateOrWhereV2: RelationPredicateOrWhereV2;
|
|
1189
1227
|
RelationPredicateWhere: RelationPredicateWhere;
|
|
1228
|
+
RelationPredicateWhereV2: RelationPredicateWhereV2;
|
|
1190
1229
|
RelationPredicateWith: RelationPredicateWith;
|
|
1191
1230
|
RelationProperty: RelationProperty;
|
|
1192
1231
|
RelationStringProperty: RelationStringProperty;
|
|
@@ -1229,6 +1268,8 @@ export type LikeC4AstType = {
|
|
|
1229
1268
|
WhereRelationExpression: WhereRelationExpression;
|
|
1230
1269
|
WhereRelationKind: WhereRelationKind;
|
|
1231
1270
|
WhereRelationNegation: WhereRelationNegation;
|
|
1271
|
+
WhereRelationParticipantKind: WhereRelationParticipantKind;
|
|
1272
|
+
WhereRelationParticipantTag: WhereRelationParticipantTag;
|
|
1232
1273
|
WhereRelationTag: WhereRelationTag;
|
|
1233
1274
|
WhereTagEqual: WhereTagEqual;
|
|
1234
1275
|
WildcardExpression: WildcardExpression;
|
package/dist/generated/ast.js
CHANGED
|
@@ -36,6 +36,10 @@ export const DeploymentElement = "DeploymentElement";
|
|
|
36
36
|
export function isDeploymentElement(item) {
|
|
37
37
|
return reflection.isInstance(item, DeploymentElement);
|
|
38
38
|
}
|
|
39
|
+
export const DeploymentNodeOrElementKind = "DeploymentNodeOrElementKind";
|
|
40
|
+
export function isDeploymentNodeOrElementKind(item) {
|
|
41
|
+
return reflection.isInstance(item, DeploymentNodeOrElementKind);
|
|
42
|
+
}
|
|
39
43
|
export const DeploymentViewRule = "DeploymentViewRule";
|
|
40
44
|
export function isDeploymentViewRule(item) {
|
|
41
45
|
return reflection.isInstance(item, DeploymentViewRule);
|
|
@@ -82,7 +86,7 @@ export function isIconId(item) {
|
|
|
82
86
|
return typeof item === "string" && /(aws|azure|gcp|tech):[-\w]*/.test(item);
|
|
83
87
|
}
|
|
84
88
|
export function isId(item) {
|
|
85
|
-
return isElementShape(item) || isThemeColor(item) || isArrowType(item) || isLineOptions(item) || item === "element" || item === "model" || item === "group" || item === "node" || item === "deployment" || item === "instance" || typeof item === "string" && /[_]*[a-zA-Z][-\w]*/.test(item);
|
|
89
|
+
return isElementShape(item) || isThemeColor(item) || isArrowType(item) || isLineOptions(item) || isParticipant(item) || item === "element" || item === "model" || item === "group" || item === "node" || item === "deployment" || item === "instance" || typeof item === "string" && /[_]*[a-zA-Z][-\w]*/.test(item);
|
|
86
90
|
}
|
|
87
91
|
export const LikeC4View = "LikeC4View";
|
|
88
92
|
export function isLikeC4View(item) {
|
|
@@ -95,6 +99,9 @@ export const MetadataProperty = "MetadataProperty";
|
|
|
95
99
|
export function isMetadataProperty(item) {
|
|
96
100
|
return reflection.isInstance(item, MetadataProperty);
|
|
97
101
|
}
|
|
102
|
+
export function isParticipant(item) {
|
|
103
|
+
return item === "source" || item === "target";
|
|
104
|
+
}
|
|
98
105
|
export const Predicate = "Predicate";
|
|
99
106
|
export function isPredicate(item) {
|
|
100
107
|
return reflection.isInstance(item, Predicate);
|
|
@@ -119,6 +126,10 @@ export const RelationPredicateOrWhere = "RelationPredicateOrWhere";
|
|
|
119
126
|
export function isRelationPredicateOrWhere(item) {
|
|
120
127
|
return reflection.isInstance(item, RelationPredicateOrWhere);
|
|
121
128
|
}
|
|
129
|
+
export const RelationPredicateOrWhereV2 = "RelationPredicateOrWhereV2";
|
|
130
|
+
export function isRelationPredicateOrWhereV2(item) {
|
|
131
|
+
return reflection.isInstance(item, RelationPredicateOrWhereV2);
|
|
132
|
+
}
|
|
122
133
|
export const RelationProperty = "RelationProperty";
|
|
123
134
|
export function isRelationProperty(item) {
|
|
124
135
|
return reflection.isInstance(item, RelationProperty);
|
|
@@ -527,6 +538,10 @@ export const RelationPredicateWhere = "RelationPredicateWhere";
|
|
|
527
538
|
export function isRelationPredicateWhere(item) {
|
|
528
539
|
return reflection.isInstance(item, RelationPredicateWhere);
|
|
529
540
|
}
|
|
541
|
+
export const RelationPredicateWhereV2 = "RelationPredicateWhereV2";
|
|
542
|
+
export function isRelationPredicateWhereV2(item) {
|
|
543
|
+
return reflection.isInstance(item, RelationPredicateWhereV2);
|
|
544
|
+
}
|
|
530
545
|
export const RelationPredicateWith = "RelationPredicateWith";
|
|
531
546
|
export function isRelationPredicateWith(item) {
|
|
532
547
|
return reflection.isInstance(item, RelationPredicateWith);
|
|
@@ -639,6 +654,14 @@ export const WhereRelationNegation = "WhereRelationNegation";
|
|
|
639
654
|
export function isWhereRelationNegation(item) {
|
|
640
655
|
return reflection.isInstance(item, WhereRelationNegation);
|
|
641
656
|
}
|
|
657
|
+
export const WhereRelationParticipantKind = "WhereRelationParticipantKind";
|
|
658
|
+
export function isWhereRelationParticipantKind(item) {
|
|
659
|
+
return reflection.isInstance(item, WhereRelationParticipantKind);
|
|
660
|
+
}
|
|
661
|
+
export const WhereRelationParticipantTag = "WhereRelationParticipantTag";
|
|
662
|
+
export function isWhereRelationParticipantTag(item) {
|
|
663
|
+
return reflection.isInstance(item, WhereRelationParticipantTag);
|
|
664
|
+
}
|
|
642
665
|
export const WhereRelationTag = "WhereRelationTag";
|
|
643
666
|
export function isWhereRelationTag(item) {
|
|
644
667
|
return reflection.isInstance(item, WhereRelationTag);
|
|
@@ -649,7 +672,7 @@ export function isWildcardExpression(item) {
|
|
|
649
672
|
}
|
|
650
673
|
export class LikeC4AstReflection extends AbstractAstReflection {
|
|
651
674
|
getAllTypes() {
|
|
652
|
-
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];
|
|
675
|
+
return [ArrowProperty, BorderProperty, ColorProperty, CustomColor, CustomElementProperties, CustomRelationProperties, DeployedInstance, DeployedInstanceBody, DeploymentElement, DeploymentNode, DeploymentNodeBody, DeploymentNodeKind, DeploymentNodeOrElementKind, 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, WhereRelationParticipantKind, WhereRelationParticipantTag, WhereRelationTag, WhereTagEqual, WildcardExpression];
|
|
653
676
|
}
|
|
654
677
|
computeIsSubtype(subtype, supertype) {
|
|
655
678
|
switch (subtype) {
|
|
@@ -669,6 +692,10 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
669
692
|
case DeploymentNode: {
|
|
670
693
|
return this.isSubtype(DeploymentElement, supertype) || this.isSubtype(Referenceable, supertype);
|
|
671
694
|
}
|
|
695
|
+
case DeploymentNodeKind:
|
|
696
|
+
case ElementKind: {
|
|
697
|
+
return this.isSubtype(DeploymentNodeOrElementKind, supertype);
|
|
698
|
+
}
|
|
672
699
|
case DeploymentView:
|
|
673
700
|
case DynamicView:
|
|
674
701
|
case ElementView: {
|
|
@@ -731,7 +758,7 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
731
758
|
return this.isSubtype(FqnReferenceable, supertype);
|
|
732
759
|
}
|
|
733
760
|
case FqnExpr:
|
|
734
|
-
case
|
|
761
|
+
case RelationPredicateOrWhereV2: {
|
|
735
762
|
return this.isSubtype(ExpressionV2, supertype);
|
|
736
763
|
}
|
|
737
764
|
case FqnRefExpr: {
|
|
@@ -756,6 +783,10 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
756
783
|
case MetadataProperty: {
|
|
757
784
|
return this.isSubtype(ElementProperty, supertype) || this.isSubtype(RelationProperty, supertype);
|
|
758
785
|
}
|
|
786
|
+
case RelationExpr:
|
|
787
|
+
case RelationPredicateWhereV2: {
|
|
788
|
+
return this.isSubtype(RelationPredicateOrWhereV2, supertype);
|
|
789
|
+
}
|
|
759
790
|
case RelationExpression:
|
|
760
791
|
case RelationPredicateWhere: {
|
|
761
792
|
return this.isSubtype(RelationPredicateOrWhere, supertype);
|
|
@@ -810,9 +841,11 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
810
841
|
case WhereRelationNegation: {
|
|
811
842
|
return this.isSubtype(WhereRelationExpression, supertype);
|
|
812
843
|
}
|
|
813
|
-
case WhereRelationKind:
|
|
844
|
+
case WhereRelationKind:
|
|
845
|
+
case WhereRelationParticipantKind: {
|
|
814
846
|
return this.isSubtype(WhereKindEqual, supertype) || this.isSubtype(WhereRelation, supertype);
|
|
815
847
|
}
|
|
848
|
+
case WhereRelationParticipantTag:
|
|
816
849
|
case WhereRelationTag: {
|
|
817
850
|
return this.isSubtype(WhereRelation, supertype) || this.isSubtype(WhereTagEqual, supertype);
|
|
818
851
|
}
|
|
@@ -859,6 +892,7 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
859
892
|
case "ElementTagExpression:tag":
|
|
860
893
|
case "Tags:values":
|
|
861
894
|
case "WhereElementTag:value":
|
|
895
|
+
case "WhereRelationParticipantTag:value":
|
|
862
896
|
case "WhereRelationTag:value": {
|
|
863
897
|
return Tag;
|
|
864
898
|
}
|
|
@@ -880,6 +914,9 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
880
914
|
case "ViewRuleGlobalStyle:style": {
|
|
881
915
|
return GlobalStyleId;
|
|
882
916
|
}
|
|
917
|
+
case "WhereRelationParticipantKind:value": {
|
|
918
|
+
return DeploymentNodeOrElementKind;
|
|
919
|
+
}
|
|
883
920
|
default: {
|
|
884
921
|
throw new Error(`${referenceId} is not a valid reference id.`);
|
|
885
922
|
}
|
|
@@ -1661,6 +1698,15 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
1661
1698
|
]
|
|
1662
1699
|
};
|
|
1663
1700
|
}
|
|
1701
|
+
case RelationPredicateWhereV2: {
|
|
1702
|
+
return {
|
|
1703
|
+
name: RelationPredicateWhereV2,
|
|
1704
|
+
properties: [
|
|
1705
|
+
{ name: "subject" },
|
|
1706
|
+
{ name: "where" }
|
|
1707
|
+
]
|
|
1708
|
+
};
|
|
1709
|
+
}
|
|
1664
1710
|
case RelationPredicateWith: {
|
|
1665
1711
|
return {
|
|
1666
1712
|
name: RelationPredicateWith,
|
|
@@ -1915,6 +1961,28 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
1915
1961
|
]
|
|
1916
1962
|
};
|
|
1917
1963
|
}
|
|
1964
|
+
case WhereRelationParticipantKind: {
|
|
1965
|
+
return {
|
|
1966
|
+
name: WhereRelationParticipantKind,
|
|
1967
|
+
properties: [
|
|
1968
|
+
{ name: "not", defaultValue: false },
|
|
1969
|
+
{ name: "operator" },
|
|
1970
|
+
{ name: "participant" },
|
|
1971
|
+
{ name: "value" }
|
|
1972
|
+
]
|
|
1973
|
+
};
|
|
1974
|
+
}
|
|
1975
|
+
case WhereRelationParticipantTag: {
|
|
1976
|
+
return {
|
|
1977
|
+
name: WhereRelationParticipantTag,
|
|
1978
|
+
properties: [
|
|
1979
|
+
{ name: "not", defaultValue: false },
|
|
1980
|
+
{ name: "operator" },
|
|
1981
|
+
{ name: "participant" },
|
|
1982
|
+
{ name: "value" }
|
|
1983
|
+
]
|
|
1984
|
+
};
|
|
1985
|
+
}
|
|
1918
1986
|
case WhereRelationTag: {
|
|
1919
1987
|
return {
|
|
1920
1988
|
name: WhereRelationTag,
|