@likec4/language-server 1.59.1 → 1.59.3
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/browser/index.mjs +4 -2
- package/dist/chunks/LikeC4FileSystem.mjs +1 -1
- package/dist/chunks/module.d.mts +43 -7
- package/dist/chunks/module.mjs +298 -108
- package/dist/chunks/utils.mjs +28 -4
- package/dist/filesystem/index.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/module.mjs +1 -1
- package/dist/protocol.mjs +2 -1
- package/package.json +16 -16
package/dist/browser/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "../chunks/rolldown-runtime.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { Br as NoLikeC4ManualLayouts, Rr as NoFileSystem, zr as NoFileSystemWatcher } from "../chunks/utils.mjs";
|
|
3
3
|
import { t as createLanguageServices } from "../chunks/module.mjs";
|
|
4
4
|
import { configureLogger, getConsoleSink, getTextFormatter } from "@likec4/log";
|
|
5
5
|
import { startLanguageServer as startLanguageServer$1 } from "langium/lsp";
|
|
@@ -12,7 +12,9 @@ import { BrowserMessageReader, BrowserMessageWriter, createConnection } from "vs
|
|
|
12
12
|
* @returns Shared and LikeC4-specific services after the connection is initialized.
|
|
13
13
|
*/
|
|
14
14
|
function startLanguageServer(port) {
|
|
15
|
-
const
|
|
15
|
+
const messageReader = new BrowserMessageReader(port);
|
|
16
|
+
const messageWriter = new BrowserMessageWriter(port);
|
|
17
|
+
const connection = createConnection(messageReader, messageWriter);
|
|
16
18
|
configureLogger({
|
|
17
19
|
sinks: { console: getConsoleSink({ formatter: getTextFormatter({ format: ({ level, category, message }) => {
|
|
18
20
|
return `${level} ${category} ${message}`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __name } from "./rolldown-runtime.mjs";
|
|
2
2
|
import { t as LibIcons } from "./icons.mjs";
|
|
3
3
|
import { isLikeC4Builtin } from "../likec4lib.mjs";
|
|
4
|
-
import { Fr as
|
|
4
|
+
import { Fr as ADisposable, Ir as compareByUri, Lr as compareByUriDeepFirst, Ur as logger$1, a as LikeC4LanguageMetaData, n as safeCall, zr as NoFileSystemWatcher } from "./utils.mjs";
|
|
5
5
|
import { compareNaturalHierarchically, onNextTick, stringHash } from "@likec4/core/utils";
|
|
6
6
|
import { isLikeC4Config, loadConfig } from "@likec4/config/node";
|
|
7
7
|
import { fdir } from "fdir";
|
package/dist/chunks/module.d.mts
CHANGED
|
@@ -65,6 +65,7 @@ declare const DeploymentNodeOrElementKind = "DeploymentNodeOrElementKind";
|
|
|
65
65
|
type DeploymentViewRule = DeploymentViewRulePredicate | DeploymentViewRuleStyle | ViewRuleAncestors | ViewRuleAutoLayout;
|
|
66
66
|
declare const DeploymentViewRule = "DeploymentViewRule";
|
|
67
67
|
type DynamicViewDisplayVariantValue = 'diagram' | 'sequence';
|
|
68
|
+
type DynamicViewFlowKeyword = 'alt' | 'break' | 'catch' | 'else' | 'finally' | 'if' | 'loop' | 'opt' | 'par' | 'parallel' | 'try' | 'when';
|
|
68
69
|
type DynamicViewProperty = DynamicViewDisplayVariantProperty | ViewProperty;
|
|
69
70
|
declare const DynamicViewProperty = "DynamicViewProperty";
|
|
70
71
|
type DynamicViewRule = DynamicViewGlobalPredicateRef | DynamicViewIncludePredicate | ViewRuleAutoLayout | ViewRuleStyleOrGlobalRef;
|
|
@@ -90,7 +91,7 @@ type FqnReferenceable = Element | ExtendDeployment | ExtendElement | Referenceab
|
|
|
90
91
|
declare const FqnReferenceable = "FqnReferenceable";
|
|
91
92
|
type IconId = string;
|
|
92
93
|
type IconPositionValue = 'bottom' | 'left' | 'right' | 'top';
|
|
93
|
-
type Id = 'deployment' | 'element' | 'group' | 'instance' | 'model' | 'node' | 'relationship' | ArrowType | DynamicViewDisplayVariantValue | ElementShape | IconPositionValue | LineOptions | Participant | RankValue | SizeValue | ThemeColor | string;
|
|
94
|
+
type Id = 'deployment' | 'element' | 'group' | 'instance' | 'model' | 'node' | 'relationship' | ArrowType | DynamicViewDisplayVariantValue | DynamicViewFlowKeyword | ElementShape | IconPositionValue | LineOptions | Participant | RankValue | SizeValue | ThemeColor | string;
|
|
94
95
|
type LikeC4View = DeploymentView | DynamicView | ElementView;
|
|
95
96
|
declare const LikeC4View = "LikeC4View";
|
|
96
97
|
type LineOptions = 'dashed' | 'dotted' | 'solid';
|
|
@@ -128,12 +129,13 @@ type StringProperty = ElementStringProperty | MetadataAttribute | NotationProper
|
|
|
128
129
|
declare const StringProperty = "StringProperty";
|
|
129
130
|
type StyleProperty = BorderProperty | ColorProperty | IconColorProperty | IconPositionProperty | IconProperty | IconSizeProperty | MultipleProperty | OpacityProperty | PaddingSizeProperty | ShapeProperty | ShapeSizeProperty | TextSizeProperty;
|
|
130
131
|
declare const StyleProperty = "StyleProperty";
|
|
132
|
+
type SubflowKind = 'break' | 'else' | 'if' | 'loop' | 'opt' | 'par' | 'parallel' | 'when';
|
|
131
133
|
type ThemeColor = 'amber' | 'blue' | 'gray' | 'green' | 'indigo' | 'muted' | 'primary' | 'red' | 'secondary' | 'sky' | 'slate';
|
|
132
134
|
type TryStep = CatchBlock | FinallyBlock | TryBlock;
|
|
133
135
|
declare const TryStep = "TryStep";
|
|
134
136
|
type Uri = string;
|
|
135
137
|
type ViewLayoutDirection = 'BottomTop' | 'LeftRight' | 'RightLeft' | 'TopBottom';
|
|
136
|
-
type ViewProperty = LinkProperty | ViewStringProperty;
|
|
138
|
+
type ViewProperty = LinkProperty | ViewOrderProperty | ViewStringProperty;
|
|
137
139
|
declare const ViewProperty = "ViewProperty";
|
|
138
140
|
type ViewRule = ViewRuleAutoLayout | ViewRuleGlobalPredicateRef | ViewRuleGroup | ViewRulePredicate | ViewRuleRank | ViewRuleStyleOrGlobalRef;
|
|
139
141
|
declare const ViewRule = "ViewRule";
|
|
@@ -482,6 +484,7 @@ interface ExtendRelation extends langium.AstNode {
|
|
|
482
484
|
readonly $type: 'ExtendRelation';
|
|
483
485
|
body: ExtendRelationBody;
|
|
484
486
|
dotKind?: RelationKindDotRef;
|
|
487
|
+
isBidirectional: boolean;
|
|
485
488
|
kind?: langium.Reference<RelationshipKind>;
|
|
486
489
|
source: FqnRef$2;
|
|
487
490
|
target: FqnRef$2;
|
|
@@ -788,6 +791,7 @@ interface Relation extends langium.AstNode {
|
|
|
788
791
|
body?: RelationBody;
|
|
789
792
|
description?: string;
|
|
790
793
|
dotKind?: RelationKindDotRef;
|
|
794
|
+
isBidirectional: boolean;
|
|
791
795
|
kind?: langium.Reference<RelationshipKind>;
|
|
792
796
|
source?: FqnRef$2;
|
|
793
797
|
tags?: Tags;
|
|
@@ -933,7 +937,9 @@ interface SpecificationTag extends langium.AstNode {
|
|
|
933
937
|
readonly $container: SpecificationRule;
|
|
934
938
|
readonly $type: 'SpecificationTag';
|
|
935
939
|
color?: ColorLiteral$1;
|
|
940
|
+
customColor?: langium.Reference<CustomColor>;
|
|
936
941
|
tag: Tag$1;
|
|
942
|
+
themeColor?: ThemeColor;
|
|
937
943
|
}
|
|
938
944
|
declare const SpecificationTag = "SpecificationTag";
|
|
939
945
|
interface StepsBlock extends langium.AstNode {
|
|
@@ -982,6 +988,13 @@ interface TextSizeProperty extends langium.AstNode {
|
|
|
982
988
|
value: SizeValue;
|
|
983
989
|
}
|
|
984
990
|
declare const TextSizeProperty = "TextSizeProperty";
|
|
991
|
+
interface ViewOrderProperty extends langium.AstNode {
|
|
992
|
+
readonly $container: DeploymentViewBody | DynamicViewBody | ElementViewBody;
|
|
993
|
+
readonly $type: 'ViewOrderProperty';
|
|
994
|
+
key: 'order';
|
|
995
|
+
value: number;
|
|
996
|
+
}
|
|
997
|
+
declare const ViewOrderProperty = "ViewOrderProperty";
|
|
985
998
|
interface ViewRef extends langium.AstNode {
|
|
986
999
|
readonly $container: NavigateToProperty;
|
|
987
1000
|
readonly $type: 'ViewRef';
|
|
@@ -1004,7 +1017,7 @@ interface ViewRuleAutoLayout extends langium.AstNode {
|
|
|
1004
1017
|
}
|
|
1005
1018
|
declare const ViewRuleAutoLayout = "ViewRuleAutoLayout";
|
|
1006
1019
|
interface ViewRuleGlobalPredicateRef extends langium.AstNode {
|
|
1007
|
-
readonly $container: ElementViewBody;
|
|
1020
|
+
readonly $container: ElementViewBody | ViewRuleGroup;
|
|
1008
1021
|
readonly $type: 'ViewRuleGlobalPredicateRef';
|
|
1009
1022
|
predicate: langium.Reference<GlobalPredicateGroup>;
|
|
1010
1023
|
}
|
|
@@ -1018,7 +1031,7 @@ declare const ViewRuleGlobalStyle = "ViewRuleGlobalStyle";
|
|
|
1018
1031
|
interface ViewRuleGroup extends langium.AstNode {
|
|
1019
1032
|
readonly $container: ElementViewBody | ViewRuleGroup;
|
|
1020
1033
|
readonly $type: 'ViewRuleGroup';
|
|
1021
|
-
groupRules: Array<ViewRuleGroup | ViewRulePredicate>;
|
|
1034
|
+
groupRules: Array<ViewRuleGlobalPredicateRef | ViewRuleGroup | ViewRulePredicate>;
|
|
1022
1035
|
props: Array<BorderProperty | ColorProperty | OpacityProperty>;
|
|
1023
1036
|
title?: string;
|
|
1024
1037
|
}
|
|
@@ -1179,7 +1192,7 @@ declare const StepSeries = "StepSeries";
|
|
|
1179
1192
|
interface SubflowStep extends StepsBlock {
|
|
1180
1193
|
readonly $container: AltSteps | DynamicViewBody | StepsBlock;
|
|
1181
1194
|
readonly $type: 'SubflowStep';
|
|
1182
|
-
kind:
|
|
1195
|
+
kind: SubflowKind;
|
|
1183
1196
|
title?: string;
|
|
1184
1197
|
}
|
|
1185
1198
|
declare const SubflowStep = "SubflowStep";
|
|
@@ -1339,6 +1352,7 @@ type LikeC4AstType = {
|
|
|
1339
1352
|
TextSizeProperty: TextSizeProperty;
|
|
1340
1353
|
TryBlock: TryBlock;
|
|
1341
1354
|
TryStep: TryStep;
|
|
1355
|
+
ViewOrderProperty: ViewOrderProperty;
|
|
1342
1356
|
ViewProperty: ViewProperty;
|
|
1343
1357
|
ViewRef: ViewRef;
|
|
1344
1358
|
ViewRule: ViewRule;
|
|
@@ -1442,7 +1456,7 @@ type ParsedElementStyle = {
|
|
|
1442
1456
|
interface ParsedAstSpecification {
|
|
1443
1457
|
tags: Record<c4.Tag, {
|
|
1444
1458
|
astPath: string;
|
|
1445
|
-
color?: c4.
|
|
1459
|
+
color?: c4.TagSpecification['color'];
|
|
1446
1460
|
}>;
|
|
1447
1461
|
elements: Record<c4.ElementKind, c4.ElementSpecification>;
|
|
1448
1462
|
relationships: Record<c4.RelationshipKind, c4.RelationshipSpecification>;
|
|
@@ -1478,6 +1492,7 @@ interface ParsedAstExtend {
|
|
|
1478
1492
|
interface ParsedAstExtendRelation {
|
|
1479
1493
|
id: c4.RelationId;
|
|
1480
1494
|
astPath: string;
|
|
1495
|
+
isBidirectional?: boolean;
|
|
1481
1496
|
tags?: c4.NonEmptyArray<c4.Tag> | null;
|
|
1482
1497
|
links?: c4.NonEmptyArray<c4.Link> | null;
|
|
1483
1498
|
metadata?: {
|
|
@@ -1489,6 +1504,7 @@ interface ParsedAstRelation {
|
|
|
1489
1504
|
astPath: string;
|
|
1490
1505
|
source: c4.FqnRef.ModelRef;
|
|
1491
1506
|
target: c4.FqnRef.ModelRef;
|
|
1507
|
+
isBidirectional?: boolean;
|
|
1492
1508
|
kind?: c4.RelationshipKind;
|
|
1493
1509
|
tags?: c4.NonEmptyArray<c4.Tag>;
|
|
1494
1510
|
title: string;
|
|
@@ -1522,6 +1538,10 @@ interface ParsedAstElementView {
|
|
|
1522
1538
|
astPath: string;
|
|
1523
1539
|
title: string | null;
|
|
1524
1540
|
description: c4.MarkdownOrString | null;
|
|
1541
|
+
/**
|
|
1542
|
+
* Optional per-view navigation order.
|
|
1543
|
+
*/
|
|
1544
|
+
order?: number;
|
|
1525
1545
|
tags: c4.NonEmptyArray<c4.Tag> | null;
|
|
1526
1546
|
links: c4.NonEmptyArray<c4.Link> | null;
|
|
1527
1547
|
rules: c4.ElementViewRule[];
|
|
@@ -1531,6 +1551,10 @@ interface ParsedAstDynamicView {
|
|
|
1531
1551
|
astPath: string;
|
|
1532
1552
|
title: string | null;
|
|
1533
1553
|
description: c4.MarkdownOrString | null;
|
|
1554
|
+
/**
|
|
1555
|
+
* Optional per-view navigation order.
|
|
1556
|
+
*/
|
|
1557
|
+
order?: number;
|
|
1534
1558
|
tags: c4.NonEmptyArray<c4.Tag> | null;
|
|
1535
1559
|
links: c4.NonEmptyArray<c4.Link> | null;
|
|
1536
1560
|
steps: c4.Step.Any[];
|
|
@@ -1542,6 +1566,10 @@ interface ParsedAstDeploymentView {
|
|
|
1542
1566
|
astPath: string;
|
|
1543
1567
|
title: string | null;
|
|
1544
1568
|
description: c4.MarkdownOrString | null;
|
|
1569
|
+
/**
|
|
1570
|
+
* Optional per-view navigation order.
|
|
1571
|
+
*/
|
|
1572
|
+
order?: number;
|
|
1545
1573
|
tags: c4.NonEmptyArray<c4.Tag> | null;
|
|
1546
1574
|
links: c4.NonEmptyArray<c4.Link> | null;
|
|
1547
1575
|
rules: Array<c4.DeploymentViewRule>;
|
|
@@ -2137,7 +2165,7 @@ declare class MergedSpecification {
|
|
|
2137
2165
|
/**
|
|
2138
2166
|
* Converts a parsed model into a C4 model relation.
|
|
2139
2167
|
*/
|
|
2140
|
-
toModelRelation: ({ astPath: _astPath, source, target, kind, links, id, title, tags, ...model }: ParsedAstRelation) => c4.Relationship | null;
|
|
2168
|
+
toModelRelation: ({ astPath: _astPath, source, target, kind, links, id, title, tags, isBidirectional, ...model }: ParsedAstRelation) => c4.Relationship | null;
|
|
2141
2169
|
/**
|
|
2142
2170
|
* Converts a parsed deployment model into a C4 deployment model
|
|
2143
2171
|
*/
|
|
@@ -2512,6 +2540,8 @@ declare const DocumentParserFromMixins: {
|
|
|
2512
2540
|
parseAbstractDynamicStep(astnode: AbstractStep): import("type-fest").Writable<import("type-fest").Except<ProjectId, "source", {
|
|
2513
2541
|
requireExactProps: true;
|
|
2514
2542
|
}>>;
|
|
2543
|
+
parseModelElementRef(node: ElementRef, errorMessage: string): ProjectId;
|
|
2544
|
+
parseDynamicStepEndpoint(node: ElementRef, endpoint: "source" | "target"): ProjectId;
|
|
2515
2545
|
parseSubflowStep(node: SubflowStep): ProjectId | ProjectId | ProjectId | ProjectId;
|
|
2516
2546
|
parseTryStep(node: TryStep): ProjectId;
|
|
2517
2547
|
parseAltSteps(node: AltSteps): ProjectId;
|
|
@@ -2621,6 +2651,8 @@ declare const DocumentParserFromMixins: {
|
|
|
2621
2651
|
parseAbstractDynamicStep(astnode: AbstractStep): import("type-fest").Writable<import("type-fest").Except<ProjectId, "source", {
|
|
2622
2652
|
requireExactProps: true;
|
|
2623
2653
|
}>>;
|
|
2654
|
+
parseModelElementRef(node: ElementRef, errorMessage: string): ProjectId;
|
|
2655
|
+
parseDynamicStepEndpoint(node: ElementRef, endpoint: "source" | "target"): ProjectId;
|
|
2624
2656
|
parseSubflowStep(node: SubflowStep): ProjectId | ProjectId | ProjectId | ProjectId;
|
|
2625
2657
|
parseTryStep(node: TryStep): ProjectId;
|
|
2626
2658
|
parseAltSteps(node: AltSteps): ProjectId;
|
|
@@ -3255,6 +3287,10 @@ interface LikeC4LanguageServices {
|
|
|
3255
3287
|
* Returns the location of the specified element, relation, view or deployment element
|
|
3256
3288
|
*/
|
|
3257
3289
|
locate(params: Locate.Params): Locate.Res;
|
|
3290
|
+
/**
|
|
3291
|
+
* Returns the current in-memory text of a document, or `undefined` if the document is not known.
|
|
3292
|
+
*/
|
|
3293
|
+
documentText(uri: string): string | undefined;
|
|
3258
3294
|
/**
|
|
3259
3295
|
* Formats documents and returns a map of document URI → formatted source text.
|
|
3260
3296
|
*
|