@likec4/language-server 1.32.2 → 1.33.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/dist/ast.d.ts +6 -5
- package/dist/ast.js +3 -0
- package/dist/bundled.mjs +3342 -2550
- package/dist/generated/ast.d.ts +20 -11
- package/dist/generated/ast.js +17 -5
- package/dist/generated/grammar.js +1 -1
- package/dist/lsp/SemanticTokenProvider.js +1 -1
- package/dist/mcp/LikeC4MCPTools.js +5 -2
- package/dist/model/builder/MergedSpecification.js +8 -4
- package/dist/model/index.d.ts +1 -0
- package/dist/model/index.js +1 -0
- package/dist/model/model-parser.d.ts +126 -0
- package/dist/model/parser/Base.d.ts +30 -2
- package/dist/model/parser/Base.js +54 -3
- package/dist/model/parser/DeploymentModelParser.d.ts +14 -0
- package/dist/model/parser/DeploymentModelParser.js +24 -21
- package/dist/model/parser/DeploymentViewParser.d.ts +14 -0
- package/dist/model/parser/DeploymentViewParser.js +15 -6
- package/dist/model/parser/FqnRefParser.d.ts +14 -0
- package/dist/model/parser/FqnRefParser.js +8 -6
- package/dist/model/parser/GlobalsParser.d.ts +14 -0
- package/dist/model/parser/ImportsParser.d.ts +14 -0
- package/dist/model/parser/ModelParser.d.ts +14 -0
- package/dist/model/parser/ModelParser.js +22 -14
- package/dist/model/parser/PredicatesParser.d.ts +14 -0
- package/dist/model/parser/SpecificationParser.d.ts +14 -0
- package/dist/model/parser/SpecificationParser.js +16 -11
- package/dist/model/parser/ValueConverter.d.ts +4 -0
- package/dist/model/parser/ValueConverter.js +12 -0
- package/dist/model/parser/ViewsParser.d.ts +14 -0
- package/dist/model/parser/ViewsParser.js +21 -7
- package/dist/module.d.ts +4 -1
- package/dist/module.js +5 -1
- package/dist/views/configurable-layouter.js +22 -28
- package/dist/views/likec4-views.js +0 -1
- package/package.json +19 -18
package/dist/generated/ast.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare const LikeC4Terminals: {
|
|
|
8
8
|
LINE_COMMENT: RegExp;
|
|
9
9
|
WS: RegExp;
|
|
10
10
|
NL: RegExp;
|
|
11
|
+
BOOLEAN: RegExp;
|
|
11
12
|
LIB_ICON: RegExp;
|
|
12
13
|
URI_WITH_SCHEMA: RegExp;
|
|
13
14
|
URI_RELATIVE: RegExp;
|
|
@@ -19,6 +20,7 @@ export declare const LikeC4Terminals: {
|
|
|
19
20
|
NotEqual: RegExp;
|
|
20
21
|
Eq: RegExp;
|
|
21
22
|
Percent: RegExp;
|
|
23
|
+
MarkdownString: RegExp;
|
|
22
24
|
String: RegExp;
|
|
23
25
|
Float: RegExp;
|
|
24
26
|
Number: RegExp;
|
|
@@ -26,12 +28,10 @@ export declare const LikeC4Terminals: {
|
|
|
26
28
|
IdTerminal: RegExp;
|
|
27
29
|
};
|
|
28
30
|
export type LikeC4TerminalNames = keyof typeof LikeC4Terminals;
|
|
29
|
-
export type LikeC4KeywordNames = "(" | ")" | "*" | "," | "->" | "-[" | ":" | ";" | "<-" | "<->" | "BottomTop" | "LeftRight" | "RightLeft" | "TopBottom" | "]->" | "amber" | "and" | "autoLayout" | "blue" | "border" | "browser" | "color" | "crow" | "cylinder" | "dashed" | "deployment" | "deploymentNode" | "description" | "diamond" | "dot" | "dotted" | "dynamic" | "dynamicPredicateGroup" | "element" | "element.kind" | "element.tag" | "exclude" | "extend" | "extends" | "
|
|
31
|
+
export type LikeC4KeywordNames = "(" | ")" | "*" | "," | "->" | "-[" | ":" | ";" | "<-" | "<->" | "BottomTop" | "LeftRight" | "RightLeft" | "TopBottom" | "]->" | "amber" | "and" | "autoLayout" | "blue" | "border" | "browser" | "color" | "crow" | "cylinder" | "dashed" | "deployment" | "deploymentNode" | "description" | "diamond" | "dot" | "dotted" | "dynamic" | "dynamicPredicateGroup" | "element" | "element.kind" | "element.tag" | "exclude" | "extend" | "extends" | "from" | "global" | "gray" | "green" | "group" | "head" | "icon" | "icons" | "import" | "include" | "indigo" | "instance" | "instanceOf" | "is" | "kind" | "large" | "lg" | "likec4lib" | "line" | "link" | "md" | "medium" | "metadata" | "mobile" | "model" | "multiple" | "muted" | "navigateTo" | "node" | "none" | "normal" | "not" | "notation" | "notes" | "odiamond" | "odot" | "of" | "onormal" | "opacity" | "open" | "or" | "padding" | "par" | "parallel" | "person" | "predicate" | "predicateGroup" | "primary" | "queue" | "rectangle" | "red" | "relationship" | "rgb" | "rgba" | "secondary" | "shape" | "size" | "sky" | "slate" | "sm" | "small" | "solid" | "source" | "specification" | "storage" | "style" | "styleGroup" | "tag" | "tail" | "target" | "technology" | "textSize" | "title" | "vee" | "view" | "views" | "where" | "with" | "xl" | "xlarge" | "xs" | "xsmall" | "{" | "}";
|
|
30
32
|
export type LikeC4TokenNames = LikeC4TerminalNames | LikeC4KeywordNames;
|
|
31
33
|
export type ArrowType = 'crow' | 'diamond' | 'dot' | 'none' | 'normal' | 'odiamond' | 'odot' | 'onormal' | 'open' | 'vee';
|
|
32
34
|
export declare function isArrowType(item: unknown): item is ArrowType;
|
|
33
|
-
export type Boolean = boolean;
|
|
34
|
-
export declare function isBoolean(item: unknown): item is Boolean;
|
|
35
35
|
export type BorderStyleValue = 'none' | LineOptions;
|
|
36
36
|
export declare function isBorderStyleValue(item: unknown): item is BorderStyleValue;
|
|
37
37
|
export type ColorLiteral = HexColor | RGBAColor;
|
|
@@ -415,7 +415,7 @@ export interface ElementStringProperty extends langium.AstNode {
|
|
|
415
415
|
readonly $container: CustomElementProperties | DeployedInstanceBody | DeploymentNodeBody | ElementBody;
|
|
416
416
|
readonly $type: 'ElementStringProperty';
|
|
417
417
|
key: 'description' | 'technology' | 'title';
|
|
418
|
-
value:
|
|
418
|
+
value: MarkdownOrString;
|
|
419
419
|
}
|
|
420
420
|
export declare const ElementStringProperty = "ElementStringProperty";
|
|
421
421
|
export declare function isElementStringProperty(item: unknown): item is ElementStringProperty;
|
|
@@ -681,11 +681,19 @@ export interface LinkProperty extends langium.AstNode {
|
|
|
681
681
|
}
|
|
682
682
|
export declare const LinkProperty = "LinkProperty";
|
|
683
683
|
export declare function isLinkProperty(item: unknown): item is LinkProperty;
|
|
684
|
+
export interface MarkdownOrString extends langium.AstNode {
|
|
685
|
+
readonly $container: ElementStringProperty | MetadataAttribute | NotationProperty | NotesProperty | RelationStringProperty | SpecificationRelationshipStringProperty | ViewStringProperty;
|
|
686
|
+
readonly $type: 'MarkdownOrString';
|
|
687
|
+
markdown?: string;
|
|
688
|
+
text?: string;
|
|
689
|
+
}
|
|
690
|
+
export declare const MarkdownOrString = "MarkdownOrString";
|
|
691
|
+
export declare function isMarkdownOrString(item: unknown): item is MarkdownOrString;
|
|
684
692
|
export interface MetadataAttribute extends langium.AstNode {
|
|
685
693
|
readonly $container: MetadataBody;
|
|
686
694
|
readonly $type: 'MetadataAttribute';
|
|
687
695
|
key: string;
|
|
688
|
-
value:
|
|
696
|
+
value: MarkdownOrString;
|
|
689
697
|
}
|
|
690
698
|
export declare const MetadataAttribute = "MetadataAttribute";
|
|
691
699
|
export declare function isMetadataAttribute(item: unknown): item is MetadataAttribute;
|
|
@@ -725,7 +733,7 @@ export interface MultipleProperty extends langium.AstNode {
|
|
|
725
733
|
readonly $container: CustomElementProperties | DeploymentViewRuleStyle | ElementStyleProperty | GlobalStyle | ViewRuleStyle;
|
|
726
734
|
readonly $type: 'MultipleProperty';
|
|
727
735
|
key: 'multiple';
|
|
728
|
-
value:
|
|
736
|
+
value: boolean;
|
|
729
737
|
}
|
|
730
738
|
export declare const MultipleProperty = "MultipleProperty";
|
|
731
739
|
export declare function isMultipleProperty(item: unknown): item is MultipleProperty;
|
|
@@ -741,7 +749,7 @@ export interface NotationProperty extends langium.AstNode {
|
|
|
741
749
|
readonly $container: CustomElementProperties | CustomRelationProperties | DeploymentViewRuleStyle | GlobalStyle | ViewRuleStyle;
|
|
742
750
|
readonly $type: 'NotationProperty';
|
|
743
751
|
key: 'notation';
|
|
744
|
-
value:
|
|
752
|
+
value: MarkdownOrString;
|
|
745
753
|
}
|
|
746
754
|
export declare const NotationProperty = "NotationProperty";
|
|
747
755
|
export declare function isNotationProperty(item: unknown): item is NotationProperty;
|
|
@@ -749,7 +757,7 @@ export interface NotesProperty extends langium.AstNode {
|
|
|
749
757
|
readonly $container: CustomRelationProperties;
|
|
750
758
|
readonly $type: 'NotesProperty';
|
|
751
759
|
key: 'notes';
|
|
752
|
-
value:
|
|
760
|
+
value: MarkdownOrString;
|
|
753
761
|
}
|
|
754
762
|
export declare const NotesProperty = "NotesProperty";
|
|
755
763
|
export declare function isNotesProperty(item: unknown): item is NotesProperty;
|
|
@@ -844,7 +852,7 @@ export interface RelationStringProperty extends langium.AstNode {
|
|
|
844
852
|
readonly $container: CustomRelationProperties | DeploymentRelationBody | RelationBody;
|
|
845
853
|
readonly $type: 'RelationStringProperty';
|
|
846
854
|
key: 'description' | 'technology' | 'title';
|
|
847
|
-
value:
|
|
855
|
+
value: MarkdownOrString;
|
|
848
856
|
}
|
|
849
857
|
export declare const RelationStringProperty = "RelationStringProperty";
|
|
850
858
|
export declare function isRelationStringProperty(item: unknown): item is RelationStringProperty;
|
|
@@ -928,7 +936,7 @@ export interface SpecificationRelationshipStringProperty extends langium.AstNode
|
|
|
928
936
|
readonly $container: SpecificationRelationshipKind;
|
|
929
937
|
readonly $type: 'SpecificationRelationshipStringProperty';
|
|
930
938
|
key: 'notation' | 'technology';
|
|
931
|
-
value:
|
|
939
|
+
value: MarkdownOrString;
|
|
932
940
|
}
|
|
933
941
|
export declare const SpecificationRelationshipStringProperty = "SpecificationRelationshipStringProperty";
|
|
934
942
|
export declare function isSpecificationRelationshipStringProperty(item: unknown): item is SpecificationRelationshipStringProperty;
|
|
@@ -1057,7 +1065,7 @@ export interface ViewStringProperty extends langium.AstNode {
|
|
|
1057
1065
|
readonly $container: DeploymentViewBody | DynamicViewBody | ElementViewBody;
|
|
1058
1066
|
readonly $type: 'ViewStringProperty';
|
|
1059
1067
|
key: 'description' | 'title';
|
|
1060
|
-
value:
|
|
1068
|
+
value: MarkdownOrString;
|
|
1061
1069
|
}
|
|
1062
1070
|
export declare const ViewStringProperty = "ViewStringProperty";
|
|
1063
1071
|
export declare function isViewStringProperty(item: unknown): item is ViewStringProperty;
|
|
@@ -1224,6 +1232,7 @@ export type LikeC4AstType = {
|
|
|
1224
1232
|
LikeC4View: LikeC4View;
|
|
1225
1233
|
LineProperty: LineProperty;
|
|
1226
1234
|
LinkProperty: LinkProperty;
|
|
1235
|
+
MarkdownOrString: MarkdownOrString;
|
|
1227
1236
|
MetadataAttribute: MetadataAttribute;
|
|
1228
1237
|
MetadataBody: MetadataBody;
|
|
1229
1238
|
MetadataProperty: MetadataProperty;
|
package/dist/generated/ast.js
CHANGED
|
@@ -4,6 +4,7 @@ export const LikeC4Terminals = {
|
|
|
4
4
|
LINE_COMMENT: /\/\/[^\n\r]*/,
|
|
5
5
|
WS: /[\t ]+/,
|
|
6
6
|
NL: /[\r\n]+/,
|
|
7
|
+
BOOLEAN: /true|false/,
|
|
7
8
|
LIB_ICON: /(aws|azure|gcp|tech):[-\w]*/,
|
|
8
9
|
URI_WITH_SCHEMA: /\w+:\/{2}\S+/,
|
|
9
10
|
URI_RELATIVE: /\.{0,2}\/[^\/]\S+/,
|
|
@@ -15,6 +16,7 @@ export const LikeC4Terminals = {
|
|
|
15
16
|
NotEqual: /\!\={1,2}/,
|
|
16
17
|
Eq: /\={1,2}/,
|
|
17
18
|
Percent: /\b\d+%/,
|
|
19
|
+
MarkdownString: /(('''([\s\S]*?'''))|("""([\s\S]*?""")))/,
|
|
18
20
|
String: /"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/,
|
|
19
21
|
Float: /\b\d+\.\d+\b/,
|
|
20
22
|
Number: /\b\d+\b/,
|
|
@@ -24,9 +26,6 @@ export const LikeC4Terminals = {
|
|
|
24
26
|
export function isArrowType(item) {
|
|
25
27
|
return item === "none" || item === "normal" || item === "onormal" || item === "dot" || item === "odot" || item === "diamond" || item === "odiamond" || item === "crow" || item === "open" || item === "vee";
|
|
26
28
|
}
|
|
27
|
-
export function isBoolean(item) {
|
|
28
|
-
return typeof item === "boolean";
|
|
29
|
-
}
|
|
30
29
|
export function isBorderStyleValue(item) {
|
|
31
30
|
return isLineOptions(item) || item === "none";
|
|
32
31
|
}
|
|
@@ -448,6 +447,10 @@ export const LinkProperty = "LinkProperty";
|
|
|
448
447
|
export function isLinkProperty(item) {
|
|
449
448
|
return reflection.isInstance(item, LinkProperty);
|
|
450
449
|
}
|
|
450
|
+
export const MarkdownOrString = "MarkdownOrString";
|
|
451
|
+
export function isMarkdownOrString(item) {
|
|
452
|
+
return reflection.isInstance(item, MarkdownOrString);
|
|
453
|
+
}
|
|
451
454
|
export const MetadataAttribute = "MetadataAttribute";
|
|
452
455
|
export function isMetadataAttribute(item) {
|
|
453
456
|
return reflection.isInstance(item, MetadataAttribute);
|
|
@@ -674,7 +677,7 @@ export function isWildcardExpression(item) {
|
|
|
674
677
|
}
|
|
675
678
|
export class LikeC4AstReflection extends langium.AbstractAstReflection {
|
|
676
679
|
getAllTypes() {
|
|
677
|
-
return [ArrowProperty, BorderProperty, ColorLiteral, 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, HexColor, 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, RGBAColor, 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];
|
|
680
|
+
return [ArrowProperty, BorderProperty, ColorLiteral, 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, HexColor, IconProperty, Imported, ImportsFromPoject, InOutRelationExpr, IncomingRelationExpr, LibIcon, LikeC4Grammar, LikeC4Lib, LikeC4View, LineProperty, LinkProperty, MarkdownOrString, MetadataAttribute, MetadataBody, MetadataProperty, Model, ModelDeployments, ModelReferenceable, ModelViews, MultipleProperty, NavigateToProperty, NotationProperty, NotesProperty, OpacityProperty, OutgoingRelationExpr, PaddingSizeProperty, RGBAColor, 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];
|
|
678
681
|
}
|
|
679
682
|
computeIsSubtype(subtype, supertype) {
|
|
680
683
|
switch (subtype) {
|
|
@@ -1501,6 +1504,15 @@ export class LikeC4AstReflection extends langium.AbstractAstReflection {
|
|
|
1501
1504
|
]
|
|
1502
1505
|
};
|
|
1503
1506
|
}
|
|
1507
|
+
case MarkdownOrString: {
|
|
1508
|
+
return {
|
|
1509
|
+
name: MarkdownOrString,
|
|
1510
|
+
properties: [
|
|
1511
|
+
{ name: "markdown" },
|
|
1512
|
+
{ name: "text" }
|
|
1513
|
+
]
|
|
1514
|
+
};
|
|
1515
|
+
}
|
|
1504
1516
|
case MetadataAttribute: {
|
|
1505
1517
|
return {
|
|
1506
1518
|
name: MetadataAttribute,
|
|
@@ -1551,7 +1563,7 @@ export class LikeC4AstReflection extends langium.AbstractAstReflection {
|
|
|
1551
1563
|
name: MultipleProperty,
|
|
1552
1564
|
properties: [
|
|
1553
1565
|
{ name: "key" },
|
|
1554
|
-
{ name: "value" }
|
|
1566
|
+
{ name: "value", defaultValue: false }
|
|
1555
1567
|
]
|
|
1556
1568
|
};
|
|
1557
1569
|
}
|