@likec4/language-server 1.16.0 → 1.17.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/browser.cjs +1 -1
- package/dist/browser.d.cts +2 -2
- package/dist/browser.d.mts +2 -2
- package/dist/browser.d.ts +2 -2
- package/dist/browser.mjs +2 -2
- package/dist/index.cjs +35 -5
- package/dist/index.d.cts +17 -4
- package/dist/index.d.mts +17 -4
- package/dist/index.d.ts +17 -4
- package/dist/index.mjs +34 -5
- package/dist/model-graph/index.cjs +1 -1
- package/dist/model-graph/index.mjs +1 -1
- package/dist/shared/{language-server.D_13fWJQ.mjs → language-server.B8qSDsWW.mjs} +36 -14
- package/dist/shared/{language-server.DViE1Zxi.d.mts → language-server.BGGRJRnr.d.mts} +1 -1
- package/dist/shared/{language-server.C5gxpVUH.mjs → language-server.BXFhlTPo.mjs} +15 -3
- package/dist/shared/{language-server.DIaiY0-C.d.mts → language-server.BgDKnNok.d.mts} +1 -1
- package/dist/shared/{language-server.7iILaJYc.d.ts → language-server.Bmpq16Gw.d.ts} +1 -1
- package/dist/shared/{language-server.CmBZHwSl.d.cts → language-server.C1ZfM22X.d.cts} +1 -1
- package/dist/shared/{language-server.CnkCWVtf.d.cts → language-server.DJo88TnT.d.cts} +1 -1
- package/dist/shared/{language-server.Dym6GL4P.cjs → language-server.DZRuJVSg.cjs} +36 -14
- package/dist/shared/{language-server.Bd3NZ8uH.cjs → language-server.N8HLDQqz.cjs} +14 -2
- package/dist/shared/{language-server.DwyQ1FtY.d.ts → language-server.PEjk7U9s.d.ts} +1 -1
- package/package.json +7 -7
- package/src/LikeC4FileSystem.ts +36 -0
- package/src/Rpc.ts +2 -2
- package/src/generated/ast.ts +1 -1
- package/src/generated/grammar.ts +1 -1
- package/src/index.ts +3 -3
- package/src/like-c4.langium +1 -1
- package/src/lsp/SemanticTokenProvider.ts +26 -8
- package/src/model/fqn-computation.ts +6 -2
- package/src/model-graph/compute-view/__test__/fixture.ts +6 -0
- package/src/model-graph/compute-view/compute.ts +9 -2
- package/src/model-graph/dynamic-view/compute.ts +8 -1
- package/src/model-graph/utils/applyCustomElementProperties.ts +1 -3
|
@@ -1048,7 +1048,13 @@ class ComputeCtx {
|
|
|
1048
1048
|
...autoLayoutRule?.nodeSep && { nodeSep: autoLayoutRule.nodeSep },
|
|
1049
1049
|
...autoLayoutRule?.rankSep && { rankSep: autoLayoutRule.rankSep }
|
|
1050
1050
|
},
|
|
1051
|
-
nodes: remeda.map(nodes,
|
|
1051
|
+
nodes: remeda.map(nodes, (n) => {
|
|
1052
|
+
delete n.notation;
|
|
1053
|
+
if (n.icon === "none") {
|
|
1054
|
+
delete n.icon;
|
|
1055
|
+
}
|
|
1056
|
+
return n;
|
|
1057
|
+
}),
|
|
1052
1058
|
edges: applyCustomRelationProperties(rules, nodes, sortedEdges),
|
|
1053
1059
|
...elementNotations.length > 0 && {
|
|
1054
1060
|
notation: {
|
|
@@ -1618,7 +1624,13 @@ class DynamicViewComputeCtx {
|
|
|
1618
1624
|
...autoLayoutRule?.nodeSep && { nodeSep: autoLayoutRule.nodeSep },
|
|
1619
1625
|
...autoLayoutRule?.rankSep && { rankSep: autoLayoutRule.rankSep }
|
|
1620
1626
|
},
|
|
1621
|
-
nodes: remeda.map(nodes,
|
|
1627
|
+
nodes: remeda.map(nodes, (n) => {
|
|
1628
|
+
delete n.notation;
|
|
1629
|
+
if (n.icon === "none") {
|
|
1630
|
+
delete n.icon;
|
|
1631
|
+
}
|
|
1632
|
+
return n;
|
|
1633
|
+
}),
|
|
1622
1634
|
edges,
|
|
1623
1635
|
...elementNotations.length > 0 && {
|
|
1624
1636
|
notation: {
|
|
@@ -423,7 +423,7 @@ interface IconProperty extends AstNode {
|
|
|
423
423
|
readonly $type: 'IconProperty';
|
|
424
424
|
key: 'icon';
|
|
425
425
|
libicon?: Reference<LibIcon>;
|
|
426
|
-
value?: Uri;
|
|
426
|
+
value?: 'none' | Uri;
|
|
427
427
|
}
|
|
428
428
|
declare const IconProperty = "IconProperty";
|
|
429
429
|
interface IncludePredicate extends AstNode {
|
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.17.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bugs": "https://github.com/likec4/likec4/issues",
|
|
7
7
|
"homepage": "https://likec4.dev",
|
|
@@ -112,8 +112,8 @@
|
|
|
112
112
|
},
|
|
113
113
|
"dependencies": {
|
|
114
114
|
"@dagrejs/dagre": "^1.1.4",
|
|
115
|
-
"@likec4/core": "1.
|
|
116
|
-
"@likec4/log": "1.
|
|
115
|
+
"@likec4/core": "1.17.0",
|
|
116
|
+
"@likec4/log": "1.17.0",
|
|
117
117
|
"@msgpack/msgpack": "^3.0.0-beta2",
|
|
118
118
|
"@smithy/util-base64": "^3.0.0",
|
|
119
119
|
"fast-equals": "^5.0.1",
|
|
@@ -133,12 +133,12 @@
|
|
|
133
133
|
"vscode-uri": "3.0.8"
|
|
134
134
|
},
|
|
135
135
|
"devDependencies": {
|
|
136
|
-
"@likec4/icons": "1.
|
|
137
|
-
"@likec4/tsconfig": "1.
|
|
136
|
+
"@likec4/icons": "1.17.0",
|
|
137
|
+
"@likec4/tsconfig": "1.17.0",
|
|
138
138
|
"@types/node": "^20.16.14",
|
|
139
139
|
"@types/object-hash": "^3.0.6",
|
|
140
140
|
"@types/string-hash": "^1.1.3",
|
|
141
|
-
"@vitest/coverage-v8": "^2.1.
|
|
141
|
+
"@vitest/coverage-v8": "^2.1.5",
|
|
142
142
|
"execa": "^9.3.1",
|
|
143
143
|
"langium-cli": "3.2.0",
|
|
144
144
|
"npm-run-all2": "^6.2.6",
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"turbo": "^2.2.3",
|
|
147
147
|
"typescript": "^5.6.3",
|
|
148
148
|
"unbuild": "^3.0.0-rc.11",
|
|
149
|
-
"vitest": "^2.1.
|
|
149
|
+
"vitest": "^2.1.5"
|
|
150
150
|
},
|
|
151
151
|
"packageManager": "yarn@4.5.1"
|
|
152
152
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type FileSystemNode, URI, UriUtils } from 'langium'
|
|
2
|
+
import { NodeFileSystemProvider } from 'langium/node'
|
|
3
|
+
import { lstatSync, readlinkSync } from 'node:fs'
|
|
4
|
+
import { readdir } from 'node:fs/promises'
|
|
5
|
+
import { dirname, resolve } from 'node:path'
|
|
6
|
+
|
|
7
|
+
export const LikeC4FileSystem = {
|
|
8
|
+
fileSystemProvider: () => new SymLinkTraversingFileSystemProvider()
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A file system provider that follows symbolic links.
|
|
13
|
+
* @see https://github.com/likec4/likec4/pull/1213
|
|
14
|
+
*/
|
|
15
|
+
class SymLinkTraversingFileSystemProvider extends NodeFileSystemProvider {
|
|
16
|
+
override async readDirectory(folderPath: URI): Promise<FileSystemNode[]> {
|
|
17
|
+
const dirents = await readdir(folderPath.fsPath, { withFileTypes: true })
|
|
18
|
+
return dirents.map(dirent => (this.followUri(UriUtils.joinPath(folderPath, dirent.name))))
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
followUri(uri: URI): FileSystemNode {
|
|
22
|
+
const directoryPath = dirname(uri.fsPath)
|
|
23
|
+
const stat = lstatSync(uri.fsPath)
|
|
24
|
+
if (stat.isSymbolicLink()) {
|
|
25
|
+
const resolved_link = readlinkSync(uri.fsPath)
|
|
26
|
+
const linked_path = resolve(directoryPath, resolved_link)
|
|
27
|
+
return this.followUri(URI.file(linked_path))
|
|
28
|
+
} else {
|
|
29
|
+
return {
|
|
30
|
+
isFile: stat.isFile(),
|
|
31
|
+
isDirectory: stat.isDirectory(),
|
|
32
|
+
uri
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
package/src/Rpc.ts
CHANGED
package/src/generated/ast.ts
CHANGED