@likec4/language-server 1.32.0 → 1.32.1

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.
@@ -20,12 +20,13 @@ export declare const LikeC4Terminals: {
20
20
  Eq: RegExp;
21
21
  Percent: RegExp;
22
22
  String: RegExp;
23
- IdTerminal: RegExp;
23
+ Float: RegExp;
24
24
  Number: RegExp;
25
25
  Hex: RegExp;
26
+ IdTerminal: RegExp;
26
27
  };
27
28
  export type LikeC4TerminalNames = keyof typeof LikeC4Terminals;
28
- 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" | "false" | "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" | "secondary" | "shape" | "size" | "sky" | "slate" | "sm" | "small" | "solid" | "source" | "specification" | "storage" | "style" | "styleGroup" | "tag" | "tail" | "target" | "technology" | "textSize" | "title" | "true" | "vee" | "view" | "views" | "where" | "with" | "xl" | "xlarge" | "xs" | "xsmall" | "{" | "}";
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" | "false" | "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" | "true" | "vee" | "view" | "views" | "where" | "with" | "xl" | "xlarge" | "xs" | "xsmall" | "{" | "}";
29
30
  export type LikeC4TokenNames = LikeC4TerminalNames | LikeC4KeywordNames;
30
31
  export type ArrowType = 'crow' | 'diamond' | 'dot' | 'none' | 'normal' | 'odiamond' | 'odot' | 'onormal' | 'open' | 'vee';
31
32
  export declare function isArrowType(item: unknown): item is ArrowType;
@@ -33,10 +34,11 @@ export type Boolean = boolean;
33
34
  export declare function isBoolean(item: unknown): item is Boolean;
34
35
  export type BorderStyleValue = 'none' | LineOptions;
35
36
  export declare function isBorderStyleValue(item: unknown): item is BorderStyleValue;
37
+ export type ColorLiteral = HexColor | RGBAColor;
38
+ export declare const ColorLiteral = "ColorLiteral";
39
+ export declare function isColorLiteral(item: unknown): item is ColorLiteral;
36
40
  export type CustomColorId = 'element' | 'model' | ArrowType | ElementShape | LineOptions | string;
37
41
  export declare function isCustomColorId(item: unknown): item is CustomColorId;
38
- export type CustomColorValue = string;
39
- export declare function isCustomColorValue(item: unknown): item is CustomColorValue;
40
42
  export type DeploymentElement = DeployedInstance | DeploymentNode;
41
43
  export declare const DeploymentElement = "DeploymentElement";
42
44
  export declare function isDeploymentElement(item: unknown): item is DeploymentElement;
@@ -589,6 +591,13 @@ export interface GlobalStyleId extends langium.AstNode {
589
591
  }
590
592
  export declare const GlobalStyleId = "GlobalStyleId";
591
593
  export declare function isGlobalStyleId(item: unknown): item is GlobalStyleId;
