@likec4/language-server 1.34.2 → 1.35.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/LikeC4FileSystem.js +2 -2
- package/dist/bundled.mjs +2647 -2633
- package/dist/generated/ast.d.ts +7 -6
- package/dist/generated/ast.js +1 -0
- package/dist/generated/grammar.js +1 -1
- package/dist/model/builder/MergedSpecification.d.ts +1 -1
- package/dist/model/builder/MergedSpecification.js +8 -0
- package/dist/model/parser/SpecificationParser.d.ts +1 -1
- package/dist/model/parser/SpecificationParser.js +18 -3
- package/dist/model/parser/ViewsParser.js +6 -1
- package/dist/view-utils/resolve-relative-paths.js +1 -1
- package/package.json +13 -13
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as c4 from '@likec4/core';
|
|
2
2
|
import { MultiMap } from '@likec4/core';
|
|
3
3
|
import type { ParsedAstDeployment, ParsedAstDeploymentRelation, ParsedAstElement, ParsedAstRelation, ParsedAstSpecification, ParsedLikeC4LangiumDocument } from '../../ast';
|
|
4
4
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as c4 from "@likec4/core";
|
|
1
2
|
import { MultiMap } from "@likec4/core";
|
|
2
3
|
import {
|
|
3
4
|
FqnRef
|
|
@@ -86,6 +87,9 @@ export class MergedSpecification {
|
|
|
86
87
|
size ??= __kind.style.size;
|
|
87
88
|
padding ??= __kind.style.padding;
|
|
88
89
|
textSize ??= __kind.style.textSize;
|
|
90
|
+
description ??= __kind.description;
|
|
91
|
+
links ??= __kind.links;
|
|
92
|
+
title = title === c4.nameFromFqn(id) && __kind.title ? __kind.title : title;
|
|
89
93
|
return {
|
|
90
94
|
...color && { color },
|
|
91
95
|
...shape && { shape },
|
|
@@ -168,11 +172,15 @@ export class MergedSpecification {
|
|
|
168
172
|
technology = __kind.technology,
|
|
169
173
|
notation = __kind.notation,
|
|
170
174
|
style,
|
|
175
|
+
title,
|
|
171
176
|
description,
|
|
172
177
|
...rest
|
|
173
178
|
} = parsed;
|
|
179
|
+
description ??= __kind.description;
|
|
180
|
+
title = title === c4.nameFromFqn(parsed.id) && __kind.title ? __kind.title : title;
|
|
174
181
|
return {
|
|
175
182
|
...rest,
|
|
183
|
+
...{ title },
|
|
176
184
|
...description && { description },
|
|
177
185
|
...notation && { notation },
|
|
178
186
|
...technology && { technology },
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as c4 from "@likec4/core";
|
|
1
2
|
import { nonNullable } from "@likec4/core/utils";
|
|
2
3
|
import { filter, isNonNullish, isNullish, isTruthy, mapToObj, omitBy, pipe } from "remeda";
|
|
3
4
|
import { ast, parseMarkdownAsString, toRelationshipStyleExcludeDefaults } from "../../ast.js";
|
|
@@ -94,15 +95,29 @@ export function SpecificationParser(B) {
|
|
|
94
95
|
}
|
|
95
96
|
const tags = this.parseTags(specAst);
|
|
96
97
|
const style = this.parseElementStyle(props.find(ast.isElementStyleProperty));
|
|
98
|
+
const links = this.parseLinks(specAst);
|
|
97
99
|
const bodyProps = pipe(
|
|
98
100
|
props.filter(ast.isSpecificationElementStringProperty) ?? [],
|
|
99
|
-
filter((p) => this.isValid(p)
|
|
100
|
-
mapToObj((p) => [p.key,
|
|
101
|
+
filter((p) => this.isValid(p)),
|
|
102
|
+
mapToObj((p) => [p.key, p.value])
|
|
101
103
|
);
|
|
104
|
+
const { title, description, technology } = this.parseTitleDescriptionTechnology(
|
|
105
|
+
{
|
|
106
|
+
title: void 0,
|
|
107
|
+
description: void 0,
|
|
108
|
+
technology: void 0
|
|
109
|
+
},
|
|
110
|
+
bodyProps
|
|
111
|
+
);
|
|
112
|
+
const notation = removeIndent(parseMarkdownAsString(bodyProps.notation));
|
|
102
113
|
return {
|
|
103
114
|
[kindName]: {
|
|
104
|
-
...
|
|
115
|
+
...title && { title },
|
|
116
|
+
...description && { description },
|
|
117
|
+
...technology && { technology },
|
|
118
|
+
...notation && { notation },
|
|
105
119
|
...tags && { tags },
|
|
120
|
+
...links && c4.isNonEmptyArray(links) && { links },
|
|
106
121
|
style
|
|
107
122
|
}
|
|
108
123
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as c4 from "@likec4/core";
|
|
2
2
|
import { invariant, isNonEmptyArray, nonexhaustive } from "@likec4/core";
|
|
3
|
-
import { filter, isArray, isDefined, isNonNullish, isTruthy, mapToObj, pipe } from "remeda";
|
|
3
|
+
import { filter, isArray, isDefined, isEmpty, isNonNullish, isTruthy, mapToObj, pipe } from "remeda";
|
|
4
4
|
import {
|
|
5
5
|
ast,
|
|
6
6
|
parseMarkdownAsString,
|
|
@@ -26,6 +26,7 @@ export function ViewsParser(B) {
|
|
|
26
26
|
return [];
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
|
+
const folder = viewBlock.folder && !isEmpty(viewBlock.folder.trim()) ? viewBlock.folder : null;
|
|
29
30
|
for (const view of viewBlock.views) {
|
|
30
31
|
try {
|
|
31
32
|
if (!isValid(view)) {
|
|
@@ -44,6 +45,10 @@ export function ViewsParser(B) {
|
|
|
44
45
|
default:
|
|
45
46
|
nonexhaustive(view);
|
|
46
47
|
}
|
|
48
|
+
if (folder) {
|
|
49
|
+
const view2 = this.doc.c4Views.at(-1);
|
|
50
|
+
view2.title = folder + " / " + (view2.title || view2.id);
|
|
51
|
+
}
|
|
47
52
|
} catch (e) {
|
|
48
53
|
logWarnError(e);
|
|
49
54
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/language-server",
|
|
3
3
|
"description": "LikeC4 Language Server",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.35.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bugs": "https://github.com/likec4/likec4/issues",
|
|
7
7
|
"homepage": "https://likec4.dev",
|
|
@@ -97,8 +97,8 @@
|
|
|
97
97
|
"@msgpack/msgpack": "^3.1.2",
|
|
98
98
|
"@smithy/util-base64": "^4.0.0",
|
|
99
99
|
"@types/express": "^5.0.3",
|
|
100
|
-
"@types/node": "~20.19.
|
|
101
|
-
"@types/picomatch": "^4.0.
|
|
100
|
+
"@types/node": "~20.19.2",
|
|
101
|
+
"@types/picomatch": "^4.0.2",
|
|
102
102
|
"@types/which": "^3.0.4",
|
|
103
103
|
"chroma-js": "^3.1.2",
|
|
104
104
|
"esm-env": "^1.2.2",
|
|
@@ -113,30 +113,30 @@
|
|
|
113
113
|
"p-debounce": "4.0.0",
|
|
114
114
|
"p-queue": "8.1.0",
|
|
115
115
|
"p-timeout": "6.1.4",
|
|
116
|
-
"picomatch": "^4.0.
|
|
116
|
+
"picomatch": "^4.0.3",
|
|
117
117
|
"pretty-ms": "^9.2.0",
|
|
118
118
|
"remeda": "^2.23.1",
|
|
119
119
|
"strip-indent": "^4.0.0",
|
|
120
|
-
"tsx": "4.
|
|
121
|
-
"turbo": "2.5.
|
|
120
|
+
"tsx": "4.20.3",
|
|
121
|
+
"turbo": "2.5.5",
|
|
122
122
|
"type-fest": "^4.41.0",
|
|
123
123
|
"typescript": "5.8.3",
|
|
124
|
-
"ufo": "
|
|
124
|
+
"ufo": "1.6.1",
|
|
125
125
|
"unbuild": "3.5.0",
|
|
126
126
|
"valibot": "^1.1.0",
|
|
127
127
|
"vitest": "3.2.4",
|
|
128
|
-
"vscode-jsonrpc": "8.2.
|
|
128
|
+
"vscode-jsonrpc": "8.2.1",
|
|
129
129
|
"vscode-languageserver": "9.0.1",
|
|
130
130
|
"vscode-languageserver-protocol": "3.17.5",
|
|
131
131
|
"vscode-languageserver-types": "3.17.5",
|
|
132
132
|
"vscode-uri": "3.1.0",
|
|
133
133
|
"which": "^5.0.0",
|
|
134
134
|
"zod": "3.25.67",
|
|
135
|
-
"@likec4/
|
|
136
|
-
"@likec4/
|
|
137
|
-
"@likec4/
|
|
138
|
-
"@likec4/
|
|
139
|
-
"@likec4/
|
|
135
|
+
"@likec4/core": "1.35.0",
|
|
136
|
+
"@likec4/icons": "1.35.0",
|
|
137
|
+
"@likec4/layouts": "1.35.0",
|
|
138
|
+
"@likec4/tsconfig": "1.35.0",
|
|
139
|
+
"@likec4/log": "1.35.0"
|
|
140
140
|
},
|
|
141
141
|
"scripts": {
|
|
142
142
|
"typecheck": "tsc -b --verbose",
|