@likec4/language-server 1.15.0 → 1.16.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 (47) hide show
  1. package/contrib/likec4.tmLanguage.json +1 -1
  2. package/dist/browser.cjs +1 -1
  3. package/dist/browser.d.cts +2 -2
  4. package/dist/browser.d.mts +2 -2
  5. package/dist/browser.d.ts +2 -2
  6. package/dist/browser.mjs +2 -2
  7. package/dist/index.cjs +1 -1
  8. package/dist/index.d.cts +2 -2
  9. package/dist/index.d.mts +2 -2
  10. package/dist/index.d.ts +2 -2
  11. package/dist/index.mjs +2 -2
  12. package/dist/model-graph/index.cjs +1 -1
  13. package/dist/model-graph/index.d.cts +4 -2
  14. package/dist/model-graph/index.d.mts +4 -2
  15. package/dist/model-graph/index.d.ts +4 -2
  16. package/dist/model-graph/index.mjs +1 -1
  17. package/dist/shared/language-server.7iILaJYc.d.ts +1338 -0
  18. package/dist/shared/{language-server.80ITEDo5.cjs → language-server.Bd3NZ8uH.cjs} +130 -76
  19. package/dist/shared/{language-server.DXC9g4_f.mjs → language-server.C5gxpVUH.mjs} +132 -78
  20. package/dist/shared/language-server.CmBZHwSl.d.cts +1338 -0
  21. package/dist/shared/{language-server.U2piOAVt.d.cts → language-server.CnkCWVtf.d.cts} +44 -10
  22. package/dist/shared/{language-server.DfMwkd2l.d.mts → language-server.DIaiY0-C.d.mts} +44 -10
  23. package/dist/shared/language-server.DViE1Zxi.d.mts +1338 -0
  24. package/dist/shared/{language-server.zY53FGJE.mjs → language-server.D_13fWJQ.mjs} +216 -94
  25. package/dist/shared/{language-server.j-ShR6as.d.ts → language-server.DwyQ1FtY.d.ts} +44 -10
  26. package/dist/shared/{language-server.BUtiWTKg.cjs → language-server.Dym6GL4P.cjs} +214 -92
  27. package/package.json +8 -8
  28. package/src/ast.ts +11 -3
  29. package/src/formatting/LikeC4Formatter.ts +44 -4
  30. package/src/generated/ast.ts +111 -10
  31. package/src/generated/grammar.ts +1 -1
  32. package/src/like-c4.langium +19 -0
  33. package/src/lsp/SemanticTokenProvider.ts +3 -1
  34. package/src/model/model-builder.ts +34 -32
  35. package/src/model/model-parser.ts +91 -18
  36. package/src/model-graph/LikeC4ModelGraph.ts +22 -11
  37. package/src/model-graph/compute-view/__test__/fixture.ts +114 -44
  38. package/src/model-graph/compute-view/compute.ts +77 -72
  39. package/src/model-graph/dynamic-view/compute.ts +4 -1
  40. package/src/model-graph/utils/applyCustomRelationProperties.ts +7 -38
  41. package/src/model-graph/utils/applyViewRuleStyles.ts +0 -4
  42. package/src/model-graph/utils/relationExpressionToPredicates.ts +43 -0
  43. package/src/references/scope-computation.ts +10 -0
  44. package/src/validation/index.ts +3 -0
  45. package/src/validation/specification.ts +21 -0
  46. package/src/view-utils/index.ts +0 -1
  47. package/src/view-utils/resolve-global-rules.ts +66 -50
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.15.0",
4
+ "version": "1.16.0",
5
5
  "license": "MIT",
6
6
  "bugs": "https://github.com/likec4/likec4/issues",
7
7
  "homepage": "https://likec4.dev",
@@ -112,8 +112,8 @@
112
112
  },
