@likec4/language-server 1.4.0 → 1.6.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.
Files changed (45) hide show
  1. package/README.md +1 -1
  2. package/contrib/likec4.tmLanguage.json +1 -1
  3. package/package.json +26 -14
  4. package/src/Rpc.ts +25 -2
  5. package/src/ast.ts +19 -15
  6. package/src/generated/ast.ts +390 -203
  7. package/src/generated/grammar.ts +1 -1
  8. package/src/generated-lib/icons.ts +952 -0
  9. package/src/like-c4.langium +120 -64
  10. package/src/likec4lib.ts +7 -0
  11. package/src/lsp/DocumentSymbolProvider.ts +28 -1
  12. package/src/lsp/SemanticTokenProvider.ts +41 -22
  13. package/src/model/fqn-computation.ts +29 -7
  14. package/src/model/fqn-index.ts +18 -31
  15. package/src/model/model-builder.ts +13 -9
  16. package/src/model/model-locator.ts +7 -7
  17. package/src/model/model-parser.ts +166 -69
  18. package/src/model-change/changeElementStyle.ts +6 -6
  19. package/src/model-graph/compute-view/__test__/fixture.ts +52 -24
  20. package/src/model-graph/compute-view/compute.ts +51 -20
  21. package/src/model-graph/compute-view/predicates.ts +6 -1
  22. package/src/model-graph/dynamic-view/__test__/fixture.ts +2 -2
  23. package/src/model-graph/dynamic-view/compute.ts +2 -2
  24. package/src/model-graph/utils/{applyElementCustomProperties.ts → applyCustomElementProperties.ts} +5 -3
  25. package/src/model-graph/utils/applyCustomRelationProperties.ts +50 -0
  26. package/src/model-graph/utils/applyViewRuleStyles.ts +11 -34
  27. package/src/model-graph/utils/elementExpressionToPredicate.ts +32 -0
  28. package/src/references/scope-computation.ts +113 -60
  29. package/src/references/scope-provider.ts +3 -23
  30. package/src/shared/NodeKindProvider.ts +1 -0
  31. package/src/shared/WorkspaceManager.ts +15 -6
  32. package/src/validation/dynamic-view-rule.ts +19 -26
  33. package/src/validation/element.ts +8 -4
  34. package/src/validation/index.ts +9 -6
  35. package/src/validation/property-checks.ts +23 -1
  36. package/src/validation/view-predicates/custom-element-expr.ts +21 -8
  37. package/src/validation/view-predicates/custom-relation-expr.ts +16 -0
  38. package/src/validation/view-predicates/expanded-element.ts +13 -24
  39. package/src/validation/view-predicates/incoming.ts +5 -5
  40. package/src/validation/view-predicates/index.ts +1 -0
  41. package/src/validation/view-predicates/outgoing.ts +5 -5
  42. package/src/view-utils/assignNavigateTo.ts +2 -2
  43. package/src/view-utils/manual-layout.ts +4 -2
  44. package/src/view-utils/resolve-extended-views.ts +2 -2
  45. package/src/view-utils/resolve-relative-paths.ts +3 -3
@@ -11,6 +11,7 @@ export const LikeC4Terminals = {
11
11
  BLOCK_COMMENT: /\/\*[\s\S]*?\*\//,
12
12
  LINE_COMMENT: /\/\/[^\n\r]*/,
13
13
  WS: /\s+/,
14
+ LIB_ICON: /\b(aws|gcp|tech):[-\w]*/,
14
15
  URI_WITH_SCHEMA: /\w+:\/\/\S+/,
15
16
  URI_RELATIVE: /\.{0,2}\/[^\/]\S+/,
16
17
  DotUnderscore: /\b\._/,
@@ -20,18 +21,15 @@ export const LikeC4Terminals = {
20
21
  Dot: /\./,
21
22
  NotEqual: /\!\={1,2}/,
22
23
  Eq: /\={1,2}/,
23
- Colon: /:/,
24
- SemiColon: /;/,
25
- Comma: /,/,
26
24
  Percent: /\b\d+%/,
27
25
  String: /"[^"]*"|'[^']*'/,
28
- IdTerminal: /\b[_]*[a-zA-Z][_-\w]*/,
26
+ IdTerminal: /[_]*[a-zA-Z][-\w]*/,
29
27
  };
30
28
 
31
- export type ArrowType = 'crow' | 'diamond' | 'none' | 'normal' | 'odiamond' | 'onormal' | 'open' | 'vee';
29
+ export type ArrowType = 'crow' | 'diamond' | 'dot' | 'none' | 'normal' | 'odiamond' | 'odot' | 'onormal' | 'open' | 'vee';
32
30
 
33
31
  export function isArrowType(item: unknown): item is ArrowType {
34
- return item === 'none' || item === 'normal' || item === 'onormal' || item === 'diamond' || item === 'odiamond' || item === 'crow' || item === 'open' || item === 'vee';
32
+ return item === 'none' || item === 'normal' || item === 'onormal' || item === 'dot' || item === 'odot' || item === 'diamond' || item === 'odiamond' || item === 'crow' || item === 'open' || item === 'vee';
35
33
  }
36
34
 
37
35
  export type BorderStyleValue = 'none' | LineOptions;
@@ -46,6 +44,14 @@ export function isDotId(item: unknown): item is DotId {
46
44
  return typeof item === 'string';
47
45
  }
48
46
 
47
+ export type DynamicViewElementExpression = CustomElementExpression | ElementExpression;
48
+
49
+ export const DynamicViewElementExpression = 'DynamicViewElementExpression';
50
+
51
+ export function isDynamicViewElementExpression(item: unknown): item is DynamicViewElementExpression {
52
+ return reflection.isInstance(item, DynamicViewElementExpression);
53
+ }
54
+
49
55
  export type DynamicViewRule = DynamicViewRulePredicate | ViewRuleAutoLayout | ViewRuleStyle;
50
56
 
51
57
  export const DynamicViewRule = 'DynamicViewRule';
@@ -54,15 +60,15 @@ export function isDynamicViewRule(item: unknown): item is DynamicViewRule {
54
60
  return reflection.isInstance(item, DynamicViewRule);
55
61
  }
56
62
 
57
- export type ElementExpr = DescedantsExpr | ElementKindExpr | ElementRef | ElementTagExpr | ExpandElementExpr | WildcardExpr;
63
+ export type ElementExpression = ElementDescedantsExpression | ElementKindExpression | ElementRef | ElementTagExpression | ExpandElementExpression | WildcardExpression;
58
64
 
59
- export const ElementExpr = 'ElementExpr';
65
+ export const ElementExpression = 'ElementExpression';
60
66
 
