@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.
Files changed (60) hide show
  1. package/contrib/likec4.monarch.ts +5 -5
  2. package/contrib/likec4.tmLanguage.json +1 -1
  3. package/dist/Rpc.d.ts +7 -0
  4. package/dist/Rpc.js +130 -0
  5. package/dist/ast.d.ts +20 -0
  6. package/dist/ast.js +169 -141
  7. package/dist/elementRef.js +31 -44
  8. package/dist/generated/ast.d.ts +48 -7
  9. package/dist/generated/ast.js +344 -315
  10. package/dist/generated/grammar.js +2 -3177
  11. package/dist/generated/module.js +13 -18
  12. package/dist/index.js +2 -3
  13. package/dist/logger.js +39 -42
  14. package/dist/lsp/CodeLensProvider.js +28 -32
  15. package/dist/lsp/DocumentLinkProvider.js +26 -33
  16. package/dist/lsp/DocumentSymbolProvider.js +165 -167
  17. package/dist/lsp/HoverProvider.js +35 -48
  18. package/dist/lsp/SemanticTokenProvider.js +160 -201
  19. package/dist/lsp/index.js +5 -6
  20. package/dist/model/fqn-computation.js +39 -40
  21. package/dist/model/fqn-index.js +117 -141
  22. package/dist/model/index.js +5 -6
  23. package/dist/model/model-builder.d.ts +10 -5
  24. package/dist/model/model-builder.js +247 -176
  25. package/dist/model/model-locator.d.ts +1 -1
  26. package/dist/model/model-locator.js +102 -100
  27. package/dist/model/model-parser.d.ts +2 -6
  28. package/dist/model/model-parser.js +284 -286
  29. package/dist/module.d.ts +4 -1
  30. package/dist/module.js +69 -60
  31. package/dist/protocol.d.ts +16 -19
  32. package/dist/protocol.js +14 -22
  33. package/dist/references/index.js +2 -3
  34. package/dist/references/scope-computation.js +72 -69
  35. package/dist/references/scope-provider.js +126 -116
  36. package/dist/shared/WorkspaceManager.d.ts +2 -3
  37. package/dist/shared/WorkspaceManager.js +13 -16
  38. package/dist/shared/index.js +1 -2
  39. package/dist/test/index.js +1 -2
  40. package/dist/test/testServices.js +73 -61
  41. package/dist/utils.d.ts +1 -0
  42. package/dist/utils.js +4 -3
  43. package/dist/validation/element.d.ts +1 -0
  44. package/dist/validation/element.js +31 -38
  45. package/dist/validation/index.js +37 -46
  46. package/dist/validation/relation.js +46 -46
  47. package/dist/validation/specification.d.ts +1 -0
  48. package/dist/validation/specification.js +33 -30
  49. package/dist/validation/view.js +16 -22
  50. package/dist/view-utils/assignNavigateTo.d.ts +3 -0
  51. package/dist/view-utils/assignNavigateTo.js +20 -0
  52. package/dist/view-utils/index.d.ts +4 -0
  53. package/dist/view-utils/index.js +3 -0
  54. package/dist/view-utils/resolve-extended-views.d.ts +7 -0
  55. package/dist/view-utils/resolve-extended-views.js +41 -0
  56. package/dist/view-utils/resolve-relative-paths.d.ts +3 -0
  57. package/dist/view-utils/resolve-relative-paths.js +76 -0
  58. package/package.json +33 -18
  59. package/dist/registerProtocolHandlers.d.ts +0 -3
  60. package/dist/registerProtocolHandlers.js +0 -112
@@ -5,6 +5,9 @@
5
5
  import type { AstNode, Reference, ReferenceInfo, TypeMetaData } from 'langium';
6
6
  import { AbstractAstReflection } from 'langium';
