@likec4/language-server 1.49.0 → 1.51.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/LICENSE +21 -0
- package/README.md +5 -25
- package/bin/likec4-language-server.mjs +2 -3
- package/dist/_chunks/LikeC4FileSystem.mjs +3 -3
- package/dist/_chunks/common-exports.mjs +0 -0
- package/dist/_chunks/likec4lib.mjs +2 -0
- package/dist/_chunks/mcp.mjs +1154 -0
- package/dist/_chunks/{index.d.mts → module.d.mts} +326 -24
- package/dist/_chunks/module.mjs +35 -0
- package/dist/_chunks/noop.mjs +1 -0
- package/dist/_chunks/protocol.d.mts +315 -0
- package/dist/_chunks/utils.mjs +1 -1
- package/dist/_chunks/workspace.mjs +1 -0
- package/dist/browser/index.d.mts +8 -3
- package/dist/browser/index.mjs +1 -1
- package/dist/browser/worker.mjs +1 -1
- package/dist/filesystem/index.d.mts +3 -2
- package/dist/filesystem/index.mjs +1 -1
- package/dist/index.d.mts +3 -39
- package/dist/index.mjs +1 -1
- package/dist/likec4lib.mjs +1 -1
- package/dist/mcp/index.d.mts +3 -2
- package/dist/mcp/index.mjs +1 -1
- package/dist/module.d.mts +3 -126
- package/dist/module.mjs +1 -1
- package/dist/protocol.d.mts +1 -314
- package/dist/protocol.mjs +1 -1
- package/package.json +23 -33
- package/bundled/package.json +0 -4
- package/dist/THIRD-PARTY-LICENSES.md +0 -178
- package/dist/_chunks/ConfigurableLayouter.mjs +0 -1
- package/dist/_chunks/LikeC4Views.mjs +0 -34
- package/dist/_chunks/ProjectsManager.mjs +0 -1
- package/dist/_chunks/WithMCPServer.mjs +0 -481
- package/dist/_chunks/icons.mjs +0 -2
- package/dist/_chunks/libs/@msgpack/msgpack.mjs +0 -1
- package/dist/_chunks/libs/eventemitter3.mjs +0 -1
- package/dist/_chunks/libs/fast-equals.mjs +0 -1
- package/dist/_chunks/libs/p-queue.mjs +0 -1
- package/dist/_chunks/libs/parse-ms.mjs +0 -1
- package/dist/_chunks/libs/picomatch.mjs +0 -1
- package/dist/_chunks/libs/pretty-ms.mjs +0 -1
- package/dist/_chunks/libs/remeda.mjs +0 -1
- package/dist/_chunks/libs/strip-indent.mjs +0 -1
- package/dist/_chunks/libs/ufo.mjs +0 -1
- package/dist/_chunks/logger.mjs +0 -1
- package/dist/_chunks/rolldown-runtime.mjs +0 -1
- package/dist/bundled.d.mts +0 -27
- package/dist/bundled.mjs +0 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { ChangeView, DidRequestOpenViewNotification
|
|
2
|
-
import { LikeC4Services, LikeC4SharedServices } from "../module.mjs";
|
|
1
|
+
import { h as Locate, n as ChangeView, o as DidRequestOpenViewNotification } from "./protocol.mjs";
|
|
3
2
|
import * as langium from "langium";
|
|
4
|
-
import { AstNode, AstNodeDescription, AsyncDisposable, BuildOptions, Cancellation, CstNode, DefaultAstNodeDescriptionProvider, DefaultDocumentValidator, DefaultIndexManager, DefaultLangiumDocuments, DefaultNameProvider, DefaultScopeComputation, DefaultScopeProvider, DefaultValueConverter, DefaultWorkspaceManager, DiagnosticInfo, Disposable, FileSelector, FileSystemNode, FileSystemProvider, GrammarAST, JSDocDocumentationProvider, LangiumDocument, LangiumDocumentFactory, MaybePromise, PrecomputedScopes, Reference, ReferenceDescription, ReferenceInfo, Scope, SimpleCache, Stream, URI, ValidationOptions, ValueType, WorkspaceCache } from "langium";
|
|
3
|
+
import { AstNode, AstNodeDescription, AsyncDisposable, BuildOptions, Cancellation, CstNode, DefaultAstNodeDescriptionProvider, DefaultDocumentValidator, DefaultIndexManager, DefaultLangiumDocuments, DefaultNameProvider, DefaultScopeComputation, DefaultScopeProvider, DefaultValueConverter, DefaultWorkspaceManager, DiagnosticInfo, Disposable, FileSelector, FileSystemNode, FileSystemProvider, GrammarAST, JSDocDocumentationProvider, LangiumDocument, LangiumDocumentFactory, MaybePromise, Module, PrecomputedScopes, Reference, ReferenceDescription, ReferenceInfo, Scope, SimpleCache, Stream, URI, ValidationOptions, ValueType, WorkspaceCache } from "langium";
|
|
5
4
|
import { DefaultWeakMap, MultiMap as MultiMap$1 } from "@likec4/core/utils";
|
|
6
|
-
import { CompletionItemKind, Diagnostic, DocumentSymbol, FormattingOptions, Hover, Location, Range,
|
|
7
|
-
import { AbstractFormatter, AbstractSemanticTokenProvider, AstNodeHoverProvider, CodeActionProvider, CodeLensProvider, CompletionAcceptor, CompletionContext, DefaultCompletionProvider, DefaultDocumentHighlightProvider, DefaultWorkspaceSymbolProvider, DocumentLinkProvider, DocumentSymbolProvider, FormattingRegion, LangiumSharedServices, NextFeature, NodeKindProvider, SemanticTokenAcceptor } from "langium/lsp";
|
|
8
|
-
import { GraphvizLayouter, QueueGraphvizLayoter } from "@likec4/layouts";
|
|
5
|
+
import { CompletionItemKind, Diagnostic, DocumentSymbol, FormattingOptions, Hover, Location, Range, SymbolKind, TextEdit } from "vscode-languageserver-types";
|
|
6
|
+
import { AbstractFormatter, AbstractSemanticTokenProvider, AstNodeHoverProvider, CodeActionProvider, CodeLensProvider, CompletionAcceptor, CompletionContext, DefaultCompletionProvider, DefaultDocumentHighlightProvider, DefaultSharedModuleContext, DefaultWorkspaceSymbolProvider, DocumentLinkProvider, DocumentSymbolProvider, FormattingRegion, LangiumServices, LangiumSharedServices, NextFeature, NodeKindProvider, PartialLangiumServices, SemanticTokenAcceptor } from "langium/lsp";
|
|
7
|
+
import { GraphvizLayouter, GraphvizPort, QueueGraphvizLayoter } from "@likec4/layouts";
|
|
9
8
|
import * as c4 from "@likec4/core";
|
|
10
9
|
import { ComputedView, DiagramView, LayoutType, LayoutedView, NonEmptyArray, NonEmptyReadonlyArray, ProjectId, Tag, UnknownComputed, UnknownLayouted, UnknownParsed, ViewChange, ViewId } from "@likec4/core";
|
|
11
10
|
import { AdhocViewPredicate, LayoutedProjectsView as LayoutedProjectsView$1 } from "@likec4/core/compute-view";
|
|
@@ -13,28 +12,41 @@ import { ElementModel, LikeC4Model } from "@likec4/core/model";
|
|
|
13
12
|
import { IncludeConfig, LikeC4ProjectConfig, LikeC4ProjectConfigInput } from "@likec4/config";
|
|
14
13
|
import { URI as URI$2 } from "vscode-uri";
|
|
15
14
|
import { LikeC4Styles } from "@likec4/core/styles";
|
|
16
|
-
import { CancellationToken, CodeLens, CodeLensParams, DocumentHighlight, DocumentLink, DocumentLinkParams, DocumentSymbolParams, WorkspaceFolder } from "vscode-languageserver";
|
|
17
|
-
import {
|
|
15
|
+
import { CancellationToken, CodeLens, CodeLensParams, Connection, DocumentHighlight, DocumentLink, DocumentLinkParams, DocumentSymbolParams, WorkspaceFolder } from "vscode-languageserver";
|
|
16
|
+
import { CodeAction, CodeActionParams, Command } from "vscode-languageserver-protocol";
|
|
18
17
|
import { Fqn as Fqn$1, GuardedBy, LayoutedView as LayoutedView$1, ProjectId as ProjectId$1, ViewId as ViewId$1 } from "@likec4/core/types";
|
|
19
|
-
import { CancellationToken as CancellationToken$
|
|
18
|
+
import { CancellationToken as CancellationToken$1 } from "vscode-jsonrpc";
|
|
20
19
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
21
20
|
import * as type_fest0 from "type-fest";
|
|
22
21
|
import { ConditionalPick, MergeExclusive, Simplify, Tagged, ValueOf, Writable } from "type-fest";
|
|
23
22
|
import { ServerOptions } from "@modelcontextprotocol/sdk/server/index.js";
|
|
24
23
|
|
|
25
24
|
//#region src/documentation/documentation-provider.d.ts
|
|
25
|
+
/**
|
|
26
|
+
* Provides documentation for LikeC4 AST nodes, extending JSDoc parsing
|
|
27
|
+
* with specialized formatting for deployment nodes, deployed instances, and elements.
|
|
28
|
+
*/
|
|
26
29
|
declare class LikeC4DocumentationProvider extends JSDocDocumentationProvider {
|
|
27
30
|
private parser;
|
|
28
31
|
private locator;
|
|
32
|
+
/**
|
|
33
|
+
* Creates a new documentation provider.
|
|
34
|
+
* @param services - The LikeC4 language services.
|
|
35
|
+
*/
|
|
29
36
|
constructor(services: LikeC4Services);
|
|
37
|
+
/**
|
|
38
|
+
* Returns documentation for the given AST node (deployment nodes, deployed instances, elements, or JSDoc fallback).
|
|
39
|
+
* @param node - The AST node to document.
|
|
40
|
+
* @returns Formatted documentation string, or undefined if none.
|
|
41
|
+
*/
|
|
30
42
|
getDocumentation(node: AstNode): string | undefined;
|
|
31
43
|
}
|
|
32
44
|
//#endregion
|
|
33
45
|
//#region src/workspace/ProjectsManager.d.ts
|
|
34
46
|
type DocOrUri = LangiumDocument | string | URI;
|
|
35
47
|
/**
|
|
36
|
-
* A tagged string that represents a project folder URI
|
|
37
|
-
*
|
|
48
|
+
* A tagged string that represents a project folder URI (with trailing slash).
|
|
49
|
+
* Used in `startsWith` checks to determine if a document belongs to a project.
|
|
38
50
|
*/
|
|
39
51
|
type ProjectFolder = Tagged<string, 'ProjectFolder'>;
|
|
40
52
|
declare function ProjectFolder(folder: URI | string): ProjectFolder;
|
|
@@ -155,6 +167,7 @@ declare class ProjectsManager {
|
|
|
155
167
|
private getWorkspaceFolder;
|
|
156
168
|
private notifyListeners;
|
|
157
169
|
private updateIncludesExcludes;
|
|
170
|
+
private warnIfConfigOverride;
|
|
158
171
|
}
|
|
159
172
|
//#endregion
|
|
160
173
|
//#region src/filesystem/types.d.ts
|
|
@@ -312,7 +325,7 @@ interface LikeC4MCPServerModuleContext {
|
|
|
312
325
|
}
|
|
313
326
|
//#endregion
|
|
314
327
|
//#region src/generated/ast.d.ts
|
|
315
|
-
type AnyProperty = DynamicViewProperty | ElementProperty | RelationProperty | StringProperty | ViewProperty;
|
|
328
|
+
type AnyProperty = DynamicViewProperty | ElementProperty | NavigateToProperty | NotationProperty | NotesProperty | RelationProperty | RelationshipStyleProperty | StringProperty | StyleProperty | ViewProperty;
|
|
316
329
|
declare const AnyProperty = "AnyProperty";
|
|
317
330
|
type ArrowType = 'crow' | 'diamond' | 'dot' | 'none' | 'normal' | 'odiamond' | 'odot' | 'onormal' | 'open' | 'vee';
|
|
318
331
|
type BorderStyleValue = 'none' | LineOptions;
|
|
@@ -1971,7 +1984,10 @@ declare class MergedSpecification {
|
|
|
1971
1984
|
readonly globals: c4.ModelGlobals;
|
|
1972
1985
|
readonly imports: MultiMap$1<c4.ProjectId, c4.Fqn, Set<c4.Fqn>>;
|
|
1973
1986
|
readonly projectId: c4.ProjectId | undefined;
|
|
1974
|
-
|
|
1987
|
+
readonly inferTechFromIcon: boolean;
|
|
1988
|
+
constructor(docs: ReadonlyArray<ParsedLikeC4LangiumDocument>, opts?: {
|
|
1989
|
+
inferTechFromIcon?: boolean;
|
|
1990
|
+
});
|
|
1975
1991
|
/**
|
|
1976
1992
|
* Converts a parsed model into a C4 model element.
|
|
1977
1993
|
*/
|
|
@@ -2025,29 +2041,59 @@ declare class MergedSpecification {
|
|
|
2025
2041
|
declare class LastSeenArtifacts {
|
|
2026
2042
|
#private;
|
|
2027
2043
|
constructor(services: LikeC4Services);
|
|
2044
|
+
/**
|
|
2045
|
+
* Cache the last successful merged specification for its project.
|
|
2046
|
+
* @param specification - MergedSpecification to store (by projectId).
|
|
2047
|
+
* @returns The same specification (stores in internal map when projectId is set).
|
|
2048
|
+
*/
|
|
2028
2049
|
rememberSpecification(specification: MergedSpecification): MergedSpecification;
|
|
2050
|
+
/**
|
|
2051
|
+
* Cache the last successful computed model and its styles for the project.
|
|
2052
|
+
* @param model - LikeC4Model.Computed to store (by projectId).
|
|
2053
|
+
* @returns The same model (stores model and styles in internal maps).
|
|
2054
|
+
*/
|
|
2029
2055
|
rememberModel<M extends LikeC4Model.Computed>(model: M): M;
|
|
2056
|
+
/**
|
|
2057
|
+
* Returns the last seen merged specification for the given project, if available.
|
|
2058
|
+
* @param projectId - Project id to look up.
|
|
2059
|
+
* @returns MergedSpecification or undefined.
|
|
2060
|
+
*/
|
|
2030
2061
|
specification(projectId: c4.ProjectId): MergedSpecification | undefined;
|
|
2062
|
+
/**
|
|
2063
|
+
* Returns the last seen styles for the given project, if available.
|
|
2064
|
+
* @param projectId - Project id to look up.
|
|
2065
|
+
* @returns LikeC4Styles or undefined.
|
|
2066
|
+
*/
|
|
2031
2067
|
styles(projectId: c4.ProjectId): LikeC4Styles | undefined;
|
|
2068
|
+
/**
|
|
2069
|
+
* Returns the last seen computed model for the given project, if available.
|
|
2070
|
+
* @param projectId - Project id to look up.
|
|
2071
|
+
* @returns LikeC4Model.Computed or undefined.
|
|
2072
|
+
*/
|
|
2032
2073
|
model(projectId: c4.ProjectId): LikeC4Model.Computed | undefined;
|
|
2033
2074
|
}
|
|
2034
2075
|
//#endregion
|
|
2035
2076
|
//#region src/model/model-builder.d.ts
|
|
2036
2077
|
type ModelParsedListener = (docs: URI[]) => void;
|
|
2037
2078
|
interface LikeC4ModelBuilder extends Disposable {
|
|
2038
|
-
parseModel(projectId?: ProjectId | undefined, cancelToken?: CancellationToken$
|
|
2079
|
+
parseModel(projectId?: ProjectId | undefined, cancelToken?: CancellationToken$1): Promise<LikeC4Model<UnknownParsed> | null>;
|
|
2039
2080
|
unsafeSyncComputeModel(projectId: ProjectId): LikeC4Model<UnknownComputed>;
|
|
2040
|
-
computeModel(projectId?: ProjectId | undefined, cancelToken?: CancellationToken$
|
|
2081
|
+
computeModel(projectId?: ProjectId | undefined, cancelToken?: CancellationToken$1): Promise<LikeC4Model<UnknownComputed>>;
|
|
2041
2082
|
onModelParsed(callback: ModelParsedListener): Disposable;
|
|
2042
2083
|
clearCache(): void;
|
|
2043
2084
|
}
|
|
2044
2085
|
//#endregion
|
|
2045
2086
|
//#region src/model/model-locator.d.ts
|
|
2087
|
+
/** Result of locating a view: document, view AST, and view block node. */
|
|
2046
2088
|
type ViewLocateResult = {
|
|
2047
2089
|
doc: ParsedLikeC4LangiumDocument;
|
|
2048
2090
|
view: ParsedAstView;
|
|
2049
2091
|
viewAst: LikeC4View;
|
|
2050
2092
|
};
|
|
2093
|
+
/**
|
|
2094
|
+
* Locates elements, views, and documents in the LikeC4 model by FQN or AST node.
|
|
2095
|
+
* Used by LSP features (hover, go-to-definition, document tags, etc.).
|
|
2096
|
+
*/
|
|
2051
2097
|
declare class LikeC4ModelLocator {
|
|
2052
2098
|
private services;
|
|
2053
2099
|
private fqnIndex;
|
|
@@ -2060,16 +2106,33 @@ declare class LikeC4ModelLocator {
|
|
|
2060
2106
|
* Returns the parsed documents
|
|
2061
2107
|
*/
|
|
2062
2108
|
private documents;
|
|
2109
|
+
/**
|
|
2110
|
+
* Get parsed element by AST node or by FQN (and optional projectId).
|
|
2111
|
+
* @param args - Either [element AST], [fqn], or [fqn, projectId]
|
|
2112
|
+
* @returns { projectId, element, document } or null if not found
|
|
2113
|
+
*/
|
|
2063
2114
|
getParsedElement(...args: [Element] | [c4.Fqn] | [c4.Fqn, c4.ProjectId]): null | {
|
|
2064
2115
|
projectId: c4.ProjectId;
|
|
2065
2116
|
element: ParsedAstElement;
|
|
2066
2117
|
document: LangiumDocument;
|
|
2067
2118
|
};
|
|
2068
2119
|
private findParsedElementByFqnIn;
|
|
2120
|
+
/**
|
|
2121
|
+
* Get LSP Location for an element by FQN (and optional projectId).
|
|
2122
|
+
* @param fqn - Fully qualified name (may include project prefix)
|
|
2123
|
+
* @param projectId - Optional project scope
|
|
2124
|
+
* @returns Location or null
|
|
2125
|
+
*/
|
|
2069
2126
|
locateElement(fqn: c4.Fqn, projectId?: c4.ProjectId | undefined): Location | null;
|
|
2070
2127
|
locateDeploymentElement(deploymentFqn: c4.DeploymentFqn, projectId?: c4.ProjectId | undefined): Location | null;
|
|
2071
2128
|
locateRelation(relationId: c4.RelationId, projectId?: c4.ProjectId): Location | null;
|
|
2072
2129
|
locateViewAst(viewId: c4.ViewId, projectId?: c4.ProjectId | undefined): null | ViewLocateResult;
|
|
2130
|
+
/**
|
|
2131
|
+
* Get LSP Location for a view by id (and optional projectId).
|
|
2132
|
+
* @param viewId - View id
|
|
2133
|
+
* @param projectId - Optional project scope
|
|
2134
|
+
* @returns Location or null
|
|
2135
|
+
*/
|
|
2073
2136
|
locateView(viewId: c4.ViewId, projectId?: c4.ProjectId): Location | null;
|
|
2074
2137
|
/**
|
|
2075
2138
|
* Returns an array of tags with their name, color, range and whether they are defined in the specification or not.
|
|
@@ -2169,6 +2232,101 @@ interface LikeC4Views {
|
|
|
2169
2232
|
adhocView(predicates: AdhocViewPredicate[], projectId?: ProjectId | undefined): Promise<LayoutedView>;
|
|
2170
2233
|
}
|
|
2171
2234
|
//#endregion
|
|
2235
|
+
//#region src/views/index.d.ts
|
|
2236
|
+
interface LikeC4ViewsModuleContext {
|
|
2237
|
+
graphviz: (services: LikeC4Services) => GraphvizPort;
|
|
2238
|
+
}
|
|
2239
|
+
declare const WithWasmGraphviz: LikeC4ViewsModuleContext;
|
|
2240
|
+
declare function WithGraphviz(graphviz: GraphvizPort): LikeC4ViewsModuleContext;
|
|
2241
|
+
//#endregion
|
|
2242
|
+
//#region src/configureLogger.d.ts
|
|
2243
|
+
type ConfigureLanguageServerLoggerOptions = {
|
|
2244
|
+
/**
|
|
2245
|
+
* The LSP connection if available
|
|
2246
|
+
* (used by Telemetry)
|
|
2247
|
+
*/
|
|
2248
|
+
lspConnection?: Connection | undefined;
|
|
2249
|
+
/**
|
|
2250
|
+
* Whether to use stderr for logging instead of stdout.
|
|
2251
|
+
* @default false
|
|
2252
|
+
*/
|
|
2253
|
+
useStdErr?: boolean;
|
|
2254
|
+
/**
|
|
2255
|
+
* The log level to use.
|
|
2256
|
+
* @default 'warning'
|
|
2257
|
+
*/
|
|
2258
|
+
logLevel?: 'trace' | 'debug' | 'info' | 'warning' | 'error' | undefined;
|
|
2259
|
+
/**
|
|
2260
|
+
* @default true
|
|
2261
|
+
*/
|
|
2262
|
+
enableTelemetry?: boolean;
|
|
2263
|
+
/**
|
|
2264
|
+
* Enable non-blocking logging (async).
|
|
2265
|
+
* @default false
|
|
2266
|
+
*/
|
|
2267
|
+
nonBlocking?: boolean;
|
|
2268
|
+
/**
|
|
2269
|
+
* Whether to use colors in logging.
|
|
2270
|
+
* @default false
|
|
2271
|
+
*/
|
|
2272
|
+
colors?: boolean;
|
|
2273
|
+
};
|
|
2274
|
+
declare function configureLanguageServerLogger({
|
|
2275
|
+
lspConnection: connection,
|
|
2276
|
+
enableTelemetry,
|
|
2277
|
+
useStdErr,
|
|
2278
|
+
logLevel: lowestLevel,
|
|
2279
|
+
nonBlocking,
|
|
2280
|
+
colors
|
|
2281
|
+
}?: ConfigureLanguageServerLoggerOptions): void;
|
|
2282
|
+
//#endregion
|
|
2283
|
+
//#region src/index.d.ts
|
|
2284
|
+
interface StartLanguageServerOptions {
|
|
2285
|
+
/**
|
|
2286
|
+
* The Language Server Protocol connection to use.
|
|
2287
|
+
*/
|
|
2288
|
+
connection?: Connection;
|
|
2289
|
+
/**
|
|
2290
|
+
* Whether to enable the file system watcher.
|
|
2291
|
+
* @default true
|
|
2292
|
+
*/
|
|
2293
|
+
enableWatcher?: boolean;
|
|
2294
|
+
/**
|
|
2295
|
+
* Whether to enable the MCP server.
|
|
2296
|
+
* @default 'sse'
|
|
2297
|
+
*/
|
|
2298
|
+
enableMCP?: false | 'stdio' | 'sse' | {
|
|
2299
|
+
port: number;
|
|
2300
|
+
};
|
|
2301
|
+
/**
|
|
2302
|
+
* Whether to enable manual layouts, stored in json5 files.
|
|
2303
|
+
* @default true
|
|
2304
|
+
*/
|
|
2305
|
+
enableManualLayouts?: boolean;
|
|
2306
|
+
/**
|
|
2307
|
+
* Whether to use the `dot` binary for layouting or the WebAssembly version.
|
|
2308
|
+
* If {@link connection} is set, {@link ConfigurableLayouter} is started
|
|
2309
|
+
* and this option controls the default layouter implementation used by it.
|
|
2310
|
+
*
|
|
2311
|
+
* @default 'wasm'
|
|
2312
|
+
*/
|
|
2313
|
+
graphviz?: 'wasm' | 'binary';
|
|
2314
|
+
/**
|
|
2315
|
+
* Whether to configure the logger.
|
|
2316
|
+
*
|
|
2317
|
+
* - `false` - don't configure the logger
|
|
2318
|
+
* - `'console'` - configure the logger with console sink
|
|
2319
|
+
* - `'stderr'` - configure the logger with stderr sink
|
|
2320
|
+
*
|
|
2321
|
+
* @default false
|
|
2322
|
+
*/
|
|
2323
|
+
configureLogger?: false | 'console' | 'stderr';
|
|
2324
|
+
}
|
|
2325
|
+
declare function startLanguageServer$1(options?: StartLanguageServerOptions): {
|
|
2326
|
+
shared: LikeC4SharedServices;
|
|
2327
|
+
likec4: LikeC4Services;
|
|
2328
|
+
};
|
|
2329
|
+
//#endregion
|
|
2172
2330
|
//#region src/model/parser/Base.d.ts
|
|
2173
2331
|
type ParserLevel = 'base' | 'model' | 'deployment' | 'fqnref' | 'relation' | 'views' | 'globals' | 'imports' | 'specification';
|
|
2174
2332
|
declare class BaseParser {
|
|
@@ -2940,28 +3098,28 @@ interface LikeC4LanguageServices {
|
|
|
2940
3098
|
* Computes and layouts projects overview - a special diagram
|
|
2941
3099
|
* that shows all projects and their relationships
|
|
2942
3100
|
*/
|
|
2943
|
-
projectsOverview(cancelToken?: CancellationToken$
|
|
3101
|
+
projectsOverview(cancelToken?: CancellationToken$1): Promise<LayoutedProjectsView$1>;
|
|
2944
3102
|
/**
|
|
2945
3103
|
* Returns {@link LikeC4Model} of the specified project, with computed views {@link ComputedView}
|
|
2946
3104
|
* Not ready for rendering, but enough to traverse model. Much faster than {@link layoutedModel}
|
|
2947
3105
|
*
|
|
2948
3106
|
* If no {@link project} is specified, returns for default project
|
|
2949
3107
|
*/
|
|
2950
|
-
computedModel(project?: ProjectId | undefined, cancelToken?: CancellationToken$
|
|
3108
|
+
computedModel(project?: ProjectId | undefined, cancelToken?: CancellationToken$1): Promise<LikeC4Model<UnknownComputed>>;
|
|
2951
3109
|
/**
|
|
2952
3110
|
* Returns {@link LikeC4Model} of the specified project, with layouted views {@link LayoutedView}
|
|
2953
3111
|
* Ready for rendering. Applies manual layouts if available.
|
|
2954
3112
|
*
|
|
2955
3113
|
* If no {@link project} is specified, returns for default project
|
|
2956
3114
|
*/
|
|
2957
|
-
layoutedModel(project?: ProjectId | undefined, cancelToken?: CancellationToken$
|
|
3115
|
+
layoutedModel(project?: ProjectId | undefined, cancelToken?: CancellationToken$1): Promise<LikeC4Model<UnknownLayouted>>;
|
|
2958
3116
|
/**
|
|
2959
3117
|
* Returns diagrams (i.e. layouted views {@link LayoutedView}) for the specified project
|
|
2960
3118
|
* Applies manual layouts if available.
|
|
2961
3119
|
*
|
|
2962
3120
|
* If no {@link project} is specified, returns diagrams for default project
|
|
2963
3121
|
*/
|
|
2964
|
-
diagrams(project?: ProjectId | undefined, cancelToken?: CancellationToken$
|
|
3122
|
+
diagrams(project?: ProjectId | undefined, cancelToken?: CancellationToken$1): Promise<LayoutedView[]>;
|
|
2965
3123
|
getErrors(): Array<{
|
|
2966
3124
|
message: string;
|
|
2967
3125
|
line: number;
|
|
@@ -3039,15 +3197,41 @@ declare class LikeC4DocumentSymbolProvider implements DocumentSymbolProvider {
|
|
|
3039
3197
|
}
|
|
3040
3198
|
//#endregion
|
|
3041
3199
|
//#region src/lsp/HoverProvider.d.ts
|
|
3200
|
+
/**
|
|
3201
|
+
* Provides hover content for LikeC4 AST nodes (elements, tags, relations, etc.)
|
|
3202
|
+
* in the language server. Resolves model references and formats markdown hover text.
|
|
3203
|
+
*/
|
|
3042
3204
|
declare class LikeC4HoverProvider extends AstNodeHoverProvider {
|
|
3043
3205
|
protected services: LikeC4Services;
|
|
3044
3206
|
private parser;
|
|
3045
3207
|
private locator;
|
|
3208
|
+
/** @param services - LikeC4 language services (parser, locator, etc.) */
|
|
3046
3209
|
constructor(services: LikeC4Services);
|
|
3047
3210
|
protected getAstNodeHoverContent(node: AstNode): MaybePromise<Hover | undefined>;
|
|
3211
|
+
/**
|
|
3212
|
+
* Builds hover content for an element node (title, summary, model details and view links).
|
|
3213
|
+
* @param node - The element AST node to generate hover content for.
|
|
3214
|
+
* @returns Hover information with markdown content, or undefined if element not found.
|
|
3215
|
+
*/
|
|
3048
3216
|
protected getElementHover(node: Element): MaybePromise<Hover | undefined>;
|
|
3217
|
+
/**
|
|
3218
|
+
* Builds markdown hover content for an element model (relationship counts and links to views).
|
|
3219
|
+
* @param model - The element model containing relationship and view information.
|
|
3220
|
+
* @param projectId - The project identifier for constructing view links.
|
|
3221
|
+
* @returns Markdown string with model details, or undefined if no details available.
|
|
3222
|
+
*/
|
|
3049
3223
|
protected getElementModelHover(model: ElementModel, projectId: ProjectId): string | undefined;
|
|
3224
|
+
/**
|
|
3225
|
+
* Builds hover content for a deployment node (id, title, kind, summary).
|
|
3226
|
+
* @param node - The deployment node AST node to generate hover content for.
|
|
3227
|
+
* @returns Hover information with markdown content.
|
|
3228
|
+
*/
|
|
3050
3229
|
protected getDeploymentNodeHover(node: DeploymentNode): MaybePromise<Hover | undefined>;
|
|
3230
|
+
/**
|
|
3231
|
+
* Builds hover content for a deployed instance (instance id, element ref, title and kind).
|
|
3232
|
+
* @param node - The deployed instance AST node to generate hover content for.
|
|
3233
|
+
* @returns Hover information with markdown content showing instance details.
|
|
3234
|
+
*/
|
|
3051
3235
|
protected getDeployedInstanceHover(node: DeployedInstance): MaybePromise<Hover | undefined>;
|
|
3052
3236
|
}
|
|
3053
3237
|
//#endregion
|
|
@@ -3069,10 +3253,6 @@ declare class LikeC4SemanticTokenProvider extends AbstractSemanticTokenProvider
|
|
|
3069
3253
|
private rules;
|
|
3070
3254
|
constructor(services: LikeC4Services);
|
|
3071
3255
|
protected initRules(): void;
|
|
3072
|
-
semanticHighlight(document: LangiumDocument, params: SemanticTokensParams, cancelToken?: CancellationToken$1): Promise<SemanticTokens>;
|
|
3073
|
-
semanticHighlightRange(document: LangiumDocument, params: SemanticTokensRangeParams, cancelToken?: CancellationToken$1): Promise<SemanticTokens>;
|
|
3074
|
-
semanticHighlightDelta(document: LangiumDocument, params: SemanticTokensDeltaParams, cancelToken?: CancellationToken$1): Promise<SemanticTokens | SemanticTokensDelta>;
|
|
3075
|
-
protected ensureState(document: LangiumDocument, cancelToken: CancellationToken$1): Promise<void>;
|
|
3076
3256
|
protected highlightElement(node: AstNode, acceptor: SemanticTokenAcceptor): void | undefined | 'prune';
|
|
3077
3257
|
private highlightNameAndKind;
|
|
3078
3258
|
private highlightView;
|
|
@@ -3104,4 +3284,126 @@ declare class NodeKindProvider$1 implements NodeKindProvider {
|
|
|
3104
3284
|
//#region src/shared/WorkspaceSymbolProvider.d.ts
|
|
3105
3285
|
declare class WorkspaceSymbolProvider extends DefaultWorkspaceSymbolProvider {}
|
|
3106
3286
|
//#endregion
|
|
3107
|
-
|
|
3287
|
+
//#region src/module.d.ts
|
|
3288
|
+
interface LikeC4AddedSharedServices {
|
|
3289
|
+
lsp: {
|
|
3290
|
+
NodeKindProvider: NodeKindProvider$1;
|
|
3291
|
+
WorkspaceSymbolProvider: WorkspaceSymbolProvider;
|
|
3292
|
+
};
|
|
3293
|
+
workspace: {
|
|
3294
|
+
Cache: WorkspaceCache<string, any>;
|
|
3295
|
+
ProjectsManager: ProjectsManager;
|
|
3296
|
+
IndexManager: IndexManager;
|
|
3297
|
+
LangiumDocuments: LangiumDocuments;
|
|
3298
|
+
WorkspaceManager: LikeC4WorkspaceManager;
|
|
3299
|
+
FileSystemProvider: FileSystemProvider$1;
|
|
3300
|
+
FileSystemWatcher: FileSystemWatcher;
|
|
3301
|
+
ManualLayouts: LikeC4ManualLayouts;
|
|
3302
|
+
};
|
|
3303
|
+
}
|
|
3304
|
+
type LikeC4SharedServices = LangiumSharedServices & LikeC4AddedSharedServices;
|
|
3305
|
+
type LikeC4SharedModuleContext = Omit<DefaultSharedModuleContext, 'fileSystemProvider'> & FileSystemModuleContext & LikeC4ManualLayoutsModuleContext;
|
|
3306
|
+
/**
|
|
3307
|
+
* Declaration of custom services - add your own service classes here.
|
|
3308
|
+
*/
|
|
3309
|
+
interface LikeC4AddedServices {
|
|
3310
|
+
documentation: {
|
|
3311
|
+
DocumentationProvider: LikeC4DocumentationProvider;
|
|
3312
|
+
};
|
|
3313
|
+
validation: {
|
|
3314
|
+
DocumentValidator: LikeC4DocumentValidator;
|
|
3315
|
+
};
|
|
3316
|
+
Rpc: Rpc;
|
|
3317
|
+
mcp: {
|
|
3318
|
+
Server: LikeC4MCPServer;
|
|
3319
|
+
ServerFactory: LikeC4MCPServerFactory;
|
|
3320
|
+
};
|
|
3321
|
+
likec4: {
|
|
3322
|
+
LanguageServices: LikeC4LanguageServices;
|
|
3323
|
+
Views: LikeC4Views;
|
|
3324
|
+
Graphviz: GraphvizPort;
|
|
3325
|
+
Layouter: QueueGraphvizLayoter;
|
|
3326
|
+
DeploymentsIndex: DeploymentsIndex;
|
|
3327
|
+
FqnIndex: FqnIndex;
|
|
3328
|
+
ModelParser: LikeC4ModelParser;
|
|
3329
|
+
ModelBuilder: LikeC4ModelBuilder;
|
|
3330
|
+
ModelLocator: LikeC4ModelLocator;
|
|
3331
|
+
ModelChanges: LikeC4ModelChanges;
|
|
3332
|
+
LastSeen: LastSeenArtifacts;
|
|
3333
|
+
};
|
|
3334
|
+
lsp: {
|
|
3335
|
+
CompletionProvider: LikeC4CompletionProvider;
|
|
3336
|
+
DocumentHighlightProvider: LikeC4DocumentHighlightProvider;
|
|
3337
|
+
DocumentSymbolProvider: LikeC4DocumentSymbolProvider;
|
|
3338
|
+
SemanticTokenProvider: LikeC4SemanticTokenProvider;
|
|
3339
|
+
HoverProvider: LikeC4HoverProvider;
|
|
3340
|
+
CodeLensProvider: LikeC4CodeLensProvider;
|
|
3341
|
+
DocumentLinkProvider: LikeC4DocumentLinkProvider;
|
|
3342
|
+
Formatter: LikeC4Formatter;
|
|
3343
|
+
CodeActionProvider: LikeC4CodeActionProvider;
|
|
3344
|
+
};
|
|
3345
|
+
references: {
|
|
3346
|
+
NameProvider: LikeC4NameProvider;
|
|
3347
|
+
ScopeComputation: LikeC4ScopeComputation;
|
|
3348
|
+
ScopeProvider: LikeC4ScopeProvider;
|
|
3349
|
+
};
|
|
3350
|
+
shared?: LikeC4SharedServices;
|
|
3351
|
+
parser: {
|
|
3352
|
+
ValueConverter: LikeC4ValueConverter;
|
|
3353
|
+
};
|
|
3354
|
+
}
|
|
3355
|
+
type LikeC4Services = LangiumServices & LikeC4AddedServices;
|
|
3356
|
+
type LikeC4ServicesContext = LikeC4MCPServerModuleContext & LikeC4ViewsModuleContext;
|
|
3357
|
+
/**
|
|
3358
|
+
* Most probably you don't need to use this function directly.
|
|
3359
|
+
* Use {@link createLanguageServices} instead.
|
|
3360
|
+
* @internal
|
|
3361
|
+
*/
|
|
3362
|
+
declare function createLikeC4Module(context: LikeC4ServicesContext): Module<LikeC4Services, PartialLangiumServices & LikeC4AddedServices>;
|
|
3363
|
+
type LanguageServicesContext = LikeC4SharedModuleContext & LikeC4ServicesContext;
|
|
3364
|
+
/**
|
|
3365
|
+
* Create and initialize likec4 language services with the given context
|
|
3366
|
+
* @example
|
|
3367
|
+
* ```ts
|
|
3368
|
+
* const { shared, likec4 } = createLanguageServices({
|
|
3369
|
+
* ...WithFileSystem(enableWatcher = true),
|
|
3370
|
+
* ...WithLikeC4ManualLayouts(),
|
|
3371
|
+
* ...NoMcpServer(),
|
|
3372
|
+
* });
|
|
3373
|
+
* ```
|
|
3374
|
+
*
|
|
3375
|
+
* It is possible to extend/override the context with additional modules
|
|
3376
|
+
* See Langium documentation for more details (or at the CliContext in packages/likec4/src/language/module.ts).
|
|
3377
|
+
*/
|
|
3378
|
+
declare function createLanguageServices(): {
|
|
3379
|
+
shared: LikeC4SharedServices;
|
|
3380
|
+
likec4: LikeC4Services;
|
|
3381
|
+
};
|
|
3382
|
+
declare function createLanguageServices(context: Partial<LanguageServicesContext>): {
|
|
3383
|
+
shared: LikeC4SharedServices;
|
|
3384
|
+
likec4: LikeC4Services;
|
|
3385
|
+
};
|
|
3386
|
+
declare function createLanguageServices(context: Partial<LanguageServicesContext>): {
|
|
3387
|
+
shared: LikeC4SharedServices;
|
|
3388
|
+
likec4: LikeC4Services;
|
|
3389
|
+
};
|
|
3390
|
+
declare function createLanguageServices<I1, I extends I1 & LikeC4Services>(context: Partial<LanguageServicesContext>, module: Module<I, I1> | undefined): {
|
|
3391
|
+
shared: LikeC4SharedServices;
|
|
3392
|
+
likec4: I;
|
|
3393
|
+
};
|
|
3394
|
+
declare function createLanguageServices<I1, I2, I extends I1 & I2 & LikeC4Services>(context: Partial<LanguageServicesContext>, module: Module<I, I1>, module2: Module<I, I2>): {
|
|
3395
|
+
shared: LikeC4SharedServices;
|
|
3396
|
+
likec4: I;
|
|
3397
|
+
};
|
|
3398
|
+
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>): {
|
|
3399
|
+
shared: LikeC4SharedServices;
|
|
3400
|
+
likec4: I;
|
|
3401
|
+
};
|
|
3402
|
+
/**
|
|
3403
|
+
* Most probably you don't need to use this function directly.
|
|
3404
|
+
* Use {@link createLanguageServices} instead.
|
|
3405
|
+
* @internal
|
|
3406
|
+
*/
|
|
3407
|
+
declare function createSharedServices(context?: Partial<LanguageServicesContext>): LikeC4SharedServices;
|
|
3408
|
+
//#endregion
|
|
3409
|
+
export { LikeC4MCPServerModuleContext as A, FileSystemWatcher as B, ViewLocateResult as C, LangiumDocuments as D, LikeC4WorkspaceManager as E, NoFileSystemWatcher as F, Project as G, LikeC4ManualLayouts as H, NoLikeC4ManualLayouts as I, ProjectData as K, FileNode as L, WithChokidarWatcher as M, WithFileSystem as N, LikeC4MCPServer as O, NoFileSystem as P, FileSystemModuleContext as R, LikeC4ModelLocator as S, FqnIndex as T, LikeC4ManualLayoutsModuleContext as U, FileSystemWatcherModuleContext as V, ManualLayoutsSnapshot as W, WithGraphviz as _, LikeC4SharedModuleContext as a, WithMCPServer as b, createLikeC4Module as c, DocumentParser as d, LikeC4ModelParser as f, LikeC4ViewsModuleContext as g, configureLanguageServerLogger as h, LikeC4ServicesContext as i, WithLikeC4ManualLayouts as j, LikeC4MCPServerFactory as k, createSharedServices as l, ConfigureLanguageServerLoggerOptions as m, LikeC4AddedServices as n, LikeC4SharedServices as o, startLanguageServer$1 as p, ProjectsManager as q, LikeC4Services as r, createLanguageServices as s, LanguageServicesContext as t, LikeC4LanguageServices as u, WithWasmGraphviz as v, LikeC4ModelBuilder as w, NoMCPServer as x, LikeC4Views as y, FileSystemProvider$1 as z };
|