61
- export function isElementExpr(item: unknown): item is ElementExpr {
62
- return reflection.isInstance(item, ElementExpr);
67
+ export function isElementExpression(item: unknown): item is ElementExpression {
68
+ return reflection.isInstance(item, ElementExpression);
63
69
  }
64
70
 
65
- export type ElementProperty = ElementStringProperty | LinkProperty | StyleProperties;
71
+ export type ElementProperty = ElementStringProperty | IconProperty | LinkProperty | StyleProperties;
66
72
 
67
73
  export const ElementProperty = 'ElementProperty';
68
74
 
@@ -76,10 +82,24 @@ export function isElementShape(item: unknown): item is ElementShape {
76
82
  return item === 'rectangle' || item === 'person' || item === 'browser' || item === 'mobile' || item === 'cylinder' || item === 'storage' || item === 'queue';
77
83
  }
78
84
 
85
+ export type Expression = CustomElementExpression | CustomRelationExpression | ElementExpression | RelationExpression;
86
+
87
+ export const Expression = 'Expression';
88
+
89
+ export function isExpression(item: unknown): item is Expression {
90
+ return reflection.isInstance(item, Expression);
91
+ }
92
+
93
+ export type IconId = string;
94
+
95
+ export function isIconId(item: unknown): item is IconId {
96
+ return (typeof item === 'string' && (/\b(aws|gcp|tech):[-\w]*/.test(item)));
97
+ }
98
+
79
99
  export type Id = 'element' | 'model' | ArrowType | ElementShape | LineOptions | ThemeColor | string;
80
100
 
81
101
  export function isId(item: unknown): item is Id {
82
- return isElementShape(item) || isThemeColor(item) || isArrowType(item) || isLineOptions(item) || item === 'element' || item === 'model' || (typeof item === 'string' && (/\b[_]*[a-zA-Z][_-\w]*/.test(item)));
102
+ return isElementShape(item) || isThemeColor(item) || isArrowType(item) || isLineOptions(item) || item === 'element' || item === 'model' || (typeof item === 'string' && (/[_]*[a-zA-Z][-\w]*/.test(item)));
83
103
  }
84
104
 
85
105
  export type LikeC4View = DynamicView | ElementView;
@@ -104,6 +124,14 @@ export function isRelation(item: unknown): item is Relation {
104
124
  return reflection.isInstance(item, Relation);
105
125
  }
106
126
 
127
+ export type RelationExpression = DirectedRelationExpression | InOutRelationExpression | IncomingRelationExpression | OutgoingRelationExpression;
128
+
129
+ export const RelationExpression = 'RelationExpression';
130
+
131
+ export function isRelationExpression(item: unknown): item is RelationExpression {
132
+ return reflection.isInstance(item, RelationExpression);
133
+ }
134
+
107
135
  export type RelationProperty = LinkProperty | RelationStringProperty | RelationStyleProperty;
108
136
 
109
137
  export const RelationProperty = 'RelationProperty';
@@ -120,7 +148,7 @@ export function isRelationshipStyleProperty(item: unknown): item is Relationship
120
148
  return reflection.isInstance(item, RelationshipStyleProperty);
121
149
  }
122
150
 
123
- export type StringProperty = ElementStringProperty | ViewStringProperty;
151
+ export type StringProperty = ElementStringProperty | RelationStringProperty | ViewStringProperty;
124
152
 
125
153
  export const StringProperty = 'StringProperty';
126
154
 
@@ -184,16 +212,8 @@ export function isViewRulePredicate(item: unknown): item is ViewRulePredicate {
184
212
  return reflection.isInstance(item, ViewRulePredicate);
185
213
  }
186
214
 