113
113
  "dependencies": {
114
114
  "@dagrejs/dagre": "^1.1.4",
115
- "@likec4/core": "1.15.0",
116
- "@likec4/log": "1.15.0",
115
+ "@likec4/core": "1.16.0",
116
+ "@likec4/log": "1.16.0",
117
117
  "@msgpack/msgpack": "^3.0.0-beta2",
118
118
  "@smithy/util-base64": "^3.0.0",
119
119
  "fast-equals": "^5.0.1",
@@ -122,7 +122,7 @@
122
122
  "langium": "3.2.0",
123
123
  "object-hash": "^3.0.0",
124
124
  "p-debounce": "^4.0.0",
125
- "remeda": "^2.15.0",
125
+ "remeda": "^2.16.0",
126
126
  "string-hash": "^1.1.3",
127
127
  "strip-indent": "^4.0.0",
128
128
  "type-fest": "4.26.1",
@@ -133,12 +133,12 @@
133
133
  "vscode-uri": "3.0.8"
134
134
  },
135
135
  "devDependencies": {
136
- "@likec4/icons": "1.15.0",
137
- "@likec4/tsconfig": "1.15.0",
136
+ "@likec4/icons": "1.16.0",
137
+ "@likec4/tsconfig": "1.16.0",
138
138
  "@types/node": "^20.16.14",
139
139
  "@types/object-hash": "^3.0.6",
140
140
  "@types/string-hash": "^1.1.3",
141
- "@vitest/coverage-v8": "^2.1.3",
141
+ "@vitest/coverage-v8": "^2.1.4",
142
142
  "execa": "^9.3.1",
143
143
  "langium-cli": "3.2.0",
144
144
  "npm-run-all2": "^6.2.6",
@@ -146,7 +146,7 @@
146
146
  "turbo": "^2.2.3",
147
147
  "typescript": "^5.6.3",
148
148
  "unbuild": "^3.0.0-rc.11",
149
- "vitest": "^2.1.3"
149
+ "vitest": "^2.1.4"
150
150
  },
151
151
  "packageManager": "yarn@4.5.1"
152
152
  }
package/src/ast.ts CHANGED
@@ -93,9 +93,13 @@ export interface ParsedAstRelation {
93
93
  metadata?: { [key: string]: string }
94
94
  }
95
95
 
96
- export interface ParsedAstGlobals {
97
- styles: Record<c4.GlobalStyleID, c4.NonEmptyArray<c4.ViewRuleStyle>>
98
- }
96
+ // export interface ParsedAstGlobals {
97
+ // predicates: Record<c4.GlobalElRelID, c4.NonEmptyArray<c4.ViewRulePredicate>>
98
+ // dynamicPredicates: Record<c4.GlobalElRelID, c4.NonEmptyArray<c4.DynamicViewIncludeRule>>
99
+ // styles: Record<c4.GlobalStyleID, c4.NonEmptyArray<c4.ViewRuleStyle>>
100
+ // }
101
+ // Alias for refactoring
102
+ export type ParsedAstGlobals = c4.ModelGlobals
99
103
 
