@likec4/language-server 1.47.0 → 1.49.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/browser/package.json +2 -2
- package/browser-worker/package.json +2 -2
- package/bundled/package.json +4 -0
- package/dist/THIRD-PARTY-LICENSES.md +178 -0
- package/dist/_chunks/ConfigurableLayouter.mjs +1 -0
- package/dist/_chunks/LikeC4FileSystem.mjs +3 -0
- package/dist/_chunks/LikeC4Views.mjs +34 -0
- package/dist/_chunks/ProjectsManager.mjs +1 -0
- package/dist/_chunks/WithMCPServer.mjs +481 -0
- package/dist/_chunks/icons.mjs +2 -0
- package/dist/_chunks/index.d.mts +3107 -0
- package/dist/_chunks/libs/@msgpack/msgpack.mjs +1 -0
- package/dist/_chunks/libs/eventemitter3.mjs +1 -0
- package/dist/_chunks/libs/fast-equals.mjs +1 -0
- package/dist/_chunks/libs/p-queue.mjs +1 -0
- package/dist/_chunks/libs/parse-ms.mjs +1 -0
- package/dist/_chunks/libs/picomatch.mjs +1 -0
- package/dist/_chunks/libs/pretty-ms.mjs +1 -0
- package/dist/_chunks/libs/remeda.mjs +1 -0
- package/dist/_chunks/libs/strip-indent.mjs +1 -0
- package/dist/_chunks/libs/ufo.mjs +1 -0
- package/dist/_chunks/logger.mjs +1 -0
- package/dist/_chunks/rolldown-runtime.mjs +1 -0
- package/dist/_chunks/utils.mjs +1 -0
- package/dist/browser/index.d.mts +10 -0
- package/dist/browser/index.mjs +1 -0
- package/dist/browser/worker.d.mts +1 -0
- package/dist/browser/worker.mjs +1 -0
- package/dist/bundled.d.mts +27 -0
- package/dist/bundled.mjs +1 -4853
- package/dist/filesystem/index.d.mts +2 -0
- package/dist/filesystem/index.mjs +1 -0
- package/dist/index.d.mts +39 -0
- package/dist/index.mjs +1 -0
- package/dist/likec4lib.d.mts +16 -0
- package/dist/likec4lib.mjs +1 -0
- package/dist/mcp/index.d.mts +2 -0
- package/dist/mcp/index.mjs +1 -0
- package/dist/module.d.mts +126 -0
- package/dist/module.mjs +1 -0
- package/dist/protocol.d.mts +315 -0
- package/dist/protocol.mjs +1 -0
- package/filesystem/package.json +4 -0
- package/likec4lib/package.json +2 -2
- package/mcp/package.json +4 -0
- package/module/package.json +4 -0
- package/package.json +128 -62
- package/protocol/package.json +2 -2
- package/LICENSE +0 -21
- package/dist/LikeC4LanguageServices.d.ts +0 -115
- package/dist/LikeC4LanguageServices.js +0 -164
- package/dist/Rpc.d.ts +0 -9
- package/dist/Rpc.js +0 -276
- package/dist/ast.d.ts +0 -226
- package/dist/ast.js +0 -264
- package/dist/browser-worker.d.ts +0 -1
- package/dist/browser-worker.js +0 -4
- package/dist/browser.d.ts +0 -10
- package/dist/browser.js +0 -34
- package/dist/bundled.d.ts +0 -8
- package/dist/bundled.js +0 -44
- package/dist/documentation/documentation-provider.d.ts +0 -8
- package/dist/documentation/documentation-provider.js +0 -51
- package/dist/documentation/index.d.ts +0 -1
- package/dist/documentation/index.js +0 -1
- package/dist/empty.d.ts +0 -2
- package/dist/empty.js +0 -2
- package/dist/filesystem/ChokidarWatcher.d.ts +0 -19
- package/dist/filesystem/ChokidarWatcher.js +0 -133
- package/dist/filesystem/FileSystemWatcher.d.ts +0 -19
- package/dist/filesystem/FileSystemWatcher.js +0 -14
- package/dist/filesystem/LikeC4FileSystem.d.ts +0 -3
- package/dist/filesystem/LikeC4FileSystem.js +0 -140
- package/dist/filesystem/index.d.ts +0 -55
- package/dist/filesystem/index.js +0 -29
- package/dist/formatting/LikeC4Formatter.d.ts +0 -59
- package/dist/formatting/LikeC4Formatter.js +0 -637
- package/dist/formatting/utils.d.ts +0 -6
- package/dist/formatting/utils.js +0 -18
- package/dist/generated/ast.d.ts +0 -1411
- package/dist/generated/ast.js +0 -2207
- package/dist/generated/grammar.d.ts +0 -6
- package/dist/generated/grammar.js +0 -7
- package/dist/generated/module.d.ts +0 -14
- package/dist/generated/module.js +0 -27
- package/dist/generated-lib/icons.d.ts +0 -1
- package/dist/generated-lib/icons.js +0 -18
- package/dist/index.d.ts +0 -37
- package/dist/index.js +0 -54
- package/dist/likec4lib.d.ts +0 -6
- package/dist/likec4lib.js +0 -7
- package/dist/logger.d.ts +0 -17
- package/dist/logger.js +0 -81
- package/dist/lsp/CodeActionProvider.d.ts +0 -14
- package/dist/lsp/CodeActionProvider.js +0 -33
- package/dist/lsp/CodeLensProvider.d.ts +0 -9
- package/dist/lsp/CodeLensProvider.js +0 -44
- package/dist/lsp/CompletionProvider.d.ts +0 -13
- package/dist/lsp/CompletionProvider.js +0 -238
- package/dist/lsp/DocumentHighlightProvider.d.ts +0 -9
- package/dist/lsp/DocumentHighlightProvider.js +0 -10
- package/dist/lsp/DocumentLinkProvider.d.ts +0 -11
- package/dist/lsp/DocumentLinkProvider.js +0 -58
- package/dist/lsp/DocumentSymbolProvider.d.ts +0 -33
- package/dist/lsp/DocumentSymbolProvider.js +0 -317
- package/dist/lsp/HoverProvider.d.ts +0 -10
- package/dist/lsp/HoverProvider.js +0 -106
- package/dist/lsp/RenameProvider.d.ts +0 -5
- package/dist/lsp/RenameProvider.js +0 -6
- package/dist/lsp/SemanticTokenProvider.d.ts +0 -19
- package/dist/lsp/SemanticTokenProvider.js +0 -305
- package/dist/lsp/index.d.ts +0 -8
- package/dist/lsp/index.js +0 -9
- package/dist/mcp/MCPServerFactory.d.ts +0 -8
- package/dist/mcp/MCPServerFactory.js +0 -73
- package/dist/mcp/NoopLikeC4MCPServer.d.ts +0 -9
- package/dist/mcp/NoopLikeC4MCPServer.js +0 -17
- package/dist/mcp/interfaces.d.ts +0 -13
- package/dist/mcp/interfaces.js +0 -4
- package/dist/mcp/server/StdioLikeC4MCPServer.d.ts +0 -16
- package/dist/mcp/server/StdioLikeC4MCPServer.js +0 -51
- package/dist/mcp/server/StreamableLikeC4MCPServer.d.ts +0 -16
- package/dist/mcp/server/StreamableLikeC4MCPServer.js +0 -121
- package/dist/mcp/server/WithMCPServer.d.ts +0 -4
- package/dist/mcp/server/WithMCPServer.js +0 -54
- package/dist/mcp/tools/_common.d.ts +0 -88
- package/dist/mcp/tools/_common.js +0 -49
- package/dist/mcp/tools/find-relationships.d.ts +0 -202
- package/dist/mcp/tools/find-relationships.js +0 -150
- package/dist/mcp/tools/list-projects.d.ts +0 -194
- package/dist/mcp/tools/list-projects.js +0 -62
- package/dist/mcp/tools/open-view.d.ts +0 -200
- package/dist/mcp/tools/open-view.js +0 -52
- package/dist/mcp/tools/read-deployment.d.ts +0 -200
- package/dist/mcp/tools/read-deployment.js +0 -150
- package/dist/mcp/tools/read-element.d.ts +0 -200
- package/dist/mcp/tools/read-element.js +0 -218
- package/dist/mcp/tools/read-project-summary.d.ts +0 -198
- package/dist/mcp/tools/read-project-summary.js +0 -176
- package/dist/mcp/tools/read-view.d.ts +0 -200
- package/dist/mcp/tools/read-view.js +0 -203
- package/dist/mcp/tools/search-element.d.ts +0 -198
- package/dist/mcp/tools/search-element.js +0 -177
- package/dist/mcp/utils.d.ts +0 -18
- package/dist/mcp/utils.js +0 -48
- package/dist/model/builder/MergedExtends.d.ts +0 -13
- package/dist/model/builder/MergedExtends.js +0 -74
- package/dist/model/builder/MergedSpecification.d.ts +0 -32
- package/dist/model/builder/MergedSpecification.js +0 -175
- package/dist/model/builder/buildModel.d.ts +0 -16
- package/dist/model/builder/buildModel.js +0 -245
- package/dist/model/deployments-index.d.ts +0 -10
- package/dist/model/deployments-index.js +0 -102
- package/dist/model/fqn-index.d.ts +0 -61
- package/dist/model/fqn-index.js +0 -253
- package/dist/model/index.d.ts +0 -6
- package/dist/model/index.js +0 -6
- package/dist/model/model-builder.d.ts +0 -54
- package/dist/model/model-builder.js +0 -233
- package/dist/model/model-locator.d.ts +0 -39
- package/dist/model/model-locator.js +0 -240
- package/dist/model/model-parser-where.d.ts +0 -4
- package/dist/model/model-parser-where.js +0 -81
- package/dist/model/model-parser.d.ts +0 -645
- package/dist/model/model-parser.js +0 -133
- package/dist/model/parser/Base.d.ts +0 -69
- package/dist/model/parser/Base.js +0 -382
- package/dist/model/parser/DeploymentModelParser.d.ts +0 -71
- package/dist/model/parser/DeploymentModelParser.js +0 -176
- package/dist/model/parser/DeploymentViewParser.d.ts +0 -75
- package/dist/model/parser/DeploymentViewParser.js +0 -86
- package/dist/model/parser/FqnRefParser.d.ts +0 -66
- package/dist/model/parser/FqnRefParser.js +0 -382
- package/dist/model/parser/GlobalsParser.d.ts +0 -109
- package/dist/model/parser/GlobalsParser.js +0 -84
- package/dist/model/parser/ImportsParser.d.ts +0 -46
- package/dist/model/parser/ImportsParser.js +0 -24
- package/dist/model/parser/ModelParser.d.ts +0 -71
- package/dist/model/parser/ModelParser.js +0 -209
- package/dist/model/parser/PredicatesParser.d.ts +0 -75
- package/dist/model/parser/PredicatesParser.js +0 -45
- package/dist/model/parser/SpecificationParser.d.ts +0 -53
- package/dist/model/parser/SpecificationParser.js +0 -113
- package/dist/model/parser/ValueConverter.d.ts +0 -4
- package/dist/model/parser/ValueConverter.js +0 -12
- package/dist/model/parser/ViewsParser.d.ts +0 -112
- package/dist/model/parser/ViewsParser.js +0 -492
- package/dist/model-change/ModelChanges.d.ts +0 -18
- package/dist/model-change/ModelChanges.js +0 -129
- package/dist/model-change/changeElementStyle.d.ts +0 -16
- package/dist/model-change/changeElementStyle.js +0 -134
- package/dist/model-change/changeViewLayout.d.ts +0 -12
- package/dist/model-change/changeViewLayout.js +0 -28
- package/dist/model-change/removeManualLayoutV1.d.ts +0 -7
- package/dist/model-change/removeManualLayoutV1.js +0 -27
- package/dist/module.d.ts +0 -92
- package/dist/module.js +0 -143
- package/dist/protocol.d.ts +0 -289
- package/dist/protocol.js +0 -123
- package/dist/references/index.d.ts +0 -3
- package/dist/references/index.js +0 -3
- package/dist/references/name-provider.d.ts +0 -9
- package/dist/references/name-provider.js +0 -37
- package/dist/references/scope-computation.d.ts +0 -20
- package/dist/references/scope-computation.js +0 -288
- package/dist/references/scope-provider.d.ts +0 -40
- package/dist/references/scope-provider.js +0 -239
- package/dist/shared/NodeKindProvider.d.ts +0 -15
- package/dist/shared/NodeKindProvider.js +0 -57
- package/dist/shared/WorkspaceSymbolProvider.d.ts +0 -3
- package/dist/shared/WorkspaceSymbolProvider.js +0 -3
- package/dist/shared/index.d.ts +0 -2
- package/dist/shared/index.js +0 -2
- package/dist/test/index.d.ts +0 -1
- package/dist/test/index.js +0 -1
- package/dist/test/testServices.d.ts +0 -64
- package/dist/test/testServices.js +0 -210
- package/dist/utils/disposable.d.ts +0 -8
- package/dist/utils/disposable.js +0 -26
- package/dist/utils/elementRef.d.ts +0 -11
- package/dist/utils/elementRef.js +0 -33
- package/dist/utils/fqnRef.d.ts +0 -11
- package/dist/utils/fqnRef.js +0 -63
- package/dist/utils/index.d.ts +0 -11
- package/dist/utils/index.js +0 -35
- package/dist/utils/printDocs.d.ts +0 -2
- package/dist/utils/printDocs.js +0 -1
- package/dist/utils/projectId.d.ts +0 -4
- package/dist/utils/projectId.js +0 -16
- package/dist/utils/stringHash.d.ts +0 -1
- package/dist/utils/stringHash.js +0 -5
- package/dist/validation/DocumentValidator.d.ts +0 -11
- package/dist/validation/DocumentValidator.js +0 -17
- package/dist/validation/_shared.d.ts +0 -3
- package/dist/validation/_shared.js +0 -26
- package/dist/validation/deployment-checks.d.ts +0 -7
- package/dist/validation/deployment-checks.js +0 -140
- package/dist/validation/dynamic-view.d.ts +0 -6
- package/dist/validation/dynamic-view.js +0 -67
- package/dist/validation/element-ref.d.ts +0 -4
- package/dist/validation/element-ref.js +0 -12
- package/dist/validation/element.d.ts +0 -4
- package/dist/validation/element.js +0 -49
- package/dist/validation/imports.d.ts +0 -4
- package/dist/validation/imports.js +0 -46
- package/dist/validation/index.d.ts +0 -15
- package/dist/validation/index.js +0 -167
- package/dist/validation/property-checks.d.ts +0 -7
- package/dist/validation/property-checks.js +0 -108
- package/dist/validation/relation.d.ts +0 -6
- package/dist/validation/relation.js +0 -141
- package/dist/validation/specification.d.ts +0 -12
- package/dist/validation/specification.js +0 -190
- package/dist/validation/view-checks.d.ts +0 -4
- package/dist/validation/view-checks.js +0 -46
- package/dist/validation/view-predicates/fqn-expr-with.d.ts +0 -4
- package/dist/validation/view-predicates/fqn-expr-with.js +0 -43
- package/dist/validation/view-predicates/fqn-ref-expr.d.ts +0 -4
- package/dist/validation/view-predicates/fqn-ref-expr.js +0 -51
- package/dist/validation/view-predicates/incoming.d.ts +0 -4
- package/dist/validation/view-predicates/incoming.js +0 -16
- package/dist/validation/view-predicates/index.d.ts +0 -6
- package/dist/validation/view-predicates/index.js +0 -6
- package/dist/validation/view-predicates/outgoing.d.ts +0 -4
- package/dist/validation/view-predicates/outgoing.js +0 -20
- package/dist/validation/view-predicates/relation-expr.d.ts +0 -4
- package/dist/validation/view-predicates/relation-expr.js +0 -46
- package/dist/validation/view-predicates/relation-with.d.ts +0 -4
- package/dist/validation/view-predicates/relation-with.js +0 -16
- package/dist/validation/view.d.ts +0 -4
- package/dist/validation/view.js +0 -42
- package/dist/view-utils/assignNavigateTo.d.ts +0 -2
- package/dist/view-utils/assignNavigateTo.js +0 -27
- package/dist/view-utils/index.d.ts +0 -2
- package/dist/view-utils/index.js +0 -2
- package/dist/view-utils/manual-layout.d.ts +0 -13
- package/dist/view-utils/manual-layout.js +0 -149
- package/dist/views/ConfigurableLayouter.d.ts +0 -7
- package/dist/views/ConfigurableLayouter.js +0 -51
- package/dist/views/LikeC4ManualLayouts.d.ts +0 -42
- package/dist/views/LikeC4ManualLayouts.js +0 -209
- package/dist/views/LikeC4Views.d.ts +0 -89
- package/dist/views/LikeC4Views.js +0 -216
- package/dist/views/index.d.ts +0 -4
- package/dist/views/index.js +0 -11
- package/dist/workspace/AstNodeDescriptionProvider.d.ts +0 -7
- package/dist/workspace/AstNodeDescriptionProvider.js +0 -18
- package/dist/workspace/IndexManager.d.ts +0 -10
- package/dist/workspace/IndexManager.js +0 -26
- package/dist/workspace/LangiumDocuments.d.ts +0 -29
- package/dist/workspace/LangiumDocuments.js +0 -104
- package/dist/workspace/ProjectsManager.d.ts +0 -134
- package/dist/workspace/ProjectsManager.js +0 -610
- package/dist/workspace/WorkspaceManager.d.ts +0 -31
- package/dist/workspace/WorkspaceManager.js +0 -132
- package/dist/workspace/index.d.ts +0 -5
- package/dist/workspace/index.js +0 -5
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { B as NoFileSystem, G as FileSystemProvider, H as NoLikeC4ManualLayouts, J as LikeC4ManualLayouts, K as FileSystemWatcher, L as WithLikeC4ManualLayouts, R as WithChokidarWatcher, U as FileNode, V as NoFileSystemWatcher, W as FileSystemModuleContext, X as ManualLayoutsSnapshot, Y as LikeC4ManualLayoutsModuleContext, q as FileSystemWatcherModuleContext, z as WithFileSystem } from "../_chunks/index.mjs";
|
|
2
|
+
export { type FileNode, type FileSystemModuleContext, type FileSystemProvider, type FileSystemWatcher, type FileSystemWatcherModuleContext, type LikeC4ManualLayouts, type LikeC4ManualLayoutsModuleContext, type ManualLayoutsSnapshot, NoFileSystem, NoFileSystemWatcher, NoLikeC4ManualLayouts, WithChokidarWatcher, WithFileSystem, WithLikeC4ManualLayouts };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Cr as NoFileSystem,Tr as NoLikeC4ManualLayouts,wr as NoFileSystemWatcher}from"../_chunks/utils.mjs";import"../_chunks/libs/eventemitter3.mjs";import{n as WithChokidarWatcher,r as WithLikeC4ManualLayouts,t as WithFileSystem}from"../_chunks/LikeC4FileSystem.mjs";export{NoFileSystem,NoFileSystemWatcher,NoLikeC4ManualLayouts,WithChokidarWatcher,WithFileSystem,WithLikeC4ManualLayouts};
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { $ as ProjectsManager, B as NoFileSystem, D as LikeC4WorkspaceManager, G as FileSystemProvider, H as NoLikeC4ManualLayouts, J as LikeC4ManualLayouts, K as FileSystemWatcher, L as WithLikeC4ManualLayouts, O as LangiumDocuments, Q as ProjectData, S as LikeC4ModelBuilder, T as FqnIndex, V as NoFileSystemWatcher, W as FileSystemModuleContext, Y as LikeC4ManualLayoutsModuleContext, Z as Project, _ as LikeC4Views, b as LikeC4ModelLocator, f as LikeC4LanguageServices, g as LikeC4ModelParser, h as DocumentParser, q as FileSystemWatcherModuleContext, v as WithMCPServer, x as ViewLocateResult, y as NoMCPServer, z as WithFileSystem } from "./_chunks/index.mjs";
|
|
2
|
+
import "./mcp/index.mjs";
|
|
3
|
+
import { LanguageServicesContext, LikeC4AddedServices, LikeC4Services, LikeC4SharedServices, createLanguageServices } from "./module.mjs";
|
|
4
|
+
import { Connection } from "vscode-languageserver";
|
|
5
|
+
|
|
6
|
+
//#region src/index.d.ts
|
|
7
|
+
type StartLanguageServerOptions = {
|
|
8
|
+
/**
|
|
9
|
+
* The Language Server Protocol connection to use.
|
|
10
|
+
*/
|
|
11
|
+
connection?: Connection;
|
|
12
|
+
/**
|
|
13
|
+
* Whether to enable the file system watcher.
|
|
14
|
+
* @default true
|
|
15
|
+
*/
|
|
16
|
+
enableWatcher?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
enableTelemetry?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Whether to enable the MCP server.
|
|
23
|
+
* @default 'sse'
|
|
24
|
+
*/
|
|
25
|
+
enableMCP?: false | 'stdio' | 'sse' | {
|
|
26
|
+
port: number;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Whether to enable manual layouts, stored in json5 files.
|
|
30
|
+
* @default true
|
|
31
|
+
*/
|
|
32
|
+
enableManualLayouts?: boolean;
|
|
33
|
+
};
|
|
34
|
+
declare function startLanguageServer(options?: StartLanguageServerOptions): {
|
|
35
|
+
shared: LikeC4SharedServices;
|
|
36
|
+
likec4: LikeC4Services;
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { DocumentParser, FileSystemModuleContext, FileSystemProvider, FileSystemWatcher, FileSystemWatcherModuleContext, FqnIndex, LangiumDocuments, LanguageServicesContext, LikeC4AddedServices, LikeC4LanguageServices, LikeC4ManualLayouts, LikeC4ManualLayoutsModuleContext, LikeC4ModelBuilder, LikeC4ModelLocator, LikeC4ModelParser, LikeC4Services, LikeC4SharedServices, LikeC4Views, LikeC4WorkspaceManager, NoFileSystem, NoFileSystemWatcher, NoLikeC4ManualLayouts, NoMCPServer, Project, ProjectData, ProjectsManager, ViewLocateResult, WithFileSystem, WithLikeC4ManualLayouts, WithMCPServer, createLanguageServices, startLanguageServer };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Cr as NoFileSystem,Tr as NoLikeC4ManualLayouts,wr as NoFileSystemWatcher}from"./_chunks/utils.mjs";import{i as logger$1,n as getTelemetrySink}from"./_chunks/logger.mjs";import"./_chunks/libs/eventemitter3.mjs";import{r as WithLikeC4ManualLayouts,t as WithFileSystem}from"./_chunks/LikeC4FileSystem.mjs";import{n as NoMCPServer}from"./_chunks/ProjectsManager.mjs";import{createLanguageServices}from"./module.mjs";import{t as WithMCPServer}from"./_chunks/WithMCPServer.mjs";import{t as ConfigurableLayouter}from"./_chunks/ConfigurableLayouter.mjs";import{configureLogger,getConsoleSink,getConsoleStderrSink,getTextFormatter}from"@likec4/log";import{startLanguageServer as startLanguageServer$1}from"langium/lsp";import{defu}from"defu";import{isDevelopment}from"std-env";function startLanguageServer(e){let t=e?.connection,n=defu(e,{enableWatcher:!0,enableMCP:`sse`,enableTelemetry:!!t,enableManualLayouts:!0}),r=!!t&&n.enableTelemetry&&!isDevelopment;configureLogger({sinks:{console:n.enableMCP===`stdio`||t?getConsoleStderrSink({formatter:getTextFormatter()}):getConsoleSink({formatter:getTextFormatter()}),...r&&{telemetry:getTelemetrySink(t)}},loggers:[{category:[`likec4`],sinks:[`console`,...r?[`telemetry`]:[]],lowestLevel:isDevelopment?`trace`:`debug`}]}),t?logger$1.info(`Starting LikeC4 language server`):logger$1.warn(`Starting LikeC4 language server (headless - no LSP connection)`);let i=createLanguageServices({...t&&{connection:t},...WithFileSystem(n.enableWatcher),...!!n.enableMCP&&WithMCPServer(n.enableMCP),...n.enableManualLayouts&&WithLikeC4ManualLayouts},t?{likec4:{...ConfigurableLayouter.likec4}}:void 0);return startLanguageServer$1(i.shared),i}export{NoFileSystem,NoFileSystemWatcher,NoLikeC4ManualLayouts,NoMCPServer,WithFileSystem,WithLikeC4ManualLayouts,WithMCPServer,createLanguageServices,startLanguageServer};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { URI } from "vscode-uri";
|
|
2
|
+
|
|
3
|
+
//#region src/generated-lib/icons.d.ts
|
|
4
|
+
declare const LibIcons: string;
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/likec4lib.d.ts
|
|
7
|
+
declare const Scheme = "likec4builtin";
|
|
8
|
+
declare const Uri: "likec4builtin:///likec4/lib/icons.c4";
|
|
9
|
+
declare function isLikeC4Builtin(uri: URI | {
|
|
10
|
+
uri: URI;
|
|
11
|
+
}): boolean;
|
|
12
|
+
declare function isNotLikeC4Builtin(uri: URI | {
|
|
13
|
+
uri: URI;
|
|
14
|
+
}): boolean;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { LibIcons as Content, Scheme, Uri, isLikeC4Builtin, isNotLikeC4Builtin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as LibIcons}from"./_chunks/icons.mjs";const Scheme=`likec4builtin`,Uri=`${Scheme}:///likec4/lib/icons.c4`;function isLikeC4Builtin(e){return(`uri`in e?e.uri:e).scheme===Scheme}function isNotLikeC4Builtin(e){return!isLikeC4Builtin(e)}export{LibIcons as Content,Scheme,Uri,isLikeC4Builtin,isNotLikeC4Builtin};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { F as LikeC4MCPServerModuleContext, N as LikeC4MCPServer, P as LikeC4MCPServerFactory, v as WithMCPServer, y as NoMCPServer } from "../_chunks/index.mjs";
|
|
2
|
+
export { type LikeC4MCPServer, type LikeC4MCPServerFactory, type LikeC4MCPServerModuleContext, NoMCPServer, WithMCPServer };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as NoMCPServer}from"../_chunks/ProjectsManager.mjs";import{t as WithMCPServer}from"../_chunks/WithMCPServer.mjs";export{NoMCPServer,WithMCPServer};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { $ as ProjectsManager, A as LikeC4ScopeComputation, B as NoFileSystem, C as LastSeenArtifacts, D as LikeC4WorkspaceManager, E as LikeC4ScopeProvider, F as LikeC4MCPServerModuleContext, G as FileSystemProvider$1, H as NoLikeC4ManualLayouts, I as LikeC4Formatter, J as LikeC4ManualLayouts, K as FileSystemWatcher, M as LikeC4DocumentValidator, N as LikeC4MCPServer, O as LangiumDocuments, P as LikeC4MCPServerFactory, S as LikeC4ModelBuilder, T as FqnIndex, W as FileSystemModuleContext, Y as LikeC4ManualLayoutsModuleContext, _ as LikeC4Views, a as LikeC4CodeActionProvider, b as LikeC4ModelLocator, c as LikeC4DocumentLinkProvider, d as LikeC4CodeLensProvider, et as LikeC4DocumentationProvider, f as LikeC4LanguageServices, g as LikeC4ModelParser, i as LikeC4SemanticTokenProvider, j as LikeC4NameProvider, k as IndexManager, l as LikeC4DocumentHighlightProvider, m as LikeC4ValueConverter, n as NodeKindProvider$1, o as LikeC4HoverProvider, p as LikeC4ModelChanges, r as Rpc, s as LikeC4DocumentSymbolProvider, t as WorkspaceSymbolProvider, u as LikeC4CompletionProvider, w as DeploymentsIndex, y as NoMCPServer } from "./_chunks/index.mjs";
|
|
2
|
+
import "./filesystem/index.mjs";
|
|
3
|
+
import { Module, WorkspaceCache } from "langium";
|
|
4
|
+
import { DefaultSharedModuleContext, LangiumServices, LangiumSharedServices, PartialLangiumServices } from "langium/lsp";
|
|
5
|
+
import { QueueGraphvizLayoter } from "@likec4/layouts";
|
|
6
|
+
|
|
7
|
+
//#region src/module.d.ts
|
|
8
|
+
type LanguageServicesContext = Omit<DefaultSharedModuleContext, 'fileSystemProvider'> & FileSystemModuleContext & LikeC4MCPServerModuleContext & LikeC4ManualLayoutsModuleContext;
|
|
9
|
+
interface LikeC4AddedSharedServices {
|
|
10
|
+
lsp: {
|
|
11
|
+
NodeKindProvider: NodeKindProvider$1;
|
|
12
|
+
WorkspaceSymbolProvider: WorkspaceSymbolProvider;
|
|
13
|
+
};
|
|
14
|
+
workspace: {
|
|
15
|
+
Cache: WorkspaceCache<string, any>;
|
|
16
|
+
ProjectsManager: ProjectsManager;
|
|
17
|
+
IndexManager: IndexManager;
|
|
18
|
+
LangiumDocuments: LangiumDocuments;
|
|
19
|
+
WorkspaceManager: LikeC4WorkspaceManager;
|
|
20
|
+
FileSystemProvider: FileSystemProvider$1;
|
|
21
|
+
FileSystemWatcher: FileSystemWatcher;
|
|
22
|
+
ManualLayouts: LikeC4ManualLayouts;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
type LikeC4SharedServices = LangiumSharedServices & LikeC4AddedSharedServices;
|
|
26
|
+
/**
|
|
27
|
+
* Declaration of custom services - add your own service classes here.
|
|
28
|
+
*/
|
|
29
|
+
interface LikeC4AddedServices {
|
|
30
|
+
documentation: {
|
|
31
|
+
DocumentationProvider: LikeC4DocumentationProvider;
|
|
32
|
+
};
|
|
33
|
+
validation: {
|
|
34
|
+
DocumentValidator: LikeC4DocumentValidator;
|
|
35
|
+
};
|
|
36
|
+
Rpc: Rpc;
|
|
37
|
+
mcp: {
|
|
38
|
+
Server: LikeC4MCPServer;
|
|
39
|
+
ServerFactory: LikeC4MCPServerFactory;
|
|
40
|
+
};
|
|
41
|
+
likec4: {
|
|
42
|
+
LanguageServices: LikeC4LanguageServices;
|
|
43
|
+
Views: LikeC4Views;
|
|
44
|
+
Layouter: QueueGraphvizLayoter;
|
|
45
|
+
DeploymentsIndex: DeploymentsIndex;
|
|
46
|
+
FqnIndex: FqnIndex;
|
|
47
|
+
ModelParser: LikeC4ModelParser;
|
|
48
|
+
ModelBuilder: LikeC4ModelBuilder;
|
|
49
|
+
ModelLocator: LikeC4ModelLocator;
|
|
50
|
+
ModelChanges: LikeC4ModelChanges;
|
|
51
|
+
LastSeen: LastSeenArtifacts;
|
|
52
|
+
};
|
|
53
|
+
lsp: {
|
|
54
|
+
CompletionProvider: LikeC4CompletionProvider;
|
|
55
|
+
DocumentHighlightProvider: LikeC4DocumentHighlightProvider;
|
|
56
|
+
DocumentSymbolProvider: LikeC4DocumentSymbolProvider;
|
|
57
|
+
SemanticTokenProvider: LikeC4SemanticTokenProvider;
|
|
58
|
+
HoverProvider: LikeC4HoverProvider;
|
|
59
|
+
CodeLensProvider: LikeC4CodeLensProvider;
|
|
60
|
+
DocumentLinkProvider: LikeC4DocumentLinkProvider;
|
|
61
|
+
Formatter: LikeC4Formatter;
|
|
62
|
+
CodeActionProvider: LikeC4CodeActionProvider;
|
|
63
|
+
};
|
|
64
|
+
references: {
|
|
65
|
+
NameProvider: LikeC4NameProvider;
|
|
66
|
+
ScopeComputation: LikeC4ScopeComputation;
|
|
67
|
+
ScopeProvider: LikeC4ScopeProvider;
|
|
68
|
+
};
|
|
69
|
+
shared?: LikeC4SharedServices;
|
|
70
|
+
parser: {
|
|
71
|
+
ValueConverter: LikeC4ValueConverter;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
type LikeC4Services = LangiumServices & LikeC4AddedServices;
|
|
75
|
+
/**
|
|
76
|
+
* Most probably you don't need to use this function directly.
|
|
77
|
+
* Use {@link createLanguageServices} instead.
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
80
|
+
declare function createLikeC4Module(context: LikeC4MCPServerModuleContext): Module<LikeC4Services, PartialLangiumServices & LikeC4AddedServices>;
|
|
81
|
+
/**
|
|
82
|
+
* Create and initialize likec4 language services with the given context
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const { shared, likec4 } = createLanguageServices({
|
|
86
|
+
* ...WithFileSystem(enableWatcher = true),
|
|
87
|
+
* ...WithLikeC4ManualLayouts(),
|
|
88
|
+
* ...NoMcpServer(),
|
|
89
|
+
* });
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* It is possible to extend/override the context with additional modules
|
|
93
|
+
* See Langium documentation for more details (or at the CliContext in packages/likec4/src/language/module.ts).
|
|
94
|
+
*/
|
|
95
|
+
declare function createLanguageServices(): {
|
|
96
|
+
shared: LikeC4SharedServices;
|
|
97
|
+
likec4: LikeC4Services;
|
|
98
|
+
};
|
|
99
|
+
declare function createLanguageServices(context: Partial<LanguageServicesContext>): {
|
|
100
|
+
shared: LikeC4SharedServices;
|
|
101
|
+
likec4: LikeC4Services;
|
|
102
|
+
};
|
|
103
|
+
declare function createLanguageServices(context: Partial<LanguageServicesContext>): {
|
|
104
|
+
shared: LikeC4SharedServices;
|
|
105
|
+
likec4: LikeC4Services;
|
|
106
|
+
};
|
|
107
|
+
declare function createLanguageServices<I1, I extends I1 & LikeC4Services>(context: Partial<LanguageServicesContext>, module: Module<I, I1> | undefined): {
|
|
108
|
+
shared: LikeC4SharedServices;
|
|
109
|
+
likec4: I;
|
|
110
|
+
};
|
|
111
|
+
declare function createLanguageServices<I1, I2, I extends I1 & I2 & LikeC4Services>(context: Partial<LanguageServicesContext>, module: Module<I, I1>, module2: Module<I, I2>): {
|
|
112
|
+
shared: LikeC4SharedServices;
|
|
113
|
+
likec4: I;
|
|
114
|
+
};
|
|
115
|
+
declare function createLanguageServices<I1, I2, I3, I extends I1 & I2 & I3 & LikeC4Services>(context: Partial<LanguageServicesContext>, module: Module<I, I1>, module2: Module<I, I2>, module3: Module<I, I3>): {
|
|
116
|
+
shared: LikeC4SharedServices;
|
|
117
|
+
likec4: I;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Most probably you don't need to use this function directly.
|
|
121
|
+
* Use {@link createLanguageServices} instead.
|
|
122
|
+
* @internal
|
|
123
|
+
*/
|
|
124
|
+
declare function createSharedServices(context?: Partial<LanguageServicesContext>): LikeC4SharedServices;
|
|
125
|
+
//#endregion
|
|
126
|
+
export { LanguageServicesContext, LikeC4AddedServices, LikeC4Services, LikeC4SharedServices, NoFileSystem, NoLikeC4ManualLayouts, NoMCPServer, createLanguageServices, createLikeC4Module, createSharedServices };
|
package/dist/module.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Cr as NoFileSystem,Tr as NoLikeC4ManualLayouts,a as LikeC4GeneratedSharedModule,i as LikeC4GeneratedModule}from"./_chunks/utils.mjs";import{A as AstNodeDescriptionProvider,C as LikeC4DocumentHighlightProvider,D as LikeC4WorkspaceManager,E as DefaultLikeC4LanguageServices,M as LikeC4DocumentationProvider,O as LangiumDocuments,S as LikeC4DocumentLinkProvider,T as LikeC4CodeLensProvider,_ as FqnIndex,a as LikeC4ScopeProvider,b as LikeC4HoverProvider,c as LikeC4ModelChanges,d as registerValidationChecks,f as LikeC4DocumentValidator,g as DeploymentsIndex,h as LastSeenArtifacts,i as Rpc,j as LikeC4Formatter,k as IndexManager,l as LikeC4ValueConverter,m as DefaultLikeC4ModelBuilder,n as WorkspaceSymbolProvider,o as LikeC4ScopeComputation,p as LikeC4ModelLocator,r as NodeKindProvider$1,s as LikeC4NameProvider,t as DefaultLikeC4Views,u as LikeC4ModelParser,v as LikeC4SemanticTokenProvider,w as LikeC4CompletionProvider,x as LikeC4DocumentSymbolProvider,y as LikeC4CodeActionProvider}from"./_chunks/LikeC4Views.mjs";import{n as NoMCPServer,t as ProjectsManager}from"./_chunks/ProjectsManager.mjs";import{DocumentState,WorkspaceCache,inject}from"langium";import{onNextTick}from"@likec4/core/utils";import{createDefaultModule,createDefaultSharedModule}from"langium/lsp";import{GraphvizWasmAdapter,QueueGraphvizLayoter}from"@likec4/layouts";function createLikeC4SharedModule(e){return{lsp:{NodeKindProvider:e=>new NodeKindProvider$1(e),WorkspaceSymbolProvider:e=>new WorkspaceSymbolProvider(e)},workspace:{Cache:e=>new WorkspaceCache(e,DocumentState.Validated),IndexManager:e=>new IndexManager(e),LangiumDocuments:e=>new LangiumDocuments(e),ProjectsManager:e=>new ProjectsManager(e),WorkspaceManager:e=>new LikeC4WorkspaceManager(e),FileSystemProvider:()=>e.fileSystemProvider(),FileSystemWatcher:t=>e.fileSystemWatcher(t),ManualLayouts:t=>e.manualLayouts(t)}}}function bind(e){return t=>new e(t)}function createLikeC4Module(e){return{documentation:{DocumentationProvider:bind(LikeC4DocumentationProvider)},validation:{DocumentValidator:bind(LikeC4DocumentValidator)},Rpc:bind(Rpc),mcp:{Server:t=>e.mcpServer(t),ServerFactory:t=>e.mcpServerFactory(t)},likec4:{LanguageServices:bind(DefaultLikeC4LanguageServices),Layouter:e=>new QueueGraphvizLayoter({graphviz:new GraphvizWasmAdapter}),Views:bind(DefaultLikeC4Views),DeploymentsIndex:bind(DeploymentsIndex),ModelChanges:bind(LikeC4ModelChanges),FqnIndex:bind(FqnIndex),ModelParser:bind(LikeC4ModelParser),ModelBuilder:bind(DefaultLikeC4ModelBuilder),ModelLocator:bind(LikeC4ModelLocator),LastSeen:bind(LastSeenArtifacts)},lsp:{CompletionProvider:bind(LikeC4CompletionProvider),DocumentHighlightProvider:bind(LikeC4DocumentHighlightProvider),DocumentSymbolProvider:bind(LikeC4DocumentSymbolProvider),SemanticTokenProvider:bind(LikeC4SemanticTokenProvider),HoverProvider:bind(LikeC4HoverProvider),CodeLensProvider:bind(LikeC4CodeLensProvider),DocumentLinkProvider:bind(LikeC4DocumentLinkProvider),Formatter:bind(LikeC4Formatter),CodeActionProvider:bind(LikeC4CodeActionProvider)},workspace:{AstNodeDescriptionProvider:bind(AstNodeDescriptionProvider)},references:{NameProvider:bind(LikeC4NameProvider),ScopeComputation:bind(LikeC4ScopeComputation),ScopeProvider:bind(LikeC4ScopeProvider)},parser:{ValueConverter:bind(LikeC4ValueConverter)}}}function createLanguageServices(n={},i,a,o){let s=createSharedServices(n),c=inject([createDefaultModule({shared:s}),LikeC4GeneratedModule,createLikeC4Module({...NoMCPServer,...NoFileSystem,...NoLikeC4ManualLayouts,...n}),i,a,o].reduce(_merge,{}));return s.ServiceRegistry.register(c),registerValidationChecks(c),n.connection?onNextTick(()=>c.Rpc.init()):s.workspace.ConfigurationProvider.initialized({}),{shared:s,likec4:c}}function createSharedServices(r={}){let i={...NoMCPServer,...NoFileSystem,...NoLikeC4ManualLayouts,...r};return inject(createDefaultSharedModule(i),LikeC4GeneratedSharedModule,createLikeC4SharedModule(i))}function _merge(e,t){if(t){for(let[n,r]of Object.entries(t))if(r!==void 0){let t=e[n];t!==null&&r!==null&&typeof t==`object`&&typeof r==`object`?e[n]=_merge(t,r):e[n]=r}}return e}export{NoFileSystem,NoLikeC4ManualLayouts,NoMCPServer,createLanguageServices,createLikeC4Module,createSharedServices};
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { DiagnosticSeverity, DocumentUri, Location, Position, Range, URI } from "vscode-languageserver-types";
|
|
2
|
+
import { ColorLiteral, ComputedLikeC4ModelData, DeploymentFqn, DiagramView, Fqn, LayoutedLikeC4ModelData, LayoutedProjectsView, NonEmptyArray, ProjectId, RelationId, ViewChange, ViewId } from "@likec4/core";
|
|
3
|
+
import { LikeC4ProjectJsonConfig } from "@likec4/config";
|
|
4
|
+
import { NotificationType, NotificationType0, RequestType, RequestType0 } from "vscode-jsonrpc";
|
|
5
|
+
|
|
6
|
+
//#region src/protocol.d.ts
|
|
7
|
+
declare namespace DidChangeModelNotification {
|
|
8
|
+
const type: NotificationType<string>;
|
|
9
|
+
type Type = typeof type;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Triggered by the language server when projects changed
|
|
13
|
+
* (number of projects changed, names changed, etc)
|
|
14
|
+
*/
|
|
15
|
+
declare namespace DidChangeProjectsNotification {
|
|
16
|
+
const type: NotificationType0;
|
|
17
|
+
type Type = typeof type;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* When the snapshot of a manual layout changes
|
|
21
|
+
* Send by the editor to the language server
|
|
22
|
+
*/
|
|
23
|
+
declare namespace DidChangeSnapshotNotification {
|
|
24
|
+
type Params = {
|
|
25
|
+
snapshotUri: DocumentUri;
|
|
26
|
+
};
|
|
27
|
+
const Method: "likec4/onDidChangeSnapshot";
|
|
28
|
+
const type: NotificationType<Params>;
|
|
29
|
+
type Type = typeof type;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* When server requests to open a likec4 preview panel
|
|
33
|
+
* (available only in the editor).
|
|
34
|
+
* (not the best place, but seems to be working)
|
|
35
|
+
*/
|
|
36
|
+
declare namespace DidRequestOpenViewNotification {
|
|
37
|
+
type Params = {
|
|
38
|
+
viewId: ViewId;
|
|
39
|
+
projectId: ProjectId;
|
|
40
|
+
};
|
|
41
|
+
const type: NotificationType<Params>;
|
|
42
|
+
type Type = typeof type;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Request to fetch the computed model data
|
|
46
|
+
* If LSP has multiple projects, the projectId is required.
|
|
47
|
+
* otherwise throws an error.
|
|
48
|
+
*/
|
|
49
|
+
declare namespace FetchComputedModel {
|
|
50
|
+
type Params = {
|
|
51
|
+
projectId?: string | undefined;
|
|
52
|
+
cleanCaches?: boolean | undefined;
|
|
53
|
+
};
|
|
54
|
+
type Res = {
|
|
55
|
+
model: ComputedLikeC4ModelData | null;
|
|
56
|
+
};
|
|
57
|
+
const req: RequestType<Params, Res, void>;
|
|
58
|
+
type Req = typeof req;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Request to fetch all views of all projects
|
|
62
|
+
*/
|
|
63
|
+
declare namespace FetchViewsFromAllProjects {
|
|
64
|
+
type Res = {
|
|
65
|
+
views: Array<{
|
|
66
|
+
id: ViewId;
|
|
67
|
+
title: string;
|
|
68
|
+
projectId: ProjectId;
|
|
69
|
+
}>;
|
|
70
|
+
};
|
|
71
|
+
const req: RequestType0<Res, void>;
|
|
72
|
+
type Req = typeof req;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Request to fetch the layouted model data
|
|
76
|
+
* If LSP has multiple projects, the projectId is required.
|
|
77
|
+
* otherwise throws an error.
|
|
78
|
+
*/
|
|
79
|
+
declare namespace FetchLayoutedModel {
|
|
80
|
+
type Params = {
|
|
81
|
+
projectId?: string | undefined;
|
|
82
|
+
};
|
|
83
|
+
type Res = {
|
|
84
|
+
model: LayoutedLikeC4ModelData | null;
|
|
85
|
+
};
|
|
86
|
+
const req: RequestType<Params, Res, void>;
|
|
87
|
+
type Req = typeof req;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Request to layout a view.
|
|
91
|
+
* If LSP has multiple projects, the projectId is required.
|
|
92
|
+
*/
|
|
93
|
+
declare namespace LayoutView {
|
|
94
|
+
type Params = {
|
|
95
|
+
viewId: ViewId;
|
|
96
|
+
projectId?: string | undefined;
|
|
97
|
+
layoutType?: 'auto' | 'manual' | undefined;
|
|
98
|
+
};
|
|
99
|
+
type Res = {
|
|
100
|
+
result: {
|
|
101
|
+
dot: string;
|
|
102
|
+
diagram: DiagramView;
|
|
103
|
+
} | null;
|
|
104
|
+
};
|
|
105
|
+
const req: RequestType<Params, Res, void>;
|
|
106
|
+
type Req = typeof req;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Request to validate all views
|
|
110
|
+
* If projects ID is provided, it will validate only the views of that project.
|
|
111
|
+
*/
|
|
112
|
+
declare namespace ValidateLayout {
|
|
113
|
+
type Params = {
|
|
114
|
+
projectId?: string;
|
|
115
|
+
};
|
|
116
|
+
type Res = {
|
|
117
|
+
result: {
|
|
118
|
+
uri: string;
|
|
119
|
+
viewId: ViewId;
|
|
120
|
+
message: string;
|
|
121
|
+
severity: DiagnosticSeverity;
|
|
122
|
+
range: {
|
|
123
|
+
start: Position;
|
|
124
|
+
end: Position;
|
|
125
|
+
};
|
|
126
|
+
}[] | null;
|
|
127
|
+
};
|
|
128
|
+
const req: RequestType<Params, Res, void>;
|
|
129
|
+
type Req = typeof req;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Request to reload projects.
|
|
133
|
+
*/
|
|
134
|
+
declare namespace ReloadProjects {
|
|
135
|
+
type Params = never;
|
|
136
|
+
type Res = void;
|
|
137
|
+
const req: RequestType0<void, void>;
|
|
138
|
+
type Req = typeof req;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Fetch all non-empty projects.
|
|
142
|
+
*/
|
|
143
|
+
declare namespace FetchProjects {
|
|
144
|
+
type Params = never;
|
|
145
|
+
type Res = {
|
|
146
|
+
projects: {
|
|
147
|
+
[projectId: ProjectId]: {
|
|
148
|
+
folder: URI;
|
|
149
|
+
config: {
|
|
150
|
+
name: string;
|
|
151
|
+
title?: string | undefined;
|
|
152
|
+
};
|
|
153
|
+
docs: NonEmptyArray<DocumentUri>;
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
const req: RequestType0<Res, void>;
|
|
158
|
+
type Req = typeof req;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Request from the client to register a project.
|
|
162
|
+
*/
|
|
163
|
+
declare namespace RegisterProject {
|
|
164
|
+
type Params = {
|
|
165
|
+
folderUri: URI;
|
|
166
|
+
config: LikeC4ProjectJsonConfig;
|
|
167
|
+
configUri?: never;
|
|
168
|
+
} | {
|
|
169
|
+
configUri: URI;
|
|
170
|
+
folderUri?: never;
|
|
171
|
+
config?: never;
|
|
172
|
+
};
|
|
173
|
+
type Res = {
|
|
174
|
+
id: ProjectId;
|
|
175
|
+
};
|
|
176
|
+
const req: RequestType<Params, Res, void>;
|
|
177
|
+
type Req = typeof req;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Request to build documents.
|
|
181
|
+
*/
|
|
182
|
+
declare namespace BuildDocuments {
|
|
183
|
+
type Params = {
|
|
184
|
+
docs: DocumentUri[];
|
|
185
|
+
};
|
|
186
|
+
const req: RequestType<Params, void, void>;
|
|
187
|
+
type Req = typeof req;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Request to locate an element, relation, deployment or view.
|
|
191
|
+
* If LSP has multiple projects, the projectId is required.
|
|
192
|
+
*/
|
|
193
|
+
declare namespace Locate {
|
|
194
|
+
type Params =
|
|
195
|
+
/**
|
|
196
|
+
* Locate an element by its fqn
|
|
197
|
+
*/
|
|
198
|
+
{
|
|
199
|
+
element: Fqn;
|
|
200
|
+
projectId?: string | undefined;
|
|
201
|
+
property?: string;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Locate a relation by its id
|
|
205
|
+
*/
|
|
206
|
+
| {
|
|
207
|
+
projectId?: string | undefined;
|
|
208
|
+
relation: RelationId;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Locate a deployment by its fqn
|
|
212
|
+
*/
|
|
213
|
+
| {
|
|
214
|
+
deployment: DeploymentFqn;
|
|
215
|
+
projectId?: string | undefined;
|
|
216
|
+
property?: string;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Locate a step in a dynamic view by its astPath
|
|
220
|
+
*/
|
|
221
|
+
| {
|
|
222
|
+
view: ViewId;
|
|
223
|
+
astPath: string;
|
|
224
|
+
projectId?: string | undefined;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Locate a view by its id
|
|
228
|
+
*/
|
|
229
|
+
| {
|
|
230
|
+
view: ViewId;
|
|
231
|
+
projectId?: string | undefined;
|
|
232
|
+
};
|
|
233
|
+
type Res = Location | null;
|
|
234
|
+
const req: RequestType<Params, Res, void>;
|
|
235
|
+
type Req = typeof req;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Request to change the view
|
|
239
|
+
* If LSP has multiple projects, the projectId is required.
|
|
240
|
+
*/
|
|
241
|
+
declare namespace ChangeView {
|
|
242
|
+
type Params = {
|
|
243
|
+
viewId: ViewId;
|
|
244
|
+
change: ViewChange;
|
|
245
|
+
projectId?: string | undefined;
|
|
246
|
+
};
|
|
247
|
+
type Res = {
|
|
248
|
+
success: true;
|
|
249
|
+
location: Location | null;
|
|
250
|
+
} | {
|
|
251
|
+
success: false;
|
|
252
|
+
location?: Location | null;
|
|
253
|
+
error: string;
|
|
254
|
+
};
|
|
255
|
+
const req: RequestType<Params, Res, void>;
|
|
256
|
+
type Req = typeof req;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Request to fetch telemetry metrics
|
|
260
|
+
*/
|
|
261
|
+
declare namespace FetchTelemetryMetrics {
|
|
262
|
+
type Res = {
|
|
263
|
+
metrics: null | {
|
|
264
|
+
elementKinds: number;
|
|
265
|
+
deploymentKinds: number;
|
|
266
|
+
relationshipKinds: number;
|
|
267
|
+
tags: number;
|
|
268
|
+
customColors: number;
|
|
269
|
+
elements: number;
|
|
270
|
+
deploymentNodes: number;
|
|
271
|
+
relationships: number;
|
|
272
|
+
views: number;
|
|
273
|
+
projects: number;
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
const req: RequestType0<Res, void>;
|
|
277
|
+
type Req = typeof req;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Request to fetch all tags of a document
|
|
281
|
+
*/
|
|
282
|
+
declare namespace GetDocumentTags {
|
|
283
|
+
type Params = {
|
|
284
|
+
documentUri: DocumentUri;
|
|
285
|
+
};
|
|
286
|
+
type Res = {
|
|
287
|
+
/**
|
|
288
|
+
* Project ID this document belongs to (if any)
|
|
289
|
+
*/
|
|
290
|
+
projectId: ProjectId;
|
|
291
|
+
/**
|
|
292
|
+
* Used tags in the document
|
|
293
|
+
*/
|
|
294
|
+
tags: Array<{
|
|
295
|
+
name: string;
|
|
296
|
+
range: Range;
|
|
297
|
+
color: ColorLiteral;
|
|
298
|
+
isSpecification?: boolean;
|
|
299
|
+
}>;
|
|
300
|
+
};
|
|
301
|
+
const req: RequestType<Params, Res, void>;
|
|
302
|
+
type Req = typeof req;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Request to fetch projects overview diagram
|
|
306
|
+
*/
|
|
307
|
+
declare namespace FetchProjectsOverview {
|
|
308
|
+
type Res = {
|
|
309
|
+
projectsView: LayoutedProjectsView | null;
|
|
310
|
+
};
|
|
311
|
+
const req: RequestType0<Res, void>;
|
|
312
|
+
type Req = typeof req;
|
|
313
|
+
}
|
|
314
|
+
//#endregion
|
|
315
|
+
export { BuildDocuments, ChangeView, DidChangeModelNotification, DidChangeProjectsNotification, DidChangeSnapshotNotification, DidRequestOpenViewNotification, FetchComputedModel, FetchLayoutedModel, FetchProjects, FetchProjectsOverview, FetchTelemetryMetrics, FetchViewsFromAllProjects, GetDocumentTags, LayoutView, Locate, RegisterProject, ReloadProjects, ValidateLayout };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{NotificationType,NotificationType0,RequestType,RequestType0}from"vscode-jsonrpc";let DidChangeModelNotification;(function(t){t.type=new NotificationType(`likec4/onDidChangeModel`)})(DidChangeModelNotification||={});let DidChangeProjectsNotification;(function(e){e.type=new NotificationType0(`likec4/onDidChangeProjects`)})(DidChangeProjectsNotification||={});let DidChangeSnapshotNotification;(function(t){t.type=new NotificationType(t.Method=`likec4/onDidChangeSnapshot`)})(DidChangeSnapshotNotification||={});let DidRequestOpenViewNotification;(function(t){t.type=new NotificationType(`likec4/onRequestOpenView`)})(DidRequestOpenViewNotification||={});let FetchComputedModel;(function(e){e.req=new RequestType(`likec4/fetchComputedModel`)})(FetchComputedModel||={});let FetchViewsFromAllProjects;(function(e){e.req=new RequestType0(`likec4/fetchViewsFromAllProjects`)})(FetchViewsFromAllProjects||={});let FetchLayoutedModel;(function(e){e.req=new RequestType(`likec4/fetchLayoutedModel`)})(FetchLayoutedModel||={});let LayoutView;(function(e){e.req=new RequestType(`likec4/layout-view`)})(LayoutView||={});let ValidateLayout;(function(e){e.req=new RequestType(`likec4/validate-layout`)})(ValidateLayout||={});let ReloadProjects;(function(e){e.req=new RequestType0(`likec4/reload-projects`)})(ReloadProjects||={});let FetchProjects;(function(e){e.req=new RequestType0(`likec4/fetch-projects`)})(FetchProjects||={});let RegisterProject;(function(e){e.req=new RequestType(`likec4/register-project`)})(RegisterProject||={});let BuildDocuments;(function(e){e.req=new RequestType(`likec4/build`)})(BuildDocuments||={});let Locate;(function(e){e.req=new RequestType(`likec4/locate`)})(Locate||={});let ChangeView;(function(e){e.req=new RequestType(`likec4/change-view`)})(ChangeView||={});let FetchTelemetryMetrics;(function(e){e.req=new RequestType0(`likec4/metrics`)})(FetchTelemetryMetrics||={});let GetDocumentTags;(function(e){e.req=new RequestType(`likec4/document-tags`)})(GetDocumentTags||={});let FetchProjectsOverview;(function(e){e.req=new RequestType0(`likec4/fetch-projects-overview`)})(FetchProjectsOverview||={});export{BuildDocuments,ChangeView,DidChangeModelNotification,DidChangeProjectsNotification,DidChangeSnapshotNotification,DidRequestOpenViewNotification,FetchComputedModel,FetchLayoutedModel,FetchProjects,FetchProjectsOverview,FetchTelemetryMetrics,FetchViewsFromAllProjects,GetDocumentTags,LayoutView,Locate,RegisterProject,ReloadProjects,ValidateLayout};
|
package/likec4lib/package.json
CHANGED
package/mcp/package.json
ADDED