@likec4/language-server 1.8.1 → 1.10.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 +21 -0
- package/dist/browser.d.cts +22 -0
- package/dist/browser.d.mts +22 -0
- package/dist/browser.d.ts +22 -0
- package/dist/browser.mjs +19 -0
- package/dist/index.cjs +10 -0
- package/dist/index.d.cts +18 -0
- package/dist/index.d.mts +18 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.mjs +1 -0
- package/dist/likec4lib.cjs +961 -0
- package/dist/likec4lib.d.cts +6 -0
- package/dist/likec4lib.d.mts +6 -0
- package/dist/likec4lib.d.ts +6 -0
- package/dist/likec4lib.mjs +957 -0
- package/dist/model-graph/index.cjs +10 -0
- package/dist/model-graph/index.d.cts +79 -0
- package/dist/model-graph/index.d.mts +79 -0
- package/dist/model-graph/index.d.ts +79 -0
- package/dist/model-graph/index.mjs +1 -0
- package/dist/node.cjs +18 -0
- package/dist/node.d.cts +20 -0
- package/dist/node.d.mts +20 -0
- package/dist/node.d.ts +20 -0
- package/dist/node.mjs +16 -0
- package/dist/protocol.cjs +25 -0
- package/dist/protocol.d.cts +43 -0
- package/dist/protocol.d.mts +43 -0
- package/dist/protocol.d.ts +43 -0
- package/dist/protocol.mjs +17 -0
- package/dist/shared/language-server.CjFzaJwI.d.cts +1223 -0
- package/dist/shared/language-server.CtKHXJDD.d.ts +1223 -0
- package/dist/shared/language-server.D-84I33F.d.mts +1223 -0
- package/dist/shared/language-server.DBJJUUgF.mjs +5737 -0
- package/dist/shared/language-server.DtBRb9os.mjs +1656 -0
- package/dist/shared/language-server.DwyCJvXm.cjs +1669 -0
- package/dist/shared/language-server.JWkqVjGv.cjs +5748 -0
- package/package.json +36 -20
- package/src/ast.ts +48 -36
- package/src/browser.ts +0 -3
- package/src/elementRef.ts +1 -1
- package/src/formatting/LikeC4Formatter.ts +388 -0
- package/src/formatting/utils.ts +26 -0
- package/src/generated/ast.ts +170 -12
- package/src/generated/grammar.ts +1 -1
- package/src/generated-lib/icons.ts +1 -1
- package/src/like-c4.langium +49 -8
- package/src/likec4lib.ts +2 -3
- package/src/logger.ts +9 -1
- package/src/lsp/DocumentLinkProvider.ts +27 -15
- package/src/lsp/RenameProvider.ts +8 -0
- package/src/lsp/SemanticTokenProvider.ts +20 -2
- package/src/lsp/index.ts +1 -0
- package/src/model/fqn-computation.ts +33 -23
- package/src/model/fqn-index.ts +5 -21
- package/src/model/model-builder.ts +180 -112
- package/src/model/model-locator.ts +1 -1
- package/src/model/model-parser-where.ts +3 -2
- package/src/model/model-parser.ts +99 -39
- package/src/model-graph/LikeC4ModelGraph.ts +42 -21
- package/src/model-graph/compute-view/__test__/fixture.ts +16 -14
- package/src/model-graph/compute-view/compute.ts +110 -81
- package/src/model-graph/compute-view/predicates.ts +6 -8
- package/src/model-graph/dynamic-view/__test__/fixture.ts +1 -0
- package/src/model-graph/dynamic-view/compute.ts +98 -61
- package/src/model-graph/utils/buildElementNotations.ts +1 -1
- package/src/model-graph/utils/elementExpressionToPredicate.ts +1 -1
- package/src/model-graph/utils/sortNodes.ts +2 -6
- package/src/module.ts +21 -4
- package/src/protocol.ts +4 -5
- package/src/references/scope-computation.ts +10 -1
- package/src/references/scope-provider.ts +2 -1
- package/src/shared/NodeKindProvider.ts +73 -34
- package/src/test/setup.ts +3 -8
- package/src/test/testServices.ts +27 -7
- package/src/utils/graphlib.ts +11 -0
- package/src/validation/index.ts +2 -1
- package/src/validation/property-checks.ts +13 -1
- package/src/validation/specification.ts +3 -3
- package/src/view-utils/manual-layout.ts +1 -1
- package/src/view-utils/resolve-extended-views.ts +19 -10
- package/src/view-utils/resolve-relative-paths.ts +19 -24
- package/src/view-utils/view-hash.ts +1 -1
- package/src/reset.d.ts +0 -2
package/src/generated/ast.ts
CHANGED
|
@@ -10,7 +10,8 @@ import { AbstractAstReflection } from 'langium';
|
|
|
10
10
|
export const LikeC4Terminals = {
|
|
11
11
|
BLOCK_COMMENT: /\/\*[\s\S]*?\*\//,
|
|
12
12
|
LINE_COMMENT: /\/\/[^\n\r]*/,
|
|
13
|
-
WS:
|
|
13
|
+
WS: /[\t ]+/,
|
|
14
|
+
NL: /[\r\n]+/,
|
|
14
15
|
LIB_ICON: /(aws|gcp|tech):[-\w]*/,
|
|
15
16
|
URI_WITH_SCHEMA: /\w+:\/\/\S+/,
|
|
16
17
|
URI_RELATIVE: /\.{0,2}\/[^\/]\S+/,
|
|
@@ -24,6 +25,7 @@ export const LikeC4Terminals = {
|
|
|
24
25
|
Percent: /\b\d+%/,
|
|
25
26
|
String: /"[^"]*"|'[^']*'/,
|
|
26
27
|
IdTerminal: /[_]*[a-zA-Z][-\w]*/,
|
|
28
|
+
Hex: /[a-zA-Z0-9]+/,
|
|
27
29
|
};
|
|
28
30
|
|
|
29
31
|
export type ArrowType = 'crow' | 'diamond' | 'dot' | 'none' | 'normal' | 'odiamond' | 'odot' | 'onormal' | 'open' | 'vee';
|
|
@@ -38,6 +40,18 @@ export function isBorderStyleValue(item: unknown): item is BorderStyleValue {
|
|
|
38
40
|
return isLineOptions(item) || item === 'none';
|
|
39
41
|
}
|
|
40
42
|
|
|
43
|
+
export type CustomColorId = 'element' | 'model' | ArrowType | ElementShape | LineOptions | string;
|
|
44
|
+
|
|
45
|
+
export function isCustomColorId(item: unknown): item is CustomColorId {
|
|
46
|
+
return isElementShape(item) || isArrowType(item) || isLineOptions(item) || item === 'element' || item === 'model' || (typeof item === 'string' && (/[_]*[a-zA-Z][-\w]*/.test(item)));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type CustomColorValue = string;
|
|
50
|
+
|
|
51
|
+
export function isCustomColorValue(item: unknown): item is CustomColorValue {
|
|
52
|
+
return typeof item === 'string';
|
|
53
|
+
}
|
|
54
|
+
|
|
41
55
|
export type DotId = string;
|
|
42
56
|
|
|
43
57
|
export function isDotId(item: unknown): item is DotId {
|
|
@@ -156,7 +170,7 @@ export function isRelationPredicateOrWhere(item: unknown): item is RelationPredi
|
|
|
156
170
|
return reflection.isInstance(item, RelationPredicateOrWhere);
|
|
157
171
|
}
|
|
158
172
|
|
|
159
|
-
export type RelationProperty = LinkProperty | MetadataProperty | RelationStringProperty | RelationStyleProperty;
|
|
173
|
+
export type RelationProperty = LinkProperty | MetadataProperty | RelationNavigateToProperty | RelationStringProperty | RelationStyleProperty;
|
|
160
174
|
|
|
161
175
|
export const RelationProperty = 'RelationProperty';
|
|
162
176
|
|
|
@@ -172,7 +186,7 @@ export function isRelationshipStyleProperty(item: unknown): item is Relationship
|
|
|
172
186
|
return reflection.isInstance(item, RelationshipStyleProperty);
|
|
173
187
|
}
|
|
174
188
|
|
|
175
|
-
export type StringProperty = ElementStringProperty | MetadataAttribute | NotationProperty | RelationStringProperty | SpecificationElementStringProperty | SpecificationRelationshipStringProperty | ViewStringProperty;
|
|
189
|
+
export type StringProperty = ElementStringProperty | MetadataAttribute | NotationProperty | NotesProperty | RelationStringProperty | SpecificationElementStringProperty | SpecificationRelationshipStringProperty | ViewStringProperty;
|
|
176
190
|
|
|
177
191
|
export const StringProperty = 'StringProperty';
|
|
178
192
|
|
|
@@ -321,8 +335,9 @@ export function isBorderProperty(item: unknown): item is BorderProperty {
|
|
|
321
335
|
export interface ColorProperty extends AstNode {
|
|
322
336
|
readonly $container: CustomElementProperties | CustomRelationProperties | ElementStyleProperty | RelationStyleProperty | SpecificationRelationshipKind | ViewRuleStyle;
|
|
323
337
|
readonly $type: 'ColorProperty';
|
|
338
|
+
customColor?: Reference<CustomColor>;
|
|
324
339
|
key: 'color';
|
|
325
|
-
|
|
340
|
+
themeColor?: ThemeColor;
|
|
326
341
|
}
|
|
327
342
|
|
|
328
343
|
export const ColorProperty = 'ColorProperty';
|
|
@@ -331,6 +346,18 @@ export function isColorProperty(item: unknown): item is ColorProperty {
|
|
|
331
346
|
return reflection.isInstance(item, ColorProperty);
|
|
332
347
|
}
|
|
333
348
|
|
|
349
|
+
export interface CustomColor extends AstNode {
|
|
350
|
+
readonly $container: SpecificationColor;
|
|
351
|
+
readonly $type: 'CustomColor';
|
|
352
|
+
name: CustomColorId;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export const CustomColor = 'CustomColor';
|
|
356
|
+
|
|
357
|
+
export function isCustomColor(item: unknown): item is CustomColor {
|
|
358
|
+
return reflection.isInstance(item, CustomColor);
|
|
359
|
+
}
|
|
360
|
+
|
|
334
361
|
export interface CustomElementProperties extends AstNode {
|
|
335
362
|
readonly $container: ElementPredicateWith;
|
|
336
363
|
readonly $type: 'CustomElementProperties';
|
|
@@ -346,7 +373,7 @@ export function isCustomElementProperties(item: unknown): item is CustomElementP
|
|
|
346
373
|
export interface CustomRelationProperties extends AstNode {
|
|
347
374
|
readonly $container: DynamicViewStep | RelationPredicateWith;
|
|
348
375
|
readonly $type: 'CustomRelationProperties';
|
|
349
|
-
props: Array<NotationProperty | RelationStringProperty | RelationshipStyleProperty>;
|
|
376
|
+
props: Array<NotationProperty | NotesProperty | RelationNavigateToProperty | RelationStringProperty | RelationshipStyleProperty>;
|
|
350
377
|
}
|
|
351
378
|
|
|
352
379
|
export const CustomRelationProperties = 'CustomRelationProperties';
|
|
@@ -386,7 +413,7 @@ export interface DynamicViewBody extends AstNode {
|
|
|
386
413
|
readonly $type: 'DynamicViewBody';
|
|
387
414
|
props: Array<ViewProperty>;
|
|
388
415
|
rules: Array<DynamicViewRule>;
|
|
389
|
-
steps: Array<DynamicViewStep>;
|
|
416
|
+
steps: Array<DynamicViewParallelSteps | DynamicViewStep>;
|
|
390
417
|
tags?: Tags;
|
|
391
418
|
}
|
|
392
419
|
|
|
@@ -408,6 +435,18 @@ export function isDynamicViewIncludePredicate(item: unknown): item is DynamicVie
|
|
|
408
435
|
return reflection.isInstance(item, DynamicViewIncludePredicate);
|
|
409
436
|
}
|
|
410
437
|
|
|
438
|
+
export interface DynamicViewParallelSteps extends AstNode {
|
|
439
|
+
readonly $container: DynamicViewBody;
|
|
440
|
+
readonly $type: 'DynamicViewParallelSteps';
|
|
441
|
+
steps: Array<DynamicViewStep>;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
export const DynamicViewParallelSteps = 'DynamicViewParallelSteps';
|
|
445
|
+
|
|
446
|
+
export function isDynamicViewParallelSteps(item: unknown): item is DynamicViewParallelSteps {
|
|
447
|
+
return reflection.isInstance(item, DynamicViewParallelSteps);
|
|
448
|
+
}
|
|
449
|
+
|
|
411
450
|
export interface DynamicViewPredicateIterator extends AstNode {
|
|
412
451
|
readonly $container: DynamicViewIncludePredicate | DynamicViewPredicateIterator;
|
|
413
452
|
readonly $type: 'DynamicViewPredicateIterator';
|
|
@@ -421,8 +460,20 @@ export function isDynamicViewPredicateIterator(item: unknown): item is DynamicVi
|
|
|
421
460
|
return reflection.isInstance(item, DynamicViewPredicateIterator);
|
|
422
461
|
}
|
|
423
462
|
|
|
463
|
+
export interface DynamicViewRef extends AstNode {
|
|
464
|
+
readonly $container: RelationNavigateToProperty;
|
|
465
|
+
readonly $type: 'DynamicViewRef';
|
|
466
|
+
view: Reference<DynamicView>;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
export const DynamicViewRef = 'DynamicViewRef';
|
|
470
|
+
|
|
471
|
+
export function isDynamicViewRef(item: unknown): item is DynamicViewRef {
|
|
472
|
+
return reflection.isInstance(item, DynamicViewRef);
|
|
473
|
+
}
|
|
474
|
+
|
|
424
475
|
export interface DynamicViewStep extends AstNode {
|
|
425
|
-
readonly $container: DynamicViewBody;
|
|
476
|
+
readonly $container: DynamicViewBody | DynamicViewParallelSteps;
|
|
426
477
|
readonly $type: 'DynamicViewStep';
|
|
427
478
|
custom?: CustomRelationProperties;
|
|
428
479
|
isBackward: boolean;
|
|
@@ -890,6 +941,19 @@ export function isNotationProperty(item: unknown): item is NotationProperty {
|
|
|
890
941
|
return reflection.isInstance(item, NotationProperty);
|
|
891
942
|
}
|
|
892
943
|
|
|
944
|
+
export interface NotesProperty extends AstNode {
|
|
945
|
+
readonly $container: CustomRelationProperties;
|
|
946
|
+
readonly $type: 'NotesProperty';
|
|
947
|
+
key: 'notes';
|
|
948
|
+
value: string;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
export const NotesProperty = 'NotesProperty';
|
|
952
|
+
|
|
953
|
+
export function isNotesProperty(item: unknown): item is NotesProperty {
|
|
954
|
+
return reflection.isInstance(item, NotesProperty);
|
|
955
|
+
}
|
|
956
|
+
|
|
893
957
|
export interface OpacityProperty extends AstNode {
|
|
894
958
|
readonly $container: CustomElementProperties | ElementStyleProperty | ViewRuleStyle;
|
|
895
959
|
readonly $type: 'OpacityProperty';
|
|
@@ -961,6 +1025,19 @@ export function isRelationBody(item: unknown): item is RelationBody {
|
|
|
961
1025
|
return reflection.isInstance(item, RelationBody);
|
|
962
1026
|
}
|
|
963
1027
|
|
|
1028
|
+
export interface RelationNavigateToProperty extends AstNode {
|
|
1029
|
+
readonly $container: CustomRelationProperties | RelationBody;
|
|
1030
|
+
readonly $type: 'RelationNavigateToProperty';
|
|
1031
|
+
key: 'navigateTo';
|
|
1032
|
+
value: DynamicViewRef;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
export const RelationNavigateToProperty = 'RelationNavigateToProperty';
|
|
1036
|
+
|
|
1037
|
+
export function isRelationNavigateToProperty(item: unknown): item is RelationNavigateToProperty {
|
|
1038
|
+
return reflection.isInstance(item, RelationNavigateToProperty);
|
|
1039
|
+
}
|
|
1040
|
+
|
|
964
1041
|
export interface RelationPredicateWhere extends AstNode {
|
|
965
1042
|
readonly $container: Predicates | RelationPredicateWith;
|
|
966
1043
|
readonly $type: 'RelationPredicateWhere';
|
|
@@ -1038,6 +1115,19 @@ export function isShapeProperty(item: unknown): item is ShapeProperty {
|
|
|
1038
1115
|
return reflection.isInstance(item, ShapeProperty);
|
|
1039
1116
|
}
|
|
1040
1117
|
|
|
1118
|
+
export interface SpecificationColor extends AstNode {
|
|
1119
|
+
readonly $container: SpecificationRule;
|
|
1120
|
+
readonly $type: 'SpecificationColor';
|
|
1121
|
+
color: CustomColorValue;
|
|
1122
|
+
name: CustomColor;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
export const SpecificationColor = 'SpecificationColor';
|
|
1126
|
+
|
|
1127
|
+
export function isSpecificationColor(item: unknown): item is SpecificationColor {
|
|
1128
|
+
return reflection.isInstance(item, SpecificationColor);
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1041
1131
|
export interface SpecificationElementKind extends AstNode {
|
|
1042
1132
|
readonly $container: SpecificationRule;
|
|
1043
1133
|
readonly $type: 'SpecificationElementKind';
|
|
@@ -1093,6 +1183,7 @@ export function isSpecificationRelationshipStringProperty(item: unknown): item i
|
|
|
1093
1183
|
export interface SpecificationRule extends AstNode {
|
|
1094
1184
|
readonly $container: LikeC4Grammar;
|
|
1095
1185
|
readonly $type: 'SpecificationRule';
|
|
1186
|
+
colors: Array<SpecificationColor>;
|
|
1096
1187
|
elements: Array<SpecificationElementKind>;
|
|
1097
1188
|
name: 'specification';
|
|
1098
1189
|
relationships: Array<SpecificationRelationshipKind>;
|
|
@@ -1302,13 +1393,16 @@ export type LikeC4AstType = {
|
|
|
1302
1393
|
ArrowProperty: ArrowProperty
|
|
1303
1394
|
BorderProperty: BorderProperty
|
|
1304
1395
|
ColorProperty: ColorProperty
|
|
1396
|
+
CustomColor: CustomColor
|
|
1305
1397
|
CustomElementProperties: CustomElementProperties
|
|
1306
1398
|
CustomRelationProperties: CustomRelationProperties
|
|
1307
1399
|
DirectedRelationExpression: DirectedRelationExpression
|
|
1308
1400
|
DynamicView: DynamicView
|
|
1309
1401
|
DynamicViewBody: DynamicViewBody
|
|
1310
1402
|
DynamicViewIncludePredicate: DynamicViewIncludePredicate
|
|
1403
|
+
DynamicViewParallelSteps: DynamicViewParallelSteps
|
|
1311
1404
|
DynamicViewPredicateIterator: DynamicViewPredicateIterator
|
|
1405
|
+
DynamicViewRef: DynamicViewRef
|
|
1312
1406
|
DynamicViewRule: DynamicViewRule
|
|
1313
1407
|
DynamicViewStep: DynamicViewStep
|
|
1314
1408
|
Element: Element
|
|
@@ -1352,6 +1446,7 @@ export type LikeC4AstType = {
|
|
|
1352
1446
|
ModelViews: ModelViews
|
|
1353
1447
|
NavigateToProperty: NavigateToProperty
|
|
1354
1448
|
NotationProperty: NotationProperty
|
|
1449
|
+
NotesProperty: NotesProperty
|
|
1355
1450
|
OpacityProperty: OpacityProperty
|
|
1356
1451
|
OutgoingRelationExpression: OutgoingRelationExpression
|
|
1357
1452
|
Predicate: Predicate
|
|
@@ -1359,6 +1454,7 @@ export type LikeC4AstType = {
|
|
|
1359
1454
|
Relation: Relation
|
|
1360
1455
|
RelationBody: RelationBody
|
|
1361
1456
|
RelationExpression: RelationExpression
|
|
1457
|
+
RelationNavigateToProperty: RelationNavigateToProperty
|
|
1362
1458
|
RelationPredicate: RelationPredicate
|
|
1363
1459
|
RelationPredicateOrWhere: RelationPredicateOrWhere
|
|
1364
1460
|
RelationPredicateWhere: RelationPredicateWhere
|
|
@@ -1369,6 +1465,7 @@ export type LikeC4AstType = {
|
|
|
1369
1465
|
RelationshipKind: RelationshipKind
|
|
1370
1466
|
RelationshipStyleProperty: RelationshipStyleProperty
|
|
1371
1467
|
ShapeProperty: ShapeProperty
|
|
1468
|
+
SpecificationColor: SpecificationColor
|
|
1372
1469
|
SpecificationElementKind: SpecificationElementKind
|
|
1373
1470
|
SpecificationElementStringProperty: SpecificationElementStringProperty
|
|
1374
1471
|
SpecificationRelationshipKind: SpecificationRelationshipKind
|
|
@@ -1406,7 +1503,7 @@ export type LikeC4AstType = {
|
|
|
1406
1503
|
export class LikeC4AstReflection extends AbstractAstReflection {
|
|
1407
1504
|
|
|
1408
1505
|
getAllTypes(): string[] {
|
|
1409
|
-
return [ArrowProperty, BorderProperty, ColorProperty, CustomElementProperties, CustomRelationProperties, DirectedRelationExpression, DynamicView, DynamicViewBody, DynamicViewIncludePredicate, DynamicViewPredicateIterator, 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, IconProperty, InOutRelationExpression, IncludePredicate, IncomingRelationExpression, LibIcon, LikeC4Grammar, LikeC4Lib, LikeC4View, LineProperty, LinkProperty, MetadataAttribute, MetadataBody, MetadataProperty, Model, ModelViews, NavigateToProperty, NotationProperty, OpacityProperty, OutgoingRelationExpression, Predicate, Predicates, Relation, RelationBody, RelationExpression, RelationPredicate, RelationPredicateOrWhere, RelationPredicateWhere, RelationPredicateWith, RelationProperty, RelationStringProperty, RelationStyleProperty, RelationshipKind, RelationshipStyleProperty, ShapeProperty, SpecificationElementKind, SpecificationElementStringProperty, SpecificationRelationshipKind, SpecificationRelationshipStringProperty, SpecificationRule, SpecificationTag, StringProperty, StyleProperty, Tag, Tags, ViewProperty, ViewRef, ViewRule, ViewRuleAutoLayout, ViewRulePredicate, ViewRuleStyle, ViewStringProperty, WhereBinaryExpression, WhereElement, WhereElementExpression, WhereElementKind, WhereElementNegation, WhereElementTag, WhereExpression, WhereKindEqual, WhereRelation, WhereRelationExpression, WhereRelationKind, WhereRelationNegation, WhereRelationTag, WhereTagEqual, WildcardExpression];
|
|
1506
|
+
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, 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, ViewRulePredicate, ViewRuleStyle, ViewStringProperty, WhereBinaryExpression, WhereElement, WhereElementExpression, WhereElementKind, WhereElementNegation, WhereElementTag, WhereExpression, WhereKindEqual, WhereRelation, WhereRelationExpression, WhereRelationKind, WhereRelationNegation, WhereRelationTag, WhereTagEqual, WildcardExpression];
|
|
1410
1507
|
}
|
|
1411
1508
|
|
|
1412
1509
|
protected override computeIsSubtype(subtype: string, supertype: string): boolean {
|
|
@@ -1474,6 +1571,7 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
1474
1571
|
}
|
|
1475
1572
|
case MetadataAttribute:
|
|
1476
1573
|
case NotationProperty:
|
|
1574
|
+
case NotesProperty:
|
|
1477
1575
|
case SpecificationElementStringProperty:
|
|
1478
1576
|
case SpecificationRelationshipStringProperty: {
|
|
1479
1577
|
return this.isSubtype(StringProperty, supertype);
|
|
@@ -1488,6 +1586,10 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
1488
1586
|
case RelationPredicateWhere: {
|
|
1489
1587
|
return this.isSubtype(RelationPredicateOrWhere, supertype);
|
|
1490
1588
|
}
|
|
1589
|
+
case RelationNavigateToProperty:
|
|
1590
|
+
case RelationStyleProperty: {
|
|
1591
|
+
return this.isSubtype(RelationProperty, supertype);
|
|
1592
|
+
}
|
|
1491
1593
|
case RelationPredicateOrWhere:
|
|
1492
1594
|
case RelationPredicateWith: {
|
|
1493
1595
|
return this.isSubtype(RelationPredicate, supertype);
|
|
@@ -1495,9 +1597,6 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
1495
1597
|
case RelationStringProperty: {
|
|
1496
1598
|
return this.isSubtype(RelationProperty, supertype) || this.isSubtype(StringProperty, supertype);
|
|
1497
1599
|
}
|
|
1498
|
-
case RelationStyleProperty: {
|
|
1499
|
-
return this.isSubtype(RelationProperty, supertype);
|
|
1500
|
-
}
|
|
1501
1600
|
case ViewRuleAutoLayout:
|
|
1502
1601
|
case ViewRuleStyle: {
|
|
1503
1602
|
return this.isSubtype(DynamicViewRule, supertype) || this.isSubtype(ViewRule, supertype);
|
|
@@ -1544,6 +1643,12 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
1544
1643
|
getReferenceType(refInfo: ReferenceInfo): string {
|
|
1545
1644
|
const referenceId = `${refInfo.container.$type}:${refInfo.property}`;
|
|
1546
1645
|
switch (referenceId) {
|
|
1646
|
+
case 'ColorProperty:customColor': {
|
|
1647
|
+
return CustomColor;
|
|
1648
|
+
}
|
|
1649
|
+
case 'DynamicViewRef:view': {
|
|
1650
|
+
return DynamicView;
|
|
1651
|
+
}
|
|
1547
1652
|
case 'DynamicViewStep:kind':
|
|
1548
1653
|
case 'OutgoingRelationExpression:kind':
|
|
1549
1654
|
case 'Relation:kind':
|
|
@@ -1604,8 +1709,17 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
1604
1709
|
return {
|
|
1605
1710
|
name: ColorProperty,
|
|
1606
1711
|
properties: [
|
|
1712
|
+
{ name: 'customColor' },
|
|
1607
1713
|
{ name: 'key' },
|
|
1608
|
-
{ name: '
|
|
1714
|
+
{ name: 'themeColor' }
|
|
1715
|
+
]
|
|
1716
|
+
};
|
|
1717
|
+
}
|
|
1718
|
+
case CustomColor: {
|
|
1719
|
+
return {
|
|
1720
|
+
name: CustomColor,
|
|
1721
|
+
properties: [
|
|
1722
|
+
{ name: 'name' }
|
|
1609
1723
|
]
|
|
1610
1724
|
};
|
|
1611
1725
|
}
|
|
@@ -1662,6 +1776,14 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
1662
1776
|
]
|
|
1663
1777
|
};
|
|
1664
1778
|
}
|
|
1779
|
+
case DynamicViewParallelSteps: {
|
|
1780
|
+
return {
|
|
1781
|
+
name: DynamicViewParallelSteps,
|
|
1782
|
+
properties: [
|
|
1783
|
+
{ name: 'steps', defaultValue: [] }
|
|
1784
|
+
]
|
|
1785
|
+
};
|
|
1786
|
+
}
|
|
1665
1787
|
case DynamicViewPredicateIterator: {
|
|
1666
1788
|
return {
|
|
1667
1789
|
name: DynamicViewPredicateIterator,
|
|
@@ -1671,6 +1793,14 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
1671
1793
|
]
|
|
1672
1794
|
};
|
|
1673
1795
|
}
|
|
1796
|
+
case DynamicViewRef: {
|
|
1797
|
+
return {
|
|
1798
|
+
name: DynamicViewRef,
|
|
1799
|
+
properties: [
|
|
1800
|
+
{ name: 'view' }
|
|
1801
|
+
]
|
|
1802
|
+
};
|
|
1803
|
+
}
|
|
1674
1804
|
case DynamicViewStep: {
|
|
1675
1805
|
return {
|
|
1676
1806
|
name: DynamicViewStep,
|
|
@@ -1997,6 +2127,15 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
1997
2127
|
]
|
|
1998
2128
|
};
|
|
1999
2129
|
}
|
|
2130
|
+
case NotesProperty: {
|
|
2131
|
+
return {
|
|
2132
|
+
name: NotesProperty,
|
|
2133
|
+
properties: [
|
|
2134
|
+
{ name: 'key' },
|
|
2135
|
+
{ name: 'value' }
|
|
2136
|
+
]
|
|
2137
|
+
};
|
|
2138
|
+
}
|
|
2000
2139
|
case OpacityProperty: {
|
|
2001
2140
|
return {
|
|
2002
2141
|
name: OpacityProperty,
|
|
@@ -2048,6 +2187,15 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
2048
2187
|
]
|
|
2049
2188
|
};
|
|
2050
2189
|
}
|
|
2190
|
+
case RelationNavigateToProperty: {
|
|
2191
|
+
return {
|
|
2192
|
+
name: RelationNavigateToProperty,
|
|
2193
|
+
properties: [
|
|
2194
|
+
{ name: 'key' },
|
|
2195
|
+
{ name: 'value' }
|
|
2196
|
+
]
|
|
2197
|
+
};
|
|
2198
|
+
}
|
|
2051
2199
|
case RelationPredicateWhere: {
|
|
2052
2200
|
return {
|
|
2053
2201
|
name: RelationPredicateWhere,
|
|
@@ -2101,6 +2249,15 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
2101
2249
|
]
|
|
2102
2250
|
};
|
|
2103
2251
|
}
|
|
2252
|
+
case SpecificationColor: {
|
|
2253
|
+
return {
|
|
2254
|
+
name: SpecificationColor,
|
|
2255
|
+
properties: [
|
|
2256
|
+
{ name: 'color' },
|
|
2257
|
+
{ name: 'name' }
|
|
2258
|
+
]
|
|
2259
|
+
};
|
|
2260
|
+
}
|
|
2104
2261
|
case SpecificationElementKind: {
|
|
2105
2262
|
return {
|
|
2106
2263
|
name: SpecificationElementKind,
|
|
@@ -2141,6 +2298,7 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
2141
2298
|
return {
|
|
2142
2299
|
name: SpecificationRule,
|
|
2143
2300
|
properties: [
|
|
2301
|
+
{ name: 'colors', defaultValue: [] },
|
|
2144
2302
|
{ name: 'elements', defaultValue: [] },
|
|
2145
2303
|
{ name: 'name' },
|
|
2146
2304
|
{ name: 'relationships', defaultValue: [] },
|