@likec4/language-server 1.14.0 → 1.15.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/browser.cjs +1 -1
- package/dist/browser.d.cts +2 -2
- package/dist/browser.d.mts +2 -2
- package/dist/browser.d.ts +2 -2
- package/dist/browser.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/likec4lib.cjs +0 -1
- package/dist/likec4lib.mjs +0 -1
- package/dist/model-graph/index.cjs +1 -1
- package/dist/model-graph/index.mjs +1 -1
- package/dist/shared/{language-server.CbDa016p.cjs → language-server.80ITEDo5.cjs} +272 -64
- package/dist/shared/{language-server.CITj0XN3.cjs → language-server.BUtiWTKg.cjs} +188 -30
- package/dist/shared/{language-server.DFLaUdYu.mjs → language-server.DXC9g4_f.mjs} +274 -66
- package/dist/shared/{language-server.CO6aEDQm.d.mts → language-server.DfMwkd2l.d.mts} +46 -15
- package/dist/shared/{language-server.Cqyh6-9S.d.cts → language-server.U2piOAVt.d.cts} +46 -15
- package/dist/shared/{language-server.BI99piRy.d.ts → language-server.j-ShR6as.d.ts} +46 -15
- package/dist/shared/{language-server.DZYziEuF.mjs → language-server.zY53FGJE.mjs} +189 -31
- package/package.json +9 -9
- package/src/ast.ts +1 -0
- package/src/generated/ast.ts +103 -19
- package/src/generated/grammar.ts +1 -1
- package/src/generated-lib/icons.ts +0 -1
- package/src/like-c4.langium +32 -9
- package/src/lsp/CompletionProvider.ts +70 -2
- package/src/model/model-builder.ts +0 -1
- package/src/model/model-parser.ts +71 -20
- package/src/model-graph/compute-view/__test__/fixture.ts +45 -4
- package/src/model-graph/compute-view/compute.ts +223 -40
- package/src/model-graph/compute-view/predicates.ts +12 -6
- package/src/model-graph/utils/applyCustomElementProperties.ts +18 -4
- package/src/model-graph/utils/applyCustomRelationProperties.ts +2 -1
- package/src/model-graph/utils/applyViewRuleStyles.ts +30 -25
- package/src/model-graph/utils/buildComputeNodes.ts +69 -17
- package/src/model-graph/utils/elementExpressionToPredicate.ts +3 -1
- package/src/model-graph/utils/sortNodes.ts +11 -7
- package/src/references/scope-computation.ts +3 -2
- package/src/validation/index.ts +2 -2
- package/src/validation/specification.ts +4 -4
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.
|
|
4
|
+
"version": "1.15.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.
|
|
116
|
-
"@likec4/log": "1.
|
|
115
|
+
"@likec4/core": "1.15.0",
|
|
116
|
+
"@likec4/log": "1.15.0",
|
|
117
117
|
"@msgpack/msgpack": "^3.0.0-beta2",
|
|
118
118
|
"@smithy/util-base64": "^3.0.0",
|
|
119
119
|
"fast-equals": "^5.0.1",
|
|
@@ -133,20 +133,20 @@
|
|
|
133
133
|
"vscode-uri": "3.0.8"
|
|
134
134
|
},
|
|
135
135
|
"devDependencies": {
|
|
136
|
-
"@likec4/icons": "1.
|
|
137
|
-
"@likec4/tsconfig": "1.
|
|
138
|
-
"@types/node": "^20.16.
|
|
136
|
+
"@likec4/icons": "1.15.0",
|
|
137
|
+
"@likec4/tsconfig": "1.15.0",
|
|
138
|
+
"@types/node": "^20.16.14",
|
|
139
139
|
"@types/object-hash": "^3.0.6",
|
|
140
140
|
"@types/string-hash": "^1.1.3",
|
|
141
141
|
"@vitest/coverage-v8": "^2.1.3",
|
|
142
142
|
"execa": "^9.3.1",
|
|
143
143
|
"langium-cli": "3.2.0",
|
|
144
|
-
"npm-run-all2": "^6.2.
|
|
144
|
+
"npm-run-all2": "^6.2.6",
|
|
145
145
|
"tsx": "~4.9.3",
|
|
146
|
-
"turbo": "^2.
|
|
146
|
+
"turbo": "^2.2.3",
|
|
147
147
|
"typescript": "^5.6.3",
|
|
148
148
|
"unbuild": "^3.0.0-rc.11",
|
|
149
149
|
"vitest": "^2.1.3"
|
|
150
150
|
},
|
|
151
|
-
"packageManager": "yarn@4.5.
|
|
151
|
+
"packageManager": "yarn@4.5.1"
|
|
152
152
|
}
|
package/src/ast.ts
CHANGED
|
@@ -236,6 +236,7 @@ function validatableAstNodeGuards<const Predicates extends Guard<AstNode>[]>(
|
|
|
236
236
|
const isValidatableAstNode = validatableAstNodeGuards([
|
|
237
237
|
ast.isGlobals,
|
|
238
238
|
ast.isGlobalStyle,
|
|
239
|
+
ast.isGlobalStyleGroup,
|
|
239
240
|
ast.isDynamicViewPredicateIterator,
|
|
240
241
|
ast.isElementPredicateWith,
|
|
241
242
|
ast.isRelationPredicateWith,
|
package/src/generated/ast.ts
CHANGED
|
@@ -71,6 +71,7 @@ export type LikeC4KeywordNames =
|
|
|
71
71
|
| "global"
|
|
72
72
|
| "gray"
|
|
73
73
|
| "green"
|
|
74
|
+
| "group"
|
|
74
75
|
| "head"
|
|
75
76
|
| "icon"
|
|
76
77
|
| "icons"
|
|
@@ -114,6 +115,7 @@ export type LikeC4KeywordNames =
|
|
|
114
115
|
| "specification"
|
|
115
116
|
| "storage"
|
|
116
117
|
| "style"
|
|
118
|
+
| "styleGroup"
|
|
117
119
|
| "tag"
|
|
118
120
|
| "tail"
|
|
119
121
|
| "technology"
|
|
@@ -158,7 +160,7 @@ export function isDotId(item: unknown): item is DotId {
|
|
|
158
160
|
return typeof item === 'string';
|
|
159
161
|
}
|
|
160
162
|
|
|
161
|
-
export type DynamicViewRule = DynamicViewIncludePredicate | ViewRuleAutoLayout |
|
|
163
|
+
export type DynamicViewRule = DynamicViewIncludePredicate | ViewRuleAutoLayout | ViewRuleStyleOrGlobalRef;
|
|
162
164
|
|
|
163
165
|
export const DynamicViewRule = 'DynamicViewRule';
|
|
164
166
|
|
|
@@ -210,10 +212,10 @@ export function isIconId(item: unknown): item is IconId {
|
|
|
210
212
|
return (typeof item === 'string' && (/(aws|azure|gcp|tech):[-\w]*/.test(item)));
|
|
211
213
|
}
|
|
212
214
|
|
|
213
|
-
export type Id = 'element' | 'model' | ArrowType | ElementShape | LineOptions | ThemeColor | string;
|
|
215
|
+
export type Id = 'element' | 'group' | 'model' | ArrowType | ElementShape | LineOptions | ThemeColor | string;
|
|
214
216
|
|
|
215
217
|
export function isId(item: unknown): item is Id {
|
|
216
|
-
return isElementShape(item) || isThemeColor(item) || isArrowType(item) || isLineOptions(item) || item === 'element' || item === 'model' || (typeof item === 'string' && (/[_]*[a-zA-Z][-\w]*/.test(item)));
|
|
218
|
+
return isElementShape(item) || isThemeColor(item) || isArrowType(item) || isLineOptions(item) || item === 'element' || item === 'model' || item === 'group' || (typeof item === 'string' && (/[_]*[a-zA-Z][-\w]*/.test(item)));
|
|
217
219
|
}
|
|
218
220
|
|
|
219
221
|
export type LikeC4View = DynamicView | ElementView;
|
|
@@ -334,7 +336,7 @@ export function isViewProperty(item: unknown): item is ViewProperty {
|
|
|
334
336
|
return reflection.isInstance(item, ViewProperty);
|
|
335
337
|
}
|
|
336
338
|
|
|
337
|
-
export type ViewRule = ViewRuleAutoLayout |
|
|
339
|
+
export type ViewRule = ViewRuleAutoLayout | ViewRuleGroup | ViewRulePredicate | ViewRuleStyleOrGlobalRef;
|
|
338
340
|
|
|
339
341
|
export const ViewRule = 'ViewRule';
|
|
340
342
|
|
|
@@ -350,6 +352,14 @@ export function isViewRulePredicate(item: unknown): item is ViewRulePredicate {
|
|
|
350
352
|
return reflection.isInstance(item, ViewRulePredicate);
|
|
351
353
|
}
|
|
352
354
|
|
|
355
|
+
export type ViewRuleStyleOrGlobalRef = ViewRuleGlobalStyle | ViewRuleStyle;
|
|
356
|
+
|
|
357
|
+
export const ViewRuleStyleOrGlobalRef = 'ViewRuleStyleOrGlobalRef';
|
|
358
|
+
|
|
359
|
+
export function isViewRuleStyleOrGlobalRef(item: unknown): item is ViewRuleStyleOrGlobalRef {
|
|
360
|
+
return reflection.isInstance(item, ViewRuleStyleOrGlobalRef);
|
|
361
|
+
}
|
|
362
|
+
|
|
353
363
|
export type WhereElement = WhereElementKind | WhereElementTag;
|
|
354
364
|
|
|
355
365
|
export const WhereElement = 'WhereElement';
|
|
@@ -420,7 +430,7 @@ export function isArrowProperty(item: unknown): item is ArrowProperty {
|
|
|
420
430
|
}
|
|
421
431
|
|
|
422
432
|
export interface BorderProperty extends AstNode {
|
|
423
|
-
readonly $container: CustomElementProperties | ElementStyleProperty | GlobalStyle | ViewRuleStyle;
|
|
433
|
+
readonly $container: CustomElementProperties | ElementStyleProperty | GlobalStyle | ViewRuleGroup | ViewRuleStyle;
|
|
424
434
|
readonly $type: 'BorderProperty';
|
|
425
435
|
key: 'border';
|
|
426
436
|
value: BorderStyleValue;
|
|
@@ -433,7 +443,7 @@ export function isBorderProperty(item: unknown): item is BorderProperty {
|
|
|
433
443
|
}
|
|
434
444
|
|
|
435
445
|
export interface ColorProperty extends AstNode {
|
|
436
|
-
readonly $container: CustomElementProperties | CustomRelationProperties | ElementStyleProperty | GlobalStyle | RelationStyleProperty | SpecificationRelationshipKind | ViewRuleStyle;
|
|
446
|
+
readonly $container: CustomElementProperties | CustomRelationProperties | ElementStyleProperty | GlobalStyle | RelationStyleProperty | SpecificationRelationshipKind | ViewRuleGroup | ViewRuleStyle;
|
|
437
447
|
readonly $type: 'ColorProperty';
|
|
438
448
|
customColor?: Reference<CustomColor>;
|
|
439
449
|
key: 'color';
|
|
@@ -788,7 +798,7 @@ export function isElementViewRef(item: unknown): item is ElementViewRef {
|
|
|
788
798
|
}
|
|
789
799
|
|
|
790
800
|
export interface ExcludePredicate extends AstNode {
|
|
791
|
-
readonly $container: ElementViewBody;
|
|
801
|
+
readonly $container: ElementViewBody | ViewRuleGroup;
|
|
792
802
|
readonly $type: 'ExcludePredicate';
|
|
793
803
|
predicates: Predicates;
|
|
794
804
|
}
|
|
@@ -853,7 +863,7 @@ export interface Globals extends AstNode {
|
|
|
853
863
|
readonly $container: LikeC4Grammar;
|
|
854
864
|
readonly $type: 'Globals';
|
|
855
865
|
name: 'global';
|
|
856
|
-
styles: Array<GlobalStyle>;
|
|
866
|
+
styles: Array<GlobalStyle | GlobalStyleGroup>;
|
|
857
867
|
}
|
|
858
868
|
|
|
859
869
|
export const Globals = 'Globals';
|
|
@@ -865,7 +875,7 @@ export function isGlobals(item: unknown): item is Globals {
|
|
|
865
875
|
export interface GlobalStyle extends AstNode {
|
|
866
876
|
readonly $container: Globals;
|
|
867
877
|
readonly $type: 'GlobalStyle';
|
|
868
|
-
|
|
878
|
+
id: GlobalStyleId;
|
|
869
879
|
props: Array<NotationProperty | StyleProperty>;
|
|
870
880
|
target: ElementExpressionsIterator;
|
|
871
881
|
}
|
|
@@ -876,6 +886,31 @@ export function isGlobalStyle(item: unknown): item is GlobalStyle {
|
|
|
876
886
|
return reflection.isInstance(item, GlobalStyle);
|
|
877
887
|
}
|
|
878
888
|
|
|
889
|
+
export interface GlobalStyleGroup extends AstNode {
|
|
890
|
+
readonly $container: Globals;
|
|
891
|
+
readonly $type: 'GlobalStyleGroup';
|
|
892
|
+
id: GlobalStyleId;
|
|
893
|
+
styles: Array<ViewRuleStyle>;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
export const GlobalStyleGroup = 'GlobalStyleGroup';
|
|
897
|
+
|
|
898
|
+
export function isGlobalStyleGroup(item: unknown): item is GlobalStyleGroup {
|
|
899
|
+
return reflection.isInstance(item, GlobalStyleGroup);
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
export interface GlobalStyleId extends AstNode {
|
|
903
|
+
readonly $container: GlobalStyle | GlobalStyleGroup;
|
|
904
|
+
readonly $type: 'GlobalStyleId';
|
|
905
|
+
name: string;
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
export const GlobalStyleId = 'GlobalStyleId';
|
|
909
|
+
|
|
910
|
+
export function isGlobalStyleId(item: unknown): item is GlobalStyleId {
|
|
911
|
+
return reflection.isInstance(item, GlobalStyleId);
|
|
912
|
+
}
|
|
913
|
+
|
|
879
914
|
export interface IconProperty extends AstNode {
|
|
880
915
|
readonly $container: CustomElementProperties | ElementBody | ElementStyleProperty | GlobalStyle | ViewRuleStyle;
|
|
881
916
|
readonly $type: 'IconProperty';
|
|
@@ -891,7 +926,7 @@ export function isIconProperty(item: unknown): item is IconProperty {
|
|
|
891
926
|
}
|
|
892
927
|
|
|
893
928
|
export interface IncludePredicate extends AstNode {
|
|
894
|
-
readonly $container: ElementViewBody;
|
|
929
|
+
readonly $container: ElementViewBody | ViewRuleGroup;
|
|
895
930
|
readonly $type: 'IncludePredicate';
|
|
896
931
|
predicates: Predicates;
|
|
897
932
|
}
|
|
@@ -1034,7 +1069,7 @@ export interface ModelViews extends AstNode {
|
|
|
1034
1069
|
readonly $container: LikeC4Grammar;
|
|
1035
1070
|
readonly $type: 'ModelViews';
|
|
1036
1071
|
name: 'views';
|
|
1037
|
-
styles: Array<
|
|
1072
|
+
styles: Array<ViewRuleStyleOrGlobalRef>;
|
|
1038
1073
|
views: Array<LikeC4View>;
|
|
1039
1074
|
}
|
|
1040
1075
|
|
|
@@ -1084,7 +1119,7 @@ export function isNotesProperty(item: unknown): item is NotesProperty {
|
|
|
1084
1119
|
}
|
|
1085
1120
|
|
|
1086
1121
|
export interface OpacityProperty extends AstNode {
|
|
1087
|
-
readonly $container: CustomElementProperties | ElementStyleProperty | GlobalStyle | ViewRuleStyle;
|
|
1122
|
+
readonly $container: CustomElementProperties | ElementStyleProperty | GlobalStyle | ViewRuleGroup | ViewRuleStyle;
|
|
1088
1123
|
readonly $type: 'OpacityProperty';
|
|
1089
1124
|
key: 'opacity';
|
|
1090
1125
|
value: string;
|
|
@@ -1389,9 +1424,9 @@ export function isViewRuleAutoLayout(item: unknown): item is ViewRuleAutoLayout
|
|
|
1389
1424
|
}
|
|
1390
1425
|
|
|
1391
1426
|
export interface ViewRuleGlobalStyle extends AstNode {
|
|
1392
|
-
readonly $container: DynamicViewBody | ElementViewBody;
|
|
1427
|
+
readonly $container: DynamicViewBody | ElementViewBody | ModelViews;
|
|
1393
1428
|
readonly $type: 'ViewRuleGlobalStyle';
|
|
1394
|
-
style: Reference<
|
|
1429
|
+
style: Reference<GlobalStyleId>;
|
|
1395
1430
|
}
|
|
1396
1431
|
|
|
1397
1432
|
export const ViewRuleGlobalStyle = 'ViewRuleGlobalStyle';
|
|
@@ -1400,8 +1435,22 @@ export function isViewRuleGlobalStyle(item: unknown): item is ViewRuleGlobalStyl
|
|
|
1400
1435
|
return reflection.isInstance(item, ViewRuleGlobalStyle);
|
|
1401
1436
|
}
|
|
1402
1437
|
|
|
1438
|
+
export interface ViewRuleGroup extends AstNode {
|
|
1439
|
+
readonly $container: ElementViewBody | ViewRuleGroup;
|
|
1440
|
+
readonly $type: 'ViewRuleGroup';
|
|
1441
|
+
groupRules: Array<ViewRuleGroup | ViewRulePredicate>;
|
|
1442
|
+
props: Array<BorderProperty | ColorProperty | OpacityProperty>;
|
|
1443
|
+
title?: string;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
export const ViewRuleGroup = 'ViewRuleGroup';
|
|
1447
|
+
|
|
1448
|
+
export function isViewRuleGroup(item: unknown): item is ViewRuleGroup {
|
|
1449
|
+
return reflection.isInstance(item, ViewRuleGroup);
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1403
1452
|
export interface ViewRuleStyle extends AstNode {
|
|
1404
|
-
readonly $container: DynamicViewBody | ElementViewBody | ModelViews;
|
|
1453
|
+
readonly $container: DynamicViewBody | ElementViewBody | GlobalStyleGroup | ModelViews;
|
|
1405
1454
|
readonly $type: 'ViewRuleStyle';
|
|
1406
1455
|
props: Array<NotationProperty | StyleProperty>;
|
|
1407
1456
|
target: ElementExpressionsIterator;
|
|
@@ -1573,6 +1622,8 @@ export type LikeC4AstType = {
|
|
|
1573
1622
|
ExtendElementBody: ExtendElementBody
|
|
1574
1623
|
FqnElementRef: FqnElementRef
|
|
1575
1624
|
GlobalStyle: GlobalStyle
|
|
1625
|
+
GlobalStyleGroup: GlobalStyleGroup
|
|
1626
|
+
GlobalStyleId: GlobalStyleId
|
|
1576
1627
|
Globals: Globals
|
|
1577
1628
|
IconProperty: IconProperty
|
|
1578
1629
|
InOutRelationExpression: InOutRelationExpression
|
|
@@ -1626,8 +1677,10 @@ export type LikeC4AstType = {
|
|
|
1626
1677
|
ViewRule: ViewRule
|
|
1627
1678
|
ViewRuleAutoLayout: ViewRuleAutoLayout
|
|
1628
1679
|
ViewRuleGlobalStyle: ViewRuleGlobalStyle
|
|
1680
|
+
ViewRuleGroup: ViewRuleGroup
|
|
1629
1681
|
ViewRulePredicate: ViewRulePredicate
|
|
1630
1682
|
ViewRuleStyle: ViewRuleStyle
|
|
1683
|
+
ViewRuleStyleOrGlobalRef: ViewRuleStyleOrGlobalRef
|
|
1631
1684
|
ViewStringProperty: ViewStringProperty
|
|
1632
1685
|
WhereBinaryExpression: WhereBinaryExpression
|
|
1633
1686
|
WhereElement: WhereElement
|
|
@@ -1649,7 +1702,7 @@ export type LikeC4AstType = {
|
|
|
1649
1702
|
export class LikeC4AstReflection extends AbstractAstReflection {
|
|
1650
1703
|
|
|
1651
1704
|
getAllTypes(): string[] {
|
|
1652
|
-
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, 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, ViewRulePredicate, ViewRuleStyle, ViewStringProperty, WhereBinaryExpression, WhereElement, WhereElementExpression, WhereElementKind, WhereElementNegation, WhereElementTag, WhereExpression, WhereKindEqual, WhereRelation, WhereRelationExpression, WhereRelationKind, WhereRelationNegation, WhereRelationTag, WhereTagEqual, WildcardExpression];
|
|
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];
|
|
1653
1706
|
}
|
|
1654
1707
|
|
|
1655
1708
|
protected override computeIsSubtype(subtype: string, supertype: string): boolean {
|
|
@@ -1744,10 +1797,14 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
1744
1797
|
return this.isSubtype(RelationProperty, supertype) || this.isSubtype(StringProperty, supertype);
|
|
1745
1798
|
}
|
|
1746
1799
|
case ViewRuleAutoLayout:
|
|
1800
|
+
case ViewRuleStyleOrGlobalRef: {
|
|
1801
|
+
return this.isSubtype(DynamicViewRule, supertype) || this.isSubtype(ViewRule, supertype);
|
|
1802
|
+
}
|
|
1747
1803
|
case ViewRuleGlobalStyle:
|
|
1748
1804
|
case ViewRuleStyle: {
|
|
1749
|
-
return this.isSubtype(
|
|
1805
|
+
return this.isSubtype(ViewRuleStyleOrGlobalRef, supertype);
|
|
1750
1806
|
}
|
|
1807
|
+
case ViewRuleGroup:
|
|
1751
1808
|
case ViewRulePredicate: {
|
|
1752
1809
|
return this.isSubtype(ViewRule, supertype);
|
|
1753
1810
|
}
|
|
@@ -1827,7 +1884,7 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
1827
1884
|
return LikeC4View;
|
|
1828
1885
|
}
|
|
1829
1886
|
case 'ViewRuleGlobalStyle:style': {
|
|
1830
|
-
return
|
|
1887
|
+
return GlobalStyleId;
|
|
1831
1888
|
}
|
|
1832
1889
|
default: {
|
|
1833
1890
|
throw new Error(`${referenceId} is not a valid reference id.`);
|
|
@@ -2157,12 +2214,29 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
2157
2214
|
return {
|
|
2158
2215
|
name: GlobalStyle,
|
|
2159
2216
|
properties: [
|
|
2160
|
-
{ name: '
|
|
2217
|
+
{ name: 'id' },
|
|
2161
2218
|
{ name: 'props', defaultValue: [] },
|
|
2162
2219
|
{ name: 'target' }
|
|
2163
2220
|
]
|
|
2164
2221
|
};
|
|
2165
2222
|
}
|
|
2223
|
+
case GlobalStyleGroup: {
|
|
2224
|
+
return {
|
|
2225
|
+
name: GlobalStyleGroup,
|
|
2226
|
+
properties: [
|
|
2227
|
+
{ name: 'id' },
|
|
2228
|
+
{ name: 'styles', defaultValue: [] }
|
|
2229
|
+
]
|
|
2230
|
+
};
|
|
2231
|
+
}
|
|
2232
|
+
case GlobalStyleId: {
|
|
2233
|
+
return {
|
|
2234
|
+
name: GlobalStyleId,
|
|
2235
|
+
properties: [
|
|
2236
|
+
{ name: 'name' }
|
|
2237
|
+
]
|
|
2238
|
+
};
|
|
2239
|
+
}
|
|
2166
2240
|
case IconProperty: {
|
|
2167
2241
|
return {
|
|
2168
2242
|
name: IconProperty,
|
|
@@ -2528,6 +2602,16 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
2528
2602
|
]
|
|
2529
2603
|
};
|
|
2530
2604
|
}
|
|
2605
|
+
case ViewRuleGroup: {
|
|
2606
|
+
return {
|
|
2607
|
+
name: ViewRuleGroup,
|
|
2608
|
+
properties: [
|
|
2609
|
+
{ name: 'groupRules', defaultValue: [] },
|
|
2610
|
+
{ name: 'props', defaultValue: [] },
|
|
2611
|
+
{ name: 'title' }
|
|
2612
|
+
]
|
|
2613
|
+
};
|
|
2614
|
+
}
|
|
2531
2615
|
case ViewRuleStyle: {
|
|
2532
2616
|
return {
|
|
2533
2617
|
name: ViewRuleStyle,
|