@likec4/language-server 1.59.2 → 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 +37 -5
- package/dist/chunks/module.mjs +293 -104
- 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 +15 -15
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
|
@@ -135,7 +135,7 @@ type TryStep = CatchBlock | FinallyBlock | TryBlock;
|
|
|
135
135
|
declare const TryStep = "TryStep";
|
|
136
136
|
type Uri = string;
|
|
137
137
|
type ViewLayoutDirection = 'BottomTop' | 'LeftRight' | 'RightLeft' | 'TopBottom';
|
|
138
|
-
type ViewProperty = LinkProperty | ViewStringProperty;
|
|
138
|
+
type ViewProperty = LinkProperty | ViewOrderProperty | ViewStringProperty;
|
|
139
139
|
declare const ViewProperty = "ViewProperty";
|
|
140
140
|
type ViewRule = ViewRuleAutoLayout | ViewRuleGlobalPredicateRef | ViewRuleGroup | ViewRulePredicate | ViewRuleRank | ViewRuleStyleOrGlobalRef;
|
|
141
141
|
declare const ViewRule = "ViewRule";
|
|
@@ -484,6 +484,7 @@ interface ExtendRelation extends langium.AstNode {
|
|
|
484
484
|
readonly $type: 'ExtendRelation';
|
|
485
485
|
body: ExtendRelationBody;
|
|
486
486
|
dotKind?: RelationKindDotRef;
|
|
487
|
+
isBidirectional: boolean;
|
|
487
488
|
kind?: langium.Reference<RelationshipKind>;
|
|
488
489
|
source: FqnRef$2;
|
|
489
490
|
target: FqnRef$2;
|
|
@@ -790,6 +791,7 @@ interface Relation extends langium.AstNode {
|
|
|
790
791
|
body?: RelationBody;
|
|
791
792
|
description?: string;
|
|
792
793
|
dotKind?: RelationKindDotRef;
|
|
794
|
+
isBidirectional: boolean;
|
|
793
795
|
kind?: langium.Reference<RelationshipKind>;
|
|
794
796
|
source?: FqnRef$2;
|
|
795
797
|
tags?: Tags;
|
|
@@ -935,7 +937,9 @@ interface SpecificationTag extends langium.AstNode {
|
|
|
935
937
|
readonly $container: SpecificationRule;
|
|
936
938
|
readonly $type: 'SpecificationTag';
|
|
937
939
|
color?: ColorLiteral$1;
|
|
940
|
+
customColor?: langium.Reference<CustomColor>;
|
|
938
941
|
tag: Tag$1;
|
|
942
|
+
themeColor?: ThemeColor;
|
|
939
943
|
}
|
|
940
944
|
declare const SpecificationTag = "SpecificationTag";
|
|
941
945
|
interface StepsBlock extends langium.AstNode {
|
|
@@ -984,6 +988,13 @@ interface TextSizeProperty extends langium.AstNode {
|
|
|
984
988
|
value: SizeValue;
|
|
985
989
|
}
|
|
986
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";
|
|
987
998
|
interface ViewRef extends langium.AstNode {
|
|
988
999
|
readonly $container: NavigateToProperty;
|
|
989
1000
|
readonly $type: 'ViewRef';
|
|
@@ -1006,7 +1017,7 @@ interface ViewRuleAutoLayout extends langium.AstNode {
|
|
|
1006
1017
|
}
|
|
1007
1018
|
declare const ViewRuleAutoLayout = "ViewRuleAutoLayout";
|
|
1008
1019
|
interface ViewRuleGlobalPredicateRef extends langium.AstNode {
|
|
1009
|
-
readonly $container: ElementViewBody;
|
|
1020
|
+
readonly $container: ElementViewBody | ViewRuleGroup;
|
|
1010
1021
|
readonly $type: 'ViewRuleGlobalPredicateRef';
|
|
1011
1022
|
predicate: langium.Reference<GlobalPredicateGroup>;
|
|
1012
1023
|
}
|
|
@@ -1020,7 +1031,7 @@ declare const ViewRuleGlobalStyle = "ViewRuleGlobalStyle";
|
|
|
1020
1031
|
interface ViewRuleGroup extends langium.AstNode {
|
|
1021
1032
|
readonly $container: ElementViewBody | ViewRuleGroup;
|
|
1022
1033
|
readonly $type: 'ViewRuleGroup';
|
|
1023
|
-
groupRules: Array<ViewRuleGroup | ViewRulePredicate>;
|
|
1034
|
+
groupRules: Array<ViewRuleGlobalPredicateRef | ViewRuleGroup | ViewRulePredicate>;
|
|
1024
1035
|
props: Array<BorderProperty | ColorProperty | OpacityProperty>;
|
|
1025
1036
|
title?: string;
|
|
1026
1037
|
}
|
|
@@ -1341,6 +1352,7 @@ type LikeC4AstType = {
|
|
|
1341
1352
|
TextSizeProperty: TextSizeProperty;
|
|
1342
1353
|
TryBlock: TryBlock;
|
|
1343
1354
|
TryStep: TryStep;
|
|
1355
|
+
ViewOrderProperty: ViewOrderProperty;
|
|
1344
1356
|
ViewProperty: ViewProperty;
|
|
1345
1357
|
ViewRef: ViewRef;
|
|
1346
1358
|
ViewRule: ViewRule;
|
|
@@ -1444,7 +1456,7 @@ type ParsedElementStyle = {
|
|
|
1444
1456
|
interface ParsedAstSpecification {
|
|
1445
1457
|
tags: Record<c4.Tag, {
|
|
1446
1458
|
astPath: string;
|
|
1447
|
-
color?: c4.
|
|
1459
|
+
color?: c4.TagSpecification['color'];
|
|
1448
1460
|
}>;
|
|
1449
1461
|
elements: Record<c4.ElementKind, c4.ElementSpecification>;
|
|
1450
1462
|
relationships: Record<c4.RelationshipKind, c4.RelationshipSpecification>;
|
|
@@ -1480,6 +1492,7 @@ interface ParsedAstExtend {
|
|
|
1480
1492
|
interface ParsedAstExtendRelation {
|
|
1481
1493
|
id: c4.RelationId;
|
|
1482
1494
|
astPath: string;
|
|
1495
|
+
isBidirectional?: boolean;
|
|
1483
1496
|
tags?: c4.NonEmptyArray<c4.Tag> | null;
|
|
1484
1497
|
links?: c4.NonEmptyArray<c4.Link> | null;
|
|
1485
1498
|
metadata?: {
|
|
@@ -1491,6 +1504,7 @@ interface ParsedAstRelation {
|
|
|
1491
1504
|
astPath: string;
|
|
1492
1505
|
source: c4.FqnRef.ModelRef;
|
|
1493
1506
|
target: c4.FqnRef.ModelRef;
|
|
1507
|
+
isBidirectional?: boolean;
|
|
1494
1508
|
kind?: c4.RelationshipKind;
|
|
1495
1509
|
tags?: c4.NonEmptyArray<c4.Tag>;
|
|
1496
1510
|
title: string;
|
|
@@ -1524,6 +1538,10 @@ interface ParsedAstElementView {
|
|
|
1524
1538
|
astPath: string;
|
|
1525
1539
|
title: string | null;
|
|
1526
1540
|
description: c4.MarkdownOrString | null;
|
|
1541
|
+
/**
|
|
1542
|
+
* Optional per-view navigation order.
|
|
1543
|
+
*/
|
|
1544
|
+
order?: number;
|
|
1527
1545
|
tags: c4.NonEmptyArray<c4.Tag> | null;
|
|
1528
1546
|
links: c4.NonEmptyArray<c4.Link> | null;
|
|
1529
1547
|
rules: c4.ElementViewRule[];
|
|
@@ -1533,6 +1551,10 @@ interface ParsedAstDynamicView {
|
|
|
1533
1551
|
astPath: string;
|
|
1534
1552
|
title: string | null;
|
|
1535
1553
|
description: c4.MarkdownOrString | null;
|
|
1554
|
+
/**
|
|
1555
|
+
* Optional per-view navigation order.
|
|
1556
|
+
*/
|
|
1557
|
+
order?: number;
|
|
1536
1558
|
tags: c4.NonEmptyArray<c4.Tag> | null;
|
|
1537
1559
|
links: c4.NonEmptyArray<c4.Link> | null;
|
|
1538
1560
|
steps: c4.Step.Any[];
|
|
@@ -1544,6 +1566,10 @@ interface ParsedAstDeploymentView {
|
|
|
1544
1566
|
astPath: string;
|
|
1545
1567
|
title: string | null;
|
|
1546
1568
|
description: c4.MarkdownOrString | null;
|
|
1569
|
+
/**
|
|
1570
|
+
* Optional per-view navigation order.
|
|
1571
|
+
*/
|
|
1572
|
+
order?: number;
|
|
1547
1573
|
tags: c4.NonEmptyArray<c4.Tag> | null;
|
|
1548
1574
|
links: c4.NonEmptyArray<c4.Link> | null;
|
|
1549
1575
|
rules: Array<c4.DeploymentViewRule>;
|
|
@@ -2139,7 +2165,7 @@ declare class MergedSpecification {
|
|
|
2139
2165
|
/**
|
|
2140
2166
|
* Converts a parsed model into a C4 model relation.
|
|
2141
2167
|
*/
|
|
2142
|
-
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;
|
|
2143
2169
|
/**
|
|
2144
2170
|
* Converts a parsed deployment model into a C4 deployment model
|
|
2145
2171
|
*/
|
|
@@ -2514,6 +2540,7 @@ declare const DocumentParserFromMixins: {
|
|
|
2514
2540
|
parseAbstractDynamicStep(astnode: AbstractStep): import("type-fest").Writable<import("type-fest").Except<ProjectId, "source", {
|
|
2515
2541
|
requireExactProps: true;
|
|
2516
2542
|
}>>;
|
|
2543
|
+
parseModelElementRef(node: ElementRef, errorMessage: string): ProjectId;
|
|
2517
2544
|
parseDynamicStepEndpoint(node: ElementRef, endpoint: "source" | "target"): ProjectId;
|
|
2518
2545
|
parseSubflowStep(node: SubflowStep): ProjectId | ProjectId | ProjectId | ProjectId;
|
|
2519
2546
|
parseTryStep(node: TryStep): ProjectId;
|
|
@@ -2624,6 +2651,7 @@ declare const DocumentParserFromMixins: {
|
|
|
2624
2651
|
parseAbstractDynamicStep(astnode: AbstractStep): import("type-fest").Writable<import("type-fest").Except<ProjectId, "source", {
|
|
2625
2652
|
requireExactProps: true;
|
|
2626
2653
|
}>>;
|
|
2654
|
+
parseModelElementRef(node: ElementRef, errorMessage: string): ProjectId;
|
|
2627
2655
|
parseDynamicStepEndpoint(node: ElementRef, endpoint: "source" | "target"): ProjectId;
|
|
2628
2656
|
parseSubflowStep(node: SubflowStep): ProjectId | ProjectId | ProjectId | ProjectId;
|
|
2629
2657
|
parseTryStep(node: TryStep): ProjectId;
|
|
@@ -3259,6 +3287,10 @@ interface LikeC4LanguageServices {
|
|
|
3259
3287
|
* Returns the location of the specified element, relation, view or deployment element
|
|
3260
3288
|
*/
|
|
3261
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;
|
|
3262
3294
|
/**
|
|
3263
3295
|
* Formats documents and returns a map of document URI → formatted source text.
|
|
3264
3296
|
*
|