100
104
  export interface ParsedAstElementView {
101
105
  __: 'element'
@@ -196,6 +200,8 @@ export function cleanParsedModel(doc: LikeC4LangiumDocument) {
196
200
  c4Elements: [],
197
201
  c4Relations: [],
198
202
  c4Globals: {
203
+ predicates: {},
204
+ dynamicPredicates: {},
199
205
  styles: {}
200
206
  },
201
207
  c4Views: []
@@ -235,6 +241,8 @@ function validatableAstNodeGuards<const Predicates extends Guard<AstNode>[]>(
235
241
  }
236
242
  const isValidatableAstNode = validatableAstNodeGuards([
237
243
  ast.isGlobals,
244
+ ast.isGlobalPredicateGroup,
245
+ ast.isGlobalDynamicPredicateGroup,
238
246
  ast.isGlobalStyle,
239
247
  ast.isGlobalStyleGroup,
240
248
  ast.isDynamicViewPredicateIterator,
@@ -17,17 +17,29 @@ export class LikeC4Formatter extends AbstractFormatter {
17
17
  this.removeIndentFromTopLevelStatements(node)
18
18
  this.indentContentInBraces(node)
19
19
 
20
+ // Specification
20
21
  this.formatSpecificationRule(node)
22
+
23
+ // Globals
24
+ this.formatGlobals(node)
25
+
26
+ // Models
21
27
  this.formatElementDeclaration(node)
22
28
  this.formatRelation(node)
29
+ this.formatMetadataProperty(node)
30
+
31
+ // Views
23
32
  this.formatView(node)
24
- this.formatViewRuleStyle(node)
33
+ this.formatViewRuleGroup(node)
34
+ this.formatViewRuleGlobalStyle(node)
25
35
  this.formatIncludeExcludeExpressions(node)
26
36
  this.formatWhereExpression(node)
37
+ this.formatAutolayoutProperty(node)
27
38
  this.formatWithPredicate(node)
39
+
40
+ // Common
41
+ this.formatViewRuleStyle(node)
28
42
  this.formatLeafProperty(node)
29
- this.formatMetadataProperty(node)
30
- this.formatAutolayoutProperty(node)
31
43
  this.formatLinkProperty(node)
32
44
  this.formatNavigateToProperty(node)
33
45
  this.formatTags(node)
@@ -92,9 +104,10 @@ export class LikeC4Formatter extends AbstractFormatter {
92
104
  || ast.isSpecificationRule(node)
93
105
  || ast.isModelViews(node)
94
106
  || ast.isLikeC4Lib(node)
107
+ || ast.isGlobals(node)
95
108
  ) {
96
109
  const formatter = this.getNodeFormatter(node)
97
- formatter.keywords('specification', 'model', 'views', 'likec4lib')
110
+ formatter.keywords('specification', 'model', 'views', 'likec4lib', 'global')
98
111
  .prepend(FormattingOptions.noIndent)
99
112
  }
100
113
  }
@@ -105,6 +118,9 @@ export class LikeC4Formatter extends AbstractFormatter {
105
118
  || ast.isSpecificationRule(node)
106
119
  || ast.isSpecificationElementKind(node)
107
120
  || ast.isSpecificationRelationshipKind(node)
121
+ || ast.isGlobals(node)
122
+ || ast.isGlobalStyle(node)
123
+ || ast.isGlobalStyleGroup(node)
108
124
  || ast.isModel(node)
109
125
  || ast.isElementBody(node)
110
126
  || ast.isExtendElementBody(node)
@@ -115,6 +131,7 @@ export class LikeC4Formatter extends AbstractFormatter {
115
131
  || ast.isElementViewBody(node)
116
132
  || ast.isDynamicViewBody(node)
117
133
  || ast.isViewRuleStyle(node)
134
+ || ast.isViewRuleGroup(node)
118
135
  || ast.isCustomElementProperties(node)
119
136
  || ast.isCustomRelationProperties(node)
120
137
  || ast.isElementStyleProperty(node)
@@ -270,6 +287,17 @@ export class LikeC4Formatter extends AbstractFormatter {
270
287
  })
271
288
  }
272
289
 
290
+ protected formatGlobals(node: AstNode) {
291
+ this.on(node, ast.isGlobalStyle, (n, f) => {
292
+ f.keyword('style').append(FormattingOptions.oneSpace)
293
+ f.property('id').append(FormattingOptions.oneSpace)
294
+ })
295
+
296
+ this.on(node, ast.isGlobalStyleGroup, (n, f) => {
297
+ f.keyword('styleGroup').append(FormattingOptions.oneSpace)
298
+ })
299
+ }
300
+
273
301
  protected formatSpecificationRule(node: AstNode) {
274
302
  if (
275
303
  ast.isSpecificationElementKind(node)
@@ -300,6 +328,18 @@ export class LikeC4Formatter extends AbstractFormatter {
300
328
  }
301
329
  }
302
330
 
331
+ protected formatViewRuleGlobalStyle(node: AstNode) {
332
+ this.on(node, ast.isViewRuleGlobalStyle, (n, f) => {
333
+ f.keywords('global', 'style').append(FormattingOptions.oneSpace)
334
+ })
335
+ }
336
+
337
+ protected formatViewRuleGroup(node: AstNode) {
338
+ this.on(node, ast.isViewRuleGroup, (n, f) => {
339
+ f.keyword('group').append(FormattingOptions.oneSpace)
340
+ })
341
+ }
342
+
303
343
  protected formatViewRuleStyle(node: AstNode) {
304
344
  this.on(node, ast.isViewRuleStyle)
305
345
  ?.keyword('style').append(FormattingOptions.oneSpace)
@@ -62,6 +62,7 @@ export type LikeC4KeywordNames =
62
62
  | "dot"
63
63
  | "dotted"
64
64
  | "dynamic"
65
+ | "dynamicPredicateGroup"
65
66
  | "element"
66
67
  | "element.kind"
67
68
  | "element.tag"
@@ -102,6 +103,8 @@ export type LikeC4KeywordNames =
102
103
  | "par"
103
104
  | "parallel"
104
105
  | "person"
106
+ | "predicate"
107
+ | "predicateGroup"
105
108
  | "primary"
106
109
  | "queue"
107
110
  | "rectangle"
@@ -160,7 +163,7 @@ export function isDotId(item: unknown): item is DotId {
160
163
  return typeof item === 'string';
161
164
  }
162
165
 
163
- export type DynamicViewRule = DynamicViewIncludePredicate | ViewRuleAutoLayout | ViewRuleStyleOrGlobalRef;
166
+ export type DynamicViewRule = DynamicViewGlobalPredicateRef | DynamicViewIncludePredicate | ViewRuleAutoLayout | ViewRuleStyleOrGlobalRef;
164
167
 
165
168
  export const DynamicViewRule = 'DynamicViewRule';
166
169
 
@@ -336,7 +339,7 @@ export function isViewProperty(item: unknown): item is ViewProperty {
336
339
  return reflection.isInstance(item, ViewProperty);
337
340
  }
338
341
 
339
- export type ViewRule = ViewRuleAutoLayout | ViewRuleGroup | ViewRulePredicate | ViewRuleStyleOrGlobalRef;
342
+ export type ViewRule = ViewRuleAutoLayout | ViewRuleGlobalPredicateRef | ViewRuleGroup | ViewRulePredicate | ViewRuleStyleOrGlobalRef;
340
343
 
341
344
  export const ViewRule = 'ViewRule';
342
345
 
@@ -533,8 +536,20 @@ export function isDynamicViewBody(item: unknown): item is DynamicViewBody {
533
536
  return reflection.isInstance(item, DynamicViewBody);
534
537
  }
535
538
 
536
- export interface DynamicViewIncludePredicate extends AstNode {
539
+ export interface DynamicViewGlobalPredicateRef extends AstNode {
537
540
  readonly $container: DynamicViewBody;
541
+ readonly $type: 'DynamicViewGlobalPredicateRef';
542
+ predicate: Reference<GlobalDynamicPredicateGroup>;
543
+ }
544
+
545
+ export const DynamicViewGlobalPredicateRef = 'DynamicViewGlobalPredicateRef';
546
+
547
+ export function isDynamicViewGlobalPredicateRef(item: unknown): item is DynamicViewGlobalPredicateRef {
548
+ return reflection.isInstance(item, DynamicViewGlobalPredicateRef);
549
+ }
550
+
551
+ export interface DynamicViewIncludePredicate extends AstNode {
552
+ readonly $container: DynamicViewBody | GlobalDynamicPredicateGroup;
538
553
  readonly $type: 'DynamicViewIncludePredicate';
539
554
  predicates: DynamicViewPredicateIterator;
540
555
  }
@@ -798,7 +813,7 @@ export function isElementViewRef(item: unknown): item is ElementViewRef {
798
813
  }
799
814
 
800
815
  export interface ExcludePredicate extends AstNode {
801
- readonly $container: ElementViewBody | ViewRuleGroup;
816
+ readonly $container: ElementViewBody | GlobalPredicateGroup | ViewRuleGroup;
802
817
  readonly $type: 'ExcludePredicate';
803
818
  predicates: Predicates;
804
819
  }
@@ -859,10 +874,37 @@ export function isFqnElementRef(item: unknown): item is FqnElementRef {
859
874
  return reflection.isInstance(item, FqnElementRef);
860
875
  }
861
876
 
877
+ export interface GlobalDynamicPredicateGroup extends AstNode {
878
+ readonly $container: Globals;
879
+ readonly $type: 'GlobalDynamicPredicateGroup';
880
+ name: string;
881
+ predicates: Array<DynamicViewIncludePredicate>;
882
+ }
883
+
884
+ export const GlobalDynamicPredicateGroup = 'GlobalDynamicPredicateGroup';
885
+
886
+ export function isGlobalDynamicPredicateGroup(item: unknown): item is GlobalDynamicPredicateGroup {
887
+ return reflection.isInstance(item, GlobalDynamicPredicateGroup);
888
+ }
889
+
890
+ export interface GlobalPredicateGroup extends AstNode {
891
+ readonly $container: Globals;
892
+ readonly $type: 'GlobalPredicateGroup';
893
+ name: string;
894
+ predicates: Array<ViewRulePredicate>;
895
+ }
896
+
897
+ export const GlobalPredicateGroup = 'GlobalPredicateGroup';
898
+
899
+ export function isGlobalPredicateGroup(item: unknown): item is GlobalPredicateGroup {
900
+ return reflection.isInstance(item, GlobalPredicateGroup);
901
+ }
902
+
862
903
  export interface Globals extends AstNode {
863
904
  readonly $container: LikeC4Grammar;
864
905
  readonly $type: 'Globals';
865
906
  name: 'global';
907
+ predicates: Array<GlobalDynamicPredicateGroup | GlobalPredicateGroup>;
866
908
  styles: Array<GlobalStyle | GlobalStyleGroup>;
867
909
  }
868
910
 
@@ -926,7 +968,7 @@ export function isIconProperty(item: unknown): item is IconProperty {
926
968
  }
927
969
 
928
970
  export interface IncludePredicate extends AstNode {
929
- readonly $container: ElementViewBody | ViewRuleGroup;
971
+ readonly $container: ElementViewBody | GlobalPredicateGroup | ViewRuleGroup;
930
972
  readonly $type: 'IncludePredicate';
931
973
  predicates: Predicates;
932
974
  }
@@ -1423,6 +1465,18 @@ export function isViewRuleAutoLayout(item: unknown): item is ViewRuleAutoLayout
1423
1465
  return reflection.isInstance(item, ViewRuleAutoLayout);
1424
1466
  }
1425
1467
 
1468
+ export interface ViewRuleGlobalPredicateRef extends AstNode {
1469
+ readonly $container: ElementViewBody;
1470
+ readonly $type: 'ViewRuleGlobalPredicateRef';
1471
+ predicate: Reference<GlobalPredicateGroup>;
1472
+ }
1473
+
1474
+ export const ViewRuleGlobalPredicateRef = 'ViewRuleGlobalPredicateRef';
1475
+
1476
+ export function isViewRuleGlobalPredicateRef(item: unknown): item is ViewRuleGlobalPredicateRef {
1477
+ return reflection.isInstance(item, ViewRuleGlobalPredicateRef);
1478
+ }
1479
+
1426
1480
  export interface ViewRuleGlobalStyle extends AstNode {
1427
1481
  readonly $container: DynamicViewBody | ElementViewBody | ModelViews;
1428
1482
  readonly $type: 'ViewRuleGlobalStyle';
@@ -1591,6 +1645,7 @@ export type LikeC4AstType = {
1591
1645
  DirectedRelationExpression: DirectedRelationExpression
1592
1646
  DynamicView: DynamicView
1593
1647
  DynamicViewBody: DynamicViewBody
1648
+ DynamicViewGlobalPredicateRef: DynamicViewGlobalPredicateRef
1594
1649
  DynamicViewIncludePredicate: DynamicViewIncludePredicate
1595
1650
  DynamicViewParallelSteps: DynamicViewParallelSteps
1596
1651
  DynamicViewPredicateIterator: DynamicViewPredicateIterator
@@ -1621,6 +1676,8 @@ export type LikeC4AstType = {
1621
1676
  ExtendElement: ExtendElement
1622
1677
  ExtendElementBody: ExtendElementBody
1623
1678
  FqnElementRef: FqnElementRef
1679
+ GlobalDynamicPredicateGroup: GlobalDynamicPredicateGroup
1680
+ GlobalPredicateGroup: GlobalPredicateGroup
1624
1681
  GlobalStyle: GlobalStyle
1625
1682
  GlobalStyleGroup: GlobalStyleGroup
1626
1683
  GlobalStyleId: GlobalStyleId
@@ -1676,6 +1733,7 @@ export type LikeC4AstType = {
1676
1733
  ViewRef: ViewRef
1677
1734
  ViewRule: ViewRule
1678
1735
  ViewRuleAutoLayout: ViewRuleAutoLayout
1736
+ ViewRuleGlobalPredicateRef: ViewRuleGlobalPredicateRef
1679
1737
  ViewRuleGlobalStyle: ViewRuleGlobalStyle
1680
1738
  ViewRuleGroup: ViewRuleGroup
1681
1739
  ViewRulePredicate: ViewRulePredicate
@@ -1702,7 +1760,7 @@ export type LikeC4AstType = {
1702
1760
  export class LikeC4AstReflection extends AbstractAstReflection {
1703
1761
 
1704
1762
  getAllTypes(): string[] {
1705
- return [ArrowProperty, BorderProperty, ColorProperty, CustomColor, CustomElementProperties, CustomRelationProperties, DirectedRelationExpression, DynamicView, DynamicViewBody, 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, ExtendElement, ExtendElementBody, FqnElementRef, GlobalStyle, GlobalStyleGroup, GlobalStyleId, Globals, IconProperty, InOutRelationExpression, IncludePredicate, IncomingRelationExpression, LibIcon, LikeC4Grammar, LikeC4Lib, LikeC4View, LineProperty, LinkProperty, MetadataAttribute, MetadataBody, MetadataProperty, Model, ModelViews, NavigateToProperty, NotationProperty, NotesProperty, OpacityProperty, OutgoingRelationExpression, Predicate, Predicates, Relation, RelationBody, RelationExpression, RelationNavigateToProperty, RelationPredicate, RelationPredicateOrWhere, RelationPredicateWhere, RelationPredicateWith, RelationProperty, RelationStringProperty, RelationStyleProperty, RelationshipKind, RelationshipStyleProperty, ShapeProperty, SpecificationColor, SpecificationElementKind, SpecificationElementStringProperty, SpecificationRelationshipKind, SpecificationRelationshipStringProperty, SpecificationRule, SpecificationTag, StringProperty, StyleProperty, Tag, Tags, ViewProperty, ViewRef, ViewRule, ViewRuleAutoLayout, ViewRuleGlobalStyle, ViewRuleGroup, ViewRulePredicate, ViewRuleStyle, ViewRuleStyleOrGlobalRef, ViewStringProperty, WhereBinaryExpression, WhereElement, WhereElementExpression, WhereElementKind, WhereElementNegation, WhereElementTag, WhereExpression, WhereKindEqual, WhereRelation, WhereRelationExpression, WhereRelationKind, WhereRelationNegation, WhereRelationTag, WhereTagEqual, WildcardExpression];
1763
+ return [ArrowProperty, BorderProperty, ColorProperty, CustomColor, CustomElementProperties, CustomRelationProperties, 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, ExtendElement, ExtendElementBody, FqnElementRef, GlobalDynamicPredicateGroup, GlobalPredicateGroup, GlobalStyle, GlobalStyleGroup, GlobalStyleId, Globals, IconProperty, InOutRelationExpression, IncludePredicate, IncomingRelationExpression, LibIcon, LikeC4Grammar, LikeC4Lib, LikeC4View, LineProperty, LinkProperty, MetadataAttribute, MetadataBody, MetadataProperty, Model, ModelViews, NavigateToProperty, NotationProperty, NotesProperty, OpacityProperty, OutgoingRelationExpression, Predicate, Predicates, Relation, RelationBody, RelationExpression, RelationNavigateToProperty, RelationPredicate, RelationPredicateOrWhere, RelationPredicateWhere, RelationPredicateWith, RelationProperty, RelationStringProperty, RelationStyleProperty, RelationshipKind, RelationshipStyleProperty, ShapeProperty, SpecificationColor, 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];
1706
1764
  }
1707
1765
 
1708
1766
  protected override computeIsSubtype(subtype: string, supertype: string): boolean {
@@ -1729,6 +1787,7 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1729
1787
  case ElementView: {
1730
1788
  return this.isSubtype(LikeC4View, supertype);
1731
1789
  }
1790
+ case DynamicViewGlobalPredicateRef:
1732
1791
  case DynamicViewIncludePredicate: {
1733
1792
  return this.isSubtype(DynamicViewRule, supertype);
1734
1793
  }
@@ -1800,14 +1859,15 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1800
1859
  case ViewRuleStyleOrGlobalRef: {
1801
1860
  return this.isSubtype(DynamicViewRule, supertype) || this.isSubtype(ViewRule, supertype);
1802
1861
  }
1803
- case ViewRuleGlobalStyle:
1804
- case ViewRuleStyle: {
1805
- return this.isSubtype(ViewRuleStyleOrGlobalRef, supertype);
1806
- }
1862
+ case ViewRuleGlobalPredicateRef:
1807
1863
  case ViewRuleGroup:
1808
1864
  case ViewRulePredicate: {
1809
1865
  return this.isSubtype(ViewRule, supertype);
1810
1866
  }
1867
+ case ViewRuleGlobalStyle:
1868
+ case ViewRuleStyle: {
1869
+ return this.isSubtype(ViewRuleStyleOrGlobalRef, supertype);
1870
+ }
1811
1871
  case ViewStringProperty: {
1812
1872
  return this.isSubtype(StringProperty, supertype) || this.isSubtype(ViewProperty, supertype);
1813
1873
  }
@@ -1850,6 +1910,9 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1850
1910
  case 'ColorProperty:customColor': {
1851
1911
  return CustomColor;
1852
1912
  }
1913
+ case 'DynamicViewGlobalPredicateRef:predicate': {
1914
+ return GlobalDynamicPredicateGroup;
1915
+ }
1853
1916
  case 'DynamicViewRef:view': {
1854
1917
  return DynamicView;
1855
1918
  }
@@ -1883,6 +1946,9 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1883
1946
  case 'ViewRef:view': {
1884
1947
  return LikeC4View;
1885
1948
  }
1949
+ case 'ViewRuleGlobalPredicateRef:predicate': {
1950
+ return GlobalPredicateGroup;
1951
+ }
1886
1952
  case 'ViewRuleGlobalStyle:style': {
1887
1953
  return GlobalStyleId;
1888
1954
  }
@@ -1975,6 +2041,14 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1975
2041
  ]
1976
2042
  };
1977
2043
  }
2044
+ case DynamicViewGlobalPredicateRef: {
2045
+ return {
2046
+ name: DynamicViewGlobalPredicateRef,
2047
+ properties: [
2048
+ { name: 'predicate' }
2049
+ ]
2050
+ };
2051
+ }
1978
2052
  case DynamicViewIncludePredicate: {
1979
2053
  return {
1980
2054
  name: DynamicViewIncludePredicate,
@@ -2201,11 +2275,30 @@ export class LikeC4AstReflection extends AbstractAstReflection {
2201
2275
  ]
2202
2276
  };
2203
2277
  }
2278
+ case GlobalDynamicPredicateGroup: {
2279
+ return {
2280
+ name: GlobalDynamicPredicateGroup,
2281
+ properties: [
2282
+ { name: 'name' },
2283
+ { name: 'predicates', defaultValue: [] }
2284
+ ]
2285
+ };
2286
+ }
2287
+ case GlobalPredicateGroup: {
2288
+ return {
2289
+ name: GlobalPredicateGroup,
2290
+ properties: [
2291
+ { name: 'name' },
2292
+ { name: 'predicates', defaultValue: [] }
2293
+ ]
2294
+ };
2295
+ }
2204
2296
  case Globals: {
2205
2297
  return {
2206
2298
  name: Globals,
2207
2299
  properties: [
2208
2300
  { name: 'name' },
2301
+ { name: 'predicates', defaultValue: [] },
2209
2302
  { name: 'styles', defaultValue: [] }
2210
2303
  ]
2211
2304
  };
@@ -2594,6 +2687,14 @@ export class LikeC4AstReflection extends AbstractAstReflection {
2594
2687
  ]
2595
2688
  };
2596
2689
  }
2690
+ case ViewRuleGlobalPredicateRef: {
2691
+ return {
2692
+ name: ViewRuleGlobalPredicateRef,
2693
+ properties: [
2694
+ { name: 'predicate' }
2695
+ ]
2696
+ };
2697
+ }
2597
2698
  case ViewRuleGlobalStyle: {
2598
2699
  return {
2599
2700
  name: ViewRuleGlobalStyle,