@likec4/language-server 1.11.0 → 1.12.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 +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/likec4lib.cjs +589 -0
- package/dist/likec4lib.mjs +589 -0
- package/dist/model-graph/index.cjs +1 -1
- package/dist/model-graph/index.mjs +1 -1
- package/dist/shared/{language-server.DJhoJBWh.cjs → language-server.3Bh0zvVS.cjs} +10 -2
- package/dist/shared/{language-server.Cyw-bCtc.d.ts → language-server.BCDM5gt9.d.ts} +6 -3
- package/dist/shared/{language-server.DGjTE7xL.d.mts → language-server.BN7V1vQA.d.mts} +6 -3
- package/dist/shared/language-server.BX2gtzo8.d.cts +1233 -0
- package/dist/shared/{language-server.CCOotWDz.mjs → language-server.BbMFBkE-.mjs} +80 -24
- package/dist/shared/language-server.BiN_phWO.d.mts +1233 -0
- package/dist/shared/{language-server.CbqwHp7Q.mjs → language-server.BxxqS4Id.mjs} +10 -2
- package/dist/shared/{language-server.C8lV6gDw.cjs → language-server.BzrAcTYK.cjs} +78 -22
- package/dist/shared/{language-server.Ol32Kygo.d.cts → language-server.DtLmc4Fz.d.cts} +6 -3
- package/dist/shared/language-server.ljop0PBQ.d.ts +1233 -0
- package/package.json +11 -11
- package/src/ast.ts +23 -9
- package/src/formatting/LikeC4Formatter.ts +19 -7
- package/src/generated/ast.ts +9 -4
- package/src/generated/grammar.ts +1 -1
- package/src/generated-lib/icons.ts +589 -0
- package/src/like-c4.langium +8 -4
- package/src/lsp/CompletionProvider.ts +48 -1
- package/src/model/model-parser.ts +2 -6
- package/src/model-graph/compute-view/compute.ts +5 -1
- package/src/model-graph/dynamic-view/compute.ts +5 -1
- package/src/test/testServices.ts +1 -1
- package/src/view-utils/manual-layout.ts +5 -2
|
@@ -200,7 +200,11 @@ export class DynamicViewComputeCtx {
|
|
|
200
200
|
|
|
201
201
|
return calcViewLayoutHash({
|
|
202
202
|
...view,
|
|
203
|
-
autoLayout:
|
|
203
|
+
autoLayout: {
|
|
204
|
+
direction: autoLayoutRule?.direction ?? 'LR',
|
|
205
|
+
...(autoLayoutRule?.nodeSep && { nodeSep: autoLayoutRule.nodeSep }),
|
|
206
|
+
...(autoLayoutRule?.rankSep && { rankSep: autoLayoutRule.rankSep }),
|
|
207
|
+
},
|
|
204
208
|
nodes: map(nodes, omit(['notation'])),
|
|
205
209
|
edges,
|
|
206
210
|
...(elementNotations.length > 0 && {
|
package/src/test/testServices.ts
CHANGED
|
@@ -72,7 +72,7 @@ export function createTestServices(workspace = 'file:///test/workspace') {
|
|
|
72
72
|
const format = async (input: string | LikeC4LangiumDocument, uri?: string) => {
|
|
73
73
|
const document = typeof input === 'string' ? await parse(input, uri) : input
|
|
74
74
|
await services.shared.workspace.WorkspaceLock.write(async (_cancelToken) => {
|
|
75
|
-
await documentBuilder.build([document], { validation:
|
|
75
|
+
await documentBuilder.build([document], { validation: true })
|
|
76
76
|
})
|
|
77
77
|
|
|
78
78
|
const edits = await services.lsp.Formatter?.formatDocument(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { isAutoLayoutDirection, type ViewManualLayout } from '@likec4/core'
|
|
2
2
|
import { decode, encode } from '@msgpack/msgpack'
|
|
3
3
|
import { fromBase64, toBase64 } from '@smithy/util-base64'
|
|
4
4
|
import { mapValues } from 'remeda'
|
|
@@ -28,10 +28,13 @@ function pack({
|
|
|
28
28
|
function unpack({
|
|
29
29
|
nodes,
|
|
30
30
|
edges,
|
|
31
|
+
autoLayout,
|
|
31
32
|
...rest
|
|
32
33
|
}: ReturnType<typeof pack>): ViewManualLayout {
|
|
33
34
|
return {
|
|
34
35
|
...rest,
|
|
36
|
+
/// Try to parse the old format for backward compatibility
|
|
37
|
+
autoLayout: isAutoLayoutDirection(autoLayout) ? { direction: autoLayout } : autoLayout,
|
|
35
38
|
nodes: mapValues(nodes, ({ b, c, ...n }) => ({
|
|
36
39
|
x: b[0],
|
|
37
40
|
y: b[1],
|
|
@@ -85,4 +88,4 @@ export function deserializeFromComment(comment: string): ViewManualLayout {
|
|
|
85
88
|
.join('')
|
|
86
89
|
const decodedb64 = fromBase64(b64)
|
|
87
90
|
return unpack(decode(decodedb64) as any) as ViewManualLayout
|
|
88
|
-
}
|
|
91
|
+
}
|