@likec4/language-server 0.24.0 → 0.25.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.
@@ -4,16 +4,16 @@ export default {
4
4
  'BottomTop','LeftRight','RightLeft','TopBottom','amber','autoLayout','blue','browser','color','cylinder','description','element','exclude','extend','gray','green','include','indigo','it','kind','mobile','model','muted','of','person','primary','queue','rectangle','red','secondary','shape','sky','slate','specification','storage','style','tag','technology','this','title','view','views'
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":"string"} },
13
14
  { regex: /[^\W\d_]/, action: { cases: { '@keywords': {"token":"keyword"}, '@default': {"token":"LETTER"} }} },
14
15
  { regex: /[0-9]/, action: {"token":"DIGIT"} },
15
16
  { regex: /[\t\r\n\v\f]/, action: {"token":"NEWLINE"} },
16
- { regex: /"[^"]*"|'[^']*'/, action: {"token":"string"} },
17
17
  { include: '@whitespace' },
18
18
  { regex: /@symbols/, action: { cases: { '@operators': {"token":"operator"}, '@default': {"token":""} }} },
19
19
  ],
package/dist/ast.js CHANGED
@@ -28,11 +28,12 @@ export const ElementViewOps = {
28
28
  };
29
29
  export const ElementOps = {
30
30
  writeId(node, id) {
31
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
31
  if (id === null) {
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-dynamic-delete
33
33
  delete node[idattr];
34
34
  }
35
35
  else {
36
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
37
  node[idattr] = id;
37
38
  }
38
39
  return node;
@@ -23,6 +23,8 @@ export declare const Expression = "Expression";
23
23
  export declare function isExpression(item: unknown): item is Expression;
24
24
  export type Name = 'element' | 'model' | ElementShape | ThemeColor | string;
25
25
  export declare function isName(item: unknown): item is Name;
26
+ export type RArrow = string;
27
+ export declare function isRArrow(item: unknown): item is RArrow;
26
28
  export type ThemeColor = 'amber' | 'blue' | 'gray' | 'green' | 'indigo' | 'muted' | 'primary' | 'red' | 'secondary' | 'sky' | 'slate';
27
29
  export declare function isThemeColor(item: unknown): item is ThemeColor;
28
30
  export type View = ElementView;
@@ -143,6 +145,7 @@ export declare function isExtendElementBody(item: unknown): item is ExtendElemen
143
145
  export interface IncomingExpression extends AstNode {
144
146
  readonly $container: InOutExpression | IncomingExpression | OutgoingExpression | RelationExpression | ViewRuleExpression | ViewRuleStyle;
145
147
  readonly $type: 'IncomingExpression';
148
+ arr: RArrow;
146
149
  target: ElementExpression;
147
150
  }
148
151
  export declare const IncomingExpression = "IncomingExpression";
@@ -150,6 +153,7 @@ export declare function isIncomingExpression(item: unknown): item is IncomingExp
150
153
  export interface InOutExpression extends AstNode {
151
154
  readonly $container: InOutExpression | IncomingExpression | OutgoingExpression | RelationExpression | ViewRuleExpression | ViewRuleStyle;
152
155
  readonly $type: 'InOutExpression';
156
+ arr: RArrow;
153
157
  inout: IncomingExpression;
154
158
  }
155
159
  export declare const InOutExpression = "InOutExpression";
@@ -181,6 +185,7 @@ export declare function isModelViews(item: unknown): item is ModelViews;
181
185
  export interface OutgoingExpression extends AstNode {
182
186
  readonly $container: InOutExpression | IncomingExpression | OutgoingExpression | RelationExpression | ViewRuleExpression | ViewRuleStyle;
183
187
  readonly $type: 'OutgoingExpression';
188
+ arr: RArrow;
184
189
  source: ElementExpression;
185
190
  }
186
191
  export declare const OutgoingExpression = "OutgoingExpression";
@@ -188,6 +193,7 @@ export declare function isOutgoingExpression(item: unknown): item is OutgoingExp
188
193
  export interface Relation extends AstNode {
189
194
  readonly $container: ElementBody | ExtendElementBody | Model;
190
195
  readonly $type: 'Relation' | 'RelationWithSource';
196
+ arr: RArrow;
191
197
  definition?: RelationBody;
192
198
  target: ElementRef;
193
199
  title?: string;
@@ -205,6 +211,7 @@ export declare function isRelationBody(item: unknown): item is RelationBody;
205
211
  export interface RelationExpression extends AstNode {
206
212
  readonly $container: InOutExpression | IncomingExpression | OutgoingExpression | RelationExpression | ViewRuleExpression | ViewRuleStyle;
207
213
  readonly $type: 'RelationExpression';
214
+ arr: RArrow;
208
215
  source: ElementExpression;
209
216
  target: ElementExpression;
210
217
  }
@@ -328,6 +335,7 @@ export declare function isWildcardExpression(item: unknown): item is WildcardExp
328
335
  export interface RelationWithSource extends Relation {
329
336
  readonly $container: ElementBody | ExtendElementBody | Model;
330
337
  readonly $type: 'RelationWithSource';
338
+ arr: RArrow;
331
339
  definition?: RelationBody;
332
340
  source: ElementRef;
333
341
  target: ElementRef;
@@ -29,6 +29,9 @@ export function isExpression(item) {
29
29
  export function isName(item) {
30
30
  return isElementShape(item) || isThemeColor(item) || item === 'element' || item === 'model' || (typeof item === 'string' && (/((([^\W\d_])|(_))((([^\W\d_])|([0-9]))|(_))*)/.test(item)));
31
31
  }
32
+ export function isRArrow(item) {
33
+ return (typeof item === 'string' && (/->/.test(item)));
34
+ }
32
35
  export function isThemeColor(item) {
33
36
  return item === 'primary' || item === 'secondary' || item === 'muted' || item === 'slate' || item === 'blue' || item === 'indigo' || item === 'sky' || item === 'red' || item === 'gray' || item === 'green' || item === 'amber';
34
37
  }