@likec4/language-server 1.56.0 → 1.58.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/_chunks/LikeC4FileSystem.mjs +2 -2
- package/dist/_chunks/module.d.mts +448 -435
- package/dist/_chunks/module.mjs +34 -19
- package/dist/_chunks/protocol.d.mts +3 -1
- package/dist/_chunks/utils.mjs +1 -1
- package/dist/browser/index.d.mts +2 -2
- package/dist/browser/index.mjs +1 -1
- package/dist/filesystem/index.d.mts +1 -1
- package/dist/filesystem/index.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/module.d.mts +1 -1
- package/dist/module.mjs +1 -1
- package/package.json +28 -26
- package/src/test/testServices.ts +3 -2
package/dist/browser/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as LikeC4ManualLayoutsModuleContext, C as ViewLocateResult, D as LangiumDocuments, E as LikeC4WorkspaceManager, F as FileSystemModuleContext, H as Project, I as FileSystemProvider, L as FileSystemWatcher, M as NoFileSystemWatcher, N as NoLikeC4ManualLayouts, R as FileSystemWatcherModuleContext, S as LikeC4ModelLocator, T as FqnIndex, U as ProjectData, W as ProjectsManager, _ as LikeC4ViewsModuleContext, b as LayoutViewParams, d as LikeC4LanguageServices, f as DocumentParser, j as NoFileSystem, n as LikeC4AddedServices, o as LikeC4SharedServices, p as LikeC4ModelParser, r as LikeC4Services, s as createLanguageServices, t as LanguageServicesContext, u as FormatOptions, w as LikeC4ModelBuilder, x as LikeC4Views, y as WithWasmGraphviz, z as LikeC4ManualLayouts } from "../_chunks/module.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/browser/index.d.ts
|
|
4
4
|
/**
|
|
@@ -11,4 +11,4 @@ declare function startLanguageServer(port: MessagePort | DedicatedWorkerGlobalSc
|
|
|
11
11
|
likec4: LikeC4Services;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
14
|
-
export { DocumentParser, FileSystemModuleContext, FileSystemProvider, FileSystemWatcher, FileSystemWatcherModuleContext, FormatOptions, FqnIndex, LangiumDocuments, LanguageServicesContext, LikeC4AddedServices, LikeC4LanguageServices, LikeC4ManualLayouts, LikeC4ManualLayoutsModuleContext, LikeC4ModelBuilder, LikeC4ModelLocator, LikeC4ModelParser, LikeC4Services, LikeC4SharedServices, LikeC4Views, LikeC4ViewsModuleContext, LikeC4WorkspaceManager, NoFileSystem, NoFileSystemWatcher, NoLikeC4ManualLayouts, Project, ProjectData, ProjectsManager, ViewLocateResult, WithWasmGraphviz, createLanguageServices, startLanguageServer };
|
|
14
|
+
export { DocumentParser, FileSystemModuleContext, FileSystemProvider, FileSystemWatcher, FileSystemWatcherModuleContext, FormatOptions, FqnIndex, LangiumDocuments, LanguageServicesContext, LayoutViewParams, LikeC4AddedServices, LikeC4LanguageServices, LikeC4ManualLayouts, LikeC4ManualLayoutsModuleContext, LikeC4ModelBuilder, LikeC4ModelLocator, LikeC4ModelParser, LikeC4Services, LikeC4SharedServices, LikeC4Views, LikeC4ViewsModuleContext, LikeC4WorkspaceManager, NoFileSystem, NoFileSystemWatcher, NoLikeC4ManualLayouts, Project, ProjectData, ProjectsManager, ViewLocateResult, WithWasmGraphviz, createLanguageServices, startLanguageServer };
|
package/dist/browser/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ai as e,oi as t,si as n}from"../_chunks/utils.mjs";import{t as r}from"../_chunks/module.mjs";import"../_chunks/common-exports.mjs";import{configureLogger as i,getConsoleSink as a,getTextFormatter as o}from"@likec4/log";import{startLanguageServer as s}from"langium/lsp";import{BrowserMessageReader as c,BrowserMessageWriter as l,createConnection as u}from"vscode-languageserver/browser";function startLanguageServer(e){let t=u(new c(e),new l(e));i({sinks:{console:a({formatter:o({format:({level:e,category:t,message:n})=>`${e} ${t} ${n}`})})},loggers:[{category:`likec4`,sinks:[`console`],lowestLevel:`debug`}]});let n=r({connection:t});return s(n.shared),n}export{e as NoFileSystem,t as NoFileSystemWatcher,n as NoLikeC4ManualLayouts,r as createLanguageServices,startLanguageServer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as WithFileSystem, B as LikeC4ManualLayoutsModuleContext, F as FileSystemModuleContext, I as FileSystemProvider, L as FileSystemWatcher, M as NoFileSystemWatcher, N as NoLikeC4ManualLayouts, O as WithLikeC4ManualLayouts, P as FileNode, R as FileSystemWatcherModuleContext, V as ManualLayoutsSnapshot, j as NoFileSystem, k as WithChokidarWatcher, z as LikeC4ManualLayouts } from "../_chunks/module.mjs";
|
|
2
2
|
export { FileNode, FileSystemModuleContext, FileSystemProvider, FileSystemWatcher, FileSystemWatcherModuleContext, LikeC4ManualLayouts, LikeC4ManualLayoutsModuleContext, ManualLayoutsSnapshot, NoFileSystem, NoFileSystemWatcher, NoLikeC4ManualLayouts, WithChokidarWatcher, WithFileSystem, WithLikeC4ManualLayouts };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ai as e,oi as t,si as n}from"../_chunks/utils.mjs";import{n as r,r as i,t as a}from"../_chunks/LikeC4FileSystem.mjs";export{e as NoFileSystem,t as NoFileSystemWatcher,n as NoLikeC4ManualLayouts,r as WithChokidarWatcher,a as WithFileSystem,i as WithLikeC4ManualLayouts};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { ConfigureLanguageServerLoggerOptions, DocumentParser, FileSystemModuleContext, FileSystemProvider, FileSystemWatcher, FileSystemWatcherModuleContext, FormatOptions, FqnIndex, LangiumDocuments, LanguageServicesContext, LikeC4AddedServices, LikeC4LanguageServices, LikeC4ManualLayouts, LikeC4ManualLayoutsModuleContext, LikeC4ModelBuilder, LikeC4ModelLocator, LikeC4ModelParser, LikeC4Services, LikeC4SharedServices, LikeC4Views, LikeC4ViewsModuleContext, LikeC4WorkspaceManager, NoFileSystem, NoFileSystemWatcher, NoLikeC4ManualLayouts, Project, ProjectData, ProjectsManager, ViewLocateResult, WithFileSystem, WithLikeC4ManualLayouts, WithWasmGraphviz, configureLanguageServerLogger, createLanguageServices, startLanguageServer };
|
|
1
|
+
import { A as WithFileSystem, B as LikeC4ManualLayoutsModuleContext, C as ViewLocateResult, D as LangiumDocuments, E as LikeC4WorkspaceManager, F as FileSystemModuleContext, H as Project, I as FileSystemProvider, L as FileSystemWatcher, M as NoFileSystemWatcher, N as NoLikeC4ManualLayouts, O as WithLikeC4ManualLayouts, R as FileSystemWatcherModuleContext, S as LikeC4ModelLocator, T as FqnIndex, U as ProjectData, W as ProjectsManager, _ as LikeC4ViewsModuleContext, b as LayoutViewParams, d as LikeC4LanguageServices, f as DocumentParser, g as configureLanguageServerLogger, h as ConfigureLanguageServerLoggerOptions, j as NoFileSystem, m as startLanguageServer, n as LikeC4AddedServices, o as LikeC4SharedServices, p as LikeC4ModelParser, r as LikeC4Services, s as createLanguageServices, t as LanguageServicesContext, u as FormatOptions, w as LikeC4ModelBuilder, x as LikeC4Views, y as WithWasmGraphviz, z as LikeC4ManualLayouts } from "./_chunks/module.mjs";
|
|
2
|
+
export { ConfigureLanguageServerLoggerOptions, DocumentParser, FileSystemModuleContext, FileSystemProvider, FileSystemWatcher, FileSystemWatcherModuleContext, FormatOptions, FqnIndex, LangiumDocuments, LanguageServicesContext, LayoutViewParams, LikeC4AddedServices, LikeC4LanguageServices, LikeC4ManualLayouts, LikeC4ManualLayoutsModuleContext, LikeC4ModelBuilder, LikeC4ModelLocator, LikeC4ModelParser, LikeC4Services, LikeC4SharedServices, LikeC4Views, LikeC4ViewsModuleContext, LikeC4WorkspaceManager, NoFileSystem, NoFileSystemWatcher, NoLikeC4ManualLayouts, Project, ProjectData, ProjectsManager, ViewLocateResult, WithFileSystem, WithLikeC4ManualLayouts, WithWasmGraphviz, configureLanguageServerLogger, createLanguageServices, startLanguageServer };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ai as e,ci as t,oi as n,si as r,ui as i}from"./_chunks/utils.mjs";import{r as a,t as o}from"./_chunks/LikeC4FileSystem.mjs";import{i as s,t as c}from"./_chunks/module.mjs";import"./_chunks/common-exports.mjs";import{configureLogger as l,getAnsiColorFormatter as u,getConsoleSink as d,getConsoleStderrSink as f,getTextFormatter as p}from"@likec4/log";import{isEmpty as m}from"remeda";import{startLanguageServer as h}from"langium/lsp";import{GraphvizWasmAdapter as g,QueueGraphvizLayoter as _}from"@likec4/layouts";import{GraphvizBinaryAdapter as v}from"@likec4/layouts/graphviz/binary";import{defu as y}from"defu";import{isDevelopment as b}from"std-env";import x from"which";function configureLanguageServerLogger({lspConnection:e,enableTelemetry:n=!!e,useStdErr:r=!1,logLevel:a=b?`debug`:`warning`,nonBlocking:o=!1,colors:s=!1}={}){let c=!!e&&n&&!b;l({reset:!0,sinks:{console:r?f({formatter:p()}):d({formatter:s?u():p(),nonBlocking:o}),...c&&{telemetry:t(e)}},loggers:[{category:[`likec4`],sinks:[`console`,...c?[`telemetry`]:[]],lowestLevel:a}]}),i.trace(`logger configured`)}function graphvizBinPath(){try{return x.sync(`dot`)}catch(e){return i.error(`Error checking for native Graphviz:`,{error:e}),null}}const S={likec4:{Layouter(e){i.debug(`Creating ConfigurableLayouter`);let t=e.likec4.Graphviz,n=new _({graphviz:t});return e.shared.workspace.ConfigurationProvider.onConfigurationSectionUpdate(t=>{if(i.debug(`Configuration update: {update}`,{update:t}),t.section!==e.LanguageMetaData.languageId){i.debug(`Ignoring configuration update as it is not for ${e.LanguageMetaData.languageId}`);return}try{let{mode:r,path:a}=t.configuration.graphviz??{mode:`wasm`,path:``};if(r!==`wasm`){let t=m(a)?graphvizBinPath():a;if(!m(t)){n.changePort(new v(t)),i.info`use graphviz binary: ${t}`;return}i.warn(`No Graphviz binaries found on PATH, use graphviz wasm`),e.shared.lsp.Connection?.window.showWarningMessage(`No Graphviz binaries found on PATH, set path to binaries in settings.`)}n.changePort(new g),i.info(`use graphviz wasm`)}catch(e){i.error(`Failed to update configuration`,{error:e})}}),n}}};function startLanguageServer(e){let t=e?.connection,n=y(e,{enableWatcher:!0,enableManualLayouts:!0,graphviz:`wasm`,configureLogger:!1});n.configureLogger!==!1&&(n.configureLogger===`stderr`?configureLanguageServerLogger({lspConnection:t,enableTelemetry:!1,useStdErr:!0}):n.configureLogger===`console`&&configureLanguageServerLogger({lspConnection:t})),t?i.info(`Starting LikeC4 language server`):i.warn(`Starting LikeC4 language server (headless - no LSP connection)`);let r=c({...t&&{connection:t},...o(n.enableWatcher),...n.enableManualLayouts&&a,...s(n.graphviz===`binary`?new v:new g)},t?{likec4:{...S.likec4}}:void 0);return h(r.shared),r}export{e as NoFileSystem,n as NoFileSystemWatcher,r as NoLikeC4ManualLayouts,o as WithFileSystem,a as WithLikeC4ManualLayouts,configureLanguageServerLogger,c as createLanguageServices,startLanguageServer};
|
package/dist/module.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { N as NoLikeC4ManualLayouts, a as LikeC4SharedModuleContext, c as createLikeC4Module, i as LikeC4ServicesContext, j as NoFileSystem, l as createSharedServices, n as LikeC4AddedServices, o as LikeC4SharedServices, r as LikeC4Services, s as createLanguageServices, t as LanguageServicesContext, v as WithGraphviz, y as WithWasmGraphviz } from "./_chunks/module.mjs";
|
|
2
2
|
export { LanguageServicesContext, LikeC4AddedServices, LikeC4Services, LikeC4ServicesContext, LikeC4SharedModuleContext, LikeC4SharedServices, NoFileSystem, NoLikeC4ManualLayouts, WithGraphviz, WithWasmGraphviz, createLanguageServices, createLikeC4Module, createSharedServices };
|
package/dist/module.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ai as e,si as t}from"./_chunks/utils.mjs";import{a as n,i as r,n as i,r as a,t as o}from"./_chunks/module.mjs";export{e as NoFileSystem,t as NoLikeC4ManualLayouts,r as WithGraphviz,n as WithWasmGraphviz,o as createLanguageServices,i as createLikeC4Module,a as createSharedServices};
|
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.58.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bugs": "https://github.com/likec4/likec4/issues",
|
|
7
7
|
"homepage": "https://likec4.dev",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"directory": "packages/language-server"
|
|
23
23
|
},
|
|
24
24
|
"engines": {
|
|
25
|
-
"node": ">=22.22.
|
|
25
|
+
"node": ">=22.22.3"
|
|
26
26
|
},
|
|
27
27
|
"type": "module",
|
|
28
28
|
"sideEffects": false,
|
|
@@ -118,44 +118,45 @@
|
|
|
118
118
|
"access": "public"
|
|
119
119
|
},
|
|
120
120
|
"dependencies": {
|
|
121
|
-
"@hpcc-js/wasm-graphviz": "1.21.
|
|
121
|
+
"@hpcc-js/wasm-graphviz": "1.21.6",
|
|
122
122
|
"chokidar": "^5.0.0",
|
|
123
123
|
"defu": "^6.1.7",
|
|
124
124
|
"fast-equals": "^6.0.0",
|
|
125
125
|
"fdir": "6.4.0",
|
|
126
|
-
"immer": "^11.1.
|
|
126
|
+
"immer": "^11.1.8",
|
|
127
127
|
"indent-string": "^5.0.0",
|
|
128
128
|
"json5": "^2.2.3",
|
|
129
129
|
"langium": "3.5.0",
|
|
130
|
-
"nano-spawn": "^2.
|
|
131
|
-
"pathe": "^2.0.3",
|
|
130
|
+
"nano-spawn": "^2.1.0",
|
|
132
131
|
"p-limit": "7.3.0",
|
|
133
132
|
"p-queue": "8.1.1",
|
|
134
133
|
"p-timeout": "7.0.1",
|
|
134
|
+
"pathe": "^2.0.3",
|
|
135
135
|
"picomatch": "^4.0.4",
|
|
136
136
|
"pretty-ms": "^9.3.0",
|
|
137
|
-
"remeda": "^2.
|
|
138
|
-
"std-env": "^
|
|
137
|
+
"remeda": "^2.37.0",
|
|
138
|
+
"std-env": "^4.1.0",
|
|
139
139
|
"strip-indent": "^4.1.1",
|
|
140
140
|
"type-fest": "^4.41.0",
|
|
141
|
-
"ufo": "1.6.
|
|
141
|
+
"ufo": "1.6.4",
|
|
142
142
|
"unstorage": "^1.17.5",
|
|
143
|
-
"vscode-jsonrpc": "8.2.
|
|
143
|
+
"vscode-jsonrpc": "8.2.0",
|
|
144
144
|
"vscode-languageserver": "9.0.1",
|
|
145
145
|
"vscode-languageserver-protocol": "3.17.5",
|
|
146
146
|
"vscode-languageserver-textdocument": "1.0.11",
|
|
147
147
|
"vscode-languageserver-types": "3.17.5",
|
|
148
148
|
"vscode-uri": "3.1.0",
|
|
149
149
|
"which": "^5.0.0",
|
|
150
|
-
"zod": "^4.3
|
|
151
|
-
"@likec4/config": "1.
|
|
152
|
-
"@likec4/core": "1.
|
|
153
|
-
"@likec4/
|
|
154
|
-
"@likec4/
|
|
150
|
+
"zod": "^4.4.3",
|
|
151
|
+
"@likec4/config": "1.58.0",
|
|
152
|
+
"@likec4/core": "1.58.0",
|
|
153
|
+
"@likec4/generators": "1.58.0",
|
|
154
|
+
"@likec4/layouts": "1.58.0",
|
|
155
|
+
"@likec4/log": "1.58.0"
|
|
155
156
|
},
|
|
156
157
|
"peerDependencies": {
|
|
157
158
|
"bundle-require": "^5.1.0",
|
|
158
|
-
"esbuild": "0.
|
|
159
|
+
"esbuild": "0.28.0"
|
|
159
160
|
},
|
|
160
161
|
"peerDependenciesMeta": {
|
|
161
162
|
"esbuild": {
|
|
@@ -167,22 +168,23 @@
|
|
|
167
168
|
},
|
|
168
169
|
"devDependencies": {
|
|
169
170
|
"@types/natural-compare-lite": "^1.4.2",
|
|
170
|
-
"@types/node": "~22.19.
|
|
171
|
+
"@types/node": "~22.19.19",
|
|
171
172
|
"@types/picomatch": "^4.0.3",
|
|
172
|
-
"@types/vscode": "^1.
|
|
173
|
+
"@types/vscode": "^1.115.0",
|
|
173
174
|
"@types/which": "^3.0.4",
|
|
174
175
|
"bundle-require": "^5.1.0",
|
|
175
|
-
"esbuild": "0.
|
|
176
|
+
"esbuild": "0.28.0",
|
|
176
177
|
"langium-cli": "3.5.2",
|
|
178
|
+
"memfs": "^4.57.3",
|
|
177
179
|
"obuild": "0.4.31",
|
|
178
|
-
"oxlint": "1.
|
|
179
|
-
"tsx": "4.
|
|
180
|
-
"turbo": "2.9.
|
|
181
|
-
"typescript": "
|
|
182
|
-
"vitest": "4.1.
|
|
180
|
+
"oxlint": "1.68.0",
|
|
181
|
+
"tsx": "4.22.4",
|
|
182
|
+
"turbo": "2.9.16",
|
|
183
|
+
"typescript": "6.0.3",
|
|
184
|
+
"vitest": "4.1.8",
|
|
185
|
+
"@likec4/devops": "1.58.0",
|
|
183
186
|
"@likec4/icons": "1.46.4",
|
|
184
|
-
"@likec4/tsconfig": "1.
|
|
185
|
-
"@likec4/devops": "1.42.0"
|
|
187
|
+
"@likec4/tsconfig": "1.58.0"
|
|
186
188
|
},
|
|
187
189
|
"scripts": {
|
|
188
190
|
"typecheck": "tsc -b --verbose",
|
package/src/test/testServices.ts
CHANGED
|
@@ -8,16 +8,17 @@ import type { LiteralUnion } from 'type-fest'
|
|
|
8
8
|
import { DiagnosticSeverity } from 'vscode-languageserver-types'
|
|
9
9
|
import { URI, Utils } from 'vscode-uri'
|
|
10
10
|
import type { LikeC4LangiumDocument } from '../ast'
|
|
11
|
-
import { createLanguageServices } from '../module'
|
|
11
|
+
import { type LanguageServicesContext, createLanguageServices } from '../module'
|
|
12
12
|
|
|
13
13
|
export function createTestServices(options?: {
|
|
14
14
|
workspace?: string
|
|
15
15
|
projectConfig?: Partial<LikeC4ProjectJsonConfig>
|
|
16
|
+
context?: Partial<LanguageServicesContext>
|
|
16
17
|
}) {
|
|
17
18
|
const workspace = options?.workspace ?? 'file:///test/workspace'
|
|
18
19
|
const projectConfig = options?.projectConfig
|
|
19
20
|
|
|
20
|
-
const services = createLanguageServices({}).likec4
|
|
21
|
+
const services = createLanguageServices(options?.context ?? {}).likec4
|
|
21
22
|
const metaData = services.LanguageMetaData
|
|
22
23
|
const langiumDocuments = services.shared.workspace.LangiumDocuments
|
|
23
24
|
const documentBuilder = services.shared.workspace.DocumentBuilder
|