@likec4/language-server 1.55.1 → 1.57.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/common-exports.mjs +1 -0
- package/dist/_chunks/module.d.mts +98 -27
- 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 -3
- package/dist/browser/index.mjs +1 -1
- package/dist/browser/worker.mjs +1 -1
- package/dist/filesystem/index.d.mts +1 -2
- package/dist/filesystem/index.mjs +1 -1
- package/dist/index.d.mts +2 -3
- package/dist/index.mjs +1 -1
- package/dist/module.d.mts +1 -2
- package/dist/module.mjs +1 -1
- package/package.json +15 -13
- package/src/test/testServices.ts +7 -2
package/dist/browser/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../_chunks/protocol.mjs";
|
|
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";
|
|
3
2
|
|
|
4
3
|
//#region src/browser/index.d.ts
|
|
5
4
|
/**
|
|
@@ -12,4 +11,4 @@ declare function startLanguageServer(port: MessagePort | DedicatedWorkerGlobalSc
|
|
|
12
11
|
likec4: LikeC4Services;
|
|
13
12
|
};
|
|
14
13
|
//#endregion
|
|
15
|
-
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};
|
package/dist/browser/worker.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{startLanguageServer as e}from"./index.mjs";function errToString(e){switch(!0){case e instanceof Error:return e.message;case typeof e==`object`&&!!e:try{return JSON.stringify(e)}catch{return`[unserializable value]`}case typeof e==`string`:return e;case e==null:return``;case typeof e==`number`||typeof e==`boolean`:return String(e);case typeof e==`symbol`:return e.toString();default:return`unknown`}}const log=(e,t)=>{let n=t==null?e:`${e} ${errToString(t)}`;try{console.error(`[LikeC4 LSP worker]`,n)}catch{}};self.onerror=e=>(log(`Uncaught error`,e.message??e.error),!1),self.onunhandledrejection=e=>{log(`Unhandled rejection`,e.reason)};try{e(self)}catch(e){throw log(`Failed to start language server`,e),e}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import "../_chunks/protocol.mjs";
|
|
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";
|
|
3
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,3 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
|
|
3
|
-
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,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./_chunks/protocol.mjs";
|
|
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";
|
|
3
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.57.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,
|
|
@@ -128,10 +128,10 @@
|
|
|
128
128
|
"json5": "^2.2.3",
|
|
129
129
|
"langium": "3.5.0",
|
|
130
130
|
"nano-spawn": "^2.0.0",
|
|
131
|
-
"pathe": "^2.0.3",
|
|
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
137
|
"remeda": "^2.33.7",
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"type-fest": "^4.41.0",
|
|
141
141
|
"ufo": "1.6.3",
|
|
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",
|
|
@@ -148,10 +148,11 @@
|
|
|
148
148
|
"vscode-uri": "3.1.0",
|
|
149
149
|
"which": "^5.0.0",
|
|
150
150
|
"zod": "^4.3.6",
|
|
151
|
-
"@likec4/config": "1.
|
|
152
|
-
"@likec4/
|
|
153
|
-
"@likec4/layouts": "1.
|
|
154
|
-
"@likec4/log": "1.
|
|
151
|
+
"@likec4/config": "1.57.0",
|
|
152
|
+
"@likec4/generators": "1.57.0",
|
|
153
|
+
"@likec4/layouts": "1.57.0",
|
|
154
|
+
"@likec4/log": "1.57.0",
|
|
155
|
+
"@likec4/core": "1.57.0"
|
|
155
156
|
},
|
|
156
157
|
"peerDependencies": {
|
|
157
158
|
"bundle-require": "^5.1.0",
|
|
@@ -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
176
|
"esbuild": "0.27.4",
|
|
176
177
|
"langium-cli": "3.5.2",
|
|
178
|
+
"memfs": "^4.57.2",
|
|
177
179
|
"obuild": "0.4.31",
|
|
178
180
|
"oxlint": "1.59.0",
|
|
179
181
|
"tsx": "4.21.0",
|
|
180
|
-
"turbo": "2.9.
|
|
182
|
+
"turbo": "2.9.14",
|
|
181
183
|
"typescript": "5.9.3",
|
|
182
184
|
"vitest": "4.1.3",
|
|
183
|
-
"@likec4/devops": "1.
|
|
185
|
+
"@likec4/devops": "1.57.0",
|
|
184
186
|
"@likec4/icons": "1.46.4",
|
|
185
|
-
"@likec4/tsconfig": "1.
|
|
187
|
+
"@likec4/tsconfig": "1.57.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
|
|
@@ -156,6 +157,7 @@ export function createTestServices(options?: {
|
|
|
156
157
|
}
|
|
157
158
|
|
|
158
159
|
return {
|
|
160
|
+
initialize,
|
|
159
161
|
services,
|
|
160
162
|
addDocument,
|
|
161
163
|
removeDocument,
|
|
@@ -188,12 +190,15 @@ export async function createMultiProjectTestServices<const Projects extends Reco
|
|
|
188
190
|
) {
|
|
189
191
|
const workspace = 'file:///test/workspace'
|
|
190
192
|
const {
|
|
193
|
+
initialize,
|
|
191
194
|
services,
|
|
192
195
|
addDocument,
|
|
193
196
|
validateAll,
|
|
194
197
|
resetState,
|
|
195
198
|
} = createTestServices({ workspace })
|
|
196
199
|
|
|
200
|
+
await initialize()
|
|
201
|
+
|
|
197
202
|
const projects = {} as {
|
|
198
203
|
readonly [K in keyof Projects]: {
|
|
199
204
|
readonly [L in keyof Projects[K]]: LikeC4LangiumDocument
|