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