594
+ export interface HexColor extends langium.AstNode {
595
+ readonly $container: SpecificationColor | SpecificationTag;
596
+ readonly $type: 'HexColor';
597
+ hex: number | string;
598
+ }
599
+ export declare const HexColor = "HexColor";
600
+ export declare function isHexColor(item: unknown): item is HexColor;
592
601
  export interface IconProperty extends langium.AstNode {
593
602
  readonly $container: CustomElementProperties | DeployedInstanceBody | DeploymentNodeBody | DeploymentViewRuleStyle | ElementBody | ElementStyleProperty | GlobalStyle | ViewRuleStyle;
594
603
  readonly $type: 'IconProperty';
@@ -845,6 +854,16 @@ export interface RelationStyleProperty extends langium.AstNode {
845
854
  }
846
855
  export declare const RelationStyleProperty = "RelationStyleProperty";
847
856
  export declare function isRelationStyleProperty(item: unknown): item is RelationStyleProperty;
857
+ export interface RGBAColor extends langium.AstNode {
858
+ readonly $container: SpecificationColor | SpecificationTag;
859
+ readonly $type: 'RGBAColor';
860
+ alpha?: number | string;
861
+ blue: number;
862
+ green: number;
863
+ red: number;
864
+ }
865
+ export declare const RGBAColor = "RGBAColor";
866
+ export declare function isRGBAColor(item: unknown): item is RGBAColor;
848
867
  export interface ShapeProperty extends langium.AstNode {
849
868
  readonly $container: CustomElementProperties | DeploymentViewRuleStyle | ElementStyleProperty | GlobalStyle | ViewRuleStyle;
850
869
  readonly $type: 'ShapeProperty';
@@ -864,7 +883,7 @@ export declare function isShapeSizeProperty(item: unknown): item is ShapeSizePro
864
883
  export interface SpecificationColor extends langium.AstNode {
865
884
  readonly $container: SpecificationRule;
866
885
  readonly $type: 'SpecificationColor';
867
- color: CustomColorValue;
886
+ color: ColorLiteral;
868
887
  name: CustomColor;
869
888
  }
870
889
  export declare const SpecificationColor = "SpecificationColor";
@@ -926,7 +945,7 @@ export declare function isSpecificationRule(item: unknown): item is Specificatio
926
945
  export interface SpecificationTag extends langium.AstNode {
927
946
  readonly $container: SpecificationRule;
928
947
  readonly $type: 'SpecificationTag';
929
- color?: CustomColorValue;
948
+ color?: ColorLiteral;
930
949
  tag: Tag;
931
950
  }
932
951
  export declare const SpecificationTag = "SpecificationTag";
@@ -1129,6 +1148,7 @@ export declare function isWildcardExpression(item: unknown): item is WildcardExp
1129
1148
  export type LikeC4AstType = {
1130
1149
  ArrowProperty: ArrowProperty;
1131
1150
  BorderProperty: BorderProperty;
1151
+ ColorLiteral: ColorLiteral;
1132
1152
  ColorProperty: ColorProperty;
1133
1153
  CustomColor: CustomColor;
1134
1154
  CustomElementProperties: CustomElementProperties;
@@ -1190,6 +1210,7 @@ export type LikeC4AstType = {
1190
1210
  GlobalStyleGroup: GlobalStyleGroup;
1191
1211
  GlobalStyleId: GlobalStyleId;
1192
1212
  Globals: Globals;
1213
+ HexColor: HexColor;
1193
1214
  IconProperty: IconProperty;
1194
1215
  Imported: Imported;
1195
1216
  ImportsFromPoject: ImportsFromPoject;
@@ -1215,6 +1236,7 @@ export type LikeC4AstType = {
1215
1236
  OpacityProperty: OpacityProperty;
1216
1237
  OutgoingRelationExpr: OutgoingRelationExpr;
1217
1238
  PaddingSizeProperty: PaddingSizeProperty;
1239
+ RGBAColor: RGBAColor;
1218
1240
  Referenceable: Referenceable;
1219
1241
  Relation: Relation;
1220
1242
  RelationBody: RelationBody;
@@ -15,10 +15,11 @@ export const LikeC4Terminals = {
15
15
  NotEqual: /\!\={1,2}/,
16
16
  Eq: /\={1,2}/,
17
17
  Percent: /\b\d+%/,
18
- String: /"[^"]*"|'[^']*'/,
19
- IdTerminal: /[_]*[a-zA-Z][-\w]*/,
18
+ String: /"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/,
19
+ Float: /\b\d+\.\d+\b/,
20
20
  Number: /\b\d+\b/,
21
- Hex: /\b[a-zA-Z0-9]+\b/
21
+ Hex: /\b[a-fA-F0-9]{3,}\b/,
22
+ IdTerminal: /[_]*[a-zA-Z][-\w]*/
22
23
  };
23
24
  export function isArrowType(item) {
24
25
  return item === "none" || item === "normal" || item === "onormal" || item === "dot" || item === "odot" || item === "diamond" || item === "odiamond" || item === "crow" || item === "open" || item === "vee";
@@ -29,11 +30,12 @@ export function isBoolean(item) {
29
30
  export function isBorderStyleValue(item) {
30
31
  return isLineOptions(item) || item === "none";
31
32
  }
32
- export function isCustomColorId(item) {
33
- return isElementShape(item) || isArrowType(item) || isLineOptions(item) || item === "element" || item === "model" || typeof item === "string" && /[_]*[a-zA-Z][-\w]*/.test(item);
33
+ export const ColorLiteral = "ColorLiteral";
34
+ export function isColorLiteral(item) {
35
+ return reflection.isInstance(item, ColorLiteral);
34
36
  }
35
- export function isCustomColorValue(item) {
36
- return typeof item === "string";
37
+ export function isCustomColorId(item) {
38
+ return isElementShape(item) || isArrowType(item) || isLineOptions(item) || item === "element" || item === "model" || typeof item === "string" && (/\b[a-fA-F0-9]{3,}\b/.test(item) || /[_]*[a-zA-Z][-\w]*/.test(item));
37
39
  }
38
40
  export const DeploymentElement = "DeploymentElement";
39
41
  export function isDeploymentElement(item) {
@@ -86,7 +88,7 @@ export function isIconId(item) {
86
88
  return typeof item === "string" && /(aws|azure|gcp|tech):[-\w]*/.test(item);
87
89
  }
88
90
  export function isId(item) {
89
- return isElementShape(item) || isThemeColor(item) || isArrowType(item) || isLineOptions(item) || isParticipant(item) || isSizeValue(item) || item === "element" || item === "model" || item === "group" || item === "node" || item === "deployment" || item === "instance" || typeof item === "string" && /[_]*[a-zA-Z][-\w]*/.test(item);
91
+ return isElementShape(item) || isThemeColor(item) || isArrowType(item) || isLineOptions(item) || isParticipant(item) || isSizeValue(item) || item === "element" || item === "model" || item === "group" || item === "node" || item === "deployment" || item === "instance" || typeof item === "string" && (/\b[a-fA-F0-9]{3,}\b/.test(item) || /[_]*[a-zA-Z][-\w]*/.test(item));
90
92
  }
91
93
  export const LikeC4View = "LikeC4View";
92
94
  export function isLikeC4View(item) {
@@ -402,6 +404,10 @@ export const GlobalStyleId = "GlobalStyleId";
402
404
  export function isGlobalStyleId(item) {
403
405
  return reflection.isInstance(item, GlobalStyleId);
404
406
  }
407
+ export const HexColor = "HexColor";
408
+ export function isHexColor(item) {
409
+ return reflection.isInstance(item, HexColor);
410
+ }
405
411
  export const IconProperty = "IconProperty";
406
412
  export function isIconProperty(item) {
407
413
  return reflection.isInstance(item, IconProperty);
@@ -526,6 +532,10 @@ export const RelationStyleProperty = "RelationStyleProperty";
526
532
  export function isRelationStyleProperty(item) {
527
533
  return reflection.isInstance(item, RelationStyleProperty);
528
534
  }
535
+ export const RGBAColor = "RGBAColor";
536
+ export function isRGBAColor(item) {
537
+ return reflection.isInstance(item, RGBAColor);
538
+ }
529
539
  export const ShapeProperty = "ShapeProperty";
530
540
  export function isShapeProperty(item) {
531
541
  return reflection.isInstance(item, ShapeProperty);
@@ -664,7 +674,7 @@ export function isWildcardExpression(item) {
664
674
  }
665
675
  export class LikeC4AstReflection extends langium.AbstractAstReflection {
666
676
  getAllTypes() {
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];
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];
668
678
  }
669
679
  computeIsSubtype(subtype, supertype) {
670
680
  switch (subtype) {
@@ -740,6 +750,10 @@ export class LikeC4AstReflection extends langium.AbstractAstReflection {
740
750
  case RelationExprOrWith: {
741
751
  return this.isSubtype(ExpressionV2, supertype);
742
752
  }
753
+ case HexColor:
754
+ case RGBAColor: {
755
+ return this.isSubtype(ColorLiteral, supertype);
756
+ }
743
757
  case IconProperty: {
744
758
  return this.isSubtype(ElementProperty, supertype) || this.isSubtype(StyleProperty, supertype);
745
759
  }
@@ -1385,6 +1399,14 @@ export class LikeC4AstReflection extends langium.AbstractAstReflection {
1385
1399
  ]
1386
1400
  };
1387
1401
  }
1402
+ case HexColor: {
1403
+ return {
1404
+ name: HexColor,
1405
+ properties: [
1406
+ { name: "hex" }
1407
+ ]
1408
+ };
1409
+ }
1388
1410
  case IconProperty: {
1389
1411
  return {
1390
1412
  name: IconProperty,
@@ -1673,6 +1695,17 @@ export class LikeC4AstReflection extends langium.AbstractAstReflection {
1673
1695
  ]
1674
1696
  };
1675
1697
  }
1698
+ case RGBAColor: {
1699
+ return {
1700
+ name: RGBAColor,
1701
+ properties: [
1702
+ { name: "alpha" },
1703
+ { name: "blue" },
1704
+ { name: "green" },
1705
+ { name: "red" }
1706
+ ]
1707
+ };
1708
+ }
1676
1709
  case ShapeProperty: {
1677
1710
  return {
1678
1711
  name: ShapeProperty,