@likec4/language-server 1.30.0 → 1.32.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 (80) hide show
  1. package/dist/LikeC4LanguageServices.d.ts +2 -1
  2. package/dist/LikeC4LanguageServices.js +4 -3
  3. package/dist/Rpc.js +11 -4
  4. package/dist/ast.d.ts +11 -15
  5. package/dist/bundled.mjs +2545 -2475
  6. package/dist/formatting/LikeC4Formatter.d.ts +26 -2
  7. package/dist/formatting/LikeC4Formatter.js +106 -8
  8. package/dist/generated/ast.d.ts +171 -153
  9. package/dist/generated/ast.js +40 -18
  10. package/dist/generated/grammar.d.ts +1 -1
  11. package/dist/generated/grammar.js +1 -1
  12. package/dist/generated/module.d.ts +1 -1
  13. package/dist/lsp/CompletionProvider.js +1 -1
  14. package/dist/lsp/DocumentLinkProvider.js +4 -3
  15. package/dist/lsp/HoverProvider.js +9 -1
  16. package/dist/lsp/SemanticTokenProvider.js +18 -4
  17. package/dist/mcp/LikeC4MCPServerFactory.d.ts +5 -2
  18. package/dist/mcp/LikeC4MCPServerFactory.js +2 -72
  19. package/dist/mcp/LikeC4MCPTools.js +5 -3
  20. package/dist/mcp/sseserver/MCPServerFactory.d.ts +8 -0
  21. package/dist/mcp/sseserver/MCPServerFactory.js +78 -0
  22. package/dist/mcp/sseserver/with-mcp-server.d.ts +2 -0
  23. package/dist/mcp/sseserver/with-mcp-server.js +5 -1
  24. package/dist/mcp/utils.d.ts +5 -4
  25. package/dist/mcp/utils.js +2 -2
  26. package/dist/model/builder/MergedExtends.d.ts +4 -4
  27. package/dist/model/builder/MergedExtends.js +1 -1
  28. package/dist/model/builder/MergedSpecification.d.ts +4 -3
  29. package/dist/model/builder/MergedSpecification.js +9 -8
  30. package/dist/model/builder/assignTagColors.d.ts +7 -0
  31. package/dist/model/builder/assignTagColors.js +51 -0
  32. package/dist/model/builder/buildModel.d.ts +2 -2
  33. package/dist/model/builder/buildModel.js +40 -18
  34. package/dist/model/deployments-index.js +2 -2
  35. package/dist/model/fqn-index.d.ts +1 -1
  36. package/dist/model/fqn-index.js +6 -6
  37. package/dist/model/model-builder.d.ts +10 -4
  38. package/dist/model/model-builder.js +22 -19
  39. package/dist/model/model-locator.d.ts +10 -2
  40. package/dist/model/model-locator.js +65 -9
  41. package/dist/model/model-parser-where.d.ts +1 -1
  42. package/dist/model/model-parser-where.js +1 -1
  43. package/dist/model/model-parser.d.ts +10 -11
  44. package/dist/model/model-parser.js +11 -7
  45. package/dist/model/parser/Base.js +2 -3
  46. package/dist/model/parser/DeploymentModelParser.d.ts +1 -1
  47. package/dist/model/parser/DeploymentModelParser.js +7 -5
  48. package/dist/model/parser/DeploymentViewParser.d.ts +3 -3
  49. package/dist/model/parser/DeploymentViewParser.js +2 -1
  50. package/dist/model/parser/FqnRefParser.d.ts +1 -1
  51. package/dist/model/parser/FqnRefParser.js +2 -5
  52. package/dist/model/parser/GlobalsParser.d.ts +23 -24
  53. package/dist/model/parser/GlobalsParser.js +4 -4
  54. package/dist/model/parser/ModelParser.d.ts +1 -1
  55. package/dist/model/parser/ModelParser.js +1 -1
  56. package/dist/model/parser/PredicatesParser.d.ts +12 -12
  57. package/dist/model/parser/SpecificationParser.d.ts +5 -2
  58. package/dist/model/parser/SpecificationParser.js +18 -30
  59. package/dist/model/parser/ViewsParser.d.ts +23 -23
  60. package/dist/model/parser/ViewsParser.js +12 -19
  61. package/dist/model-change/changeElementStyle.d.ts +2 -2
  62. package/dist/model-change/changeElementStyle.js +6 -2
  63. package/dist/module.d.ts +1 -1
  64. package/dist/module.js +5 -2
  65. package/dist/protocol.d.ts +24 -3
  66. package/dist/protocol.js +4 -0
  67. package/dist/references/scope-computation.js +2 -3
  68. package/dist/test/testServices.d.ts +15 -0
  69. package/dist/test/testServices.js +4 -1
  70. package/dist/validation/relation.js +1 -1
  71. package/dist/validation/specification.js +1 -1
  72. package/dist/view-utils/assignNavigateTo.d.ts +1 -1
  73. package/dist/view-utils/assignNavigateTo.js +3 -3
  74. package/dist/views/likec4-views.d.ts +1 -3
  75. package/dist/views/likec4-views.js +68 -44
  76. package/dist/workspace/WorkspaceManager.d.ts +2 -2
  77. package/dist/workspace/WorkspaceManager.js +2 -2
  78. package/package.json +27 -25
  79. /package/dist/mcp/sseserver/{SSELikeC4MCPServer.d.ts → MCPServer.d.ts} +0 -0
  80. /package/dist/mcp/sseserver/{SSELikeC4MCPServer.js → MCPServer.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { AbstractAstReflection } from "langium";
1
+ import * as langium from "langium";
2
2
  export const LikeC4Terminals = {
3
3
  BLOCK_COMMENT: /\/\*[\s\S]*?\*\//,
4
4
  LINE_COMMENT: /\/\/[^\n\r]*/,
@@ -47,9 +47,6 @@ export const DeploymentViewRule = "DeploymentViewRule";
47
47
  export function isDeploymentViewRule(item) {
48
48
  return reflection.isInstance(item, DeploymentViewRule);
49
49
  }
50
- export function isDotId(item) {
51
- return typeof item === "string";
52
- }
53
50
  export const DynamicViewRule = "DynamicViewRule";
54
51
  export function isDynamicViewRule(item) {
55
52
  return reflection.isInstance(item, DynamicViewRule);
@@ -148,9 +145,6 @@ export const StyleProperty = "StyleProperty";
148
145
  export function isStyleProperty(item) {
149
146
  return reflection.isInstance(item, StyleProperty);
150
147
  }
151
- export function isTagId(item) {
152
- return typeof item === "string";
153
- }
154
148
  export function isThemeColor(item) {
155
149
  return item === "primary" || item === "secondary" || item === "muted" || item === "slate" || item === "blue" || item === "indigo" || item === "sky" || item === "red" || item === "gray" || item === "green" || item === "amber";
156
150
  }
@@ -512,6 +506,10 @@ export const RelationExprWith = "RelationExprWith";
512
506
  export function isRelationExprWith(item) {
513
507
  return reflection.isInstance(item, RelationExprWith);
514
508
  }
509
+ export const RelationKindDotRef = "RelationKindDotRef";
510
+ export function isRelationKindDotRef(item) {
511
+ return reflection.isInstance(item, RelationKindDotRef);
512
+ }
515
513
  export const RelationNavigateToProperty = "RelationNavigateToProperty";
516
514
  export function isRelationNavigateToProperty(item) {
517
515
  return reflection.isInstance(item, RelationNavigateToProperty);
@@ -580,6 +578,10 @@ export const Tag = "Tag";
580
578
  export function isTag(item) {
581
579
  return reflection.isInstance(item, Tag);
582
580
  }
581
+ export const TagRef = "TagRef";
582
+ export function isTagRef(item) {
583
+ return reflection.isInstance(item, TagRef);
584
+ }
583
585
  export const Tags = "Tags";
584
586
  export function isTags(item) {
585
587
  return reflection.isInstance(item, Tags);
@@ -660,9 +662,9 @@ export const WildcardExpression = "WildcardExpression";
660
662
  export function isWildcardExpression(item) {
661
663
  return reflection.isInstance(item, WildcardExpression);
662
664
  }
663
- export class LikeC4AstReflection extends AbstractAstReflection {
665
+ export class LikeC4AstReflection extends langium.AbstractAstReflection {
664
666
  getAllTypes() {
665
- return [ArrowProperty, BorderProperty, ColorProperty, CustomColor, CustomElementProperties, CustomRelationProperties, DeployedInstance, DeployedInstanceBody, DeploymentElement, DeploymentNode, DeploymentNodeBody, DeploymentNodeKind, DeploymentNodeOrElementKind, DeploymentRelation, DeploymentRelationBody, DeploymentView, DeploymentViewBody, DeploymentViewRule, DeploymentViewRulePredicate, DeploymentViewRuleStyle, DirectedRelationExpr, DynamicView, DynamicViewBody, DynamicViewGlobalPredicateRef, DynamicViewIncludePredicate, DynamicViewParallelSteps, DynamicViewRef, DynamicViewRule, DynamicViewStep, Element, ElementBody, ElementKind, ElementKindExpression, ElementProperty, ElementRef, ElementStringProperty, ElementStyleProperty, ElementTagExpression, ElementView, ElementViewBody, ElementViewRef, ExpressionV2, Expressions, ExtendDeployment, ExtendDeploymentBody, ExtendElement, ExtendElementBody, ExtendElementProperty, FqnExpr, FqnExprOrWhere, FqnExprOrWith, FqnExprWhere, FqnExprWith, FqnExpressions, FqnRef, FqnRefExpr, FqnReferenceable, GlobalDynamicPredicateGroup, GlobalPredicateGroup, GlobalStyle, GlobalStyleGroup, GlobalStyleId, Globals, IconProperty, Imported, ImportsFromPoject, InOutRelationExpr, IncomingRelationExpr, LibIcon, LikeC4Grammar, LikeC4Lib, LikeC4View, LineProperty, LinkProperty, MetadataAttribute, MetadataBody, MetadataProperty, Model, ModelDeployments, ModelReferenceable, ModelViews, MultipleProperty, NavigateToProperty, NotationProperty, NotesProperty, OpacityProperty, OutgoingRelationExpr, PaddingSizeProperty, Referenceable, Relation, RelationBody, RelationExpr, RelationExprOrWhere, RelationExprOrWith, RelationExprWhere, RelationExprWith, RelationNavigateToProperty, RelationProperty, RelationStringProperty, RelationStyleProperty, RelationshipKind, RelationshipStyleProperty, ShapeProperty, ShapeSizeProperty, SizeProperty, SpecificationColor, SpecificationDeploymentNodeKind, SpecificationElementKind, SpecificationElementStringProperty, SpecificationRelationshipKind, SpecificationRelationshipStringProperty, SpecificationRule, SpecificationTag, StrictFqnElementRef, StrictFqnRef, StringProperty, StyleProperty, Tag, Tags, TextSizeProperty, ViewProperty, ViewRef, ViewRule, ViewRuleAutoLayout, ViewRuleGlobalPredicateRef, ViewRuleGlobalStyle, ViewRuleGroup, ViewRulePredicate, ViewRuleStyle, ViewRuleStyleOrGlobalRef, ViewStringProperty, WhereBinaryExpression, WhereElement, WhereElementExpression, WhereElementKind, WhereElementNegation, WhereElementTag, WhereExpression, WhereKindEqual, WhereRelation, WhereRelationExpression, WhereRelationKind, WhereRelationNegation, WhereRelationParticipantKind, WhereRelationParticipantTag, WhereRelationTag, WhereTagEqual, WildcardExpression];
667
+ return [ArrowProperty, BorderProperty, ColorProperty, CustomColor, CustomElementProperties, CustomRelationProperties, DeployedInstance, DeployedInstanceBody, DeploymentElement, DeploymentNode, DeploymentNodeBody, DeploymentNodeKind, DeploymentNodeOrElementKind, DeploymentRelation, DeploymentRelationBody, DeploymentView, DeploymentViewBody, DeploymentViewRule, DeploymentViewRulePredicate, DeploymentViewRuleStyle, DirectedRelationExpr, DynamicView, DynamicViewBody, DynamicViewGlobalPredicateRef, DynamicViewIncludePredicate, DynamicViewParallelSteps, DynamicViewRef, DynamicViewRule, DynamicViewStep, Element, ElementBody, ElementKind, ElementKindExpression, ElementProperty, ElementRef, ElementStringProperty, ElementStyleProperty, ElementTagExpression, ElementView, ElementViewBody, ElementViewRef, ExpressionV2, Expressions, ExtendDeployment, ExtendDeploymentBody, ExtendElement, ExtendElementBody, ExtendElementProperty, FqnExpr, FqnExprOrWhere, FqnExprOrWith, FqnExprWhere, FqnExprWith, FqnExpressions, FqnRef, FqnRefExpr, FqnReferenceable, GlobalDynamicPredicateGroup, GlobalPredicateGroup, GlobalStyle, GlobalStyleGroup, GlobalStyleId, Globals, IconProperty, Imported, ImportsFromPoject, InOutRelationExpr, IncomingRelationExpr, LibIcon, LikeC4Grammar, LikeC4Lib, LikeC4View, LineProperty, LinkProperty, MetadataAttribute, MetadataBody, MetadataProperty, Model, ModelDeployments, ModelReferenceable, ModelViews, MultipleProperty, NavigateToProperty, NotationProperty, NotesProperty, OpacityProperty, OutgoingRelationExpr, PaddingSizeProperty, Referenceable, Relation, RelationBody, RelationExpr, RelationExprOrWhere, RelationExprOrWith, RelationExprWhere, RelationExprWith, RelationKindDotRef, RelationNavigateToProperty, RelationProperty, RelationStringProperty, RelationStyleProperty, RelationshipKind, RelationshipStyleProperty, ShapeProperty, ShapeSizeProperty, SizeProperty, SpecificationColor, SpecificationDeploymentNodeKind, SpecificationElementKind, SpecificationElementStringProperty, SpecificationRelationshipKind, SpecificationRelationshipStringProperty, SpecificationRule, SpecificationTag, StrictFqnElementRef, StrictFqnRef, StringProperty, StyleProperty, Tag, TagRef, Tags, TextSizeProperty, ViewProperty, ViewRef, ViewRule, ViewRuleAutoLayout, ViewRuleGlobalPredicateRef, ViewRuleGlobalStyle, ViewRuleGroup, ViewRulePredicate, ViewRuleStyle, ViewRuleStyleOrGlobalRef, ViewStringProperty, WhereBinaryExpression, WhereElement, WhereElementExpression, WhereElementKind, WhereElementNegation, WhereElementTag, WhereExpression, WhereKindEqual, WhereRelation, WhereRelationExpression, WhereRelationKind, WhereRelationNegation, WhereRelationParticipantKind, WhereRelationParticipantTag, WhereRelationTag, WhereTagEqual, WildcardExpression];
666
668
  }
667
669
  computeIsSubtype(subtype, supertype) {
668
670
  switch (subtype) {
@@ -845,6 +847,7 @@ export class LikeC4AstReflection extends AbstractAstReflection {
845
847
  case "DynamicViewStep:kind":
846
848
  case "OutgoingRelationExpr:kind":
847
849
  case "Relation:kind":
850
+ case "RelationKindDotRef:kind":
848
851
  case "WhereRelationKind:value": {
849
852
  return RelationshipKind;
850
853
  }
@@ -858,13 +861,6 @@ export class LikeC4AstReflection extends AbstractAstReflection {
858
861
  case "ElementKindExpression:kind": {
859
862
  return ElementKind;
860
863
  }
861
- case "ElementTagExpression:tag":
862
- case "Tags:values":
863
- case "WhereElementTag:value":
864
- case "WhereRelationParticipantTag:value":
865
- case "WhereRelationTag:value": {
866
- return Tag;
867
- }
868
864
  case "ElementViewRef:view": {
869
865
  return ElementView;
870
866
  }
@@ -879,6 +875,9 @@ export class LikeC4AstReflection extends AbstractAstReflection {
879
875
  case "StrictFqnElementRef:el": {
880
876
  return Element;
881
877
  }
878
+ case "TagRef:tag": {
879
+ return Tag;
880
+ }
882
881
  case "ViewRef:view": {
883
882
  return LikeC4View;
884
883
  }
@@ -1006,6 +1005,7 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1006
1005
  name: DeploymentRelation,
1007
1006
  properties: [
1008
1007
  { name: "body" },
1008
+ { name: "dotKind" },
1009
1009
  { name: "kind" },
1010
1010
  { name: "source" },
1011
1011
  { name: "tags" },
@@ -1127,6 +1127,7 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1127
1127
  name: DynamicViewStep,
1128
1128
  properties: [
1129
1129
  { name: "custom" },
1130
+ { name: "dotKind" },
1130
1131
  { name: "isBackward", defaultValue: false },
1131
1132
  { name: "kind" },
1132
1133
  { name: "source" },
@@ -1571,6 +1572,7 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1571
1572
  return {
1572
1573
  name: OutgoingRelationExpr,
1573
1574
  properties: [
1575
+ { name: "dotKind" },
1574
1576
  { name: "from" },
1575
1577
  { name: "isBidirectional", defaultValue: false },
1576
1578
  { name: "kind" }
@@ -1591,6 +1593,7 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1591
1593
  name: Relation,
1592
1594
  properties: [
1593
1595
  { name: "body" },
1596
+ { name: "dotKind" },
1594
1597
  { name: "kind" },
1595
1598
  { name: "source" },
1596
1599
  { name: "tags" },
@@ -1627,6 +1630,14 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1627
1630
  ]
1628
1631
  };
1629
1632
  }
1633
+ case RelationKindDotRef: {
1634
+ return {
1635
+ name: RelationKindDotRef,
1636
+ properties: [
1637
+ { name: "kind" }
1638
+ ]
1639
+ };
1640
+ }
1630
1641
  case RelationNavigateToProperty: {
1631
1642
  return {
1632
1643
  name: RelationNavigateToProperty,
@@ -1694,7 +1705,8 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1694
1705
  name: SpecificationDeploymentNodeKind,
1695
1706
  properties: [
1696
1707
  { name: "kind" },
1697
- { name: "props", defaultValue: [] }
1708
+ { name: "props", defaultValue: [] },
1709
+ { name: "tags" }
1698
1710
  ]
1699
1711
  };
1700
1712
  }
@@ -1703,7 +1715,8 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1703
1715
  name: SpecificationElementKind,
1704
1716
  properties: [
1705
1717
  { name: "kind" },
1706
- { name: "props", defaultValue: [] }
1718
+ { name: "props", defaultValue: [] },
1719
+ { name: "tags" }
1707
1720
  ]
1708
1721
  };
1709
1722
  }
@@ -1751,6 +1764,7 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1751
1764
  return {
1752
1765
  name: SpecificationTag,
1753
1766
  properties: [
1767
+ { name: "color" },
1754
1768
  { name: "tag" }
1755
1769
  ]
1756
1770
  };
@@ -1781,6 +1795,14 @@ export class LikeC4AstReflection extends AbstractAstReflection {
1781
1795
  ]
1782
1796
  };
1783
1797
  }
1798
+ case TagRef: {
1799
+ return {
1800
+ name: TagRef,
1801
+ properties: [
1802
+ { name: "tag" }
1803
+ ]
1804
+ };
1805
+ }
1784
1806
  case Tags: {
1785
1807
  return {
1786
1808
  name: Tags,
@@ -1,5 +1,5 @@
1
1
  /******************************************************************************
2
- * This file was generated by langium-cli 3.4.0.
2
+ * This file was generated by langium-cli 3.5.0.
3
3
  * DO NOT EDIT MANUALLY!
4
4
  ******************************************************************************/
5
5
  import type { Grammar } from 'langium';