7
7
  export declare const LikeC4Terminals: {
8
+ BLOCK_COMMENT: RegExp;
9
+ LINE_COMMENT: RegExp;
10
+ WS: RegExp;
8
11
  URI_WITH_SCHEMA: RegExp;
9
12
  URI_RELATIVE: RegExp;
10
13
  RARROW: RegExp;
@@ -16,13 +19,12 @@ export declare const LikeC4Terminals: {
16
19
  Colon: RegExp;
17
20
  SemiColon: RegExp;
18
21
  Comma: RegExp;
22
+ STRING: RegExp;
19
23
  TagID: RegExp;
20
24
  ID: RegExp;
21
- STRING: RegExp;
22
- WS: RegExp;
23
- BLOCK_COMMENT: RegExp;
24
- LINE_COMMENT: RegExp;
25
25
  };
26
+ export type ArrowType = 'crow' | 'diamond' | 'none' | 'normal' | 'odiamond' | 'onormal' | 'open' | 'vee';
27
+ export declare function isArrowType(item: unknown): item is ArrowType;
26
28
  export type ElementExpression = ElementKindExpression | ElementRefExpression | ElementTagExpression | WildcardExpression;
27
29
  export declare const ElementExpression = "ElementExpression";
28
30
  export declare function isElementExpression(item: unknown): item is ElementExpression;
@@ -34,7 +36,9 @@ export declare function isElementShape(item: unknown): item is ElementShape;
34
36
  export type Expression = ElementExpression | InOutExpression | IncomingExpression | OutgoingExpression | RelationExpression;
35
37
  export declare const Expression = "Expression";
36
38
  export declare function isExpression(item: unknown): item is Expression;
37
- export type Name = 'element' | 'model' | ElementShape | ThemeColor | string;
39
+ export type LineOptions = 'dashed' | 'dotted' | 'solid';
40
+ export declare function isLineOptions(item: unknown): item is LineOptions;
41
+ export type Name = 'element' | 'model' | ArrowType | ElementShape | LineOptions | ThemeColor | string;
38
42
  export declare function isName(item: unknown): item is Name;
39
43
  export type RArrow = string;
40
44
  export declare function isRArrow(item: unknown): item is RArrow;
@@ -50,8 +54,16 @@ export declare const ViewRule = "ViewRule";
50
54
  export declare function isViewRule(item: unknown): item is ViewRule;
51
55
  export type ViewRuleLayoutDirection = 'BottomTop' | 'LeftRight' | 'RightLeft' | 'TopBottom';
52
56
  export declare function isViewRuleLayoutDirection(item: unknown): item is ViewRuleLayoutDirection;
57
+ export interface ArrowProperty extends AstNode {
58
+ readonly $container: SpecificationRelationshipKind;
59
+ readonly $type: 'ArrowProperty';
60
+ key: 'head' | 'tail';
61
+ value: ArrowType;
62
+ }
63
+ export declare const ArrowProperty = "ArrowProperty";
64
+ export declare function isArrowProperty(item: unknown): item is ArrowProperty;
53
65
  export interface ColorProperty extends AstNode {
54
- readonly $container: StyleProperties | ViewRuleStyle;
66
+ readonly $container: SpecificationRelationshipKind | StyleProperties | ViewRuleStyle;
55
67
  readonly $type: 'ColorProperty';
56
68
  key: 'color';
57
69
  value: ThemeColor;
@@ -197,6 +209,14 @@ export interface LikeC4Document extends AstNode {
197
209
  }
198
210
  export declare const LikeC4Document = "LikeC4Document";
199
211
  export declare function isLikeC4Document(item: unknown): item is LikeC4Document;
212
+ export interface LineProperty extends AstNode {
213
+ readonly $container: SpecificationRelationshipKind;
214
+ readonly $type: 'LineProperty';
215
+ key: 'line';
216
+ value: LineOptions;
217
+ }
218
+ export declare const LineProperty = "LineProperty";
219
+ export declare function isLineProperty(item: unknown): item is LineProperty;
200
220
  export interface LinkProperty extends AstNode {
201
221
  readonly $container: ElementBody | ElementViewBody;
202
222
  readonly $type: 'LinkProperty';
@@ -232,8 +252,9 @@ export declare function isOutgoingExpression(item: unknown): item is OutgoingExp
232
252
  export interface Relation extends AstNode {
233
253
  readonly $container: ElementBody | ExtendElementBody | Model;
234
254
  readonly $type: 'Relation';
235
- arr: RArrow;
255
+ arr?: RArrow;
236
256
  body?: RelationBody;
257
+ kind?: Reference<RelationshipKind>;
237
258
  source?: ElementRef;
238
259
  target: ElementRef;
239
260
  title?: string;
@@ -257,6 +278,13 @@ export interface RelationExpression extends AstNode {
257
278
  }
258
279
  export declare const RelationExpression = "RelationExpression";
259
280
  export declare function isRelationExpression(item: unknown): item is RelationExpression;
281
+ export interface RelationshipKind extends AstNode {
282
+ readonly $container: SpecificationRelationshipKind;
283
+ readonly $type: 'RelationshipKind';
284
+ name: Name;
285
+ }
286
+ export declare const RelationshipKind = "RelationshipKind";
287
+ export declare function isRelationshipKind(item: unknown): item is RelationshipKind;
260
288
  export interface RelationStringProperty extends AstNode {
261
289
  readonly $container: RelationBody;
262
290
  readonly $type: 'RelationStringProperty';
@@ -281,11 +309,20 @@ export interface SpecificationElementKind extends AstNode {
281
309
  }
282
310
  export declare const SpecificationElementKind = "SpecificationElementKind";
283
311
  export declare function isSpecificationElementKind(item: unknown): item is SpecificationElementKind;
312
+ export interface SpecificationRelationshipKind extends AstNode {
313
+ readonly $container: SpecificationRule;
314
+ readonly $type: 'SpecificationRelationshipKind';
315
+ kind: RelationshipKind;
316
+ props: Array<ArrowProperty | ColorProperty | LineProperty>;
317
+ }
318
+ export declare const SpecificationRelationshipKind = "SpecificationRelationshipKind";
319
+ export declare function isSpecificationRelationshipKind(item: unknown): item is SpecificationRelationshipKind;
284
320
  export interface SpecificationRule extends AstNode {
285
321
  readonly $container: LikeC4Document;
286
322
  readonly $type: 'SpecificationRule';
287
323
  elements: Array<SpecificationElementKind>;
288
324
  name: 'specification';
325
+ relationships: Array<SpecificationRelationshipKind>;
289
326
  tags: Array<SpecificationTag>;
290
327
  }
291
328
  export declare const SpecificationRule = "SpecificationRule";
@@ -367,6 +404,7 @@ export interface WildcardExpression extends AstNode {
367
404
  export declare const WildcardExpression = "WildcardExpression";
368
405
  export declare function isWildcardExpression(item: unknown): item is WildcardExpression;
369
406
  export type LikeC4AstType = {
407
+ ArrowProperty: ArrowProperty;
370
408
  ColorProperty: ColorProperty;
371
409
  Element: Element;
372
410
  ElementBody: ElementBody;
@@ -388,6 +426,7 @@ export type LikeC4AstType = {
388
426
  InOutExpression: InOutExpression;
389
427
  IncomingExpression: IncomingExpression;
390
428
  LikeC4Document: LikeC4Document;
429
+ LineProperty: LineProperty;
391
430
  LinkProperty: LinkProperty;
392
431
  Model: Model;
393
432
  ModelViews: ModelViews;
@@ -396,8 +435,10 @@ export type LikeC4AstType = {
396
435
  RelationBody: RelationBody;
397
436
  RelationExpression: RelationExpression;
398
437
  RelationStringProperty: RelationStringProperty;
438
+ RelationshipKind: RelationshipKind;
399
439
  ShapeProperty: ShapeProperty;
400
440
  SpecificationElementKind: SpecificationElementKind;
441
+ SpecificationRelationshipKind: SpecificationRelationshipKind;
401
442
  SpecificationRule: SpecificationRule;
402
443
  SpecificationTag: SpecificationTag;
403
444
  StrictElementRef: StrictElementRef;