@likec4/language-server 1.48.0 → 1.50.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/browser/package.json +2 -2
- package/browser-worker/package.json +2 -2
- package/dist/THIRD-PARTY-LICENSES.md +178 -0
- package/dist/_chunks/ConfigurableLayouter.mjs +1 -1956
- package/dist/_chunks/LikeC4FileSystem.mjs +3 -0
- package/dist/_chunks/WithMCPServer.mjs +1154 -0
- package/dist/_chunks/libs/@msgpack/msgpack.mjs +1 -805
- package/dist/_chunks/libs/eventemitter3.mjs +1 -243
- package/dist/_chunks/libs/fast-equals.mjs +1 -446
- package/dist/_chunks/libs/p-queue.mjs +1 -449
- package/dist/_chunks/libs/parse-ms.mjs +1 -36
- package/dist/_chunks/libs/picomatch.mjs +1 -1673
- package/dist/_chunks/libs/pretty-ms.mjs +1 -80
- package/dist/_chunks/libs/remeda.mjs +2 -482
- package/dist/_chunks/libs/strip-indent.mjs +1 -15
- package/dist/_chunks/libs/ufo.mjs +1 -166
- package/dist/_chunks/likec4lib.mjs +2 -9
- package/dist/_chunks/{LikeC4LanguageServices.d.mts → module.d.mts} +2101 -732
- package/dist/_chunks/module.mjs +34 -28
- package/dist/_chunks/noop.mjs +1 -0
- package/dist/_chunks/protocol.d.mts +6 -2
- package/dist/_chunks/rolldown-runtime.mjs +1 -42
- package/dist/_chunks/utils.mjs +1 -0
- package/dist/_chunks/workspace.mjs +1 -0
- package/dist/browser/index.d.mts +15 -0
- package/dist/browser/index.mjs +1 -0
- package/dist/browser/worker.mjs +1 -0
- package/dist/bundled.d.mts +1 -2
- package/dist/bundled.mjs +1 -51
- package/dist/filesystem/index.d.mts +2 -3
- package/dist/filesystem/index.mjs +1 -3
- package/dist/index.d.mts +1 -2
- package/dist/index.mjs +1 -48
- package/dist/likec4lib.d.mts +10 -3
- package/dist/likec4lib.mjs +1 -4
- package/dist/mcp/index.d.mts +2 -3
- package/dist/mcp/index.mjs +1 -3
- package/dist/module.d.mts +2 -3
- package/dist/module.mjs +1 -3
- package/dist/protocol.mjs +1 -3
- package/filesystem/package.json +4 -0
- package/mcp/package.json +4 -0
- package/module/package.json +4 -0
- package/package.json +79 -56
- package/LICENSE +0 -21
- package/dist/LikeC4LanguageServices.d.mts +0 -4
- package/dist/LikeC4LanguageServices.mjs +0 -3
- package/dist/_chunks/LikeC4LanguageServices.mjs +0 -725
- package/dist/_chunks/ast.d.mts +0 -1444
- package/dist/_chunks/ast.mjs +0 -2375
- package/dist/_chunks/ast2.mjs +0 -176
- package/dist/_chunks/filesystem.mjs +0 -58
- package/dist/_chunks/grammar.mjs +0 -8
- package/dist/_chunks/icons.mjs +0 -5211
- package/dist/_chunks/libs/@hono/node-server.mjs +0 -436
- package/dist/_chunks/libs/hono.mjs +0 -1829
- package/dist/_chunks/mcp.mjs +0 -33
- package/dist/_chunks/module2.mjs +0 -6576
- package/dist/_chunks/protocol.mjs +0 -78
- package/dist/ast.d.mts +0 -4
- package/dist/ast.mjs +0 -4
- package/dist/browser-worker.mjs +0 -6
- package/dist/browser.d.mts +0 -11
- package/dist/browser.mjs +0 -27
- package/dist/common-exports.d.mts +0 -4
- package/dist/common-exports.mjs +0 -5
- package/dist/generated/ast.d.mts +0 -2
- package/dist/generated/ast.mjs +0 -3
- package/dist/generated/grammar.d.mts +0 -6
- package/dist/generated/grammar.mjs +0 -3
- package/dist/generated/module.d.mts +0 -14
- package/dist/generated/module.mjs +0 -3
- package/dist/generated-lib/icons.d.mts +0 -4
- package/dist/generated-lib/icons.mjs +0 -3
- /package/dist/{browser-worker.d.mts → browser/worker.d.mts} +0 -0
package/dist/_chunks/ast2.mjs
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { I as t, _ as e, p as e$1 } from "./libs/remeda.mjs";
|
|
2
|
-
import { Dr as isDeploymentNodeBody, Fr as isDeploymentViewRulePredicate, Gr as isDynamicViewIncludePredicate, Nr as isDeploymentViewBody, Pi as isGlobals, Qi as isLineProperty, Qr as isElementBody, Vr as isDynamicViewBody, ci as isElementViewBody, do as isViewRulePredicate, hi as isExtendElementBody, la as isModelViews, ni as isElementRef, oa as isModel, pi as isExtendDeploymentBody, pr as isArrowProperty, sa as isModelDeployments, vr as isColorProperty, wr as isDeployedInstanceBody } from "./ast.mjs";
|
|
3
|
-
import { r as LikeC4LanguageMetaData } from "./module.mjs";
|
|
4
|
-
import { AstUtils, DocumentState } from "langium";
|
|
5
|
-
import { MultiMap as MultiMap$1, nonexhaustive } from "@likec4/core/utils";
|
|
6
|
-
|
|
7
|
-
//#region src/ast.ts
|
|
8
|
-
const idattr = Symbol.for("idattr");
|
|
9
|
-
const ViewOps = {
|
|
10
|
-
writeId(node, id) {
|
|
11
|
-
node[idattr] = id;
|
|
12
|
-
return node;
|
|
13
|
-
},
|
|
14
|
-
readId(node) {
|
|
15
|
-
return node[idattr];
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
const ElementOps = {
|
|
19
|
-
writeId(node, id) {
|
|
20
|
-
if (e(id)) node[idattr] = void 0;
|
|
21
|
-
else node[idattr] = id;
|
|
22
|
-
return node;
|
|
23
|
-
},
|
|
24
|
-
readId(node) {
|
|
25
|
-
return node[idattr];
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
function isLikeC4LangiumDocument(doc) {
|
|
29
|
-
if (doc.textDocument.languageId === LikeC4LanguageMetaData.languageId) return true;
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
function isParsedLikeC4LangiumDocument(doc) {
|
|
33
|
-
return isLikeC4LangiumDocument(doc) && doc.state == DocumentState.Validated && !!doc.c4Specification && !!doc.c4Elements && !!doc.c4ExtendElements && !!doc.c4ExtendDeployments && !!doc.c4ExtendRelations && !!doc.c4Relations && !!doc.c4Views && !!doc.c4Deployments && !!doc.c4DeploymentRelations && !!doc.c4Imports;
|
|
34
|
-
}
|
|
35
|
-
function parseMarkdownAsString(node) {
|
|
36
|
-
return node?.markdown || node?.text;
|
|
37
|
-
}
|
|
38
|
-
function parseAstPercent(value) {
|
|
39
|
-
const opacity = parseFloat(value);
|
|
40
|
-
return isNaN(opacity) ? 100 : t(opacity, {
|
|
41
|
-
min: 0,
|
|
42
|
-
max: 100
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
function parseAstOpacityProperty({ value }) {
|
|
46
|
-
return parseAstPercent(value);
|
|
47
|
-
}
|
|
48
|
-
function parseAstSizeValue({ value }) {
|
|
49
|
-
switch (value) {
|
|
50
|
-
case "xs":
|
|
51
|
-
case "sm":
|
|
52
|
-
case "md":
|
|
53
|
-
case "lg":
|
|
54
|
-
case "xl": return value;
|
|
55
|
-
case "xsmall": return "xs";
|
|
56
|
-
case "small": return "sm";
|
|
57
|
-
case "medium": return "md";
|
|
58
|
-
case "large": return "lg";
|
|
59
|
-
case "xlarge": return "xl";
|
|
60
|
-
default: nonexhaustive(value);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
function parseAstIconPositionValue({ value }) {
|
|
64
|
-
switch (value) {
|
|
65
|
-
case "left":
|
|
66
|
-
case "right":
|
|
67
|
-
case "top":
|
|
68
|
-
case "bottom": return value;
|
|
69
|
-
default: nonexhaustive(value);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function toRelationshipStyle(props, isValid) {
|
|
73
|
-
const result = {};
|
|
74
|
-
if (!props || props.length === 0) return result;
|
|
75
|
-
for (const prop of props) {
|
|
76
|
-
if (!isValid(prop)) continue;
|
|
77
|
-
switch (true) {
|
|
78
|
-
case isColorProperty(prop): {
|
|
79
|
-
const color = toColor(prop);
|
|
80
|
-
if (e$1(color)) result.color = color;
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
case isLineProperty(prop):
|
|
84
|
-
result.line = prop.value;
|
|
85
|
-
break;
|
|
86
|
-
case isArrowProperty(prop):
|
|
87
|
-
switch (prop.key) {
|
|
88
|
-
case "head":
|
|
89
|
-
result.head = prop.value;
|
|
90
|
-
break;
|
|
91
|
-
case "tail":
|
|
92
|
-
result.tail = prop.value;
|
|
93
|
-
break;
|
|
94
|
-
default: nonexhaustive(prop);
|
|
95
|
-
}
|
|
96
|
-
break;
|
|
97
|
-
default: nonexhaustive(prop);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return result;
|
|
101
|
-
}
|
|
102
|
-
function toColor(astNode) {
|
|
103
|
-
return astNode?.themeColor ?? astNode?.customColor?.$refText;
|
|
104
|
-
}
|
|
105
|
-
function toAutoLayout(rule) {
|
|
106
|
-
const rankSep = rule.rankSep;
|
|
107
|
-
const nodeSep = rule.nodeSep;
|
|
108
|
-
let direction;
|
|
109
|
-
switch (rule.direction) {
|
|
110
|
-
case "TopBottom":
|
|
111
|
-
direction = "TB";
|
|
112
|
-
break;
|
|
113
|
-
case "BottomTop":
|
|
114
|
-
direction = "BT";
|
|
115
|
-
break;
|
|
116
|
-
case "LeftRight":
|
|
117
|
-
direction = "LR";
|
|
118
|
-
break;
|
|
119
|
-
case "RightLeft":
|
|
120
|
-
direction = "RL";
|
|
121
|
-
break;
|
|
122
|
-
default: nonexhaustive(rule.direction);
|
|
123
|
-
}
|
|
124
|
-
return {
|
|
125
|
-
direction,
|
|
126
|
-
...nodeSep && { nodeSep },
|
|
127
|
-
...rankSep && { rankSep }
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
function toAstViewLayoutDirection(c4) {
|
|
131
|
-
switch (c4) {
|
|
132
|
-
case "TB": return "TopBottom";
|
|
133
|
-
case "BT": return "BottomTop";
|
|
134
|
-
case "LR": return "LeftRight";
|
|
135
|
-
case "RL": return "RightLeft";
|
|
136
|
-
default: nonexhaustive(c4);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
function getViewRulePredicateContainer(el) {
|
|
140
|
-
return AstUtils.getContainerOfType(el, (n) => {
|
|
141
|
-
return isViewRulePredicate(n) || isDeploymentViewRulePredicate(n) || isDynamicViewIncludePredicate(n);
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
const _isModel = (astNode) => {
|
|
145
|
-
return isModel(astNode) || isElementBody(astNode) || isExtendElementBody(astNode) || isElementViewBody(astNode) || isDynamicViewBody(astNode) || isElementRef(astNode);
|
|
146
|
-
};
|
|
147
|
-
const _isDeployment = (astNode) => {
|
|
148
|
-
return isModelDeployments(astNode) || isDeploymentViewBody(astNode) || isDeploymentNodeBody(astNode) || isExtendDeploymentBody(astNode) || isDeployedInstanceBody(astNode);
|
|
149
|
-
};
|
|
150
|
-
function isFqnRefInsideGlobals(astNode) {
|
|
151
|
-
while (true) {
|
|
152
|
-
if (_isDeployment(astNode) || _isModel(astNode)) return false;
|
|
153
|
-
if (isGlobals(astNode) || isModelViews(astNode)) return true;
|
|
154
|
-
if (astNode.$container) astNode = astNode.$container;
|
|
155
|
-
else return false;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
function isFqnRefInsideModel(astNode) {
|
|
159
|
-
while (true) {
|
|
160
|
-
if (_isDeployment(astNode)) return false;
|
|
161
|
-
if (_isModel(astNode)) return true;
|
|
162
|
-
if (astNode.$container) astNode = astNode.$container;
|
|
163
|
-
else return false;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
function isFqnRefInsideDeployment(astNode) {
|
|
167
|
-
while (true) {
|
|
168
|
-
if (_isModel(astNode)) return false;
|
|
169
|
-
if (_isDeployment(astNode)) return true;
|
|
170
|
-
if (astNode.$container) astNode = astNode.$container;
|
|
171
|
-
else return false;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
//#endregion
|
|
176
|
-
export { toRelationshipStyle as _, isFqnRefInsideGlobals as a, isParsedLikeC4LangiumDocument as c, parseAstPercent as d, parseAstSizeValue as f, toColor as g, toAutoLayout as h, isFqnRefInsideDeployment as i, parseAstIconPositionValue as l, toAstViewLayoutDirection as m, ViewOps as n, isFqnRefInsideModel as o, parseMarkdownAsString as p, getViewRulePredicateContainer as r, isLikeC4LangiumDocument as s, ElementOps as t, parseAstOpacityProperty as u };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { t as LibIcons } from "./icons.mjs";
|
|
2
|
-
import { r as isLikeC4Builtin } from "./likec4lib.mjs";
|
|
3
|
-
|
|
4
|
-
//#region src/filesystem/noop.ts
|
|
5
|
-
var NoopFileSystemProvider = class {
|
|
6
|
-
scanProjectFiles() {
|
|
7
|
-
return Promise.resolve([]);
|
|
8
|
-
}
|
|
9
|
-
scanDirectory() {
|
|
10
|
-
return Promise.resolve([]);
|
|
11
|
-
}
|
|
12
|
-
readFile(uri) {
|
|
13
|
-
if (isLikeC4Builtin(uri)) return Promise.resolve(LibIcons);
|
|
14
|
-
throw new Error("No file system is available.");
|
|
15
|
-
}
|
|
16
|
-
readDirectory() {
|
|
17
|
-
return Promise.resolve([]);
|
|
18
|
-
}
|
|
19
|
-
loadProjectConfig() {
|
|
20
|
-
throw new Error("No file system is available.");
|
|
21
|
-
}
|
|
22
|
-
writeFile() {
|
|
23
|
-
throw new Error("No file system is available.");
|
|
24
|
-
}
|
|
25
|
-
deleteFile() {
|
|
26
|
-
throw new Error("No file system is available.");
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* A no-op file system watcher.
|
|
31
|
-
*/
|
|
32
|
-
var NoopFileSystemWatcher = class {
|
|
33
|
-
watch() {}
|
|
34
|
-
dispose() {
|
|
35
|
-
return Promise.resolve();
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var NoopLikeC4ManualLayouts = class {
|
|
39
|
-
read() {
|
|
40
|
-
return Promise.resolve(null);
|
|
41
|
-
}
|
|
42
|
-
write() {
|
|
43
|
-
return Promise.reject(/* @__PURE__ */ new Error("NoopLikeC4ManualLayouts: write operation is not supported"));
|
|
44
|
-
}
|
|
45
|
-
remove() {
|
|
46
|
-
return Promise.resolve(null);
|
|
47
|
-
}
|
|
48
|
-
clearCaches() {}
|
|
49
|
-
};
|
|
50
|
-
const NoFileSystemWatcher = { fileSystemWatcher: () => new NoopFileSystemWatcher() };
|
|
51
|
-
const NoFileSystem = {
|
|
52
|
-
fileSystemProvider: () => new NoopFileSystemProvider(),
|
|
53
|
-
...NoFileSystemWatcher
|
|
54
|
-
};
|
|
55
|
-
const NoLikeC4ManualLayouts = { manualLayouts: () => new NoopLikeC4ManualLayouts() };
|
|
56
|
-
|
|
57
|
-
//#endregion
|
|
58
|
-
export { NoFileSystemWatcher as n, NoLikeC4ManualLayouts as r, NoFileSystem as t };
|