@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.
Files changed (37) hide show
  1. package/dist/browser.cjs +1 -1
  2. package/dist/browser.d.cts +2 -2
  3. package/dist/browser.d.mts +2 -2
  4. package/dist/browser.d.ts +2 -2
  5. package/dist/browser.mjs +2 -2
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.d.cts +2 -2
  8. package/dist/index.d.mts +2 -2
  9. package/dist/index.d.ts +2 -2
  10. package/dist/index.mjs +2 -2
  11. package/dist/likec4lib.cjs +589 -0
  12. package/dist/likec4lib.mjs +589 -0
  13. package/dist/model-graph/index.cjs +1 -1
  14. package/dist/model-graph/index.mjs +1 -1
  15. package/dist/shared/{language-server.DJhoJBWh.cjs → language-server.3Bh0zvVS.cjs} +10 -2
  16. package/dist/shared/{language-server.Cyw-bCtc.d.ts → language-server.BCDM5gt9.d.ts} +6 -3
  17. package/dist/shared/{language-server.DGjTE7xL.d.mts → language-server.BN7V1vQA.d.mts} +6 -3
  18. package/dist/shared/language-server.BX2gtzo8.d.cts +1233 -0
  19. package/dist/shared/{language-server.CCOotWDz.mjs → language-server.BbMFBkE-.mjs} +80 -24
  20. package/dist/shared/language-server.BiN_phWO.d.mts +1233 -0
  21. package/dist/shared/{language-server.CbqwHp7Q.mjs → language-server.BxxqS4Id.mjs} +10 -2
  22. package/dist/shared/{language-server.C8lV6gDw.cjs → language-server.BzrAcTYK.cjs} +78 -22
  23. package/dist/shared/{language-server.Ol32Kygo.d.cts → language-server.DtLmc4Fz.d.cts} +6 -3
  24. package/dist/shared/language-server.ljop0PBQ.d.ts +1233 -0
  25. package/package.json +11 -11
  26. package/src/ast.ts +23 -9
  27. package/src/formatting/LikeC4Formatter.ts +19 -7
  28. package/src/generated/ast.ts +9 -4
  29. package/src/generated/grammar.ts +1 -1
  30. package/src/generated-lib/icons.ts +589 -0
  31. package/src/like-c4.langium +8 -4
  32. package/src/lsp/CompletionProvider.ts +48 -1
  33. package/src/model/model-parser.ts +2 -6
  34. package/src/model-graph/compute-view/compute.ts +5 -1
  35. package/src/model-graph/dynamic-view/compute.ts +5 -1
  36. package/src/test/testServices.ts +1 -1
  37. 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: autoLayoutRule?.autoLayout ?? 'LR',
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 && {
@@ -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: false })
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 { ViewManualLayout } from '@likec4/core'
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
+ }