187
- export type ViewRulePredicateExpr = CustomElementExpr | ElementExpr | InOutExpr | IncomingExpr | OutgoingExpr | RelationExpr;
188
-
189
- export const ViewRulePredicateExpr = 'ViewRulePredicateExpr';
190
-
191
- export function isViewRulePredicateExpr(item: unknown): item is ViewRulePredicateExpr {
192
- return reflection.isInstance(item, ViewRulePredicateExpr);
193
- }
194
-
195
215
  export interface ArrowProperty extends AstNode {
196
- readonly $container: RelationStyleProperty | SpecificationRelationshipKind;
216
+ readonly $container: CustomRelationProperties | RelationStyleProperty | SpecificationRelationshipKind;
197
217
  readonly $type: 'ArrowProperty';
198
218
  key: 'head' | 'tail';
199
219
  value: ArrowType;
@@ -206,7 +226,7 @@ export function isArrowProperty(item: unknown): item is ArrowProperty {
206
226
  }
207
227
 
208
228
  export interface BorderProperty extends AstNode {
209
- readonly $container: CustomElementExprBody | StyleProperties | ViewRuleStyle;
229
+ readonly $container: CustomElementProperties | StyleProperties | ViewRuleStyle;
210
230
  readonly $type: 'BorderProperty';
211
231
  key: 'border';
212
232
  value: BorderStyleValue;
@@ -219,7 +239,7 @@ export function isBorderProperty(item: unknown): item is BorderProperty {
219
239
  }
220
240
 
221
241
  export interface ColorProperty extends AstNode {
222
- readonly $container: CustomElementExprBody | RelationStyleProperty | SpecificationRelationshipKind | StyleProperties | ViewRuleStyle;
242
+ readonly $container: CustomElementProperties | CustomRelationProperties | RelationStyleProperty | SpecificationRelationshipKind | StyleProperties | ViewRuleStyle;
223
243
  readonly $type: 'ColorProperty';
224
244
  key: 'color';
225
245
  value: ThemeColor;
@@ -231,41 +251,67 @@ export function isColorProperty(item: unknown): item is ColorProperty {
231
251
  return reflection.isInstance(item, ColorProperty);
232
252
  }
233
253
 
234
- export interface CustomElementExpr extends AstNode {
235
- readonly $container: DynamicViewRulePredicate | ExcludePredicate | IncludePredicate;
236
- readonly $type: 'CustomElementExpr';
237
- body: CustomElementExprBody;
238
- target: ElementExpr;
254
+ export interface CustomElementExpression extends AstNode {
255
+ readonly $container: DynamicViewRulePredicateIterator | Expressions;
256
+ readonly $type: 'CustomElementExpression';
257
+ custom: CustomElementProperties;
258
+ target: ElementExpression;
239
259
  }
240
260
 
241
- export const CustomElementExpr = 'CustomElementExpr';
261
+ export const CustomElementExpression = 'CustomElementExpression';
242
262
 
243
- export function isCustomElementExpr(item: unknown): item is CustomElementExpr {
244
- return reflection.isInstance(item, CustomElementExpr);
263
+ export function isCustomElementExpression(item: unknown): item is CustomElementExpression {
264
+ return reflection.isInstance(item, CustomElementExpression);
245
265
  }
246
266
 
247
- export interface CustomElementExprBody extends AstNode {
248
- readonly $container: CustomElementExpr;
249
- readonly $type: 'CustomElementExprBody';
267
+ export interface CustomElementProperties extends AstNode {
268
+ readonly $container: CustomElementExpression;
269
+ readonly $type: 'CustomElementProperties';
250
270
  props: Array<ElementStringProperty | NavigateToProperty | StyleProperty>;
251
271
  }
252
272
 
253
- export const CustomElementExprBody = 'CustomElementExprBody';
273
+ export const CustomElementProperties = 'CustomElementProperties';
254
274
 
255
- export function isCustomElementExprBody(item: unknown): item is CustomElementExprBody {
256
- return reflection.isInstance(item, CustomElementExprBody);
275
+ export function isCustomElementProperties(item: unknown): item is CustomElementProperties {
276
+ return reflection.isInstance(item, CustomElementProperties);
257
277
  }
258
278
 
259
- export interface DescedantsExpr extends AstNode {
260
- readonly $container: CustomElementExpr | DynamicViewRulePredicate | ExcludePredicate | IncludePredicate | IncomingExpr | OutgoingExpr | RelationExpr | ViewRuleStyle;
261
- readonly $type: 'DescedantsExpr';
262
- parent: ElementRef;
279
+ export interface CustomRelationExpression extends AstNode {
280
+ readonly $container: Expressions;
281
+ readonly $type: 'CustomRelationExpression';
282
+ custom: CustomRelationProperties;
283
+ relation: RelationExpression;
284
+ }
285
+
286
+ export const CustomRelationExpression = 'CustomRelationExpression';
287
+
288
+ export function isCustomRelationExpression(item: unknown): item is CustomRelationExpression {
289
+ return reflection.isInstance(item, CustomRelationExpression);
290
+ }
291
+
292
+ export interface CustomRelationProperties extends AstNode {
293
+ readonly $container: CustomRelationExpression;
294
+ readonly $type: 'CustomRelationProperties';
295
+ props: Array<RelationStringProperty | RelationshipStyleProperty>;
296
+ }
297
+
298
+ export const CustomRelationProperties = 'CustomRelationProperties';
299
+
300
+ export function isCustomRelationProperties(item: unknown): item is CustomRelationProperties {
301
+ return reflection.isInstance(item, CustomRelationProperties);
263
302
  }
264
303
 
265
- export const DescedantsExpr = 'DescedantsExpr';
304
+ export interface DirectedRelationExpression extends AstNode {
305
+ readonly $container: CustomRelationExpression | Expressions;
306
+ readonly $type: 'DirectedRelationExpression';
307
+ source: OutgoingRelationExpression;
308
+ target: ElementExpression;
309
+ }
310
+
311
+ export const DirectedRelationExpression = 'DirectedRelationExpression';
266
312
 
267
- export function isDescedantsExpr(item: unknown): item is DescedantsExpr {
268
- return reflection.isInstance(item, DescedantsExpr);
313
+ export function isDirectedRelationExpression(item: unknown): item is DirectedRelationExpression {
314
+ return reflection.isInstance(item, DirectedRelationExpression);
269
315
  }
270
316
 
271
317
  export interface DynamicView extends AstNode {
@@ -299,8 +345,7 @@ export function isDynamicViewBody(item: unknown): item is DynamicViewBody {
299
345
  export interface DynamicViewRulePredicate extends AstNode {
300
346
  readonly $container: DynamicViewBody;
301
347
  readonly $type: 'DynamicViewRulePredicate';
302
- commas: Array<string>;
303
- expressions: Array<ViewRulePredicateExpr>;
348
+ exprs: DynamicViewRulePredicateIterator;
304
349
  }
305
350
 
306
351
  export const DynamicViewRulePredicate = 'DynamicViewRulePredicate';
@@ -309,6 +354,19 @@ export function isDynamicViewRulePredicate(item: unknown): item is DynamicViewRu
309
354
  return reflection.isInstance(item, DynamicViewRulePredicate);
310
355
  }
311
356
 
357
+ export interface DynamicViewRulePredicateIterator extends AstNode {
358
+ readonly $container: DynamicViewRulePredicate | DynamicViewRulePredicateIterator;
359
+ readonly $type: 'DynamicViewRulePredicateIterator';
360
+ prev?: DynamicViewRulePredicateIterator;
361
+ value: DynamicViewElementExpression;
362
+ }
363
+
364
+ export const DynamicViewRulePredicateIterator = 'DynamicViewRulePredicateIterator';
365
+
366
+ export function isDynamicViewRulePredicateIterator(item: unknown): item is DynamicViewRulePredicateIterator {
367
+ return reflection.isInstance(item, DynamicViewRulePredicateIterator);
368
+ }
369
+
312
370
  export interface DynamicViewStep extends AstNode {
313
371
  readonly $container: DynamicViewBody;
314
372
  readonly $type: 'DynamicViewStep';
@@ -354,6 +412,31 @@ export function isElementBody(item: unknown): item is ElementBody {
354
412
  return reflection.isInstance(item, ElementBody);
355
413
  }
356
414
 
415
+ export interface ElementDescedantsExpression extends AstNode {
416
+ readonly $container: CustomElementExpression | DirectedRelationExpression | DynamicViewRulePredicateIterator | ElementExpressionsIterator | Expressions | IncomingRelationExpression | OutgoingRelationExpression;
417
+ readonly $type: 'ElementDescedantsExpression';
418
+ parent: ElementRef;
419
+ }
420
+
421
+ export const ElementDescedantsExpression = 'ElementDescedantsExpression';
422
+
423
+ export function isElementDescedantsExpression(item: unknown): item is ElementDescedantsExpression {
424
+ return reflection.isInstance(item, ElementDescedantsExpression);
425
+ }
426
+
427
+ export interface ElementExpressionsIterator extends AstNode {
428
+ readonly $container: ElementExpressionsIterator | ViewRuleStyle;
429
+ readonly $type: 'ElementExpressionsIterator';
430
+ prev?: ElementExpressionsIterator;
431
+ value: ElementExpression;
432
+ }
433
+
434
+ export const ElementExpressionsIterator = 'ElementExpressionsIterator';
435
+
436
+ export function isElementExpressionsIterator(item: unknown): item is ElementExpressionsIterator {
437
+ return reflection.isInstance(item, ElementExpressionsIterator);
438
+ }
439
+
357
440
  export interface ElementKind extends AstNode {
358
441
  readonly $container: SpecificationElementKind;
359
442
  readonly $type: 'ElementKind';
@@ -366,21 +449,21 @@ export function isElementKind(item: unknown): item is ElementKind {
366
449
  return reflection.isInstance(item, ElementKind);
367
450
  }
368
451
 
369
- export interface ElementKindExpr extends AstNode {
370
- readonly $container: CustomElementExpr | DynamicViewRulePredicate | ExcludePredicate | IncludePredicate | IncomingExpr | OutgoingExpr | RelationExpr | ViewRuleStyle;
371
- readonly $type: 'ElementKindExpr';
452
+ export interface ElementKindExpression extends AstNode {
453
+ readonly $container: CustomElementExpression | DirectedRelationExpression | DynamicViewRulePredicateIterator | ElementExpressionsIterator | Expressions | IncomingRelationExpression | OutgoingRelationExpression;
454
+ readonly $type: 'ElementKindExpression';
372
455
  isEqual: boolean;
373
- kind: Reference<ElementKind>;
456
+ kind?: Reference<ElementKind>;
374
457
  }
375
458
 
376
- export const ElementKindExpr = 'ElementKindExpr';
459
+ export const ElementKindExpression = 'ElementKindExpression';
377
460
 
378
- export function isElementKindExpr(item: unknown): item is ElementKindExpr {
379
- return reflection.isInstance(item, ElementKindExpr);
461
+ export function isElementKindExpression(item: unknown): item is ElementKindExpression {
462
+ return reflection.isInstance(item, ElementKindExpression);
380
463
  }
381
464
 
382
465
  export interface ElementRef extends AstNode {
383
- readonly $container: CustomElementExpr | DescedantsExpr | DynamicViewRulePredicate | DynamicViewStep | ElementRef | ElementView | ExcludePredicate | ExpandElementExpr | ExplicitRelation | ImplicitRelation | IncludePredicate | IncomingExpr | OutgoingExpr | RelationExpr | ViewRuleStyle;
466
+ readonly $container: CustomElementExpression | DirectedRelationExpression | DynamicViewRulePredicateIterator | DynamicViewStep | ElementDescedantsExpression | ElementExpressionsIterator | ElementRef | ElementView | ExpandElementExpression | ExplicitRelation | Expressions | ImplicitRelation | IncomingRelationExpression | OutgoingRelationExpression;
384
467
  readonly $type: 'ElementRef';
385
468
  dot?: string;
386
469
  el: Reference<Element>;
@@ -394,7 +477,7 @@ export function isElementRef(item: unknown): item is ElementRef {
394
477
  }
395
478
 
396
479
  export interface ElementStringProperty extends AstNode {
397
- readonly $container: CustomElementExprBody | ElementBody;
480
+ readonly $container: CustomElementProperties | ElementBody;
398
481
  readonly $type: 'ElementStringProperty';
399
482
  key: 'description' | 'technology' | 'title';
400
483
  value: string;
@@ -406,17 +489,17 @@ export function isElementStringProperty(item: unknown): item is ElementStringPro
406
489
  return reflection.isInstance(item, ElementStringProperty);
407
490
  }
408
491
 
409
- export interface ElementTagExpr extends AstNode {
410
- readonly $container: CustomElementExpr | DynamicViewRulePredicate | ExcludePredicate | IncludePredicate | IncomingExpr | OutgoingExpr | RelationExpr | ViewRuleStyle;
411
- readonly $type: 'ElementTagExpr';
492
+ export interface ElementTagExpression extends AstNode {
493
+ readonly $container: CustomElementExpression | DirectedRelationExpression | DynamicViewRulePredicateIterator | ElementExpressionsIterator | Expressions | IncomingRelationExpression | OutgoingRelationExpression;
494
+ readonly $type: 'ElementTagExpression';
412
495
  isEqual: boolean;
413
- tag: Reference<Tag>;
496
+ tag?: Reference<Tag>;
414
497
  }
415
498
 
416
- export const ElementTagExpr = 'ElementTagExpr';
499
+ export const ElementTagExpression = 'ElementTagExpression';
417
500
 
418
- export function isElementTagExpr(item: unknown): item is ElementTagExpr {
419
- return reflection.isInstance(item, ElementTagExpr);
501
+ export function isElementTagExpression(item: unknown): item is ElementTagExpression {
502
+ return reflection.isInstance(item, ElementTagExpression);
420
503
  }
421
504
 
422
505
  export interface ElementView extends AstNode {
@@ -463,8 +546,7 @@ export function isElementViewRef(item: unknown): item is ElementViewRef {
463
546
  export interface ExcludePredicate extends AstNode {
464
547
  readonly $container: ElementViewBody;
465
548
  readonly $type: 'ExcludePredicate';
466
- commas: Array<string>;
467
- expressions: Array<ViewRulePredicateExpr>;
549
+ exprs: Expressions;
468
550
  }
469
551
 
470
552
  export const ExcludePredicate = 'ExcludePredicate';
@@ -473,16 +555,16 @@ export function isExcludePredicate(item: unknown): item is ExcludePredicate {
473
555
  return reflection.isInstance(item, ExcludePredicate);
474
556
  }
475
557
 
476
- export interface ExpandElementExpr extends AstNode {
477
- readonly $container: CustomElementExpr | DynamicViewRulePredicate | ExcludePredicate | IncludePredicate | IncomingExpr | OutgoingExpr | RelationExpr | ViewRuleStyle;
478
- readonly $type: 'ExpandElementExpr';
479
- parent: ElementRef;
558
+ export interface ExpandElementExpression extends AstNode {
559
+ readonly $container: CustomElementExpression | DirectedRelationExpression | DynamicViewRulePredicateIterator | ElementExpressionsIterator | Expressions | IncomingRelationExpression | OutgoingRelationExpression;
560
+ readonly $type: 'ExpandElementExpression';
561
+ expand: ElementRef;
480
562
  }
481
563
 
482
- export const ExpandElementExpr = 'ExpandElementExpr';
564
+ export const ExpandElementExpression = 'ExpandElementExpression';
483
565
 
484
- export function isExpandElementExpr(item: unknown): item is ExpandElementExpr {
485
- return reflection.isInstance(item, ExpandElementExpr);
566
+ export function isExpandElementExpression(item: unknown): item is ExpandElementExpression {
567
+ return reflection.isInstance(item, ExpandElementExpression);
486
568
  }
487
569
 
488
570
  export interface ExplicitRelation extends AstNode {
@@ -502,6 +584,19 @@ export function isExplicitRelation(item: unknown): item is ExplicitRelation {
502
584
  return reflection.isInstance(item, ExplicitRelation);
503
585
  }
504
586
 
587
+ export interface Expressions extends AstNode {
588
+ readonly $container: ExcludePredicate | Expressions | IncludePredicate;
589
+ readonly $type: 'Expressions';
590
+ prev?: Expressions;
591
+ value: Expression;
592
+ }
593
+
594
+ export const Expressions = 'Expressions';
595
+
596
+ export function isExpressions(item: unknown): item is Expressions {
597
+ return reflection.isInstance(item, Expressions);
598
+ }
599
+
505
600
  export interface ExtendElement extends AstNode {
506
601
  readonly $container: Model;
507
602
  readonly $type: 'ExtendElement';
@@ -542,10 +637,11 @@ export function isFqnElementRef(item: unknown): item is FqnElementRef {
542
637
  }
543
638
 
544
639
  export interface IconProperty extends AstNode {
545
- readonly $container: CustomElementExprBody | StyleProperties | ViewRuleStyle;
640
+ readonly $container: CustomElementProperties | ElementBody | StyleProperties | ViewRuleStyle;
546
641
  readonly $type: 'IconProperty';
547
642
  key: 'icon';
548
- value: Uri;
643
+ libicon?: Reference<LibIcon>;
644
+ value?: Uri;
549
645
  }
550
646
 
551
647
  export const IconProperty = 'IconProperty';
@@ -573,8 +669,7 @@ export function isImplicitRelation(item: unknown): item is ImplicitRelation {
573
669
  export interface IncludePredicate extends AstNode {
574
670
  readonly $container: ElementViewBody;
575
671
  readonly $type: 'IncludePredicate';
576
- commas: Array<string>;
577
- expressions: Array<ViewRulePredicateExpr>;
672
+ exprs: Expressions;
578
673
  }
579
674
 
580
675
  export const IncludePredicate = 'IncludePredicate';
@@ -583,32 +678,45 @@ export function isIncludePredicate(item: unknown): item is IncludePredicate {
583
678
  return reflection.isInstance(item, IncludePredicate);
584
679
  }
585
680
 
586
- export interface IncomingExpr extends AstNode {
587
- readonly $container: DynamicViewRulePredicate | ExcludePredicate | InOutExpr | IncludePredicate;
588
- readonly $type: 'IncomingExpr';
589
- to: ElementExpr;
681
+ export interface IncomingRelationExpression extends AstNode {
682
+ readonly $container: CustomRelationExpression | Expressions | InOutRelationExpression;
683
+ readonly $type: 'IncomingRelationExpression';
684
+ to: ElementExpression;
590
685
  }
591
686
 
592
- export const IncomingExpr = 'IncomingExpr';
687
+ export const IncomingRelationExpression = 'IncomingRelationExpression';
593
688
 
594
- export function isIncomingExpr(item: unknown): item is IncomingExpr {
595
- return reflection.isInstance(item, IncomingExpr);
689
+ export function isIncomingRelationExpression(item: unknown): item is IncomingRelationExpression {
690
+ return reflection.isInstance(item, IncomingRelationExpression);
596
691
  }
597
692
 
598
- export interface InOutExpr extends AstNode {
599
- readonly $container: DynamicViewRulePredicate | ExcludePredicate | IncludePredicate;
600
- readonly $type: 'InOutExpr';
601
- inout: IncomingExpr;
693
+ export interface InOutRelationExpression extends AstNode {
694
+ readonly $container: CustomRelationExpression | Expressions;
695
+ readonly $type: 'InOutRelationExpression';
696
+ inout: IncomingRelationExpression;
602
697
  }
603
698
 
604
- export const InOutExpr = 'InOutExpr';
699
+ export const InOutRelationExpression = 'InOutRelationExpression';
700
+
701
+ export function isInOutRelationExpression(item: unknown): item is InOutRelationExpression {
702
+ return reflection.isInstance(item, InOutRelationExpression);
703
+ }
605
704
 
606
- export function isInOutExpr(item: unknown): item is InOutExpr {
607
- return reflection.isInstance(item, InOutExpr);
705
+ export interface LibIcon extends AstNode {
706
+ readonly $container: LikeC4Lib;
707
+ readonly $type: 'LibIcon';
708
+ name: IconId;
709
+ }
710
+
711
+ export const LibIcon = 'LibIcon';
712
+
713
+ export function isLibIcon(item: unknown): item is LibIcon {
714
+ return reflection.isInstance(item, LibIcon);
608
715
  }
609
716
 
610
717
  export interface LikeC4Grammar extends AstNode {
611
718
  readonly $type: 'LikeC4Grammar';
719
+ likec4lib: Array<LikeC4Lib>;
612
720
  models: Array<Model>;
613
721
  specifications: Array<SpecificationRule>;
614
722
  views: Array<ModelViews>;
@@ -620,8 +728,20 @@ export function isLikeC4Grammar(item: unknown): item is LikeC4Grammar {
620
728
  return reflection.isInstance(item, LikeC4Grammar);
621
729
  }
622
730
 
731
+ export interface LikeC4Lib extends AstNode {
732
+ readonly $container: LikeC4Grammar;
733
+ readonly $type: 'LikeC4Lib';
734
+ icons: Array<LibIcon>;
735
+ }
736
+
737
+ export const LikeC4Lib = 'LikeC4Lib';
738
+
739
+ export function isLikeC4Lib(item: unknown): item is LikeC4Lib {
740
+ return reflection.isInstance(item, LikeC4Lib);
741
+ }
742
+
623
743
  export interface LineProperty extends AstNode {
624
- readonly $container: RelationStyleProperty | SpecificationRelationshipKind;
744
+ readonly $container: CustomRelationProperties | RelationStyleProperty | SpecificationRelationshipKind;
625
745
  readonly $type: 'LineProperty';
626
746
  key: 'line';
627
747
  value: LineOptions;
@@ -673,7 +793,7 @@ export function isModelViews(item: unknown): item is ModelViews {
673
793
  }
674
794
 
675
795
  export interface NavigateToProperty extends AstNode {
676
- readonly $container: CustomElementExprBody;
796
+ readonly $container: CustomElementProperties;
677
797
  readonly $type: 'NavigateToProperty';
678
798
  key: 'navigateTo';
679
799
  value: ViewRef;
@@ -686,7 +806,7 @@ export function isNavigateToProperty(item: unknown): item is NavigateToProperty
686
806
  }
687
807
 
688
808
  export interface OpacityProperty extends AstNode {
689
- readonly $container: CustomElementExprBody | StyleProperties | ViewRuleStyle;
809
+ readonly $container: CustomElementProperties | StyleProperties | ViewRuleStyle;
690
810
  readonly $type: 'OpacityProperty';
691
811
  key: 'opacity';
692
812
  value: string;
@@ -698,16 +818,18 @@ export function isOpacityProperty(item: unknown): item is OpacityProperty {
698
818
  return reflection.isInstance(item, OpacityProperty);
699
819
  }
700
820
 
701
- export interface OutgoingExpr extends AstNode {
702
- readonly $container: DynamicViewRulePredicate | ExcludePredicate | IncludePredicate;
703
- readonly $type: 'OutgoingExpr';
704
- from: ElementExpr;
821
+ export interface OutgoingRelationExpression extends AstNode {
822
+ readonly $container: CustomRelationExpression | DirectedRelationExpression | Expressions;
823
+ readonly $type: 'OutgoingRelationExpression';
824
+ from: ElementExpression;
825
+ isBidirectional: boolean;
826
+ kind?: Reference<RelationshipKind>;
705
827
  }
706
828
 
707
- export const OutgoingExpr = 'OutgoingExpr';
829
+ export const OutgoingRelationExpression = 'OutgoingRelationExpression';
708
830
 
709
- export function isOutgoingExpr(item: unknown): item is OutgoingExpr {
710
- return reflection.isInstance(item, OutgoingExpr);
831
+ export function isOutgoingRelationExpression(item: unknown): item is OutgoingRelationExpression {
832
+ return reflection.isInstance(item, OutgoingRelationExpression);
711
833
  }
712
834
 
713
835
  export interface RelationBody extends AstNode {
@@ -723,20 +845,6 @@ export function isRelationBody(item: unknown): item is RelationBody {
723
845
  return reflection.isInstance(item, RelationBody);
724
846
  }
725
847
 
726
- export interface RelationExpr extends AstNode {
727
- readonly $container: DynamicViewRulePredicate | ExcludePredicate | IncludePredicate;
728
- readonly $type: 'RelationExpr';
729
- isBidirectional: boolean;
730
- source: ElementExpr;
731
- target: ElementExpr;
732
- }
733
-
734
- export const RelationExpr = 'RelationExpr';
735
-
736
- export function isRelationExpr(item: unknown): item is RelationExpr {
737
- return reflection.isInstance(item, RelationExpr);
738
- }
739
-
740
848
  export interface RelationshipKind extends AstNode {
741
849
  readonly $container: SpecificationRelationshipKind;
742
850
  readonly $type: 'RelationshipKind';
@@ -750,7 +858,7 @@ export function isRelationshipKind(item: unknown): item is RelationshipKind {
750
858
  }
751
859
 
752
860
  export interface RelationStringProperty extends AstNode {
753
- readonly $container: RelationBody;
861
+ readonly $container: CustomRelationProperties | RelationBody;
754
862
  readonly $type: 'RelationStringProperty';
755
863
  key: 'title';
756
864
  value: string;
@@ -776,7 +884,7 @@ export function isRelationStyleProperty(item: unknown): item is RelationStylePro
776
884
  }
777
885
 
778
886
  export interface ShapeProperty extends AstNode {
779
- readonly $container: CustomElementExprBody | StyleProperties | ViewRuleStyle;
887
+ readonly $container: CustomElementProperties | StyleProperties | ViewRuleStyle;
780
888
  readonly $type: 'ShapeProperty';
781
889
  key: 'shape';
782
890
  value: ElementShape;
@@ -869,7 +977,6 @@ export function isTag(item: unknown): item is Tag {
869
977
  export interface Tags extends AstNode {
870
978
  readonly $container: DynamicViewBody | ElementBody | ElementViewBody | ExplicitRelation | ImplicitRelation | RelationBody;
871
979
  readonly $type: 'Tags';
872
- comma: Array<string>;
873
980
  value: Array<Reference<Tag>>;
874
981
  }
875
982
 
@@ -906,9 +1013,8 @@ export function isViewRuleAutoLayout(item: unknown): item is ViewRuleAutoLayout
906
1013
  export interface ViewRuleStyle extends AstNode {
907
1014
  readonly $container: DynamicViewBody | ElementViewBody;
908
1015
  readonly $type: 'ViewRuleStyle';
909
- commas: Array<string>;
910
- styleprops: Array<StyleProperty>;
911
- targets: Array<ElementExpr>;
1016
+ props: Array<StyleProperty>;
1017
+ target: ElementExpressionsIterator;
912
1018
  }
913
1019
 
914
1020
  export const ViewRuleStyle = 'ViewRuleStyle';
@@ -930,54 +1036,64 @@ export function isViewStringProperty(item: unknown): item is ViewStringProperty
930
1036
  return reflection.isInstance(item, ViewStringProperty);
931
1037
  }
932
1038
 
933
- export interface WildcardExpr extends AstNode {
934
- readonly $container: CustomElementExpr | DynamicViewRulePredicate | ExcludePredicate | IncludePredicate | IncomingExpr | OutgoingExpr | RelationExpr | ViewRuleStyle;
935
- readonly $type: 'WildcardExpr';
1039
+ export interface WildcardExpression extends AstNode {
1040
+ readonly $container: CustomElementExpression | DirectedRelationExpression | DynamicViewRulePredicateIterator | ElementExpressionsIterator | Expressions | IncomingRelationExpression | OutgoingRelationExpression;
1041
+ readonly $type: 'WildcardExpression';
936
1042
  isWildcard: boolean;
937
1043
  }
938
1044
 
939
- export const WildcardExpr = 'WildcardExpr';
1045
+ export const WildcardExpression = 'WildcardExpression';
940
1046
 
941
- export function isWildcardExpr(item: unknown): item is WildcardExpr {
942
- return reflection.isInstance(item, WildcardExpr);
1047
+ export function isWildcardExpression(item: unknown): item is WildcardExpression {
1048
+ return reflection.isInstance(item, WildcardExpression);
943
1049
  }
944
1050
 
945
1051
  export type LikeC4AstType = {
946
1052
  ArrowProperty: ArrowProperty
947
1053
  BorderProperty: BorderProperty
948
1054
  ColorProperty: ColorProperty
949
- CustomElementExpr: CustomElementExpr
950
- CustomElementExprBody: CustomElementExprBody
951
- DescedantsExpr: DescedantsExpr
1055
+ CustomElementExpression: CustomElementExpression
1056
+ CustomElementProperties: CustomElementProperties
1057
+ CustomRelationExpression: CustomRelationExpression
1058
+ CustomRelationProperties: CustomRelationProperties
1059
+ DirectedRelationExpression: DirectedRelationExpression
952
1060
  DynamicView: DynamicView
953
1061
  DynamicViewBody: DynamicViewBody
1062
+ DynamicViewElementExpression: DynamicViewElementExpression
954
1063
  DynamicViewRule: DynamicViewRule
955
1064
  DynamicViewRulePredicate: DynamicViewRulePredicate
1065
+ DynamicViewRulePredicateIterator: DynamicViewRulePredicateIterator
956
1066
  DynamicViewStep: DynamicViewStep
957
1067
  Element: Element
958
1068
  ElementBody: ElementBody
959
- ElementExpr: ElementExpr
1069
+ ElementDescedantsExpression: ElementDescedantsExpression
1070
+ ElementExpression: ElementExpression
1071
+ ElementExpressionsIterator: ElementExpressionsIterator
960
1072
  ElementKind: ElementKind
961
- ElementKindExpr: ElementKindExpr
1073
+ ElementKindExpression: ElementKindExpression
962
1074
  ElementProperty: ElementProperty
963
1075
  ElementRef: ElementRef
964
1076
  ElementStringProperty: ElementStringProperty
965
- ElementTagExpr: ElementTagExpr
1077
+ ElementTagExpression: ElementTagExpression
966
1078
  ElementView: ElementView
967
1079
  ElementViewBody: ElementViewBody
968
1080
  ElementViewRef: ElementViewRef
969
1081
  ExcludePredicate: ExcludePredicate
970
- ExpandElementExpr: ExpandElementExpr
1082
+ ExpandElementExpression: ExpandElementExpression
971
1083
  ExplicitRelation: ExplicitRelation
1084
+ Expression: Expression
1085
+ Expressions: Expressions
972
1086
  ExtendElement: ExtendElement
973
1087
  ExtendElementBody: ExtendElementBody
974
1088
  FqnElementRef: FqnElementRef
975
1089
  IconProperty: IconProperty
976
1090
  ImplicitRelation: ImplicitRelation
977
- InOutExpr: InOutExpr
1091
+ InOutRelationExpression: InOutRelationExpression
978
1092
  IncludePredicate: IncludePredicate
979
- IncomingExpr: IncomingExpr
1093
+ IncomingRelationExpression: IncomingRelationExpression
1094
+ LibIcon: LibIcon
980
1095
  LikeC4Grammar: LikeC4Grammar
1096
+ LikeC4Lib: LikeC4Lib
981
1097
  LikeC4View: LikeC4View
982
1098
  LineProperty: LineProperty
983
1099
  LinkProperty: LinkProperty
@@ -985,10 +1101,10 @@ export type LikeC4AstType = {
985
1101
  ModelViews: ModelViews
986
1102
  NavigateToProperty: NavigateToProperty
987
1103
  OpacityProperty: OpacityProperty
988
- OutgoingExpr: OutgoingExpr
1104
+ OutgoingRelationExpression: OutgoingRelationExpression
989
1105
  Relation: Relation
990
1106
  RelationBody: RelationBody
991
- RelationExpr: RelationExpr
1107
+ RelationExpression: RelationExpression
992
1108
  RelationProperty: RelationProperty
993
1109
  RelationStringProperty: RelationStringProperty
994
1110
  RelationStyleProperty: RelationStyleProperty
@@ -1009,16 +1125,15 @@ export type LikeC4AstType = {
1009
1125
  ViewRule: ViewRule
1010
1126
  ViewRuleAutoLayout: ViewRuleAutoLayout
1011
1127
  ViewRulePredicate: ViewRulePredicate
1012
- ViewRulePredicateExpr: ViewRulePredicateExpr
1013
1128
  ViewRuleStyle: ViewRuleStyle
1014
1129
  ViewStringProperty: ViewStringProperty
1015
- WildcardExpr: WildcardExpr
1130
+ WildcardExpression: WildcardExpression
1016
1131
  }
1017
1132
 
1018
1133
  export class LikeC4AstReflection extends AbstractAstReflection {
1019
1134
 
1020
1135
  getAllTypes(): string[] {
1021
- return [ArrowProperty, BorderProperty, ColorProperty, CustomElementExpr, CustomElementExprBody, DescedantsExpr, DynamicView, DynamicViewBody, DynamicViewRule, DynamicViewRulePredicate, DynamicViewStep, Element, ElementBody, ElementExpr, ElementKind, ElementKindExpr, ElementProperty, ElementRef, ElementStringProperty, ElementTagExpr, ElementView, ElementViewBody, ElementViewRef, ExcludePredicate, ExpandElementExpr, ExplicitRelation, ExtendElement, ExtendElementBody, FqnElementRef, IconProperty, ImplicitRelation, InOutExpr, IncludePredicate, IncomingExpr, LikeC4Grammar, LikeC4View, LineProperty, LinkProperty, Model, ModelViews, NavigateToProperty, OpacityProperty, OutgoingExpr, Relation, RelationBody, RelationExpr, RelationProperty, RelationStringProperty, RelationStyleProperty, RelationshipKind, RelationshipStyleProperty, ShapeProperty, SpecificationElementKind, SpecificationRelationshipKind, SpecificationRule, SpecificationTag, StringProperty, StyleProperties, StyleProperty, Tag, Tags, ViewProperty, ViewRef, ViewRule, ViewRuleAutoLayout, ViewRulePredicate, ViewRulePredicateExpr, ViewRuleStyle, ViewStringProperty, WildcardExpr];
1136
+ return [ArrowProperty, BorderProperty, ColorProperty, CustomElementExpression, CustomElementProperties, CustomRelationExpression, CustomRelationProperties, DirectedRelationExpression, DynamicView, DynamicViewBody, DynamicViewElementExpression, DynamicViewRule, DynamicViewRulePredicate, DynamicViewRulePredicateIterator, DynamicViewStep, Element, ElementBody, ElementDescedantsExpression, ElementExpression, ElementExpressionsIterator, ElementKind, ElementKindExpression, ElementProperty, ElementRef, ElementStringProperty, ElementTagExpression, ElementView, ElementViewBody, ElementViewRef, ExcludePredicate, ExpandElementExpression, ExplicitRelation, Expression, Expressions, ExtendElement, ExtendElementBody, FqnElementRef, IconProperty, ImplicitRelation, InOutRelationExpression, IncludePredicate, IncomingRelationExpression, LibIcon, LikeC4Grammar, LikeC4Lib, LikeC4View, LineProperty, LinkProperty, Model, ModelViews, NavigateToProperty, OpacityProperty, OutgoingRelationExpression, Relation, RelationBody, RelationExpression, RelationProperty, RelationStringProperty, RelationStyleProperty, RelationshipKind, RelationshipStyleProperty, ShapeProperty, SpecificationElementKind, SpecificationRelationshipKind, SpecificationRule, SpecificationTag, StringProperty, StyleProperties, StyleProperty, Tag, Tags, ViewProperty, ViewRef, ViewRule, ViewRuleAutoLayout, ViewRulePredicate, ViewRuleStyle, ViewStringProperty, WildcardExpression];
1022
1137
  }
1023
1138
 
1024
1139
  protected override computeIsSubtype(subtype: string, supertype: string): boolean {
@@ -1028,7 +1143,6 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1028
1143
  return this.isSubtype(RelationshipStyleProperty, supertype);
1029
1144
  }
1030
1145
  case BorderProperty:
1031
- case IconProperty:
1032
1146
  case OpacityProperty:
1033
1147
  case ShapeProperty: {
1034
1148
  return this.isSubtype(StyleProperty, supertype);
@@ -1036,21 +1150,19 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1036
1150
  case ColorProperty: {
1037
1151
  return this.isSubtype(RelationshipStyleProperty, supertype) || this.isSubtype(StyleProperty, supertype);
1038
1152
  }
1039
- case CustomElementExpr:
1040
- case ElementExpr:
1041
- case IncomingExpr:
1042
- case InOutExpr:
1043
- case OutgoingExpr:
1044
- case RelationExpr: {
1045
- return this.isSubtype(ViewRulePredicateExpr, supertype);
1153
+ case CustomElementExpression:
1154
+ case ElementExpression: {
1155
+ return this.isSubtype(DynamicViewElementExpression, supertype) || this.isSubtype(Expression, supertype);
1046
1156
  }
1047
- case DescedantsExpr:
1048
- case ElementKindExpr:
1049
- case ElementRef:
1050
- case ElementTagExpr:
1051
- case ExpandElementExpr:
1052
- case WildcardExpr: {
1053
- return this.isSubtype(ElementExpr, supertype);
1157
+ case CustomRelationExpression:
1158
+ case RelationExpression: {
1159
+ return this.isSubtype(Expression, supertype);
1160
+ }
1161
+ case DirectedRelationExpression:
1162
+ case IncomingRelationExpression:
1163
+ case InOutRelationExpression:
1164
+ case OutgoingRelationExpression: {
1165
+ return this.isSubtype(RelationExpression, supertype);
1054
1166
  }
1055
1167
  case DynamicView:
1056
1168
  case ElementView: {
@@ -1059,6 +1171,14 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1059
1171
  case DynamicViewRulePredicate: {
1060
1172
  return this.isSubtype(DynamicViewRule, supertype);
1061
1173
  }
1174
+ case ElementDescedantsExpression:
1175
+ case ElementKindExpression:
1176
+ case ElementRef:
1177
+ case ElementTagExpression:
1178
+ case ExpandElementExpression:
1179
+ case WildcardExpression: {
1180
+ return this.isSubtype(ElementExpression, supertype);
1181
+ }
1062
1182
  case ElementStringProperty: {
1063
1183
  return this.isSubtype(ElementProperty, supertype) || this.isSubtype(StringProperty, supertype);
1064
1184
  }
@@ -1070,10 +1190,15 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1070
1190
  case ImplicitRelation: {
1071
1191
  return this.isSubtype(Relation, supertype);
1072
1192
  }
1193
+ case IconProperty: {
1194
+ return this.isSubtype(ElementProperty, supertype) || this.isSubtype(StyleProperty, supertype);
1195
+ }
1073
1196
  case LinkProperty: {
1074
1197
  return this.isSubtype(ElementProperty, supertype) || this.isSubtype(RelationProperty, supertype) || this.isSubtype(ViewProperty, supertype);
1075
1198
  }
1076
- case RelationStringProperty:
1199
+ case RelationStringProperty: {
1200
+ return this.isSubtype(RelationProperty, supertype) || this.isSubtype(StringProperty, supertype);
1201
+ }
1077
1202
  case RelationStyleProperty: {
1078
1203
  return this.isSubtype(RelationProperty, supertype);
1079
1204
  }
@@ -1101,24 +1226,28 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1101
1226
  switch (referenceId) {
1102
1227
  case 'DynamicViewStep:kind':
1103
1228
  case 'ExplicitRelation:kind':
1104
- case 'ImplicitRelation:kind': {
1229
+ case 'ImplicitRelation:kind':
1230
+ case 'OutgoingRelationExpression:kind': {
1105
1231
  return RelationshipKind;
1106
1232
  }
1107
1233
  case 'Element:kind':
1108
- case 'ElementKindExpr:kind': {
1234
+ case 'ElementKindExpression:kind': {
1109
1235
  return ElementKind;
1110
1236
  }
1111
1237
  case 'ElementRef:el':
1112
1238
  case 'FqnElementRef:el': {
1113
1239
  return Element;
1114
1240
  }
1115
- case 'ElementTagExpr:tag':
1241
+ case 'ElementTagExpression:tag':
1116
1242
  case 'Tags:value': {
1117
1243
  return Tag;
1118
1244
  }
1119
1245
  case 'ElementViewRef:view': {
1120
1246
  return ElementView;
1121
1247
  }
1248
+ case 'IconProperty:libicon': {
1249
+ return LibIcon;
1250
+ }
1122
1251
  case 'ViewRef:view': {
1123
1252
  return LikeC4View;
1124
1253
  }
@@ -1157,28 +1286,46 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1157
1286
  ]
1158
1287
  };
1159
1288
  }
1160
- case CustomElementExpr: {
1289
+ case CustomElementExpression: {
1161
1290
  return {
1162
- name: CustomElementExpr,
1291
+ name: CustomElementExpression,
1163
1292
  properties: [
1164
- { name: 'body' },
1293
+ { name: 'custom' },
1165
1294
  { name: 'target' }
1166
1295
  ]
1167
1296
  };
1168
1297
  }
1169
- case CustomElementExprBody: {
1298
+ case CustomElementProperties: {
1170
1299
  return {
1171
- name: CustomElementExprBody,
1300
+ name: CustomElementProperties,
1172
1301
  properties: [
1173
1302
  { name: 'props', defaultValue: [] }
1174
1303
  ]
1175
1304
  };
1176
1305
  }
1177
- case DescedantsExpr: {
1306
+ case CustomRelationExpression: {
1178
1307
  return {
1179
- name: DescedantsExpr,
1308
+ name: CustomRelationExpression,
1180
1309
  properties: [
1181
- { name: 'parent' }
1310
+ { name: 'custom' },
1311
+ { name: 'relation' }
1312
+ ]
1313
+ };
1314
+ }
1315
+ case CustomRelationProperties: {
1316
+ return {
1317
+ name: CustomRelationProperties,
1318
+ properties: [
1319
+ { name: 'props', defaultValue: [] }
1320
+ ]
1321
+ };
1322
+ }
1323
+ case DirectedRelationExpression: {
1324
+ return {
1325
+ name: DirectedRelationExpression,
1326
+ properties: [
1327
+ { name: 'source' },
1328
+ { name: 'target' }
1182
1329
  ]
1183
1330
  };
1184
1331
  }
@@ -1206,8 +1353,16 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1206
1353
  return {
1207
1354
  name: DynamicViewRulePredicate,
1208
1355
  properties: [
1209
- { name: 'commas', defaultValue: [] },
1210
- { name: 'expressions', defaultValue: [] }
1356
+ { name: 'exprs' }
1357
+ ]
1358
+ };
1359
+ }
1360
+ case DynamicViewRulePredicateIterator: {
1361
+ return {
1362
+ name: DynamicViewRulePredicateIterator,
1363
+ properties: [
1364
+ { name: 'prev' },
1365
+ { name: 'value' }
1211
1366
  ]
1212
1367
  };
1213
1368
  }
@@ -1244,6 +1399,23 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1244
1399
  ]
1245
1400
  };
1246
1401
  }
1402
+ case ElementDescedantsExpression: {
1403
+ return {
1404
+ name: ElementDescedantsExpression,
1405
+ properties: [
1406
+ { name: 'parent' }
1407
+ ]
1408
+ };
1409
+ }
1410
+ case ElementExpressionsIterator: {
1411
+ return {
1412
+ name: ElementExpressionsIterator,
1413
+ properties: [
1414
+ { name: 'prev' },
1415
+ { name: 'value' }
1416
+ ]
1417
+ };
1418
+ }
1247
1419
  case ElementKind: {
1248
1420
  return {
1249
1421
  name: ElementKind,
@@ -1252,9 +1424,9 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1252
1424
  ]
1253
1425
  };
1254
1426
  }
1255
- case ElementKindExpr: {
1427
+ case ElementKindExpression: {
1256
1428
  return {
1257
- name: ElementKindExpr,
1429
+ name: ElementKindExpression,
1258
1430
  properties: [
1259
1431
  { name: 'isEqual', defaultValue: false },
1260
1432
  { name: 'kind' }
@@ -1280,9 +1452,9 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1280
1452
  ]
1281
1453
  };
1282
1454
  }
1283
- case ElementTagExpr: {
1455
+ case ElementTagExpression: {
1284
1456
  return {
1285
- name: ElementTagExpr,
1457
+ name: ElementTagExpression,
1286
1458
  properties: [
1287
1459
  { name: 'isEqual', defaultValue: false },
1288
1460
  { name: 'tag' }
@@ -1322,16 +1494,15 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1322
1494
  return {
1323
1495
  name: ExcludePredicate,
1324
1496
  properties: [
1325
- { name: 'commas', defaultValue: [] },
1326
- { name: 'expressions', defaultValue: [] }
1497
+ { name: 'exprs' }
1327
1498
  ]
1328
1499
  };
1329
1500
  }
1330
- case ExpandElementExpr: {
1501
+ case ExpandElementExpression: {
1331
1502
  return {
1332
- name: ExpandElementExpr,
1503
+ name: ExpandElementExpression,
1333
1504
  properties: [
1334
- { name: 'parent' }
1505
+ { name: 'expand' }
1335
1506
  ]
1336
1507
  };
1337
1508
  }
@@ -1348,6 +1519,15 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1348
1519
  ]
1349
1520
  };
1350
1521
  }
1522
+ case Expressions: {
1523
+ return {
1524
+ name: Expressions,
1525
+ properties: [
1526
+ { name: 'prev' },
1527
+ { name: 'value' }
1528
+ ]
1529
+ };
1530
+ }
1351
1531
  case ExtendElement: {
1352
1532
  return {
1353
1533
  name: ExtendElement,
@@ -1380,6 +1560,7 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1380
1560
  name: IconProperty,
1381
1561
  properties: [
1382
1562
  { name: 'key' },
1563
+ { name: 'libicon' },
1383
1564
  { name: 'value' }
1384
1565
  ]
1385
1566
  };
@@ -1400,37 +1581,53 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1400
1581
  return {
1401
1582
  name: IncludePredicate,
1402
1583
  properties: [
1403
- { name: 'commas', defaultValue: [] },
1404
- { name: 'expressions', defaultValue: [] }
1584
+ { name: 'exprs' }
1405
1585
  ]
1406
1586
  };
1407
1587
  }
1408
- case IncomingExpr: {
1588
+ case IncomingRelationExpression: {
1409
1589
  return {
1410
- name: IncomingExpr,
1590
+ name: IncomingRelationExpression,
1411
1591
  properties: [
1412
1592
  { name: 'to' }
1413
1593
  ]
1414
1594
  };
1415
1595
  }
1416
- case InOutExpr: {
1596
+ case InOutRelationExpression: {
1417
1597
  return {
1418
- name: InOutExpr,
1598
+ name: InOutRelationExpression,
1419
1599
  properties: [
1420
1600
  { name: 'inout' }
1421
1601
  ]
1422
1602
  };
1423
1603
  }
1604
+ case LibIcon: {
1605
+ return {
1606
+ name: LibIcon,
1607
+ properties: [
1608
+ { name: 'name' }
1609
+ ]
1610
+ };
1611
+ }
1424
1612
  case LikeC4Grammar: {
1425
1613
  return {
1426
1614
  name: LikeC4Grammar,
1427
1615
  properties: [
1616
+ { name: 'likec4lib', defaultValue: [] },
1428
1617
  { name: 'models', defaultValue: [] },
1429
1618
  { name: 'specifications', defaultValue: [] },
1430
1619
  { name: 'views', defaultValue: [] }
1431
1620
  ]
1432
1621
  };
1433
1622
  }
1623
+ case LikeC4Lib: {
1624
+ return {
1625
+ name: LikeC4Lib,
1626
+ properties: [
1627
+ { name: 'icons', defaultValue: [] }
1628
+ ]
1629
+ };
1630
+ }
1434
1631
  case LineProperty: {
1435
1632
  return {
1436
1633
  name: LineProperty,
@@ -1485,11 +1682,13 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1485
1682
  ]
1486
1683
  };
1487
1684
  }
1488
- case OutgoingExpr: {
1685
+ case OutgoingRelationExpression: {
1489
1686
  return {
1490
- name: OutgoingExpr,
1687
+ name: OutgoingRelationExpression,
1491
1688
  properties: [
1492
- { name: 'from' }
1689
+ { name: 'from' },
1690
+ { name: 'isBidirectional', defaultValue: false },
1691
+ { name: 'kind' }
1493
1692
  ]
1494
1693
  };
1495
1694
  }
@@ -1502,16 +1701,6 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1502
1701
  ]
1503
1702
  };
1504
1703
  }
1505
- case RelationExpr: {
1506
- return {
1507
- name: RelationExpr,
1508
- properties: [
1509
- { name: 'isBidirectional', defaultValue: false },
1510
- { name: 'source' },
1511
- { name: 'target' }
1512
- ]
1513
- };
1514
- }
1515
1704
  case RelationshipKind: {
1516
1705
  return {
1517
1706
  name: RelationshipKind,
@@ -1605,7 +1794,6 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1605
1794
  return {
1606
1795
  name: Tags,
1607
1796
  properties: [
1608
- { name: 'comma', defaultValue: [] },
1609
1797
  { name: 'value', defaultValue: [] }
1610
1798
  ]
1611
1799
  };
@@ -1630,9 +1818,8 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1630
1818
  return {
1631
1819
  name: ViewRuleStyle,
1632
1820
  properties: [
1633
- { name: 'commas', defaultValue: [] },
1634
- { name: 'styleprops', defaultValue: [] },
1635
- { name: 'targets', defaultValue: [] }
1821
+ { name: 'props', defaultValue: [] },
1822
+ { name: 'target' }
1636
1823
  ]
1637
1824
  };
1638
1825
  }
@@ -1645,9 +1832,9 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1645
1832
  ]
1646
1833
  };
1647
1834
  }
1648
- case WildcardExpr: {
1835
+ case WildcardExpression: {
1649
1836
  return {
1650
- name: WildcardExpr,
1837
+ name: WildcardExpression,
1651
1838
  properties: [
1652
1839
  { name: 'isWildcard', defaultValue: false }
1653
1840
  ]