@likec4/language-server 0.28.3 → 0.30.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.
@@ -10,12 +10,13 @@ export default {
10
10
 
11
11
  tokenizer: {
12
12
  initial: [
13
- { regex: /(\w+:\/\/)[^\s]+/, action: {"token":"URI_WITH_SCHEMA"} },
14
- { regex: /\/[^\s\/][^\s]*/, action: {"token":"URI_RELATIVE"} },
15
- { regex: /"[^"]*"|'[^']*'/, action: {"token":"string"} },
16
13
  { regex: /[^\W\d_]/, action: { cases: { '@keywords': {"token":"keyword"}, '@default': {"token":"LETTER"} }} },
17
14
  { regex: /[0-9]/, action: {"token":"DIGIT"} },
18
15
  { regex: /[\t\r\n\v\f]/, action: {"token":"NEWLINE"} },
16
+ { regex: /\w+:\/\/\S+/, action: {"token":"URI_WITH_SCHEMA"} },
17
+ { regex: /\.{0,2}\/[^\/]\S+/, action: {"token":"URI_RELATIVE"} },
18
+ { regex: /\b\.\b/, action: {"token":"Dot"} },
19
+ { regex: /"[^"]*"|'[^']*'/, action: {"token":"string"} },
19
20
  { include: '@whitespace' },
20
21
  { regex: /@symbols/, action: { cases: { '@operators': {"token":"operator"}, '@default': {"token":""} }} },
21
22
  ],
package/dist/ast.d.ts CHANGED
@@ -1,10 +1,8 @@
1
- /// <reference types="react" />
2
1
  import type * as c4 from '@likec4/core/types';
3
2
  import type { LangiumDocument, MultiMap } from 'langium';
4
3
  import type { LikeC4Document } from './generated/ast';
5
4
  import * as ast from './generated/ast';
6
5
  export { ast };
7
- export declare function c4hash({ c4Specification, c4Elements, c4Relations, c4Views }: LikeC4LangiumDocument): string;
8
6
  export interface ParsedAstSpecification {
9
7
  kinds: Record<c4.ElementKind, {
10
8
  shape: c4.ElementShape;
package/dist/ast.js CHANGED
@@ -1,23 +1,15 @@
1
+ import { RelationRefError } from '@likec4/core';
1
2
  import { DocumentState } from 'langium/lib/workspace';
2
- import objectHash from 'object-hash';
3
+ // import objectHash from 'object-hash'
3
4
  import { elementRef } from './elementRef';
4
5
  import * as ast from './generated/ast';
5
6
  import { LikeC4LanguageMetaData } from './generated/module';
6
7
  export { ast };
7
- export function c4hash({ c4Specification, c4Elements, c4Relations, c4Views }) {
8
- return objectHash({
9
- c4Specification,
10
- c4Elements,
11
- c4Relations,
12
- c4Views
13
- }, {
14
- respectType: false
15
- });
16
- }
17
8
  const idattr = Symbol.for('idattr');
18
9
  export const ElementViewOps = {
19
10
  writeId(node, id) {
20
11
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
+ ;
21
13
  node[idattr] = id;
22
14
  return node;
23
15
  },
@@ -34,6 +26,7 @@ export const ElementOps = {
34
26
  }
35
27
  else {
36
28
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
+ ;
37
30
  node[idattr] = id;
38
31
  }
39
32
  return node;
@@ -78,7 +71,7 @@ export function* streamModel(doc) {
78
71
  const relations = [];
79
72
  let el;
80
73
  while ((el = traverseStack.shift())) {
81
- if (ast.isRelationWithSource(el)) {
74
+ if (ast.isRelation(el)) {
82
75
  relations.push(el);
83
76
  continue;
84
77
  }
@@ -107,12 +100,12 @@ export function* streamModel(doc) {
107
100
  export function resolveRelationPoints(node) {
108
101
  const target = elementRef(node.target);
109
102
  if (!target) {
110
- throw new Error('Skip relation due to invalid reference to target');
103
+ throw new RelationRefError('Invalid reference to target');
111
104
  }
112
- if (ast.isRelationWithSource(node)) {
105
+ if ('source' in node) {
113
106
  const source = elementRef(node.source);
114
107
  if (!source) {
115
- throw new Error('Skip relation due to invalid reference to source');
108
+ throw new RelationRefError('Invalid reference to source');
116
109
  }
117
110
  return {
118
111
  source,
@@ -120,7 +113,7 @@ export function resolveRelationPoints(node) {
120
113
  };
121
114
  }
122
115
  if (!ast.isElementBody(node.$container)) {
123
- throw new Error('Skip relation due to invalid reference to source');
116
+ throw new RelationRefError('Invalid relation parent');
124
117
  }
125
118
  return {
126
119
  source: node.$container.$container,
@@ -1,5 +1,5 @@
1
1
  import { ast } from './ast';
2
- import invariant from 'tiny-invariant';
2
+ import { invariant } from '@likec4/core';
3
3
  import { failExpectedNever } from './utils';
4
4
  export function isElementRefHead(node) {
5
5
  if (ast.isElementRef(node)) {
@@ -4,16 +4,13 @@
4
4
  ******************************************************************************/
5
5
  import type { AstNode, Reference, ReferenceInfo, TypeMetaData } from 'langium';
6
6
  import { AbstractAstReflection } from 'langium';
7
- export type AnyStringProperty = ElementStringProperty | LinkProperty | RelationStringProperty | ViewProperty;
8
- export declare const AnyStringProperty = "AnyStringProperty";
9
- export declare function isAnyStringProperty(item: unknown): item is AnyStringProperty;
10
7
  export type AStyleProperty = ColorProperty | ShapeProperty;
11
8
  export declare const AStyleProperty = "AStyleProperty";
12
9
  export declare function isAStyleProperty(item: unknown): item is AStyleProperty;
13
10
  export type ElementExpression = ElementKindExpression | ElementRefExpression | ElementTagExpression | WildcardExpression;
14
11
  export declare const ElementExpression = "ElementExpression";
15
12
  export declare function isElementExpression(item: unknown): item is ElementExpression;
16
- export type ElementProperty = ElementStringProperty | ElementStyleProperty;
13
+ export type ElementProperty = ElementStringProperty | ElementStyleProperties;
17
14
  export declare const ElementProperty = "ElementProperty";
18
15
  export declare function isElementProperty(item: unknown): item is ElementProperty;
19
16
  export type ElementShape = 'browser' | 'cylinder' | 'mobile' | 'person' | 'queue' | 'rectangle' | 'storage';
@@ -38,7 +35,7 @@ export declare function isViewRule(item: unknown): item is ViewRule;
38
35
  export type ViewRuleLayoutDirection = 'BottomTop' | 'LeftRight' | 'RightLeft' | 'TopBottom';
39
36
  export declare function isViewRuleLayoutDirection(item: unknown): item is ViewRuleLayoutDirection;
40
37
  export interface ColorProperty extends AstNode {
41
- readonly $container: ElementStyleProperty | SpecificationElementKindStyle | SpecificationTagStyle | ViewRuleStyle;
38
+ readonly $container: ElementStyleProperties | SpecificationStyleProperties | ViewRuleStyle;
42
39
  readonly $type: 'ColorProperty';
43
40
  key: 'color';
44
41
  value: ThemeColor;
@@ -80,7 +77,7 @@ export interface ElementKindExpression extends AstNode {
80
77
  export declare const ElementKindExpression = "ElementKindExpression";
81
78
  export declare function isElementKindExpression(item: unknown): item is ElementKindExpression;
82
79
  export interface ElementRef extends AstNode {
83
- readonly $container: ElementRef | ElementRefExpression | ElementView | Relation | RelationWithSource;
80
+ readonly $container: ElementRef | ElementRefExpression | ElementView | Relation;
84
81
  readonly $type: 'ElementRef';
85
82
  el: Reference<Element>;
86
83
  next?: ElementRef;
@@ -96,21 +93,21 @@ export interface ElementRefExpression extends AstNode {
96
93
  export declare const ElementRefExpression = "ElementRefExpression";
97
94
  export declare function isElementRefExpression(item: unknown): item is ElementRefExpression;
98
95
  export interface ElementStringProperty extends AstNode {
99
- readonly $container: ElementBody | ElementView | RelationBody;
96
+ readonly $container: ElementBody;
100
97
  readonly $type: 'ElementStringProperty';
101
98
  key: 'description' | 'technology' | 'title';
102
99
  value: string;
103
100
  }
104
101
  export declare const ElementStringProperty = "ElementStringProperty";
105
102
  export declare function isElementStringProperty(item: unknown): item is ElementStringProperty;
106
- export interface ElementStyleProperty extends AstNode {
107
- readonly $container: ElementBody | ElementView | RelationBody;
108
- readonly $type: 'ElementStyleProperty';
103
+ export interface ElementStyleProperties extends AstNode {
104
+ readonly $container: ElementBody;
105
+ readonly $type: 'ElementStyleProperties';
109
106
  key: 'style';
110
107
  props: Array<ColorProperty | ShapeProperty>;
111
108
  }
112
- export declare const ElementStyleProperty = "ElementStyleProperty";
113
- export declare function isElementStyleProperty(item: unknown): item is ElementStyleProperty;
109
+ export declare const ElementStyleProperties = "ElementStyleProperties";
110
+ export declare function isElementStyleProperties(item: unknown): item is ElementStyleProperties;
114
111
  export interface ElementTagExpression extends AstNode {
115
112
  readonly $container: InOutExpression | IncomingExpression | OutgoingExpression | RelationExpression | ViewRuleExpression | ViewRuleStyle;
116
113
  readonly $type: 'ElementTagExpression';
@@ -140,7 +137,7 @@ export declare function isExtendElement(item: unknown): item is ExtendElement;
140
137
  export interface ExtendElementBody extends AstNode {
141
138
  readonly $container: ExtendElement;
142
139
  readonly $type: 'ExtendElementBody';
143
- elements: Array<Element | RelationWithSource>;
140
+ elements: Array<Element | Relation>;
144
141
  }
145
142
  export declare const ExtendElementBody = "ExtendElementBody";
146
143
  export declare function isExtendElementBody(item: unknown): item is ExtendElementBody;
@@ -169,7 +166,7 @@ export interface LikeC4Document extends AstNode {
169
166
  export declare const LikeC4Document = "LikeC4Document";
170
167
  export declare function isLikeC4Document(item: unknown): item is LikeC4Document;
171
168
  export interface LinkProperty extends AstNode {
172
- readonly $container: ElementBody | ElementView | RelationBody;
169
+ readonly $container: ElementBody;
173
170
  readonly $type: 'LinkProperty';
174
171
  key: 'link';
175
172
  value: Uri;
@@ -179,7 +176,7 @@ export declare function isLinkProperty(item: unknown): item is LinkProperty;
179
176
  export interface Model extends AstNode {
180
177
  readonly $container: LikeC4Document;
181
178
  readonly $type: 'Model';
182
- elements: Array<Element | ExtendElement | RelationWithSource>;
179
+ elements: Array<Element | ExtendElement | Relation>;
183
180
  name: 'model';
184
181
  }
185
182
  export declare const Model = "Model";
@@ -202,16 +199,17 @@ export declare const OutgoingExpression = "OutgoingExpression";
202
199
  export declare function isOutgoingExpression(item: unknown): item is OutgoingExpression;
203
200
  export interface Relation extends AstNode {
204
201
  readonly $container: ElementBody | ExtendElementBody | Model;
205
- readonly $type: 'Relation' | 'RelationWithSource';
202
+ readonly $type: 'Relation';
206
203
  arr: RArrow;
207
- definition?: RelationBody;
204
+ body?: RelationBody;
205
+ source?: ElementRef;
208
206
  target: ElementRef;
209
207
  title?: string;
210
208
  }
211
209
  export declare const Relation = "Relation";
212
210
  export declare function isRelation(item: unknown): item is Relation;
213
211
  export interface RelationBody extends AstNode {
214
- readonly $container: Relation | RelationWithSource;
212
+ readonly $container: Relation;
215
213
  readonly $type: 'RelationBody';
216
214
  props: Array<RelationStringProperty>;
217
215
  tags?: Tags;
@@ -228,7 +226,7 @@ export interface RelationExpression extends AstNode {
228
226
  export declare const RelationExpression = "RelationExpression";
229
227
  export declare function isRelationExpression(item: unknown): item is RelationExpression;
230
228
  export interface RelationStringProperty extends AstNode {
231
- readonly $container: ElementBody | ElementView | RelationBody;
229
+ readonly $container: RelationBody;
232
230
  readonly $type: 'RelationStringProperty';
233
231
  key: 'title';
234
232
  value: string;
@@ -236,7 +234,7 @@ export interface RelationStringProperty extends AstNode {
236
234
  export declare const RelationStringProperty = "RelationStringProperty";
237
235
  export declare function isRelationStringProperty(item: unknown): item is RelationStringProperty;
238
236
  export interface ShapeProperty extends AstNode {
239
- readonly $container: ElementStyleProperty | SpecificationElementKindStyle | SpecificationTagStyle | ViewRuleStyle;
237
+ readonly $container: ElementStyleProperties | SpecificationStyleProperties | ViewRuleStyle;
240
238
  readonly $type: 'ShapeProperty';
241
239
  key: 'shape';
242
240
  value: ElementShape;
@@ -247,17 +245,10 @@ export interface SpecificationElementKind extends AstNode {
247
245
  readonly $container: SpecificationRule;
248
246
  readonly $type: 'SpecificationElementKind';
249
247
  kind: ElementKind;
250
- style?: SpecificationElementKindStyle;
248
+ style?: SpecificationStyleProperties;
251
249
  }
252
250
  export declare const SpecificationElementKind = "SpecificationElementKind";
253
251
  export declare function isSpecificationElementKind(item: unknown): item is SpecificationElementKind;
254
- export interface SpecificationElementKindStyle extends AstNode {
255
- readonly $container: SpecificationElementKind;
256
- readonly $type: 'SpecificationElementKindStyle';
257
- props: Array<ColorProperty | ShapeProperty>;
258
- }
259
- export declare const SpecificationElementKindStyle = "SpecificationElementKindStyle";
260
- export declare function isSpecificationElementKindStyle(item: unknown): item is SpecificationElementKindStyle;
261
252
  export interface SpecificationRule extends AstNode {
262
253
  readonly $container: LikeC4Document;
263
254
  readonly $type: 'SpecificationRule';
@@ -266,21 +257,21 @@ export interface SpecificationRule extends AstNode {
266
257
  }
267
258
  export declare const SpecificationRule = "SpecificationRule";
268
259
  export declare function isSpecificationRule(item: unknown): item is SpecificationRule;
260
+ export interface SpecificationStyleProperties extends AstNode {
261
+ readonly $container: SpecificationElementKind | SpecificationTag;
262
+ readonly $type: 'SpecificationStyleProperties';
263
+ props: Array<ColorProperty | ShapeProperty>;
264
+ }
265
+ export declare const SpecificationStyleProperties = "SpecificationStyleProperties";
266
+ export declare function isSpecificationStyleProperties(item: unknown): item is SpecificationStyleProperties;
269
267
  export interface SpecificationTag extends AstNode {
270
268
  readonly $container: SpecificationRule;
271
269
  readonly $type: 'SpecificationTag';
272
- style?: SpecificationTagStyle;
270
+ style?: SpecificationStyleProperties;
273
271
  tag: Tag;
274
272
  }
275
273
  export declare const SpecificationTag = "SpecificationTag";
276
274
  export declare function isSpecificationTag(item: unknown): item is SpecificationTag;
277
- export interface SpecificationTagStyle extends AstNode {
278
- readonly $container: SpecificationTag;
279
- readonly $type: 'SpecificationTagStyle';
280
- props: Array<ColorProperty | ShapeProperty>;
281
- }
282
- export declare const SpecificationTagStyle = "SpecificationTagStyle";
283
- export declare function isSpecificationTagStyle(item: unknown): item is SpecificationTagStyle;
284
275
  export interface StrictElementRef extends AstNode {
285
276
  readonly $container: ExtendElement | StrictElementRef;
286
277
  readonly $type: 'StrictElementRef';
@@ -304,7 +295,7 @@ export interface Tags extends AstNode {
304
295
  export declare const Tags = "Tags";
305
296
  export declare function isTags(item: unknown): item is Tags;
306
297
  export interface ViewProperty extends AstNode {
307
- readonly $container: ElementBody | ElementView | RelationBody;
298
+ readonly $container: ElementView;
308
299
  readonly $type: 'ViewProperty';
309
300
  key: 'description' | 'title';
310
301
  value: string;
@@ -341,20 +332,8 @@ export interface WildcardExpression extends AstNode {
341
332
  }
342
333
  export declare const WildcardExpression = "WildcardExpression";
343
334
  export declare function isWildcardExpression(item: unknown): item is WildcardExpression;
344
- export interface RelationWithSource extends Relation {
345
- readonly $container: ElementBody | ExtendElementBody | Model;
346
- readonly $type: 'RelationWithSource';
347
- arr: RArrow;
348
- definition?: RelationBody;
349
- source: ElementRef;
350
- target: ElementRef;
351
- title?: string;
352
- }
353
- export declare const RelationWithSource = "RelationWithSource";
354
- export declare function isRelationWithSource(item: unknown): item is RelationWithSource;
355
335
  export type LikeC4AstType = {
356
336
  AStyleProperty: AStyleProperty;
357
- AnyStringProperty: AnyStringProperty;
358
337
  ColorProperty: ColorProperty;
359
338
  Element: Element;
360
339
  ElementBody: ElementBody;
@@ -365,7 +344,7 @@ export type LikeC4AstType = {
365
344
  ElementRef: ElementRef;
366
345
  ElementRefExpression: ElementRefExpression;
367
346
  ElementStringProperty: ElementStringProperty;
368
- ElementStyleProperty: ElementStyleProperty;
347
+ ElementStyleProperties: ElementStyleProperties;
369
348
  ElementTagExpression: ElementTagExpression;
370
349
  ElementView: ElementView;
371
350
  Expression: Expression;
@@ -382,13 +361,11 @@ export type LikeC4AstType = {
382
361
  RelationBody: RelationBody;
383
362
  RelationExpression: RelationExpression;
384
363
  RelationStringProperty: RelationStringProperty;
385
- RelationWithSource: RelationWithSource;
386
364
  ShapeProperty: ShapeProperty;
387
365
  SpecificationElementKind: SpecificationElementKind;
388
- SpecificationElementKindStyle: SpecificationElementKindStyle;
389
366
  SpecificationRule: SpecificationRule;
367
+ SpecificationStyleProperties: SpecificationStyleProperties;
390
368
  SpecificationTag: SpecificationTag;
391
- SpecificationTagStyle: SpecificationTagStyle;
392
369
  StrictElementRef: StrictElementRef;
393
370
  Tag: Tag;
394
371
  Tags: Tags;
@@ -3,10 +3,6 @@
3
3
  * DO NOT EDIT MANUALLY!
4
4
  ******************************************************************************/
5
5
  import { AbstractAstReflection } from 'langium';
6
- export const AnyStringProperty = 'AnyStringProperty';
7
- export function isAnyStringProperty(item) {
8
- return reflection.isInstance(item, AnyStringProperty);
9
- }
10
6
  export const AStyleProperty = 'AStyleProperty';
11
7
  export function isAStyleProperty(item) {
12
8
  return reflection.isInstance(item, AStyleProperty);
@@ -36,7 +32,7 @@ export function isThemeColor(item) {
36
32
  return item === 'primary' || item === 'secondary' || item === 'muted' || item === 'slate' || item === 'blue' || item === 'indigo' || item === 'sky' || item === 'red' || item === 'gray' || item === 'green' || item === 'amber';
37
33
  }
38
34
  export function isUri(item) {
39
- return typeof item === 'string';
35
+ return (typeof item === 'string' && (/\w+:\/\/\S+/.test(item) || /\.{0,2}\/[^\/]\S+/.test(item)));
40
36
  }
41
37
  export const View = 'View';
42
38
  export function isView(item) {
@@ -81,9 +77,9 @@ export const ElementStringProperty = 'ElementStringProperty';
81
77
  export function isElementStringProperty(item) {
82
78
  return reflection.isInstance(item, ElementStringProperty);
83
79
  }
84
- export const ElementStyleProperty = 'ElementStyleProperty';
85
- export function isElementStyleProperty(item) {
86
- return reflection.isInstance(item, ElementStyleProperty);
80
+ export const ElementStyleProperties = 'ElementStyleProperties';
81
+ export function isElementStyleProperties(item) {
82
+ return reflection.isInstance(item, ElementStyleProperties);
87
83
  }
88
84
  export const ElementTagExpression = 'ElementTagExpression';
89
85
  export function isElementTagExpression(item) {
@@ -153,22 +149,18 @@ export const SpecificationElementKind = 'SpecificationElementKind';
153
149
  export function isSpecificationElementKind(item) {
154
150
  return reflection.isInstance(item, SpecificationElementKind);
155
151
  }
156
- export const SpecificationElementKindStyle = 'SpecificationElementKindStyle';
157
- export function isSpecificationElementKindStyle(item) {
158
- return reflection.isInstance(item, SpecificationElementKindStyle);
159
- }
160
152
  export const SpecificationRule = 'SpecificationRule';
161
153
  export function isSpecificationRule(item) {
162
154
  return reflection.isInstance(item, SpecificationRule);
163
155
  }
156
+ export const SpecificationStyleProperties = 'SpecificationStyleProperties';
157
+ export function isSpecificationStyleProperties(item) {
158
+ return reflection.isInstance(item, SpecificationStyleProperties);
159
+ }
164
160
  export const SpecificationTag = 'SpecificationTag';
165
161
  export function isSpecificationTag(item) {
166
162
  return reflection.isInstance(item, SpecificationTag);
167
163
  }
168
- export const SpecificationTagStyle = 'SpecificationTagStyle';
169
- export function isSpecificationTagStyle(item) {
170
- return reflection.isInstance(item, SpecificationTagStyle);
171
- }
172
164
  export const StrictElementRef = 'StrictElementRef';
173
165
  export function isStrictElementRef(item) {
174
166
  return reflection.isInstance(item, StrictElementRef);
@@ -201,13 +193,9 @@ export const WildcardExpression = 'WildcardExpression';
201
193
  export function isWildcardExpression(item) {
202
194
  return reflection.isInstance(item, WildcardExpression);
203
195
  }
204
- export const RelationWithSource = 'RelationWithSource';
205
- export function isRelationWithSource(item) {
206
- return reflection.isInstance(item, RelationWithSource);
207
- }
208
196
  export class LikeC4AstReflection extends AbstractAstReflection {
209
197
  getAllTypes() {
210
- return ['AStyleProperty', 'AnyStringProperty', 'ColorProperty', 'Element', 'ElementBody', 'ElementExpression', 'ElementKind', 'ElementKindExpression', 'ElementProperty', 'ElementRef', 'ElementRefExpression', 'ElementStringProperty', 'ElementStyleProperty', 'ElementTagExpression', 'ElementView', 'Expression', 'ExtendElement', 'ExtendElementBody', 'InOutExpression', 'IncomingExpression', 'LikeC4Document', 'LinkProperty', 'Model', 'ModelViews', 'OutgoingExpression', 'Relation', 'RelationBody', 'RelationExpression', 'RelationStringProperty', 'RelationWithSource', 'ShapeProperty', 'SpecificationElementKind', 'SpecificationElementKindStyle', 'SpecificationRule', 'SpecificationTag', 'SpecificationTagStyle', 'StrictElementRef', 'Tag', 'Tags', 'View', 'ViewProperty', 'ViewRule', 'ViewRuleAutoLayout', 'ViewRuleExpression', 'ViewRuleStyle', 'WildcardExpression'];
198
+ return ['AStyleProperty', 'ColorProperty', 'Element', 'ElementBody', 'ElementExpression', 'ElementKind', 'ElementKindExpression', 'ElementProperty', 'ElementRef', 'ElementRefExpression', 'ElementStringProperty', 'ElementStyleProperties', 'ElementTagExpression', 'ElementView', 'Expression', 'ExtendElement', 'ExtendElementBody', 'InOutExpression', 'IncomingExpression', 'LikeC4Document', 'LinkProperty', 'Model', 'ModelViews', 'OutgoingExpression', 'Relation', 'RelationBody', 'RelationExpression', 'RelationStringProperty', 'ShapeProperty', 'SpecificationElementKind', 'SpecificationRule', 'SpecificationStyleProperties', 'SpecificationTag', 'StrictElementRef', 'Tag', 'Tags', 'View', 'ViewProperty', 'ViewRule', 'ViewRuleAutoLayout', 'ViewRuleExpression', 'ViewRuleStyle', 'WildcardExpression'];
211
199
  }
212
200
  computeIsSubtype(subtype, supertype) {
213
201
  switch (subtype) {
@@ -228,23 +216,13 @@ export class LikeC4AstReflection extends AbstractAstReflection {
228
216
  case WildcardExpression: {
229
217
  return this.isSubtype(ElementExpression, supertype);
230
218
  }
231
- case ElementStringProperty: {
232
- return this.isSubtype(AnyStringProperty, supertype) || this.isSubtype(ElementProperty, supertype);
233
- }
234
- case ElementStyleProperty: {
219
+ case ElementStringProperty:
220
+ case ElementStyleProperties: {
235
221
  return this.isSubtype(ElementProperty, supertype);
236
222
  }
237
223
  case ElementView: {
238
224
  return this.isSubtype(View, supertype);
239
225
  }
240
- case LinkProperty:
241
- case RelationStringProperty:
242
- case ViewProperty: {
243
- return this.isSubtype(AnyStringProperty, supertype);
244
- }
245
- case RelationWithSource: {
246
- return this.isSubtype(Relation, supertype);
247
- }
248
226
  case ViewRuleAutoLayout:
249
227
  case ViewRuleExpression:
250
228
  case ViewRuleStyle: {
@@ -310,9 +288,9 @@ export class LikeC4AstReflection extends AbstractAstReflection {
310
288
  ]
311
289
  };
312
290
  }
313
- case 'ElementStyleProperty': {
291
+ case 'ElementStyleProperties': {
314
292
  return {
315
- name: 'ElementStyleProperty',
293
+ name: 'ElementStyleProperties',
316
294
  mandatory: [
317
295
  { name: 'props', type: 'array' }
318
296
  ]
@@ -367,14 +345,6 @@ export class LikeC4AstReflection extends AbstractAstReflection {
367
345
  ]
368
346
  };
369
347
  }
370
- case 'SpecificationElementKindStyle': {
371
- return {
372
- name: 'SpecificationElementKindStyle',
373
- mandatory: [
374
- { name: 'props', type: 'array' }
375
- ]
376
- };
377
- }
378
348
  case 'SpecificationRule': {
379
349
  return {
380
350
  name: 'SpecificationRule',
@@ -383,9 +353,9 @@ export class LikeC4AstReflection extends AbstractAstReflection {
383
353
  ]
384
354
  };
385
355
  }
386
- case 'SpecificationTagStyle': {
356
+ case 'SpecificationStyleProperties': {
387
357
  return {
388
- name: 'SpecificationTagStyle',
358
+ name: 'SpecificationStyleProperties',
389
359
  mandatory: [
390
360
  { name: 'props', type: 'array' }
391
361
  ]