@likec4/language-server 0.46.1 → 0.48.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 (42) hide show
  1. package/contrib/likec4.monarch.ts +5 -8
  2. package/contrib/likec4.tmLanguage.json +1 -1
  3. package/dist/ast.d.ts +8 -3
  4. package/dist/ast.js +12 -8
  5. package/dist/generated/ast.d.ts +152 -110
  6. package/dist/generated/ast.js +149 -94
  7. package/dist/generated/grammar.js +1 -1
  8. package/dist/lsp/DocumentSymbolProvider.d.ts +7 -2
  9. package/dist/lsp/DocumentSymbolProvider.js +63 -56
  10. package/dist/lsp/HoverProvider.js +2 -8
  11. package/dist/lsp/SemanticTokenProvider.d.ts +1 -1
  12. package/dist/lsp/SemanticTokenProvider.js +17 -25
  13. package/dist/model/fqn-index.d.ts +2 -7
  14. package/dist/model/fqn-index.js +14 -26
  15. package/dist/model/model-builder.js +5 -3
  16. package/dist/model/model-parser.d.ts +3 -2
  17. package/dist/model/model-parser.js +111 -51
  18. package/dist/module.js +3 -2
  19. package/dist/references/scope-computation.js +35 -15
  20. package/dist/references/scope-provider.d.ts +1 -2
  21. package/dist/references/scope-provider.js +17 -25
  22. package/dist/shared/NodeKindProvider.d.ts +4 -2
  23. package/dist/shared/NodeKindProvider.js +40 -13
  24. package/dist/shared/WorkspaceSymbolProvider.d.ts +4 -0
  25. package/dist/shared/WorkspaceSymbolProvider.js +3 -0
  26. package/dist/shared/index.d.ts +2 -0
  27. package/dist/shared/index.js +2 -0
  28. package/dist/test/testServices.d.ts +5 -0
  29. package/dist/test/testServices.js +25 -13
  30. package/dist/validation/index.js +22 -14
  31. package/dist/validation/specification.js +2 -1
  32. package/dist/validation/view-predicates/custom-element-expr.d.ts +5 -0
  33. package/dist/validation/view-predicates/custom-element-expr.js +16 -0
  34. package/dist/validation/view-predicates/incoming.d.ts +1 -1
  35. package/dist/validation/view-predicates/incoming.js +1 -1
  36. package/dist/validation/view-predicates/index.d.ts +1 -0
  37. package/dist/validation/view-predicates/index.js +1 -0
  38. package/dist/validation/view-predicates/outgoing.d.ts +1 -1
  39. package/dist/validation/view-predicates/outgoing.js +1 -1
  40. package/dist/validation/view.js +1 -1
  41. package/dist/view-utils/assignNavigateTo.js +3 -0
  42. package/package.json +6 -5
@@ -1,16 +1,15 @@
1
1
  // Monarch syntax highlighting for the likec4 language.
