@likec4/language-server 0.37.1 → 0.40.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/dist/Rpc.d.ts +6 -0
- package/dist/Rpc.js +130 -0
- package/dist/ast.d.ts +0 -97
- package/dist/ast.js +127 -143
- package/dist/elementRef.d.ts +1 -2
- package/dist/elementRef.js +31 -44
- package/dist/generated/ast.d.ts +4 -5
- package/dist/generated/ast.js +310 -315
- package/dist/generated/grammar.d.ts +0 -2
- package/dist/generated/grammar.js +2 -3177
- package/dist/generated/module.d.ts +1 -6
- package/dist/generated/module.js +13 -18
- package/dist/index.d.ts +0 -1
- package/dist/index.js +2 -3
- package/dist/logger.d.ts +0 -1
- package/dist/logger.js +39 -42
- package/dist/lsp/CodeLensProvider.d.ts +0 -1
- package/dist/lsp/CodeLensProvider.js +28 -32
- package/dist/lsp/DocumentLinkProvider.d.ts +0 -1
- package/dist/lsp/DocumentLinkProvider.js +26 -33
- package/dist/lsp/DocumentSymbolProvider.d.ts +0 -1
- package/dist/lsp/DocumentSymbolProvider.js +165 -167
- package/dist/lsp/HoverProvider.d.ts +0 -1
- package/dist/lsp/HoverProvider.js +35 -48
- package/dist/lsp/SemanticTokenProvider.d.ts +0 -1
- package/dist/lsp/SemanticTokenProvider.js +153 -201
- package/dist/lsp/index.d.ts +0 -1
- package/dist/lsp/index.js +5 -6
- package/dist/model/fqn-computation.d.ts +0 -1
- package/dist/model/fqn-computation.js +39 -40
- package/dist/model/fqn-index.d.ts +0 -1
- package/dist/model/fqn-index.js +112 -142
- package/dist/model/index.d.ts +0 -1
- package/dist/model/index.js +5 -6
- package/dist/model/model-builder.d.ts +10 -6
- package/dist/model/model-builder.js +242 -177
- package/dist/model/model-locator.d.ts +1 -2
- package/dist/model/model-locator.js +102 -100
- package/dist/model/model-parser.d.ts +2 -7
- package/dist/model/model-parser.js +296 -287
- package/dist/module.d.ts +4 -2
- package/dist/module.js +69 -60
- package/dist/protocol.d.ts +16 -20
- package/dist/protocol.js +14 -22
- package/dist/references/index.d.ts +0 -1
- package/dist/references/index.js +2 -3
- package/dist/references/scope-computation.d.ts +2 -3
- package/dist/references/scope-computation.js +68 -70
- package/dist/references/scope-provider.d.ts +1 -2
- package/dist/references/scope-provider.js +126 -116
- package/dist/shared/WorkspaceManager.d.ts +2 -4
- package/dist/shared/WorkspaceManager.js +13 -16
- package/dist/shared/index.d.ts +0 -1
- package/dist/shared/index.js +1 -2
- package/dist/test/index.d.ts +0 -1
- package/dist/test/index.js +1 -2
- package/dist/test/testServices.d.ts +6 -7
- package/dist/test/testServices.js +64 -61
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +4 -3
- package/dist/validation/element.d.ts +0 -2
- package/dist/validation/element.js +28 -39
- package/dist/validation/index.d.ts +0 -1
- package/dist/validation/index.js +36 -46
- package/dist/validation/relation.d.ts +0 -2
- package/dist/validation/relation.js +43 -47
- package/dist/validation/specification.d.ts +0 -2
- package/dist/validation/specification.js +21 -30
- package/dist/validation/view.d.ts +0 -2
- package/dist/validation/view.js +16 -22
- package/package.json +20 -13
- package/contrib/likec4.monarch.ts +0 -48
- package/contrib/likec4.tmLanguage.json +0 -73
- package/dist/registerProtocolHandlers.d.ts +0 -3
- package/dist/registerProtocolHandlers.js +0 -112
package/dist/generated/ast.js
CHANGED
|
@@ -1,423 +1,418 @@
|
|
|
1
|
-
|
|
2
|
-
* This file was generated by langium-cli 2.0.1.
|
|
3
|
-
* DO NOT EDIT MANUALLY!
|
|
4
|
-
******************************************************************************/
|
|
5
|
-
import { AbstractAstReflection } from 'langium';
|
|
1
|
+
import { AbstractAstReflection } from "langium";
|
|
6
2
|
export const LikeC4Terminals = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
3
|
+
BLOCK_COMMENT: /\/\*[\s\S]*?\*\//,
|
|
4
|
+
LINE_COMMENT: /\/\/[^\n\r]*/,
|
|
5
|
+
WS: /(([\t\r\n\v\f])|([^\S\r\n]))+/,
|
|
6
|
+
URI_WITH_SCHEMA: /\w+:\/\/\S+/,
|
|
7
|
+
URI_RELATIVE: /\.{0,2}\/[^\/]\S+/,
|
|
8
|
+
RARROW: /->/,
|
|
9
|
+
Dot: /\b\.\b/,
|
|
10
|
+
NotEqual: /!=/,
|
|
11
|
+
Eq: /=/,
|
|
12
|
+
OpenBlock: /\{/,
|
|
13
|
+
CloseBlock: /\}/,
|
|
14
|
+
Colon: /:/,
|
|
15
|
+
SemiColon: /;/,
|
|
16
|
+
Comma: /,/,
|
|
17
|
+
STRING: /"[^"]*"|'[^']*'/,
|
|
18
|
+
TagID: /((#)([^\W\d_])(((([^\W\d_])|([0-9]))|(_))|(-))*)/,
|
|
19
|
+
ID: /((([^\W\d_])|(_))(((([^\W\d_])|([0-9]))|(_))|(-))*)/
|
|
24
20
|
};
|
|
25
|
-
export const ElementExpression =
|
|
21
|
+
export const ElementExpression = "ElementExpression";
|
|
26
22
|
export function isElementExpression(item) {
|
|
27
|
-
|
|
23
|
+
return reflection.isInstance(item, ElementExpression);
|
|
28
24
|
}
|
|
29
|
-
export const ElementProperty =
|
|
25
|
+
export const ElementProperty = "ElementProperty";
|
|
30
26
|
export function isElementProperty(item) {
|
|
31
|
-
|
|
27
|
+
return reflection.isInstance(item, ElementProperty);
|
|
32
28
|
}
|
|
33
29
|
export function isElementShape(item) {
|
|
34
|
-
|
|
30
|
+
return item === "rectangle" || item === "person" || item === "browser" || item === "mobile" || item === "cylinder" || item === "storage" || item === "queue";
|
|
35
31
|
}
|
|
36
|
-
export const Expression =
|
|
32
|
+
export const Expression = "Expression";
|
|
37
33
|
export function isExpression(item) {
|
|
38
|
-
|
|
34
|
+
return reflection.isInstance(item, Expression);
|
|
39
35
|
}
|
|
40
36
|
export function isName(item) {
|
|
41
|
-
|
|
37
|
+
return isElementShape(item) || isThemeColor(item) || item === "element" || item === "model" || typeof item === "string" && /((([^\W\d_])|(_))(((([^\W\d_])|([0-9]))|(_))|(-))*)/.test(item);
|
|
42
38
|
}
|
|
43
39
|
export function isRArrow(item) {
|
|
44
|
-
|
|
40
|
+
return typeof item === "string" && /->/.test(item);
|
|
45
41
|
}
|
|
46
42
|
export function isThemeColor(item) {
|
|
47
|
-
|
|
43
|
+
return item === "primary" || item === "secondary" || item === "muted" || item === "slate" || item === "blue" || item === "indigo" || item === "sky" || item === "red" || item === "gray" || item === "green" || item === "amber";
|
|
48
44
|
}
|
|
49
45
|
export function isUri(item) {
|
|
50
|
-
|
|
46
|
+
return typeof item === "string" && (/\w+:\/\/\S+/.test(item) || /\.{0,2}\/[^\/]\S+/.test(item));
|
|
51
47
|
}
|
|
52
|
-
export const View =
|
|
48
|
+
export const View = "View";
|
|
53
49
|
export function isView(item) {
|
|
54
|
-
|
|
50
|
+
return reflection.isInstance(item, View);
|
|
55
51
|
}
|
|
56
|
-
export const ViewRule =
|
|
52
|
+
export const ViewRule = "ViewRule";
|
|
57
53
|
export function isViewRule(item) {
|
|
58
|
-
|
|
54
|
+
return reflection.isInstance(item, ViewRule);
|
|
59
55
|
}
|
|
60
56
|
export function isViewRuleLayoutDirection(item) {
|
|
61
|
-
|
|
57
|
+
return item === "TopBottom" || item === "LeftRight" || item === "BottomTop" || item === "RightLeft";
|
|
62
58
|
}
|
|
63
|
-
export const ColorProperty =
|
|
59
|
+
export const ColorProperty = "ColorProperty";
|
|
64
60
|
export function isColorProperty(item) {
|
|
65
|
-
|
|
61
|
+
return reflection.isInstance(item, ColorProperty);
|
|
66
62
|
}
|
|
67
|
-
export const Element =
|
|
63
|
+
export const Element = "Element";
|
|
68
64
|
export function isElement(item) {
|
|
69
|
-
|
|
65
|
+
return reflection.isInstance(item, Element);
|
|
70
66
|
}
|
|
71
|
-
export const ElementBody =
|
|
67
|
+
export const ElementBody = "ElementBody";
|
|
72
68
|
export function isElementBody(item) {
|
|
73
|
-
|
|
69
|
+
return reflection.isInstance(item, ElementBody);
|
|
74
70
|
}
|
|
75
|
-
export const ElementKind =
|
|
71
|
+
export const ElementKind = "ElementKind";
|
|
76
72
|
export function isElementKind(item) {
|
|
77
|
-
|
|
73
|
+
return reflection.isInstance(item, ElementKind);
|
|
78
74
|
}
|
|
79
|
-
export const ElementKindExpression =
|
|
75
|
+
export const ElementKindExpression = "ElementKindExpression";
|
|
80
76
|
export function isElementKindExpression(item) {
|
|
81
|
-
|
|
77
|
+
return reflection.isInstance(item, ElementKindExpression);
|
|
82
78
|
}
|
|
83
|
-
export const ElementRef =
|
|
79
|
+
export const ElementRef = "ElementRef";
|
|
84
80
|
export function isElementRef(item) {
|
|
85
|
-
|
|
81
|
+
return reflection.isInstance(item, ElementRef);
|
|
86
82
|
}
|
|
87
|
-
export const ElementRefExpression =
|
|
83
|
+
export const ElementRefExpression = "ElementRefExpression";
|
|
88
84
|
export function isElementRefExpression(item) {
|
|
89
|
-
|
|
85
|
+
return reflection.isInstance(item, ElementRefExpression);
|
|
90
86
|
}
|
|
91
|
-
export const ElementStringProperty =
|
|
87
|
+
export const ElementStringProperty = "ElementStringProperty";
|
|
92
88
|
export function isElementStringProperty(item) {
|
|
93
|
-
|
|
89
|
+
return reflection.isInstance(item, ElementStringProperty);
|
|
94
90
|
}
|
|
95
|
-
export const ElementTagExpression =
|
|
91
|
+
export const ElementTagExpression = "ElementTagExpression";
|
|
96
92
|
export function isElementTagExpression(item) {
|
|
97
|
-
|
|
93
|
+
return reflection.isInstance(item, ElementTagExpression);
|
|
98
94
|
}
|
|
99
|
-
export const ElementView =
|
|
95
|
+
export const ElementView = "ElementView";
|
|
100
96
|
export function isElementView(item) {
|
|
101
|
-
|
|
97
|
+
return reflection.isInstance(item, ElementView);
|
|
102
98
|
}
|
|
103
|
-
export const ElementViewBody =
|
|
99
|
+
export const ElementViewBody = "ElementViewBody";
|
|
104
100
|
export function isElementViewBody(item) {
|
|
105
|
-
|
|
101
|
+
return reflection.isInstance(item, ElementViewBody);
|
|
106
102
|
}
|
|
107
|
-
export const ElementViewRef =
|
|
103
|
+
export const ElementViewRef = "ElementViewRef";
|
|
108
104
|
export function isElementViewRef(item) {
|
|
109
|
-
|
|
105
|
+
return reflection.isInstance(item, ElementViewRef);
|
|
110
106
|
}
|
|
111
|
-
export const ExtendElement =
|
|
107
|
+
export const ExtendElement = "ExtendElement";
|
|
112
108
|
export function isExtendElement(item) {
|
|
113
|
-
|
|
109
|
+
return reflection.isInstance(item, ExtendElement);
|
|
114
110
|
}
|
|
115
|
-
export const ExtendElementBody =
|
|
111
|
+
export const ExtendElementBody = "ExtendElementBody";
|
|
116
112
|
export function isExtendElementBody(item) {
|
|
117
|
-
|
|
113
|
+
return reflection.isInstance(item, ExtendElementBody);
|
|
118
114
|
}
|
|
119
|
-
export const IconProperty =
|
|
115
|
+
export const IconProperty = "IconProperty";
|
|
120
116
|
export function isIconProperty(item) {
|
|
121
|
-
|
|
117
|
+
return reflection.isInstance(item, IconProperty);
|
|
122
118
|
}
|
|
123
|
-
export const IncomingExpression =
|
|
119
|
+
export const IncomingExpression = "IncomingExpression";
|
|
124
120
|
export function isIncomingExpression(item) {
|
|
125
|
-
|
|
121
|
+
return reflection.isInstance(item, IncomingExpression);
|
|
126
122
|
}
|
|
127
|
-
export const InOutExpression =
|
|
123
|
+
export const InOutExpression = "InOutExpression";
|
|
128
124
|
export function isInOutExpression(item) {
|
|
129
|
-
|
|
125
|
+
return reflection.isInstance(item, InOutExpression);
|
|
130
126
|
}
|
|
131
|
-
export const LikeC4Document =
|
|
127
|
+
export const LikeC4Document = "LikeC4Document";
|
|
132
128
|
export function isLikeC4Document(item) {
|
|
133
|
-
|
|
129
|
+
return reflection.isInstance(item, LikeC4Document);
|
|
134
130
|
}
|
|
135
|
-
export const LinkProperty =
|
|
131
|
+
export const LinkProperty = "LinkProperty";
|
|
136
132
|
export function isLinkProperty(item) {
|
|
137
|
-
|
|
133
|
+
return reflection.isInstance(item, LinkProperty);
|
|
138
134
|
}
|
|
139
|
-
export const Model =
|
|
135
|
+
export const Model = "Model";
|
|
140
136
|
export function isModel(item) {
|
|
141
|
-
|
|
137
|
+
return reflection.isInstance(item, Model);
|
|
142
138
|
}
|
|
143
|
-
export const ModelViews =
|
|
139
|
+
export const ModelViews = "ModelViews";
|
|
144
140
|
export function isModelViews(item) {
|
|
145
|
-
|
|
141
|
+
return reflection.isInstance(item, ModelViews);
|
|
146
142
|
}
|
|
147
|
-
export const OutgoingExpression =
|
|
143
|
+
export const OutgoingExpression = "OutgoingExpression";
|
|
148
144
|
export function isOutgoingExpression(item) {
|
|
149
|
-
|
|
145
|
+
return reflection.isInstance(item, OutgoingExpression);
|
|
150
146
|
}
|
|
151
|
-
export const Relation =
|
|
147
|
+
export const Relation = "Relation";
|
|
152
148
|
export function isRelation(item) {
|
|
153
|
-
|
|
149
|
+
return reflection.isInstance(item, Relation);
|
|
154
150
|
}
|
|
155
|
-
export const RelationBody =
|
|
151
|
+
export const RelationBody = "RelationBody";
|
|
156
152
|
export function isRelationBody(item) {
|
|
157
|
-
|
|
153
|
+
return reflection.isInstance(item, RelationBody);
|
|
158
154
|
}
|
|
159
|
-
export const RelationExpression =
|
|
155
|
+
export const RelationExpression = "RelationExpression";
|
|
160
156
|
export function isRelationExpression(item) {
|
|
161
|
-
|
|
157
|
+
return reflection.isInstance(item, RelationExpression);
|
|
162
158
|
}
|
|
163
|
-
export const RelationStringProperty =
|
|
159
|
+
export const RelationStringProperty = "RelationStringProperty";
|
|
164
160
|
export function isRelationStringProperty(item) {
|
|
165
|
-
|
|
161
|
+
return reflection.isInstance(item, RelationStringProperty);
|
|
166
162
|
}
|
|
167
|
-
export const ShapeProperty =
|
|
163
|
+
export const ShapeProperty = "ShapeProperty";
|
|
168
164
|
export function isShapeProperty(item) {
|
|
169
|
-
|
|
165
|
+
return reflection.isInstance(item, ShapeProperty);
|
|
170
166
|
}
|
|
171
|
-
export const SpecificationElementKind =
|
|
167
|
+
export const SpecificationElementKind = "SpecificationElementKind";
|
|
172
168
|
export function isSpecificationElementKind(item) {
|
|
173
|
-
|
|
169
|
+
return reflection.isInstance(item, SpecificationElementKind);
|
|
174
170
|
}
|
|
175
|
-
export const SpecificationRule =
|
|
171
|
+
export const SpecificationRule = "SpecificationRule";
|
|
176
172
|
export function isSpecificationRule(item) {
|
|
177
|
-
|
|
173
|
+
return reflection.isInstance(item, SpecificationRule);
|
|
178
174
|
}
|
|
179
|
-
export const SpecificationTag =
|
|
175
|
+
export const SpecificationTag = "SpecificationTag";
|
|
180
176
|
export function isSpecificationTag(item) {
|
|
181
|
-
|
|
177
|
+
return reflection.isInstance(item, SpecificationTag);
|
|
182
178
|
}
|
|
183
|
-
export const StrictElementRef =
|
|
179
|
+
export const StrictElementRef = "StrictElementRef";
|
|
184
180
|
export function isStrictElementRef(item) {
|
|
185
|
-
|
|
181
|
+
return reflection.isInstance(item, StrictElementRef);
|
|
186
182
|
}
|
|
187
|
-
export const StyleProperties =
|
|
183
|
+
export const StyleProperties = "StyleProperties";
|
|
188
184
|
export function isStyleProperties(item) {
|
|
189
|
-
|
|
185
|
+
return reflection.isInstance(item, StyleProperties);
|
|
190
186
|
}
|
|
191
|
-
export const Tag =
|
|
187
|
+
export const Tag = "Tag";
|
|
192
188
|
export function isTag(item) {
|
|
193
|
-
|
|
189
|
+
return reflection.isInstance(item, Tag);
|
|
194
190
|
}
|
|
195
|
-
export const Tags =
|
|
191
|
+
export const Tags = "Tags";
|
|
196
192
|
export function isTags(item) {
|
|
197
|
-
|
|
193
|
+
return reflection.isInstance(item, Tags);
|
|
198
194
|
}
|
|
199
|
-
export const ViewProperty =
|
|
195
|
+
export const ViewProperty = "ViewProperty";
|
|
200
196
|
export function isViewProperty(item) {
|
|
201
|
-
|
|
197
|
+
return reflection.isInstance(item, ViewProperty);
|
|
202
198
|
}
|
|
203
|
-
export const ViewRuleAutoLayout =
|
|
199
|
+
export const ViewRuleAutoLayout = "ViewRuleAutoLayout";
|
|
204
200
|
export function isViewRuleAutoLayout(item) {
|
|
205
|
-
|
|
201
|
+
return reflection.isInstance(item, ViewRuleAutoLayout);
|
|
206
202
|
}
|
|
207
|
-
export const ViewRuleExpression =
|
|
203
|
+
export const ViewRuleExpression = "ViewRuleExpression";
|
|
208
204
|
export function isViewRuleExpression(item) {
|
|
209
|
-
|
|
205
|
+
return reflection.isInstance(item, ViewRuleExpression);
|
|
210
206
|
}
|
|
211
|
-
export const ViewRuleStyle =
|
|
207
|
+
export const ViewRuleStyle = "ViewRuleStyle";
|
|
212
208
|
export function isViewRuleStyle(item) {
|
|
213
|
-
|
|
209
|
+
return reflection.isInstance(item, ViewRuleStyle);
|
|
214
210
|
}
|
|
215
|
-
export const WildcardExpression =
|
|
211
|
+
export const WildcardExpression = "WildcardExpression";
|
|
216
212
|
export function isWildcardExpression(item) {
|
|
217
|
-
|
|
213
|
+
return reflection.isInstance(item, WildcardExpression);
|
|
218
214
|
}
|
|
219
215
|
export class LikeC4AstReflection extends AbstractAstReflection {
|
|
220
|
-
|
|
221
|
-
|
|
216
|
+
getAllTypes() {
|
|
217
|
+
return ["ColorProperty", "Element", "ElementBody", "ElementExpression", "ElementKind", "ElementKindExpression", "ElementProperty", "ElementRef", "ElementRefExpression", "ElementStringProperty", "ElementTagExpression", "ElementView", "ElementViewBody", "ElementViewRef", "Expression", "ExtendElement", "ExtendElementBody", "IconProperty", "InOutExpression", "IncomingExpression", "LikeC4Document", "LinkProperty", "Model", "ModelViews", "OutgoingExpression", "Relation", "RelationBody", "RelationExpression", "RelationStringProperty", "ShapeProperty", "SpecificationElementKind", "SpecificationRule", "SpecificationTag", "StrictElementRef", "StyleProperties", "Tag", "Tags", "View", "ViewProperty", "ViewRule", "ViewRuleAutoLayout", "ViewRuleExpression", "ViewRuleStyle", "WildcardExpression"];
|
|
218
|
+
}
|
|
219
|
+
computeIsSubtype(subtype, supertype) {
|
|
220
|
+
switch (subtype) {
|
|
221
|
+
case ElementExpression:
|
|
222
|
+
case IncomingExpression:
|
|
223
|
+
case InOutExpression:
|
|
224
|
+
case OutgoingExpression:
|
|
225
|
+
case RelationExpression: {
|
|
226
|
+
return this.isSubtype(Expression, supertype);
|
|
227
|
+
}
|
|
228
|
+
case ElementKindExpression:
|
|
229
|
+
case ElementRefExpression:
|
|
230
|
+
case ElementTagExpression:
|
|
231
|
+
case WildcardExpression: {
|
|
232
|
+
return this.isSubtype(ElementExpression, supertype);
|
|
233
|
+
}
|
|
234
|
+
case ElementStringProperty:
|
|
235
|
+
case StyleProperties: {
|
|
236
|
+
return this.isSubtype(ElementProperty, supertype);
|
|
237
|
+
}
|
|
238
|
+
case ElementView: {
|
|
239
|
+
return this.isSubtype(View, supertype);
|
|
240
|
+
}
|
|
241
|
+
case ViewRuleAutoLayout:
|
|
242
|
+
case ViewRuleExpression:
|
|
243
|
+
case ViewRuleStyle: {
|
|
244
|
+
return this.isSubtype(ViewRule, supertype);
|
|
245
|
+
}
|
|
246
|
+
default: {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
222
249
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
case ViewRuleAutoLayout:
|
|
246
|
-
case ViewRuleExpression:
|
|
247
|
-
case ViewRuleStyle: {
|
|
248
|
-
return this.isSubtype(ViewRule, supertype);
|
|
249
|
-
}
|
|
250
|
-
default: {
|
|
251
|
-
return false;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
250
|
+
}
|
|
251
|
+
getReferenceType(refInfo) {
|
|
252
|
+
const referenceId = `${refInfo.container.$type}:${refInfo.property}`;
|
|
253
|
+
switch (referenceId) {
|
|
254
|
+
case "Element:kind":
|
|
255
|
+
case "ElementKindExpression:kind": {
|
|
256
|
+
return ElementKind;
|
|
257
|
+
}
|
|
258
|
+
case "ElementRef:el":
|
|
259
|
+
case "StrictElementRef:el": {
|
|
260
|
+
return Element;
|
|
261
|
+
}
|
|
262
|
+
case "ElementTagExpression:tag":
|
|
263
|
+
case "Tags:value": {
|
|
264
|
+
return Tag;
|
|
265
|
+
}
|
|
266
|
+
case "ElementViewRef:view": {
|
|
267
|
+
return ElementView;
|
|
268
|
+
}
|
|
269
|
+
default: {
|
|
270
|
+
throw new Error(`${referenceId} is not a valid reference id.`);
|
|
271
|
+
}
|
|
254
272
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
return {
|
|
398
|
-
name: 'ViewRuleStyle',
|
|
399
|
-
mandatory: [
|
|
400
|
-
{ name: 'props', type: 'array' },
|
|
401
|
-
{ name: 'targets', type: 'array' }
|
|
402
|
-
]
|
|
403
|
-
};
|
|
404
|
-
}
|
|
405
|
-
case 'WildcardExpression': {
|
|
406
|
-
return {
|
|
407
|
-
name: 'WildcardExpression',
|
|
408
|
-
mandatory: [
|
|
409
|
-
{ name: 'isWildcard', type: 'boolean' }
|
|
410
|
-
]
|
|
411
|
-
};
|
|
412
|
-
}
|
|
413
|
-
default: {
|
|
414
|
-
return {
|
|
415
|
-
name: type,
|
|
416
|
-
mandatory: []
|
|
417
|
-
};
|
|
418
|
-
}
|
|
419
|
-
}
|
|
273
|
+
}
|
|
274
|
+
getTypeMetaData(type) {
|
|
275
|
+
switch (type) {
|
|
276
|
+
case "Element": {
|
|
277
|
+
return {
|
|
278
|
+
name: "Element",
|
|
279
|
+
mandatory: [
|
|
280
|
+
{ name: "props", type: "array" }
|
|
281
|
+
]
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
case "ElementBody": {
|
|
285
|
+
return {
|
|
286
|
+
name: "ElementBody",
|
|
287
|
+
mandatory: [
|
|
288
|
+
{ name: "elements", type: "array" },
|
|
289
|
+
{ name: "props", type: "array" }
|
|
290
|
+
]
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
case "ElementKindExpression": {
|
|
294
|
+
return {
|
|
295
|
+
name: "ElementKindExpression",
|
|
296
|
+
mandatory: [
|
|
297
|
+
{ name: "isEqual", type: "boolean" }
|
|
298
|
+
]
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
case "ElementRefExpression": {
|
|
302
|
+
return {
|
|
303
|
+
name: "ElementRefExpression",
|
|
304
|
+
mandatory: [
|
|
305
|
+
{ name: "isDescedants", type: "boolean" }
|
|
306
|
+
]
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
case "ElementTagExpression": {
|
|
310
|
+
return {
|
|
311
|
+
name: "ElementTagExpression",
|
|
312
|
+
mandatory: [
|
|
313
|
+
{ name: "isEqual", type: "boolean" }
|
|
314
|
+
]
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
case "ElementViewBody": {
|
|
318
|
+
return {
|
|
319
|
+
name: "ElementViewBody",
|
|
320
|
+
mandatory: [
|
|
321
|
+
{ name: "props", type: "array" },
|
|
322
|
+
{ name: "rules", type: "array" }
|
|
323
|
+
]
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
case "ExtendElementBody": {
|
|
327
|
+
return {
|
|
328
|
+
name: "ExtendElementBody",
|
|
329
|
+
mandatory: [
|
|
330
|
+
{ name: "elements", type: "array" }
|
|
331
|
+
]
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
case "Model": {
|
|
335
|
+
return {
|
|
336
|
+
name: "Model",
|
|
337
|
+
mandatory: [
|
|
338
|
+
{ name: "elements", type: "array" }
|
|
339
|
+
]
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
case "ModelViews": {
|
|
343
|
+
return {
|
|
344
|
+
name: "ModelViews",
|
|
345
|
+
mandatory: [
|
|
346
|
+
{ name: "views", type: "array" }
|
|
347
|
+
]
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
case "RelationBody": {
|
|
351
|
+
return {
|
|
352
|
+
name: "RelationBody",
|
|
353
|
+
mandatory: [
|
|
354
|
+
{ name: "props", type: "array" }
|
|
355
|
+
]
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
case "SpecificationRule": {
|
|
359
|
+
return {
|
|
360
|
+
name: "SpecificationRule",
|
|
361
|
+
mandatory: [
|
|
362
|
+
{ name: "elements", type: "array" },
|
|
363
|
+
{ name: "tags", type: "array" }
|
|
364
|
+
]
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
case "StyleProperties": {
|
|
368
|
+
return {
|
|
369
|
+
name: "StyleProperties",
|
|
370
|
+
mandatory: [
|
|
371
|
+
{ name: "props", type: "array" }
|
|
372
|
+
]
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
case "Tags": {
|
|
376
|
+
return {
|
|
377
|
+
name: "Tags",
|
|
378
|
+
mandatory: [
|
|
379
|
+
{ name: "value", type: "array" }
|
|
380
|
+
]
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
case "ViewRuleExpression": {
|
|
384
|
+
return {
|
|
385
|
+
name: "ViewRuleExpression",
|
|
386
|
+
mandatory: [
|
|
387
|
+
{ name: "expressions", type: "array" },
|
|
388
|
+
{ name: "isInclude", type: "boolean" }
|
|
389
|
+
]
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
case "ViewRuleStyle": {
|
|
393
|
+
return {
|
|
394
|
+
name: "ViewRuleStyle",
|
|
395
|
+
mandatory: [
|
|
396
|
+
{ name: "props", type: "array" },
|
|
397
|
+
{ name: "targets", type: "array" }
|
|
398
|
+
]
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
case "WildcardExpression": {
|
|
402
|
+
return {
|
|
403
|
+
name: "WildcardExpression",
|
|
404
|
+
mandatory: [
|
|
405
|
+
{ name: "isWildcard", type: "boolean" }
|
|
406
|
+
]
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
default: {
|
|
410
|
+
return {
|
|
411
|
+
name: type,
|
|
412
|
+
mandatory: []
|
|
413
|
+
};
|
|
414
|
+
}
|
|
420
415
|
}
|
|
416
|
+
}
|
|
421
417
|
}
|
|
422
418
|
export const reflection = new LikeC4AstReflection();
|
|
423
|
-
//# sourceMappingURL=ast.js.map
|