2
2
  export default {
3
3
  keywords: [
4
- 'BottomTop','LeftRight','RightLeft','TopBottom','amber','autoLayout','blue','browser','color','crow','cylinder','dashed','description','diamond','dotted','element','exclude','extend','extends','gray','green','head','icon','include','indigo','it','kind','line','link','mobile','model','muted','none','normal','odiamond','of','onormal','open','person','primary','queue','rectangle','red','relationship','secondary','shape','sky','slate','solid','specification','storage','style','tag','tail','technology','this','title','vee','view','views'
4
+ 'BottomTop','LeftRight','RightLeft','TopBottom','amber','autoLayout','blue','browser','color','crow','cylinder','dashed','description','diamond','dotted','element','exclude','extend','extends','gray','green','head','icon','include','indigo','it','kind','line','link','mobile','model','muted','navigateTo','none','normal','odiamond','of','onormal','open','person','primary','queue','rectangle','red','relationship','secondary','shape','sky','slate','solid','specification','storage','style','tag','tail','technology','this','title','vee','view','views','with'
5
5
  ],
6
6
  operators: [
7
7
  '*'
8
8
  ],
9
- symbols: /\*|-\[|\]->/,
9
+ symbols: /\*|-\[|\]->|\{|\}/,
10
10
 
11
11
  tokenizer: {
12
12
  initial: [
13
- { regex: /#/, action: {"token":"HASH"} },
14
13
  { regex: /_/, action: {"token":"UNDERSCORE"} },
15
14
  { regex: /-/, action: {"token":"DASH"} },
16
15
  { regex: /[^\W\d_]/, action: { cases: { '@keywords': {"token":"keyword"}, '@default': {"token":"LETTER"} }} },
@@ -20,17 +19,15 @@ export default {
20
19
  { regex: /\.{0,2}\/[^\/]\S+/, action: {"token":"URI_RELATIVE"} },
21
20
  { regex: /->/, action: {"token":"RArrow"} },
22
21
  { regex: /\b\.\*/, action: {"token":"DotWildcard"} },
22
+ { regex: /\#\b/, action: {"token":"TagHash"} },
23
23
  { regex: /\b\./, action: {"token":"Dot"} },
24
- { regex: /!=/, action: {"token":"NotEqual"} },
24
+ { regex: /\!\={1,2}/, action: {"token":"NotEqual"} },
25
25
  { regex: /\={1,2}/, action: {"token":"Eq"} },
26
- { regex: /\{/, action: {"token":"OpenBlock"} },
27
- { regex: /\}/, action: {"token":"CloseBlock"} },
28
26
  { regex: /:/, action: {"token":"Colon"} },
29
27
  { regex: /;/, action: {"token":"SemiColon"} },
30
28
  { regex: /,/, action: {"token":"Comma"} },
31
29
  { regex: /"[^"]*"|'[^']*'/, action: {"token":"string"} },
32
- { regex: /((#)([^\W\d_])(((([^\W\d_])|([0-9]))|(_))|(-))*)/, action: {"token":"TagID"} },
33
- { regex: /((([^\W\d_])|(_))(((([^\W\d_])|([0-9]))|(_))|(-))*)/, action: { cases: { '@keywords': {"token":"keyword"}, '@default': {"token":"ID"} }} },
30
+ { regex: /((([^\W\d_])|((_)+(([^\W\d_])|([0-9]))))(((([^\W\d_])|([0-9]))|(_))|(-))*)/, action: { cases: { '@keywords': {"token":"keyword"}, '@default': {"token":"ID"} }} },
34
31
  { include: '@whitespace' },
35
32
  { regex: /@symbols/, action: { cases: { '@operators': {"token":"operator"}, '@default': {"token":""} }} },
36
33
  ],
@@ -12,7 +12,7 @@
12
12
  },
13
13
  {
14
14
  "name": "keyword.control.likec4",
15
- "match": "\\b(BottomTop|LeftRight|RightLeft|TopBottom|amber|autoLayout|blue|browser|color|crow|cylinder|dashed|description|diamond|dotted|element|exclude|extend|extends|gray|green|head|icon|include|indigo|it|kind|line|link|mobile|model|muted|none|normal|odiamond|of|onormal|open|person|primary|queue|rectangle|red|relationship|secondary|shape|sky|slate|solid|specification|storage|style|tag|tail|technology|this|title|vee|view|views)\\b"
15
+ "match": "\\b(BottomTop|LeftRight|RightLeft|TopBottom|amber|autoLayout|blue|browser|color|crow|cylinder|dashed|description|diamond|dotted|element|exclude|extend|extends|gray|green|head|icon|include|indigo|it|kind|line|link|mobile|model|muted|navigateTo|none|normal|odiamond|of|onormal|open|person|primary|queue|rectangle|red|relationship|secondary|shape|sky|slate|solid|specification|storage|style|tag|tail|technology|this|title|vee|view|views|with)\\b"
16
16
  },
17
17
  {
18
18
  "name": "string.quoted.double.likec4",
package/dist/ast.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { type c4 } from '@likec4/core';
3
3
  import type { LangiumDocument, MultiMap } from 'langium';
4
+ import type { SetRequired } from 'type-fest';
4
5
  import type { LikeC4Grammar } from './generated/ast';
5
6
  import * as ast from './generated/ast';
6
7
  export { ast };
@@ -81,8 +82,12 @@ export interface LikeC4DocumentProps {
81
82
  }
82
83
  export interface LikeC4LangiumDocument extends LangiumDocument<LikeC4Grammar>, LikeC4DocumentProps {
83
84
  }
84
- export type ParsedLikeC4LangiumDocument = Omit<LikeC4LangiumDocument, keyof LikeC4DocumentProps> & Required<LikeC4DocumentProps>;
85
+ export interface FqnIndexedDocument extends LangiumDocument<LikeC4Grammar>, SetRequired<LikeC4DocumentProps, 'c4fqns'> {
86
+ }
87
+ export interface ParsedLikeC4LangiumDocument extends LangiumDocument<LikeC4Grammar>, Required<LikeC4DocumentProps> {
88
+ }
85
89
  export declare function cleanParsedModel(doc: LikeC4LangiumDocument): ParsedLikeC4LangiumDocument;
90
+ export declare function isFqnIndexedDocument(doc: LangiumDocument): doc is FqnIndexedDocument;
86
91
  export declare function isLikeC4LangiumDocument(doc: LangiumDocument): doc is LikeC4LangiumDocument;
87
92
  export declare function isParsedLikeC4LangiumDocument(doc: LangiumDocument): doc is ParsedLikeC4LangiumDocument;
88
93
  export declare const isValidLikeC4LangiumDocument: (doc: LangiumDocument) => doc is ParsedLikeC4LangiumDocument;
@@ -91,7 +96,7 @@ export declare function resolveRelationPoints(node: ast.Relation): {
91
96
  source: ast.Element;
92
97
  target: ast.Element;
93
98
  };
94
- export declare function toElementStyle(props?: ast.StyleProperties['props']): {
99
+ export declare function toElementStyle(props?: Array<ast.StyleProperty>): {
95
100
  color?: c4.ThemeColor;
96
101
  shape?: c4.ElementShape;
97
102
  icon?: c4.IconUrl;
@@ -113,5 +118,5 @@ export declare function toRelationshipStyleExcludeDefaults(props?: ast.Specifica
113
118
  line?: "dotted" | "solid";
114
119
  color?: "amber" | "blue" | "green" | "indigo" | "muted" | "primary" | "red" | "secondary" | "sky" | "slate";
115
120
  };
116
- export declare function toAutoLayout(direction: ast.ViewRuleLayoutDirection): c4.ViewRuleAutoLayout['autoLayout'];
121
+ export declare function toAutoLayout(direction: ast.ViewLayoutDirection): c4.ViewRuleAutoLayout['autoLayout'];
117
122
  //# sourceMappingURL=ast.d.ts.map
package/dist/ast.js CHANGED
@@ -1,17 +1,18 @@
1
1
  import {
2
+ DefaultArrowType,
2
3
  DefaultElementShape,
4
+ DefaultLineStyle,
5
+ DefaultRelationshipColor,
3
6
  DefaultThemeColor,
4
7
  RelationRefError,
5
- nonexhaustive,
6
- DefaultLineStyle,
7
- DefaultArrowType,
8
- DefaultRelationshipColor
8
+ nonexhaustive
9
9
  } from "@likec4/core";
10
10
  import { DocumentState } from "langium";
11
+ import { isNil } from "remeda";
11
12
  import { elementRef } from "./elementRef.js";
12
13
  import * as ast from "./generated/ast.js";
13
14
  import { LikeC4LanguageMetaData } from "./generated/module.js";
14
- import { isNil } from "remeda";
15
+ import { DiagnosticSeverity } from "vscode-languageserver-protocol";
15
16
  export { ast };
16
17
  const idattr = Symbol.for("idattr");
17
18
  export const ElementViewOps = {
@@ -49,17 +50,20 @@ export function cleanParsedModel(doc) {
49
50
  Object.assign(doc, props);
50
51
  return doc;
51
52
  }
53
+ export function isFqnIndexedDocument(doc) {
54
+ return isLikeC4LangiumDocument(doc) && doc.state >= DocumentState.IndexedContent && !isNil(doc.c4fqns);
55
+ }
52
56
  export function isLikeC4LangiumDocument(doc) {
53
57
  return doc.textDocument.languageId === LikeC4LanguageMetaData.languageId;
54
58
  }
55
59
  export function isParsedLikeC4LangiumDocument(doc) {
56
- return isLikeC4LangiumDocument(doc) && doc.state >= DocumentState.Validated && !!doc.c4Specification && !!doc.c4Elements && !!doc.c4Relations && !!doc.c4Views && !!doc.c4fqns;
60
+ return isLikeC4LangiumDocument(doc) && doc.state == DocumentState.Validated && !!doc.c4Specification && !!doc.c4Elements && !!doc.c4Relations && !!doc.c4Views && !!doc.c4fqns;
57
61
  }
58
62
  export const isValidLikeC4LangiumDocument = (doc) => {
59
63
  if (!isParsedLikeC4LangiumDocument(doc))
60
64
  return false;
61
- const { state, parseResult, diagnostics } = doc;
62
- return state === DocumentState.Validated && parseResult.lexerErrors.length === 0 && (!diagnostics || diagnostics.every((d) => d.severity !== 1));
65
+ const { parseResult, diagnostics } = doc;
66
+ return parseResult.lexerErrors.length === 0 && (!diagnostics || diagnostics.every((d) => d.severity !== DiagnosticSeverity.Error));
63
67
  };
64
68
  export function* streamModel(doc) {
65
69
  const elements = doc.parseResult.value.models.flatMap((m) => m.elements);
@@ -12,31 +12,26 @@ export declare const LikeC4Terminals: {
12
12
  URI_RELATIVE: RegExp;
13
13
  RArrow: RegExp;
14
14
  DotWildcard: RegExp;
15
+ TagHash: RegExp;
15
16
  Dot: RegExp;
16
17
  NotEqual: RegExp;
17
18
  Eq: RegExp;
18
- OpenBlock: RegExp;
19
- CloseBlock: RegExp;
20
19
  Colon: RegExp;
21
20
  SemiColon: RegExp;
22
21
  Comma: RegExp;
23
22
  String: RegExp;
24
- TagID: RegExp;
25
23
  ID: RegExp;
26
24
  };
27
25
  export type ArrowType = 'crow' | 'diamond' | 'none' | 'normal' | 'odiamond' | 'onormal' | 'open' | 'vee';
28
26
  export declare function isArrowType(item: unknown): item is ArrowType;
29
- export type ElementExpression = ElementKindExpression | ElementRefExpression | ElementTagExpression | WildcardExpression;
30
- export declare const ElementExpression = "ElementExpression";
31
- export declare function isElementExpression(item: unknown): item is ElementExpression;
27
+ export type ElementExpr = DescedantsExpr | ElementKindExpr | ElementRef | ElementTagExpr | WildcardExpr;
28
+ export declare const ElementExpr = "ElementExpr";
29
+ export declare function isElementExpr(item: unknown): item is ElementExpr;
32
30
  export type ElementProperty = ElementStringProperty | LinkProperty | StyleProperties;
33
31
  export declare const ElementProperty = "ElementProperty";
34
32
  export declare function isElementProperty(item: unknown): item is ElementProperty;
35
33
  export type ElementShape = 'browser' | 'cylinder' | 'mobile' | 'person' | 'queue' | 'rectangle' | 'storage';
36
34
  export declare function isElementShape(item: unknown): item is ElementShape;
37
- export type Expression = ElementExpression | InOutExpression | IncomingExpression | OutgoingExpression | RelationExpression;
38
- export declare const Expression = "Expression";
39
- export declare function isExpression(item: unknown): item is Expression;
40
35
  export type LineOptions = 'dashed' | 'dotted' | 'solid';
41
36
  export declare function isLineOptions(item: unknown): item is LineOptions;
42
37
  export type Name = 'element' | 'model' | ArrowType | ElementShape | LineOptions | ThemeColor | string;
@@ -44,18 +39,32 @@ export declare function isName(item: unknown): item is Name;
44
39
  export type Relation = ExplicitRelation | ImplicitRelation;
45
40
  export declare const Relation = "Relation";
46
41
  export declare function isRelation(item: unknown): item is Relation;
42
+ export type RelationshipStyleProperty = ArrowProperty | ColorProperty | LineProperty;
43
+ export declare const RelationshipStyleProperty = "RelationshipStyleProperty";
44
+ export declare function isRelationshipStyleProperty(item: unknown): item is RelationshipStyleProperty;
45
+ export type StyleProperty = ColorProperty | IconProperty | ShapeProperty;
46
+ export declare const StyleProperty = "StyleProperty";
47
+ export declare function isStyleProperty(item: unknown): item is StyleProperty;
48
+ export type TagID = string;
49
+ export declare function isTagID(item: unknown): item is TagID;
47
50
  export type ThemeColor = 'amber' | 'blue' | 'gray' | 'green' | 'indigo' | 'muted' | 'primary' | 'red' | 'secondary' | 'sky' | 'slate';
48
51
  export declare function isThemeColor(item: unknown): item is ThemeColor;
49
52
  export type Uri = string;
50
53
  export declare function isUri(item: unknown): item is Uri;
51
- export type View = ElementView;
52
- export declare const View = "View";
53
- export declare function isView(item: unknown): item is View;
54
- export type ViewRule = ViewRuleAutoLayout | ViewRuleExpression | ViewRuleStyle;
54
+ export type ViewLayoutDirection = 'BottomTop' | 'LeftRight' | 'RightLeft' | 'TopBottom';
55
+ export declare function isViewLayoutDirection(item: unknown): item is ViewLayoutDirection;
56
+ export type ViewProperty = LinkProperty | ViewStringProperty;
57
+ export declare const ViewProperty = "ViewProperty";
58
+ export declare function isViewProperty(item: unknown): item is ViewProperty;
59
+ export type ViewRule = ViewRuleAutoLayout | ViewRulePredicate | ViewRuleStyle;
55
60
  export declare const ViewRule = "ViewRule";
56
61
  export declare function isViewRule(item: unknown): item is ViewRule;
57
- export type ViewRuleLayoutDirection = 'BottomTop' | 'LeftRight' | 'RightLeft' | 'TopBottom';
58
- export declare function isViewRuleLayoutDirection(item: unknown): item is ViewRuleLayoutDirection;
62
+ export type ViewRulePredicate = ExcludePredicate | IncludePredicate;
63
+ export declare const ViewRulePredicate = "ViewRulePredicate";
64
+ export declare function isViewRulePredicate(item: unknown): item is ViewRulePredicate;
65
+ export type ViewRulePredicateExpr = CustomElementExpr | ElementExpr | InOutExpr | IncomingExpr | OutgoingExpr | RelationExpr;
66
+ export declare const ViewRulePredicateExpr = "ViewRulePredicateExpr";
67
+ export declare function isViewRulePredicateExpr(item: unknown): item is ViewRulePredicateExpr;
59
68
  export interface ArrowProperty extends AstNode {
60
69
  readonly $container: SpecificationRelationshipKind;
61
70
  readonly $type: 'ArrowProperty';
@@ -65,13 +74,35 @@ export interface ArrowProperty extends AstNode {
65
74
  export declare const ArrowProperty = "ArrowProperty";
66
75
  export declare function isArrowProperty(item: unknown): item is ArrowProperty;
67
76
  export interface ColorProperty extends AstNode {
68
- readonly $container: SpecificationRelationshipKind | StyleProperties | ViewRuleStyle;
77
+ readonly $container: CustomElementExprBody | SpecificationRelationshipKind | StyleProperties | ViewRuleStyle;
69
78
  readonly $type: 'ColorProperty';
70
79
  key: 'color';
71
80
  value: ThemeColor;
72
81
  }
73
82
  export declare const ColorProperty = "ColorProperty";
74
83
  export declare function isColorProperty(item: unknown): item is ColorProperty;
84
+ export interface CustomElementExpr extends AstNode {
85
+ readonly $container: ExcludePredicate | IncludePredicate;
86
+ readonly $type: 'CustomElementExpr';
87
+ body: CustomElementExprBody;
88
+ target: ElementExpr;
89
+ }
90
+ export declare const CustomElementExpr = "CustomElementExpr";
91
+ export declare function isCustomElementExpr(item: unknown): item is CustomElementExpr;
92
+ export interface CustomElementExprBody extends AstNode {
93
+ readonly $container: CustomElementExpr;
94
+ readonly $type: 'CustomElementExprBody';
95
+ props: Array<ColorProperty | ElementStringProperty | NavigateToProperty | ShapeProperty>;
96
+ }
97
+ export declare const CustomElementExprBody = "CustomElementExprBody";
98
+ export declare function isCustomElementExprBody(item: unknown): item is CustomElementExprBody;
99
+ export interface DescedantsExpr extends AstNode {
100
+ readonly $container: CustomElementExpr | ExcludePredicate | IncludePredicate | IncomingExpr | OutgoingExpr | RelationExpr | ViewRuleStyle;
101
+ readonly $type: 'DescedantsExpr';
102
+ parent: ElementRef;
103
+ }
104
+ export declare const DescedantsExpr = "DescedantsExpr";
105
+ export declare function isDescedantsExpr(item: unknown): item is DescedantsExpr;
75
106
  export interface Element extends AstNode {
76
107
  readonly $container: ElementBody | ExtendElementBody | Model;
77
108
  readonly $type: 'Element';
@@ -98,46 +129,38 @@ export interface ElementKind extends AstNode {
98
129
  }
99
130
  export declare const ElementKind = "ElementKind";
100
131
  export declare function isElementKind(item: unknown): item is ElementKind;
101
- export interface ElementKindExpression extends AstNode {
102
- readonly $container: IncomingExpression | OutgoingExpression | RelationExpression | ViewRuleExpression | ViewRuleStyle;
103
- readonly $type: 'ElementKindExpression';
132
+ export interface ElementKindExpr extends AstNode {
133
+ readonly $container: CustomElementExpr | ExcludePredicate | IncludePredicate | IncomingExpr | OutgoingExpr | RelationExpr | ViewRuleStyle;
134
+ readonly $type: 'ElementKindExpr';
104
135
  isEqual: boolean;
105
136
  kind: Reference<ElementKind>;
106
137
  }
107
- export declare const ElementKindExpression = "ElementKindExpression";
108
- export declare function isElementKindExpression(item: unknown): item is ElementKindExpression;
138
+ export declare const ElementKindExpr = "ElementKindExpr";
139
+ export declare function isElementKindExpr(item: unknown): item is ElementKindExpr;
109
140
  export interface ElementRef extends AstNode {
110
- readonly $container: ElementRef | ElementRefExpression | ElementView | ExplicitRelation | ImplicitRelation;
141
+ readonly $container: CustomElementExpr | DescedantsExpr | ElementRef | ElementView | ExcludePredicate | ExplicitRelation | ImplicitRelation | IncludePredicate | IncomingExpr | OutgoingExpr | RelationExpr | ViewRuleStyle;
111
142
  readonly $type: 'ElementRef';
112
143
  el: Reference<Element>;
113
144
  parent?: ElementRef;
114
145
  }
115
146
  export declare const ElementRef = "ElementRef";
116
147
  export declare function isElementRef(item: unknown): item is ElementRef;
117
- export interface ElementRefExpression extends AstNode {
118
- readonly $container: IncomingExpression | OutgoingExpression | RelationExpression | ViewRuleExpression | ViewRuleStyle;
119
- readonly $type: 'ElementRefExpression';
120
- id: ElementRef;
121
- isDescedants: boolean;
122
- }
123
- export declare const ElementRefExpression = "ElementRefExpression";
124
- export declare function isElementRefExpression(item: unknown): item is ElementRefExpression;
125
148
  export interface ElementStringProperty extends AstNode {
126
- readonly $container: ElementBody;
149
+ readonly $container: CustomElementExprBody | ElementBody;
127
150
  readonly $type: 'ElementStringProperty';
128
151
  key: 'description' | 'technology' | 'title';
129
152
  value: string;
130
153
  }
131
154
  export declare const ElementStringProperty = "ElementStringProperty";
132
155
  export declare function isElementStringProperty(item: unknown): item is ElementStringProperty;
133
- export interface ElementTagExpression extends AstNode {
134
- readonly $container: IncomingExpression | OutgoingExpression | RelationExpression | ViewRuleExpression | ViewRuleStyle;
135
- readonly $type: 'ElementTagExpression';
156
+ export interface ElementTagExpr extends AstNode {
157
+ readonly $container: CustomElementExpr | ExcludePredicate | IncludePredicate | IncomingExpr | OutgoingExpr | RelationExpr | ViewRuleStyle;
158
+ readonly $type: 'ElementTagExpr';
136
159
  isEqual: boolean;
137
160
  tag: Reference<Tag>;
138
161
  }
139
- export declare const ElementTagExpression = "ElementTagExpression";
140
- export declare function isElementTagExpression(item: unknown): item is ElementTagExpression;
162
+ export declare const ElementTagExpr = "ElementTagExpr";
163
+ export declare function isElementTagExpr(item: unknown): item is ElementTagExpr;
141
164
  export interface ElementView extends AstNode {
142
165
  readonly $container: ModelViews;
143
166
  readonly $type: 'ElementView';
@@ -151,19 +174,26 @@ export declare function isElementView(item: unknown): item is ElementView;
151
174
  export interface ElementViewBody extends AstNode {
152
175
  readonly $container: ElementView;
153
176
  readonly $type: 'ElementViewBody';
154
- props: Array<LinkProperty | ViewProperty>;
155
- rules: Array<ViewRuleAutoLayout | ViewRuleExpression | ViewRuleStyle>;
177
+ props: Array<ViewProperty>;
178
+ rules: Array<ViewRule>;
156
179
  tags?: Tags;
157
180
  }
158
181
  export declare const ElementViewBody = "ElementViewBody";
159
182
  export declare function isElementViewBody(item: unknown): item is ElementViewBody;
160
183
  export interface ElementViewRef extends AstNode {
161
- readonly $container: ElementView;
184
+ readonly $container: ElementView | NavigateToProperty;
162
185
  readonly $type: 'ElementViewRef';
163
186
  view: Reference<ElementView>;
164
187
  }
165
188
  export declare const ElementViewRef = "ElementViewRef";
166
189
  export declare function isElementViewRef(item: unknown): item is ElementViewRef;
190
+ export interface ExcludePredicate extends AstNode {
191
+ readonly $container: ElementViewBody;
192
+ readonly $type: 'ExcludePredicate';
193
+ expressions: Array<ViewRulePredicateExpr>;
194
+ }
195
+ export declare const ExcludePredicate = "ExcludePredicate";
196
+ export declare function isExcludePredicate(item: unknown): item is ExcludePredicate;
167
197
  export interface ExplicitRelation extends AstNode {
168
198
  readonly $container: ElementBody | ExtendElementBody | Model;
169
199
  readonly $type: 'ExplicitRelation';
@@ -218,20 +248,27 @@ export interface ImplicitRelation extends AstNode {
218
248
  }
219
249
  export declare const ImplicitRelation = "ImplicitRelation";
220
250
  export declare function isImplicitRelation(item: unknown): item is ImplicitRelation;
221
- export interface IncomingExpression extends AstNode {
222
- readonly $container: InOutExpression | ViewRuleExpression;
223
- readonly $type: 'IncomingExpression';
224
- target: ElementExpression;
225
- }
226
- export declare const IncomingExpression = "IncomingExpression";
227
- export declare function isIncomingExpression(item: unknown): item is IncomingExpression;
228
- export interface InOutExpression extends AstNode {
229
- readonly $container: ViewRuleExpression;
230
- readonly $type: 'InOutExpression';
231
- inout: IncomingExpression;
232
- }
233
- export declare const InOutExpression = "InOutExpression";
234
- export declare function isInOutExpression(item: unknown): item is InOutExpression;
251
+ export interface IncludePredicate extends AstNode {
252
+ readonly $container: ElementViewBody;
253
+ readonly $type: 'IncludePredicate';
254
+ expressions: Array<ViewRulePredicateExpr>;
255
+ }
256
+ export declare const IncludePredicate = "IncludePredicate";
257
+ export declare function isIncludePredicate(item: unknown): item is IncludePredicate;
258
+ export interface IncomingExpr extends AstNode {
259
+ readonly $container: ExcludePredicate | InOutExpr | IncludePredicate;
260
+ readonly $type: 'IncomingExpr';
261
+ to: ElementExpr;
262
+ }
263
+ export declare const IncomingExpr = "IncomingExpr";
264
+ export declare function isIncomingExpr(item: unknown): item is IncomingExpr;
265
+ export interface InOutExpr extends AstNode {
266
+ readonly $container: ExcludePredicate | IncludePredicate;
267
+ readonly $type: 'InOutExpr';
268
+ inout: IncomingExpr;
269
+ }
270
+ export declare const InOutExpr = "InOutExpr";
271
+ export declare function isInOutExpr(item: unknown): item is InOutExpr;
235
272
  export interface LikeC4Grammar extends AstNode {
236
273
  readonly $type: 'LikeC4Grammar';
237
274
  models: Array<Model>;
@@ -268,25 +305,32 @@ export interface ModelViews extends AstNode {
268
305
  readonly $container: LikeC4Grammar;
269
306
  readonly $type: 'ModelViews';
270
307
  name: 'views';
271
- views: Array<View>;
308
+ views: Array<ElementView>;
272
309
  }
273
310
  export declare const ModelViews = "ModelViews";
274
311
  export declare function isModelViews(item: unknown): item is ModelViews;
275
- export interface OutgoingExpression extends AstNode {
276
- readonly $container: ViewRuleExpression;
277
- readonly $type: 'OutgoingExpression';
278
- source: ElementExpression;
279
- }
280
- export declare const OutgoingExpression = "OutgoingExpression";
281
- export declare function isOutgoingExpression(item: unknown): item is OutgoingExpression;
282
- export interface RelationExpression extends AstNode {
283
- readonly $container: ViewRuleExpression;
284
- readonly $type: 'RelationExpression';
285
- source: ElementExpression;
286
- target: ElementExpression;
287
- }
288
- export declare const RelationExpression = "RelationExpression";
289
- export declare function isRelationExpression(item: unknown): item is RelationExpression;
312
+ export interface NavigateToProperty extends AstNode {
313
+ readonly $container: CustomElementExprBody;
314
+ readonly $type: 'NavigateToProperty';
315
+ value: ElementViewRef;
316
+ }
317
+ export declare const NavigateToProperty = "NavigateToProperty";
318
+ export declare function isNavigateToProperty(item: unknown): item is NavigateToProperty;
319
+ export interface OutgoingExpr extends AstNode {
320
+ readonly $container: ExcludePredicate | IncludePredicate;
321
+ readonly $type: 'OutgoingExpr';
322
+ from: ElementExpr;
323
+ }
324
+ export declare const OutgoingExpr = "OutgoingExpr";
325
+ export declare function isOutgoingExpr(item: unknown): item is OutgoingExpr;
326
+ export interface RelationExpr extends AstNode {
327
+ readonly $container: ExcludePredicate | IncludePredicate;
328
+ readonly $type: 'RelationExpr';
329
+ source: ElementExpr;
330
+ target: ElementExpr;
331
+ }
332
+ export declare const RelationExpr = "RelationExpr";
333
+ export declare function isRelationExpr(item: unknown): item is RelationExpr;
290
334
  export interface RelationshipKind extends AstNode {
291
335
  readonly $container: SpecificationRelationshipKind;
292
336
  readonly $type: 'RelationshipKind';
@@ -303,7 +347,7 @@ export interface RelationStringProperty extends AstNode {
303
347
  export declare const RelationStringProperty = "RelationStringProperty";
304
348
  export declare function isRelationStringProperty(item: unknown): item is RelationStringProperty;
305
349
  export interface ShapeProperty extends AstNode {
306
- readonly $container: StyleProperties | ViewRuleStyle;
350
+ readonly $container: CustomElementExprBody | StyleProperties | ViewRuleStyle;
307
351
  readonly $type: 'ShapeProperty';
308
352
  key: 'shape';
309
353
  value: ElementShape;
@@ -322,7 +366,7 @@ export interface SpecificationRelationshipKind extends AstNode {
322
366
  readonly $container: SpecificationRule;
323
367
  readonly $type: 'SpecificationRelationshipKind';
324
368
  kind: RelationshipKind;
325
- props: Array<ArrowProperty | ColorProperty | LineProperty>;
369
+ props: Array<RelationshipStyleProperty>;
326
370
  }
327
371
  export declare const SpecificationRelationshipKind = "SpecificationRelationshipKind";
328
372
  export declare function isSpecificationRelationshipKind(item: unknown): item is SpecificationRelationshipKind;
@@ -339,16 +383,15 @@ export declare function isSpecificationRule(item: unknown): item is Specificatio
339
383
  export interface SpecificationTag extends AstNode {
340
384
  readonly $container: SpecificationRule;
341
385
  readonly $type: 'SpecificationTag';
342
- style?: StyleProperties;
343
386
  tag: Tag;
344
387
  }
345
388
  export declare const SpecificationTag = "SpecificationTag";
346
389
  export declare function isSpecificationTag(item: unknown): item is SpecificationTag;
347
390
  export interface StyleProperties extends AstNode {
348
- readonly $container: ElementBody | SpecificationElementKind | SpecificationTag;
391
+ readonly $container: ElementBody | SpecificationElementKind;
349
392
  readonly $type: 'StyleProperties';
350
393
  key: 'style';
351
- props: Array<ColorProperty | IconProperty | ShapeProperty>;
394
+ props: Array<StyleProperty>;
352
395
  }
353
396
  export declare const StyleProperties = "StyleProperties";
354
397
  export declare function isStyleProperties(item: unknown): item is StyleProperties;
@@ -366,94 +409,93 @@ export interface Tags extends AstNode {
366
409
  }
367
410
  export declare const Tags = "Tags";
368
411
  export declare function isTags(item: unknown): item is Tags;
369
- export interface ViewProperty extends AstNode {
370
- readonly $container: ElementViewBody;
371
- readonly $type: 'ViewProperty';
372
- key: 'description' | 'title';
373
- value: string;
374
- }
375
- export declare const ViewProperty = "ViewProperty";
376
- export declare function isViewProperty(item: unknown): item is ViewProperty;
377
412
  export interface ViewRuleAutoLayout extends AstNode {
378
413
  readonly $container: ElementViewBody;
379
414
  readonly $type: 'ViewRuleAutoLayout';
380
- direction: ViewRuleLayoutDirection;
415
+ direction: ViewLayoutDirection;
381
416
  }
382
417
  export declare const ViewRuleAutoLayout = "ViewRuleAutoLayout";
383
418
  export declare function isViewRuleAutoLayout(item: unknown): item is ViewRuleAutoLayout;
384
- export interface ViewRuleExpression extends AstNode {
385
- readonly $container: ElementViewBody;
386
- readonly $type: 'ViewRuleExpression';
387
- expressions: Array<Expression>;
388
- isInclude: boolean;
389
- }
390
- export declare const ViewRuleExpression = "ViewRuleExpression";
391
- export declare function isViewRuleExpression(item: unknown): item is ViewRuleExpression;
392
419
  export interface ViewRuleStyle extends AstNode {
393
420
  readonly $container: ElementViewBody;
394
421
  readonly $type: 'ViewRuleStyle';
395
- props: Array<ColorProperty | IconProperty | ShapeProperty>;
396
- targets: Array<ElementExpression>;
422
+ styleprops: Array<StyleProperty>;
423
+ targets: Array<ElementExpr>;
397
424
  }
398
425
  export declare const ViewRuleStyle = "ViewRuleStyle";
399
426
  export declare function isViewRuleStyle(item: unknown): item is ViewRuleStyle;
400
- export interface WildcardExpression extends AstNode {
401
- readonly $container: IncomingExpression | OutgoingExpression | RelationExpression | ViewRuleExpression | ViewRuleStyle;
402
- readonly $type: 'WildcardExpression';
427
+ export interface ViewStringProperty extends AstNode {
428
+ readonly $container: ElementViewBody;
429
+ readonly $type: 'ViewStringProperty';
430
+ key: 'description' | 'title';
431
+ value: string;
432
+ }
433
+ export declare const ViewStringProperty = "ViewStringProperty";
434
+ export declare function isViewStringProperty(item: unknown): item is ViewStringProperty;
435
+ export interface WildcardExpr extends AstNode {
436
+ readonly $container: CustomElementExpr | ExcludePredicate | IncludePredicate | IncomingExpr | OutgoingExpr | RelationExpr | ViewRuleStyle;
437
+ readonly $type: 'WildcardExpr';
403
438
  isWildcard: boolean;
404
439
  }
405
- export declare const WildcardExpression = "WildcardExpression";
406
- export declare function isWildcardExpression(item: unknown): item is WildcardExpression;
440
+ export declare const WildcardExpr = "WildcardExpr";
441
+ export declare function isWildcardExpr(item: unknown): item is WildcardExpr;
407
442
  export type LikeC4AstType = {
408
443
  ArrowProperty: ArrowProperty;
409
444
  ColorProperty: ColorProperty;
445
+ CustomElementExpr: CustomElementExpr;
446
+ CustomElementExprBody: CustomElementExprBody;
447
+ DescedantsExpr: DescedantsExpr;
410
448
  Element: Element;
411
449
  ElementBody: ElementBody;
412
- ElementExpression: ElementExpression;
450
+ ElementExpr: ElementExpr;
413
451
  ElementKind: ElementKind;
414
- ElementKindExpression: ElementKindExpression;
452
+ ElementKindExpr: ElementKindExpr;
415
453
  ElementProperty: ElementProperty;
416
454
  ElementRef: ElementRef;
417
- ElementRefExpression: ElementRefExpression;
418
455
  ElementStringProperty: ElementStringProperty;
419
- ElementTagExpression: ElementTagExpression;
456
+ ElementTagExpr: ElementTagExpr;
420
457
  ElementView: ElementView;
421
458
  ElementViewBody: ElementViewBody;
422
459
  ElementViewRef: ElementViewRef;
460
+ ExcludePredicate: ExcludePredicate;
423
461
  ExplicitRelation: ExplicitRelation;
424
- Expression: Expression;
425
462
  ExtendElement: ExtendElement;
426
463
  ExtendElementBody: ExtendElementBody;
427
464
  FqnElementRef: FqnElementRef;
428
465
  IconProperty: IconProperty;
429
466
  ImplicitRelation: ImplicitRelation;
430
- InOutExpression: InOutExpression;
431
- IncomingExpression: IncomingExpression;
467
+ InOutExpr: InOutExpr;
468
+ IncludePredicate: IncludePredicate;
469
+ IncomingExpr: IncomingExpr;
432
470
  LikeC4Grammar: LikeC4Grammar;
433
471
  LineProperty: LineProperty;
434
472
  LinkProperty: LinkProperty;
435
473
  Model: Model;
436
474
  ModelViews: ModelViews;
437
- OutgoingExpression: OutgoingExpression;
475
+ NavigateToProperty: NavigateToProperty;
476
+ OutgoingExpr: OutgoingExpr;
438
477
  Relation: Relation;
439
- RelationExpression: RelationExpression;
478
+ RelationExpr: RelationExpr;
440
479
  RelationStringProperty: RelationStringProperty;
441
480
  RelationshipKind: RelationshipKind;
481
+ RelationshipStyleProperty: RelationshipStyleProperty;
442
482
  ShapeProperty: ShapeProperty;
443
483
  SpecificationElementKind: SpecificationElementKind;
444
484
  SpecificationRelationshipKind: SpecificationRelationshipKind;
445
485
  SpecificationRule: SpecificationRule;
446
486
  SpecificationTag: SpecificationTag;
447
487
  StyleProperties: StyleProperties;
488
+ StyleProperty: StyleProperty;
448
489
  Tag: Tag;
449
490
  Tags: Tags;
450
- View: View;
451
491
  ViewProperty: ViewProperty;
452
492
  ViewRule: ViewRule;
453
493
  ViewRuleAutoLayout: ViewRuleAutoLayout;
454
- ViewRuleExpression: ViewRuleExpression;
494
+ ViewRulePredicate: ViewRulePredicate;
495
+ ViewRulePredicateExpr: ViewRulePredicateExpr;
455
496
  ViewRuleStyle: ViewRuleStyle;
456
- WildcardExpression: WildcardExpression;
497
+ ViewStringProperty: ViewStringProperty;
498
+ WildcardExpr: WildcardExpr;
457
499
  };
458
500
  export declare class LikeC4AstReflection extends AbstractAstReflection {
459
501
  getAllTypes(): string[];