@likec4/language-server 1.56.0 → 1.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/LikeC4FileSystem.mjs +2 -2
- package/dist/_chunks/module.d.mts +448 -435
- package/dist/_chunks/module.mjs +34 -19
- package/dist/_chunks/protocol.d.mts +3 -1
- package/dist/_chunks/utils.mjs +1 -1
- package/dist/browser/index.d.mts +2 -2
- package/dist/browser/index.mjs +1 -1
- package/dist/filesystem/index.d.mts +1 -1
- package/dist/filesystem/index.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/module.d.mts +1 -1
- package/dist/module.mjs +1 -1
- package/package.json +28 -26
- package/src/test/testServices.ts +3 -2
|
@@ -18,6 +18,7 @@ import { Fqn as Fqn$1, GuardedBy, LayoutedView as LayoutedView$1, ProjectId as P
|
|
|
18
18
|
import { CancellationToken as CancellationToken$1 } from "vscode-jsonrpc";
|
|
19
19
|
import * as type_fest0 from "type-fest";
|
|
20
20
|
import { ConditionalPick, MergeExclusive, Simplify, Tagged, ValueOf, Writable } from "type-fest";
|
|
21
|
+
import { AILayoutHints } from "@likec4/layouts/ai";
|
|
21
22
|
|
|
22
23
|
//#region src/documentation/documentation-provider.d.ts
|
|
23
24
|
/**
|
|
@@ -40,335 +41,13 @@ declare class LikeC4DocumentationProvider extends JSDocDocumentationProvider {
|
|
|
40
41
|
getDocumentation(node: AstNode): string | undefined;
|
|
41
42
|
}
|
|
42
43
|
//#endregion
|
|
43
|
-
//#region src/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
type ProjectFolder = Tagged<string, 'ProjectFolder'>;
|
|
51
|
-
declare function ProjectFolder(folder: URI | string): ProjectFolder;
|
|
52
|
-
interface Project {
|
|
53
|
-
id: ProjectId$1;
|
|
54
|
-
folderUri: URI;
|
|
55
|
-
config: LikeC4ProjectConfig;
|
|
56
|
-
}
|
|
57
|
-
interface ProjectData extends Project {
|
|
58
|
-
id: ProjectId$1;
|
|
59
|
-
folder: ProjectFolder;
|
|
60
|
-
config: LikeC4ProjectConfig;
|
|
61
|
-
configUri: URI;
|
|
62
|
-
folderUri: URI;
|
|
63
|
-
exclude?: {
|
|
64
|
-
(test: string): boolean;
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Resolved include paths with both URI and folder string representations.
|
|
68
|
-
* These are additional directories that are part of this project.
|
|
69
|
-
*/
|
|
70
|
-
includePaths?: NonEmptyArray<{
|
|
71
|
-
uri: URI;
|
|
72
|
-
folder: ProjectFolder;
|
|
73
|
-
}>;
|
|
74
|
-
/**
|
|
75
|
-
* Normalized include configuration (paths, maxDepth, fileThreshold).
|
|
76
|
-
*/
|
|
77
|
-
includeConfig: IncludeConfig;
|
|
78
|
-
}
|
|
79
|
-
type RegisterProjectOptions = {
|
|
80
|
-
config: LikeC4ProjectConfig | LikeC4ProjectConfigInput;
|
|
81
|
-
} & ({
|
|
82
|
-
configUri: URI | string;
|
|
83
|
-
} | {
|
|
84
|
-
folderUri: URI | string;
|
|
85
|
-
});
|
|
86
|
-
declare class ProjectsManager {
|
|
87
|
-
#private;
|
|
88
|
-
protected services: LikeC4SharedServices;
|
|
89
|
-
/**
|
|
90
|
-
* The global project ID used for all documents
|
|
91
|
-
* that are not part of a specific project.
|
|
92
|
-
*/
|
|
93
|
-
static readonly DefaultProjectId: ProjectId$1;
|
|
94
|
-
constructor(services: LikeC4SharedServices);
|
|
95
|
-
/**
|
|
96
|
-
* Checks if a document is excluded by workspace-level patterns.
|
|
97
|
-
* These patterns come from VS Code settings and take precedence over project-level excludes.
|
|
98
|
-
*/
|
|
99
|
-
isExcludedByWorkspace(uri: NormalizedUri | URI): boolean;
|
|
100
|
-
/**
|
|
101
|
-
* Updates the workspace-level exclude patterns from VS Code settings.
|
|
102
|
-
* Called during initial server startup; dynamic changes restart the server.
|
|
103
|
-
*/
|
|
104
|
-
setWorkspaceExcludePatterns(patterns: string[] | undefined): void;
|
|
105
|
-
/**
|
|
106
|
-
* Returns:
|
|
107
|
-
* - configured default project ID if set
|
|
108
|
-
* - the default project ID if there are no projects.
|
|
109
|
-
* - the ID of the only project
|
|
110
|
-
* - undefined if there are multiple projects.
|
|
111
|
-
*/
|
|
112
|
-
get defaultProjectId(): ProjectId$1 | undefined;
|
|
113
|
-
set defaultProjectId(id: string | ProjectId$1 | undefined);
|
|
114
|
-
get default(): ProjectData;
|
|
115
|
-
get all(): NonEmptyReadonlyArray<ProjectId$1>;
|
|
116
|
-
getProject(arg: ProjectId$1 | LangiumDocument): ProjectData;
|
|
117
|
-
/**
|
|
118
|
-
* Returns all projects that overlap with the specified folder (is parent or child)
|
|
119
|
-
*/
|
|
120
|
-
findOverlaped(folder: URI | string): ReadonlyArray<ProjectData>;
|
|
121
|
-
/**
|
|
122
|
-
* Validates and ensures the project ID.
|
|
123
|
-
* If no project ID is specified, returns default project ID
|
|
124
|
-
* If there are multiple projects and default project is not set, throws an error
|
|
125
|
-
*/
|
|
126
|
-
ensureProjectId(projectId?: ProjectId$1 | undefined): ProjectId$1;
|
|
127
|
-
/**
|
|
128
|
-
* Validates and ensures the project data.
|
|
129
|
-
* If projectId is not specified, returns default project
|
|
130
|
-
*
|
|
131
|
-
* If there are multiple projects and default project is not set, throws an error
|
|
132
|
-
*
|
|
133
|
-
* @see ensureProjectId - to validate project ID only
|
|
134
|
-
*/
|
|
135
|
-
ensureProject(projectId?: ProjectId$1 | undefined): ProjectData;
|
|
136
|
-
hasMultipleProjects(): boolean;
|
|
137
|
-
/**
|
|
138
|
-
* Checks if given document (or URI) must be excluded from processing.
|
|
139
|
-
*/
|
|
140
|
-
isExcluded(document: DocOrUri): boolean;
|
|
141
|
-
/**
|
|
142
|
-
* Checks if given document (or URI) must be excluded in the context of the project.
|
|
143
|
-
*/
|
|
144
|
-
isExcluded(projectId: ProjectId$1, document: DocOrUri): boolean;
|
|
145
|
-
/**
|
|
146
|
-
* Checks if the specified document is included by the project:
|
|
147
|
-
* - if the document belongs to the project and is not excluded
|
|
148
|
-
* - if the document is included by the project
|
|
149
|
-
*/
|
|
150
|
-
isIncluded(projectId: ProjectId$1, document: LangiumDocument | URI | string): boolean;
|
|
151
|
-
/**
|
|
152
|
-
* Registers likec4 project by config file.
|
|
153
|
-
*/
|
|
154
|
-
registerConfigFile(configUri: URI, cancelToken?: Cancellation.CancellationToken): Promise<ProjectData>;
|
|
155
|
-
/**
|
|
156
|
-
* Registers (or reloads) likec4 project by config file or config object.
|
|
157
|
-
* If there is some project registered at same folder, it will be reloaded.
|
|
158
|
-
*/
|
|
159
|
-
registerProject(opts: RegisterProjectOptions, cancelToken?: Cancellation.CancellationToken): Promise<ProjectData>;
|
|
160
|
-
/**
|
|
161
|
-
* Determines which project the given document belongs to.
|
|
162
|
-
* If the document does not belong to any project, returns the default project ID.
|
|
163
|
-
*/
|
|
164
|
-
ownerProjectId(document: LangiumDocument | URI | string): ProjectId$1;
|
|
165
|
-
/**
|
|
166
|
-
* Returns path to the document relative to the project folder.
|
|
167
|
-
* If the document does not belong to any project, returns the document URI as string.
|
|
168
|
-
*/
|
|
169
|
-
relativePath(document: LangiumDocument | URI | string): string;
|
|
170
|
-
/**
|
|
171
|
-
* Returns true if the manager is currently initializing or reloading projects.
|
|
172
|
-
* This is used to prevent duplicate reload operations.
|
|
173
|
-
*/
|
|
174
|
-
protected get isInitiatingOrReloading(): boolean;
|
|
175
|
-
reloadProjects(cancelToken?: Cancellation.CancellationToken): Promise<void>;
|
|
176
|
-
protected _reloadProjects(cancelToken?: Cancellation.CancellationToken): Promise<void>;
|
|
177
|
-
protected uniqueProjectId(name: string): ProjectId$1;
|
|
178
|
-
protected resetCaches(): void;
|
|
179
|
-
rebuildProject(projectId: ProjectId$1, cancelToken?: Cancellation.CancellationToken): Promise<void>;
|
|
180
|
-
/**
|
|
181
|
-
* Returns all include paths from all projects.
|
|
182
|
-
* Used by WorkspaceManager to scan additional directories for C4 files.
|
|
183
|
-
*/
|
|
184
|
-
getAllIncludePaths(): Array<{
|
|
185
|
-
projectId: ProjectId$1;
|
|
186
|
-
includePath: URI;
|
|
187
|
-
includeConfig: IncludeConfig;
|
|
188
|
-
}>;
|
|
189
|
-
/**
|
|
190
|
-
* Register a listener to be called when the projects configuration has changed.
|
|
191
|
-
* @returns A disposable that can be used to unregister the callback.
|
|
192
|
-
*/
|
|
193
|
-
onProjectsUpdate(callback: () => void): Disposable;
|
|
194
|
-
private getWorkspaceFolder;
|
|
195
|
-
private notifyListeners;
|
|
196
|
-
private updateIncludesExcludes;
|
|
197
|
-
private warnIfConfigOverride;
|
|
198
|
-
}
|
|
199
|
-
//#endregion
|
|
200
|
-
//#region src/filesystem/types.d.ts
|
|
201
|
-
interface FileNode extends FileSystemNode {
|
|
202
|
-
readonly isFile: true;
|
|
203
|
-
readonly isDirectory: false;
|
|
204
|
-
}
|
|
205
|
-
interface FileSystemProvider$1 extends FileSystemProvider {
|
|
206
|
-
/**
|
|
207
|
-
* Scans the project files for the given URI.
|
|
208
|
-
* @returns The list of file system entries that are contained within the specified directory.
|
|
209
|
-
*/
|
|
210
|
-
scanProjectFiles(folderUri: URI): Promise<FileNode[]>;
|
|
211
|
-
/**
|
|
212
|
-
* Loads the project config from the given file.
|
|
213
|
-
* @returns The project config.
|
|
214
|
-
* @throws Error if the file does not exist or is not a valid project config.
|
|
215
|
-
*/
|
|
216
|
-
loadProjectConfig(filepath: URI): Promise<LikeC4ProjectConfig>;
|
|
217
|
-
/**
|
|
218
|
-
* Reads the directory and returns LikeC4 files.
|
|
219
|
-
*
|
|
220
|
-
* @param options.recursive If true, recursively reads the directory,
|
|
221
|
-
* @param options.maxDepth Maximum depth to traverse when recursive is true (default: Infinity)
|
|
222
|
-
*/
|
|
223
|
-
readDirectory(uri: URI, options?: {
|
|
224
|
-
recursive?: boolean;
|
|
225
|
-
maxDepth?: number;
|
|
226
|
-
}): Promise<FileNode[]>;
|
|
227
|
-
/**
|
|
228
|
-
* Finds all files in the given directory, matching the given filter.
|
|
229
|
-
*/
|
|
230
|
-
scanDirectory(directory: URI, filter: (filepath: string, isDirectory: boolean) => boolean): Promise<FileNode[]>;
|
|
231
|
-
/**
|
|
232
|
-
* Writes the content to the file system.
|
|
233
|
-
* Used by manual layouts.
|
|
234
|
-
*/
|
|
235
|
-
writeFile(uri: URI, content: string): Promise<void>;
|
|
236
|
-
/**
|
|
237
|
-
* Deletes the file from the file system.
|
|
238
|
-
* Used by manual layouts.
|
|
239
|
-
* @return true if the file was deleted, false if the file did not exist.
|
|
240
|
-
*/
|
|
241
|
-
deleteFile(uri: URI): Promise<boolean>;
|
|
242
|
-
}
|
|
243
|
-
interface FileSystemModuleContext extends FileSystemWatcherModuleContext {
|
|
244
|
-
fileSystemProvider: () => FileSystemProvider$1;
|
|
245
|
-
}
|
|
246
|
-
interface FileSystemWatcherModuleContext {
|
|
247
|
-
fileSystemWatcher: (services: LikeC4SharedServices) => FileSystemWatcher;
|
|
248
|
-
}
|
|
249
|
-
interface FileSystemWatcher extends AsyncDisposable {
|
|
250
|
-
/**
|
|
251
|
-
* Watches a folder for changes and triggers a reload of the documents and projects.
|
|
252
|
-
*/
|
|
253
|
-
watch(folder: string): void;
|
|
254
|
-
}
|
|
255
|
-
interface LikeC4ManualLayoutsModuleContext {
|
|
256
|
-
manualLayouts: (services: LikeC4SharedServices) => LikeC4ManualLayouts;
|
|
257
|
-
}
|
|
258
|
-
type ManualLayoutsSnapshot = {
|
|
259
|
-
hash: string;
|
|
260
|
-
views: Record<ViewId$1, LayoutedView$1>;
|
|
261
|
-
};
|
|
262
|
-
type ManualLayoutUpdateEvent = {
|
|
263
|
-
updated: URI;
|
|
264
|
-
projectId: ProjectId$1;
|
|
265
|
-
viewId: ViewId$1;
|
|
266
|
-
} | {
|
|
267
|
-
removed: URI;
|
|
268
|
-
projectId: ProjectId$1;
|
|
269
|
-
/**
|
|
270
|
-
* Missing if triggered by FS event (file was deleted)
|
|
271
|
-
*/
|
|
272
|
-
viewId?: ViewId$1;
|
|
273
|
-
};
|
|
274
|
-
type ManualLayoutUpdateListener = (event: ManualLayoutUpdateEvent) => void;
|
|
275
|
-
interface LikeC4ManualLayouts {
|
|
276
|
-
/**
|
|
277
|
-
* Reads a single layouted view from the file system by its URI.
|
|
278
|
-
* Used by the language server to get the current layout state.
|
|
279
|
-
*/
|
|
280
|
-
readSnapshot(uri: URI): Promise<LayoutedView$1 | null>;
|
|
281
|
-
read(project: Project): Promise<ManualLayoutsSnapshot | null>;
|
|
282
|
-
write(project: Project, layouted: LayoutedView$1): Promise<Location>;
|
|
283
|
-
remove(project: Project, view: ViewId$1): Promise<Location | null>;
|
|
284
|
-
clearCaches(): void;
|
|
285
|
-
/**
|
|
286
|
-
* Registers a listener for manual layout updates.
|
|
287
|
-
* The listener will be called when a manual layout is created, updated, or deleted.
|
|
288
|
-
*/
|
|
289
|
-
onManualLayoutUpdate(listener: ManualLayoutUpdateListener): Disposable;
|
|
290
|
-
/**
|
|
291
|
-
* Handles file system updates for manual layouts.
|
|
292
|
-
* Used by the file system watcher to notify the manual layouts module of changes.
|
|
293
|
-
* @param event The file system event
|
|
294
|
-
*/
|
|
295
|
-
handleFileSystemUpdate(event: {
|
|
296
|
-
update: URI;
|
|
297
|
-
delete?: never;
|
|
298
|
-
} | {
|
|
299
|
-
delete: URI;
|
|
300
|
-
update?: never;
|
|
301
|
-
}): Promise<void>;
|
|
302
|
-
}
|
|
303
|
-
//#endregion
|
|
304
|
-
//#region src/filesystem/noop.d.ts
|
|
305
|
-
declare const NoFileSystemWatcher: FileSystemWatcherModuleContext;
|
|
306
|
-
declare const NoFileSystem: FileSystemModuleContext;
|
|
307
|
-
declare const NoLikeC4ManualLayouts: LikeC4ManualLayoutsModuleContext;
|
|
308
|
-
//#endregion
|
|
309
|
-
//#region src/filesystem/LikeC4FileSystem.d.ts
|
|
310
|
-
declare const WithFileSystem: (enableWatcher?: boolean) => FileSystemModuleContext;
|
|
311
|
-
//#endregion
|
|
312
|
-
//#region src/filesystem/ChokidarWatcher.d.ts
|
|
313
|
-
declare const WithChokidarWatcher: FileSystemWatcherModuleContext;
|
|
314
|
-
//#endregion
|
|
315
|
-
//#region src/filesystem/LikeC4ManualLayouts.d.ts
|
|
316
|
-
declare const WithLikeC4ManualLayouts: LikeC4ManualLayoutsModuleContext;
|
|
317
|
-
//#endregion
|
|
318
|
-
//#region src/formatting/LikeC4Formatter.d.ts
|
|
319
|
-
type QuoteStyle = 'single' | 'double' | 'ignore' | 'auto';
|
|
320
|
-
interface LikeC4FormatterOptions {
|
|
321
|
-
quoteStyle: QuoteStyle;
|
|
322
|
-
}
|
|
323
|
-
type ExtendedFormattingCommandType = 'normalizeQuotes';
|
|
324
|
-
interface ExtendedFormattingCommand {
|
|
325
|
-
type: ExtendedFormattingCommandType;
|
|
326
|
-
region: FormattingRegion;
|
|
327
|
-
}
|
|
328
|
-
declare class LikeC4Formatter extends AbstractFormatter {
|
|
329
|
-
protected options: LikeC4FormatterOptions;
|
|
330
|
-
extendedFormattingCommands: ExtendedFormattingCommand[];
|
|
331
|
-
constructor(services: LikeC4Services);
|
|
332
|
-
protected doDocumentFormat(document: LangiumDocument, options: FormattingOptions, range?: Range): TextEdit[];
|
|
333
|
-
protected format(node: AstNode): void;
|
|
334
|
-
protected formatTags(node: AstNode): void;
|
|
335
|
-
protected formatDeploymentRelation(node: AstNode): void;
|
|
336
|
-
protected formatExtendDeployment(node: AstNode): void;
|
|
337
|
-
protected formatRelation(node: AstNode): void;
|
|
338
|
-
protected removeIndentFromTopLevelStatements(node: AstNode): void;
|
|
339
|
-
protected indentContentInBraces(node: AstNode): void;
|
|
340
|
-
protected appendKeywordsWithSpace(node: AstNode): void;
|
|
341
|
-
protected formatView(node: AstNode): void;
|
|
342
|
-
protected formatLeafProperty(node: AstNode): void;
|
|
343
|
-
protected formatLinkProperty(node: AstNode): void;
|
|
344
|
-
protected formatNavigateToProperty(node: AstNode): void;
|
|
345
|
-
protected formatAutolayoutProperty(node: AstNode): void;
|
|
346
|
-
protected formatMetadataProperty(node: AstNode): void;
|
|
347
|
-
protected formatElementDeclaration(node: AstNode): void;
|
|
348
|
-
protected formatExtendElement(node: AstNode): void;
|
|
349
|
-
protected formatGlobals(node: AstNode): void;
|
|
350
|
-
protected formatImports(node: AstNode): void;
|
|
351
|
-
protected formatSpecificationRule(node: AstNode): void;
|
|
352
|
-
protected formatWithPredicate(node: AstNode): void;
|
|
353
|
-
protected formatDeploymentNodeDeclaration(node: AstNode): void;
|
|
354
|
-
protected formatDeployedInstance(node: AstNode): void;
|
|
355
|
-
protected formatViewRuleGlobalStyle(node: AstNode): void;
|
|
356
|
-
protected formatViewRuleGlobalPredicate(node: AstNode): void;
|
|
357
|
-
protected formatViewRuleGroup(node: AstNode): void;
|
|
358
|
-
protected formatViewRuleStyle(node: AstNode): void;
|
|
359
|
-
protected formatWhereExpression(node: AstNode): void;
|
|
360
|
-
protected formatWhereRelationExpression(node: AstNode): void;
|
|
361
|
-
protected formatWhereElementExpression(node: AstNode): void;
|
|
362
|
-
protected formatIncludeExcludeExpressions(node: AstNode): void;
|
|
363
|
-
protected formatRelationExpression(node: AstNode): void;
|
|
364
|
-
private findPredicateExpressionRoot;
|
|
365
|
-
private on;
|
|
366
|
-
private doExtendedFormatting;
|
|
367
|
-
protected normalizeQuotes(node: AstNode): void;
|
|
368
|
-
private quotesNormalizerFactory;
|
|
369
|
-
private escapeQuotesInternalQuotes;
|
|
370
|
-
private getAutoQuoteStyle;
|
|
371
|
-
private onConfigurationUpdate;
|
|
44
|
+
//#region src/utils/disposable.d.ts
|
|
45
|
+
declare abstract class ADisposable implements Disposable {
|
|
46
|
+
protected toDispose: Disposable[];
|
|
47
|
+
protected isDisposed: boolean;
|
|
48
|
+
onDispose(...disposable: Disposable[]): void;
|
|
49
|
+
dispose(): void;
|
|
50
|
+
protected throwIfDisposed(): void;
|
|
372
51
|
}
|
|
373
52
|
//#endregion
|
|
374
53
|
//#region src/generated/ast.d.ts
|
|
@@ -383,7 +62,7 @@ type DeploymentElement = DeployedInstance | DeploymentNode;
|
|
|
383
62
|
declare const DeploymentElement = "DeploymentElement";
|
|
384
63
|
type DeploymentNodeOrElementKind = DeploymentNodeKind | ElementKind;
|
|
385
64
|
declare const DeploymentNodeOrElementKind = "DeploymentNodeOrElementKind";
|
|
386
|
-
type DeploymentViewRule = DeploymentViewRulePredicate | DeploymentViewRuleStyle | ViewRuleAutoLayout;
|
|
65
|
+
type DeploymentViewRule = DeploymentViewRulePredicate | DeploymentViewRuleStyle | ViewRuleAncestors | ViewRuleAutoLayout;
|
|
387
66
|
declare const DeploymentViewRule = "DeploymentViewRule";
|
|
388
67
|
type DynamicViewDisplayVariantValue = 'diagram' | 'sequence';
|
|
389
68
|
type DynamicViewProperty = DynamicViewDisplayVariantProperty | ViewProperty;
|
|
@@ -515,7 +194,7 @@ declare const CustomElementProperties = "CustomElementProperties";
|
|
|
515
194
|
interface CustomRelationProperties extends langium.AstNode {
|
|
516
195
|
readonly $container: AbstractDynamicStep | RelationExprWith;
|
|
517
196
|
readonly $type: 'CustomRelationProperties';
|
|
518
|
-
props: Array<NotationProperty | NotesProperty | RelationNavigateToProperty | RelationStringProperty | RelationshipStyleProperty>;
|
|
197
|
+
props: Array<MultipleProperty | NotationProperty | NotesProperty | RelationNavigateToProperty | RelationStringProperty | RelationshipStyleProperty>;
|
|
519
198
|
}
|
|
520
199
|
declare const CustomRelationProperties = "CustomRelationProperties";
|
|
521
200
|
interface DeployedInstance extends langium.AstNode {
|
|
@@ -653,9 +332,9 @@ interface DynamicViewIncludePredicate extends langium.AstNode {
|
|
|
653
332
|
}
|
|
654
333
|
declare const DynamicViewIncludePredicate = "DynamicViewIncludePredicate";
|
|
655
334
|
interface DynamicViewParallelSteps extends langium.AstNode {
|
|
656
|
-
readonly $container: DynamicViewBody;
|
|
335
|
+
readonly $container: DynamicViewBody | DynamicViewParallelSteps;
|
|
657
336
|
readonly $type: 'DynamicViewParallelSteps';
|
|
658
|
-
steps: Array<DynamicViewStep>;
|
|
337
|
+
steps: Array<DynamicViewParallelSteps | DynamicViewStep>;
|
|
659
338
|
}
|
|
660
339
|
declare const DynamicViewParallelSteps = "DynamicViewParallelSteps";
|
|
661
340
|
interface DynamicViewRef extends langium.AstNode {
|
|
@@ -994,7 +673,7 @@ interface MetadataAttribute extends langium.AstNode {
|
|
|
994
673
|
readonly $container: MetadataBody;
|
|
995
674
|
readonly $type: 'MetadataAttribute';
|
|
996
675
|
boolValue: boolean;
|
|
997
|
-
key:
|
|
676
|
+
key: Id;
|
|
998
677
|
value?: MetadataValue;
|
|
999
678
|
}
|
|
1000
679
|
declare const MetadataAttribute = "MetadataAttribute";
|
|
@@ -1028,7 +707,7 @@ interface ModelViews extends langium.AstNode {
|
|
|
1028
707
|
}
|
|
1029
708
|
declare const ModelViews = "ModelViews";
|
|
1030
709
|
interface MultipleProperty extends langium.AstNode {
|
|
1031
|
-
readonly $container: CustomElementProperties | DeploymentViewRuleStyle | ElementStyleProperty | GlobalStyle | ViewRuleStyle;
|
|
710
|
+
readonly $container: CustomElementProperties | CustomRelationProperties | DeploymentViewRuleStyle | ElementStyleProperty | GlobalStyle | SpecificationRelationshipKind | ViewRuleStyle;
|
|
1032
711
|
readonly $type: 'MultipleProperty';
|
|
1033
712
|
key: 'multiple';
|
|
1034
713
|
value: boolean;
|
|
@@ -1203,7 +882,7 @@ interface SpecificationRelationshipKind extends langium.AstNode {
|
|
|
1203
882
|
readonly $container: SpecificationRule;
|
|
1204
883
|
readonly $type: 'SpecificationRelationshipKind';
|
|
1205
884
|
kind: RelationshipKind;
|
|
1206
|
-
props: Array<RelationshipStyleProperty | SpecificationRelationshipStringProperty>;
|
|
885
|
+
props: Array<MultipleProperty | RelationshipStyleProperty | SpecificationRelationshipStringProperty>;
|
|
1207
886
|
}
|
|
1208
887
|
declare const SpecificationRelationshipKind = "SpecificationRelationshipKind";
|
|
1209
888
|
interface SpecificationRelationshipStringProperty extends langium.AstNode {
|
|
@@ -1277,6 +956,13 @@ interface ViewRef extends langium.AstNode {
|
|
|
1277
956
|
view: langium.Reference<LikeC4View>;
|
|
1278
957
|
}
|
|
1279
958
|
declare const ViewRef = "ViewRef";
|
|
959
|
+
interface ViewRuleAncestors extends langium.AstNode {
|
|
960
|
+
readonly $container: DeploymentViewBody;
|
|
961
|
+
readonly $type: 'ViewRuleAncestors';
|
|
962
|
+
key: 'includeAncestors';
|
|
963
|
+
value: boolean;
|
|
964
|
+
}
|
|
965
|
+
declare const ViewRuleAncestors = "ViewRuleAncestors";
|
|
1280
966
|
interface ViewRuleAutoLayout extends langium.AstNode {
|
|
1281
967
|
readonly $container: DeploymentViewBody | DynamicViewBody | ElementViewBody;
|
|
1282
968
|
readonly $type: 'ViewRuleAutoLayout';
|
|
@@ -1594,6 +1280,7 @@ type LikeC4AstType = {
|
|
|
1594
1280
|
ViewProperty: ViewProperty;
|
|
1595
1281
|
ViewRef: ViewRef;
|
|
1596
1282
|
ViewRule: ViewRule;
|
|
1283
|
+
ViewRuleAncestors: ViewRuleAncestors;
|
|
1597
1284
|
ViewRuleAutoLayout: ViewRuleAutoLayout;
|
|
1598
1285
|
ViewRuleGlobalPredicateRef: ViewRuleGlobalPredicateRef;
|
|
1599
1286
|
ViewRuleGlobalStyle: ViewRuleGlobalStyle;
|
|
@@ -1703,6 +1390,7 @@ interface ParsedAstSpecification {
|
|
|
1703
1390
|
line?: c4.RelationshipLineType;
|
|
1704
1391
|
head?: c4.RelationshipArrowType;
|
|
1705
1392
|
tail?: c4.RelationshipArrowType;
|
|
1393
|
+
multiple?: boolean;
|
|
1706
1394
|
}>;
|
|
1707
1395
|
colors: Record<c4.CustomColor, {
|
|
1708
1396
|
color: c4.ColorLiteral;
|
|
@@ -1742,95 +1430,426 @@ interface ParsedAstExtendRelation {
|
|
|
1742
1430
|
[key: string]: string | string[];
|
|
1743
1431
|
};
|
|
1744
1432
|
}
|
|
1745
|
-
interface ParsedAstRelation {
|
|
1746
|
-
id: c4.RelationId;
|
|
1747
|
-
astPath: string;
|
|
1748
|
-
source: c4.FqnRef.ModelRef;
|
|
1749
|
-
target: c4.FqnRef.ModelRef;
|
|
1750
|
-
kind?: c4.RelationshipKind;
|
|
1751
|
-
tags?: c4.NonEmptyArray<c4.Tag>;
|
|
1752
|
-
title: string;
|
|
1753
|
-
description?: c4.MarkdownOrString;
|
|
1754
|
-
technology?: string;
|
|
1755
|
-
color?: c4.Color;
|
|
1756
|
-
line?: c4.RelationshipLineType;
|
|
1757
|
-
head?: c4.RelationshipArrowType;
|
|
1758
|
-
tail?: c4.RelationshipArrowType;
|
|
1759
|
-
links?: c4.NonEmptyArray<c4.Link>;
|
|
1760
|
-
navigateTo?: c4.ViewId;
|
|
1761
|
-
metadata?: {
|
|
1762
|
-
[key: string]: string | string[];
|
|
1763
|
-
};
|
|
1433
|
+
interface ParsedAstRelation {
|
|
1434
|
+
id: c4.RelationId;
|
|
1435
|
+
astPath: string;
|
|
1436
|
+
source: c4.FqnRef.ModelRef;
|
|
1437
|
+
target: c4.FqnRef.ModelRef;
|
|
1438
|
+
kind?: c4.RelationshipKind;
|
|
1439
|
+
tags?: c4.NonEmptyArray<c4.Tag>;
|
|
1440
|
+
title: string;
|
|
1441
|
+
description?: c4.MarkdownOrString;
|
|
1442
|
+
technology?: string;
|
|
1443
|
+
color?: c4.Color;
|
|
1444
|
+
line?: c4.RelationshipLineType;
|
|
1445
|
+
head?: c4.RelationshipArrowType;
|
|
1446
|
+
tail?: c4.RelationshipArrowType;
|
|
1447
|
+
links?: c4.NonEmptyArray<c4.Link>;
|
|
1448
|
+
navigateTo?: c4.ViewId;
|
|
1449
|
+
metadata?: {
|
|
1450
|
+
[key: string]: string | string[];
|
|
1451
|
+
};
|
|
1452
|
+
}
|
|
1453
|
+
type ParsedAstDeployment = Simplify<MergeExclusive<ParsedAstDeployment.Node, ParsedAstDeployment.Instance>>;
|
|
1454
|
+
declare namespace ParsedAstDeployment {
|
|
1455
|
+
type Node = c4.DeploymentNode;
|
|
1456
|
+
type Instance = Omit<c4.DeployedInstance, 'element'> & {
|
|
1457
|
+
readonly element: c4.FqnRef.ModelRef;
|
|
1458
|
+
};
|
|
1459
|
+
}
|
|
1460
|
+
type ParsedAstDeploymentRelation = c4.DeploymentRelationship & {
|
|
1461
|
+
astPath: string;
|
|
1462
|
+
};
|
|
1463
|
+
type ParsedAstGlobals = Writable<c4.ModelGlobals>;
|
|
1464
|
+
interface ParsedAstElementView {
|
|
1465
|
+
id: c4.ViewId;
|
|
1466
|
+
viewOf?: c4.Fqn;
|
|
1467
|
+
extends?: c4.ViewId;
|
|
1468
|
+
astPath: string;
|
|
1469
|
+
title: string | null;
|
|
1470
|
+
description: c4.MarkdownOrString | null;
|
|
1471
|
+
tags: c4.NonEmptyArray<c4.Tag> | null;
|
|
1472
|
+
links: c4.NonEmptyArray<c4.Link> | null;
|
|
1473
|
+
rules: c4.ElementViewRule[];
|
|
1474
|
+
}
|
|
1475
|
+
interface ParsedAstDynamicView {
|
|
1476
|
+
id: c4.ViewId;
|
|
1477
|
+
astPath: string;
|
|
1478
|
+
title: string | null;
|
|
1479
|
+
description: c4.MarkdownOrString | null;
|
|
1480
|
+
tags: c4.NonEmptyArray<c4.Tag> | null;
|
|
1481
|
+
links: c4.NonEmptyArray<c4.Link> | null;
|
|
1482
|
+
steps: c4.DynamicViewStep[];
|
|
1483
|
+
rules: Array<c4.DynamicViewRule>;
|
|
1484
|
+
variant: c4.DynamicViewDisplayVariant | undefined;
|
|
1485
|
+
}
|
|
1486
|
+
interface ParsedAstDeploymentView {
|
|
1487
|
+
id: c4.ViewId;
|
|
1488
|
+
astPath: string;
|
|
1489
|
+
title: string | null;
|
|
1490
|
+
description: c4.MarkdownOrString | null;
|
|
1491
|
+
tags: c4.NonEmptyArray<c4.Tag> | null;
|
|
1492
|
+
links: c4.NonEmptyArray<c4.Link> | null;
|
|
1493
|
+
rules: Array<c4.DeploymentViewRule>;
|
|
1494
|
+
}
|
|
1495
|
+
type ParsedAstView = ParsedAstElementView | ParsedAstDynamicView | ParsedAstDeploymentView;
|
|
1496
|
+
interface AstNodeDescriptionWithFqn extends AstNodeDescription {
|
|
1497
|
+
likec4ProjectId: c4.ProjectId;
|
|
1498
|
+
id: c4.Fqn;
|
|
1499
|
+
}
|
|
1500
|
+
type LikeC4AstNode = ValueOf<ConditionalPick<LikeC4AstType, AstNode>>;
|
|
1501
|
+
type LikeC4DocumentDiagnostic = Diagnostic & DiagnosticInfo<LikeC4AstNode>;
|
|
1502
|
+
interface LikeC4DocumentProps {
|
|
1503
|
+
diagnostics?: Array<LikeC4DocumentDiagnostic>;
|
|
1504
|
+
c4Specification?: ParsedAstSpecification;
|
|
1505
|
+
c4Elements?: ParsedAstElement[];
|
|
1506
|
+
c4ExtendElements?: ParsedAstExtend[];
|
|
1507
|
+
c4ExtendDeployments?: ParsedAstExtend[];
|
|
1508
|
+
c4ExtendRelations?: ParsedAstExtendRelation[];
|
|
1509
|
+
c4Relations?: ParsedAstRelation[];
|
|
1510
|
+
c4Globals?: ParsedAstGlobals;
|
|
1511
|
+
c4Views?: ParsedAstView[];
|
|
1512
|
+
c4Deployments?: ParsedAstDeployment[];
|
|
1513
|
+
c4DeploymentRelations?: ParsedAstDeploymentRelation[];
|
|
1514
|
+
c4Imports?: MultiMap<c4.ProjectId, c4.Fqn, Set<c4.Fqn>>;
|
|
1515
|
+
}
|
|
1516
|
+
type LikeC4GrammarDocument = Omit<LangiumDocument<LikeC4Grammar>, 'diagnostics'>;
|
|
1517
|
+
interface LikeC4LangiumDocument extends LikeC4GrammarDocument, LikeC4DocumentProps {
|
|
1518
|
+
likec4ProjectId: c4.ProjectId;
|
|
1519
|
+
}
|
|
1520
|
+
interface ParsedLikeC4LangiumDocument extends LikeC4GrammarDocument, Required<LikeC4DocumentProps> {
|
|
1521
|
+
likec4ProjectId: c4.ProjectId;
|
|
1522
|
+
}
|
|
1523
|
+
//#endregion
|
|
1524
|
+
//#region src/workspace/ProjectsManager.d.ts
|
|
1525
|
+
type NormalizedUri = Tagged<string, 'NormalizedUri'>;
|
|
1526
|
+
type DocOrUri = LangiumDocument | string | URI;
|
|
1527
|
+
/**
|
|
1528
|
+
* A tagged string that represents a project folder URI (with trailing slash).
|
|
1529
|
+
* Used in `startsWith` checks to determine if a document belongs to a project.
|
|
1530
|
+
*/
|
|
1531
|
+
type ProjectFolder = Tagged<string, 'ProjectFolder'>;
|
|
1532
|
+
declare function ProjectFolder(folder: URI | string): ProjectFolder;
|
|
1533
|
+
interface Project {
|
|
1534
|
+
id: ProjectId$1;
|
|
1535
|
+
folderUri: URI;
|
|
1536
|
+
config: LikeC4ProjectConfig;
|
|
1537
|
+
}
|
|
1538
|
+
interface ProjectData extends Project {
|
|
1539
|
+
id: ProjectId$1;
|
|
1540
|
+
folder: ProjectFolder;
|
|
1541
|
+
config: LikeC4ProjectConfig;
|
|
1542
|
+
configUri: URI;
|
|
1543
|
+
folderUri: URI;
|
|
1544
|
+
exclude?: {
|
|
1545
|
+
(test: string): boolean;
|
|
1546
|
+
};
|
|
1547
|
+
/**
|
|
1548
|
+
* Resolved include paths with both URI and folder string representations.
|
|
1549
|
+
* These are additional directories that are part of this project.
|
|
1550
|
+
*/
|
|
1551
|
+
includePaths?: NonEmptyArray<{
|
|
1552
|
+
uri: URI;
|
|
1553
|
+
folder: ProjectFolder;
|
|
1554
|
+
}>;
|
|
1555
|
+
/**
|
|
1556
|
+
* Normalized include configuration (paths, maxDepth, fileThreshold).
|
|
1557
|
+
*/
|
|
1558
|
+
includeConfig: IncludeConfig;
|
|
1559
|
+
}
|
|
1560
|
+
type RegisterProjectOptions = {
|
|
1561
|
+
config: LikeC4ProjectConfig | LikeC4ProjectConfigInput;
|
|
1562
|
+
} & ({
|
|
1563
|
+
configUri: URI | string;
|
|
1564
|
+
} | {
|
|
1565
|
+
folderUri: URI | string;
|
|
1566
|
+
});
|
|
1567
|
+
declare class ProjectsManager extends ADisposable {
|
|
1568
|
+
#private;
|
|
1569
|
+
protected services: LikeC4SharedServices;
|
|
1570
|
+
/**
|
|
1571
|
+
* The global project ID used for all documents
|
|
1572
|
+
* that are not part of a specific project.
|
|
1573
|
+
*/
|
|
1574
|
+
static readonly DefaultProjectId: ProjectId$1;
|
|
1575
|
+
constructor(services: LikeC4SharedServices);
|
|
1576
|
+
/**
|
|
1577
|
+
* Checks if a document is excluded by workspace-level patterns.
|
|
1578
|
+
* These patterns come from VS Code settings and take precedence over project-level excludes.
|
|
1579
|
+
*/
|
|
1580
|
+
isExcludedByWorkspace(uri: NormalizedUri | URI): boolean;
|
|
1581
|
+
/**
|
|
1582
|
+
* Updates the workspace-level exclude patterns from VS Code settings.
|
|
1583
|
+
* Called during initial server startup; dynamic changes restart the server.
|
|
1584
|
+
*/
|
|
1585
|
+
setWorkspaceExcludePatterns(patterns: string[] | undefined): void;
|
|
1586
|
+
/**
|
|
1587
|
+
* Returns:
|
|
1588
|
+
* - configured default project ID if set
|
|
1589
|
+
* - the default project ID if there are no projects.
|
|
1590
|
+
* - the ID of the only project
|
|
1591
|
+
* - undefined if there are multiple projects.
|
|
1592
|
+
*/
|
|
1593
|
+
get defaultProjectId(): ProjectId$1 | undefined;
|
|
1594
|
+
set defaultProjectId(id: string | ProjectId$1 | undefined);
|
|
1595
|
+
get default(): ProjectData;
|
|
1596
|
+
get all(): NonEmptyReadonlyArray<ProjectId$1>;
|
|
1597
|
+
getProject(arg: ProjectId$1 | LangiumDocument): ProjectData;
|
|
1598
|
+
/**
|
|
1599
|
+
* Returns all projects that overlap with the specified folder (is parent or child)
|
|
1600
|
+
*/
|
|
1601
|
+
findOverlaped(folder: URI | string): ReadonlyArray<ProjectData>;
|
|
1602
|
+
/**
|
|
1603
|
+
* Validates and ensures the project ID.
|
|
1604
|
+
* If no project ID is specified, returns default project ID
|
|
1605
|
+
* If there are multiple projects and default project is not set, throws an error
|
|
1606
|
+
*/
|
|
1607
|
+
ensureProjectId(projectId?: ProjectId$1 | undefined): ProjectId$1;
|
|
1608
|
+
/**
|
|
1609
|
+
* Validates and ensures the project data.
|
|
1610
|
+
* If projectId is not specified, returns default project
|
|
1611
|
+
*
|
|
1612
|
+
* If there are multiple projects and default project is not set, throws an error
|
|
1613
|
+
*
|
|
1614
|
+
* @see ensureProjectId - to validate project ID only
|
|
1615
|
+
*/
|
|
1616
|
+
ensureProject(projectId?: ProjectId$1 | undefined): ProjectData;
|
|
1617
|
+
hasMultipleProjects(): boolean;
|
|
1618
|
+
/**
|
|
1619
|
+
* Checks if given document (or URI) must be excluded from processing.
|
|
1620
|
+
*/
|
|
1621
|
+
isExcluded(document: DocOrUri): boolean;
|
|
1622
|
+
/**
|
|
1623
|
+
* Checks if given document (or URI) must be excluded in the context of the project.
|
|
1624
|
+
*/
|
|
1625
|
+
isExcluded(projectId: ProjectId$1, document: DocOrUri): boolean;
|
|
1626
|
+
/**
|
|
1627
|
+
* Checks if the specified document is included by the project:
|
|
1628
|
+
* - if the document belongs to the project and is not excluded
|
|
1629
|
+
* - if the document is included by the project
|
|
1630
|
+
*/
|
|
1631
|
+
isIncluded(projectId: ProjectId$1, document: LangiumDocument | URI | string): boolean;
|
|
1632
|
+
/**
|
|
1633
|
+
* Registers likec4 project by config file.
|
|
1634
|
+
*/
|
|
1635
|
+
registerConfigFile(configUri: URI, cancelToken?: Cancellation.CancellationToken): Promise<ProjectData>;
|
|
1636
|
+
/**
|
|
1637
|
+
* Registers (or reloads) likec4 project by config file or config object.
|
|
1638
|
+
* If there is some project registered at same folder, it will be reloaded.
|
|
1639
|
+
*/
|
|
1640
|
+
registerProject(opts: RegisterProjectOptions, cancelToken?: Cancellation.CancellationToken): Promise<ProjectData>;
|
|
1641
|
+
/**
|
|
1642
|
+
* Determines which project the given document belongs to.
|
|
1643
|
+
* If the document does not belong to any project, returns the default project ID.
|
|
1644
|
+
*/
|
|
1645
|
+
ownerProjectId(document: LangiumDocument | URI | string): ProjectId$1;
|
|
1646
|
+
/**
|
|
1647
|
+
* Returns path to the document relative to the project folder.
|
|
1648
|
+
* If the document does not belong to any project, returns the document URI as string.
|
|
1649
|
+
*/
|
|
1650
|
+
relativePath(document: LangiumDocument | URI | string): string;
|
|
1651
|
+
/**
|
|
1652
|
+
* Returns true if the manager is currently initializing or reloading projects.
|
|
1653
|
+
* This is used to prevent duplicate reload operations.
|
|
1654
|
+
*/
|
|
1655
|
+
protected get isInitiatingOrReloading(): boolean;
|
|
1656
|
+
reloadProjects(cancelToken?: Cancellation.CancellationToken): Promise<void>;
|
|
1657
|
+
protected _reloadProjects(cancelToken?: Cancellation.CancellationToken): Promise<void>;
|
|
1658
|
+
protected uniqueProjectId(name: string): ProjectId$1;
|
|
1659
|
+
protected resetCaches(): void;
|
|
1660
|
+
rebuildProject(projectId: ProjectId$1, cancelToken?: Cancellation.CancellationToken): Promise<void>;
|
|
1661
|
+
/**
|
|
1662
|
+
* Returns all include paths from all projects.
|
|
1663
|
+
* Used by WorkspaceManager to scan additional directories for C4 files.
|
|
1664
|
+
*/
|
|
1665
|
+
getAllIncludePaths(): Array<{
|
|
1666
|
+
projectId: ProjectId$1;
|
|
1667
|
+
includePath: URI;
|
|
1668
|
+
includeConfig: IncludeConfig;
|
|
1669
|
+
}>;
|
|
1670
|
+
/**
|
|
1671
|
+
* Register a listener to be called when the projects configuration has changed.
|
|
1672
|
+
* @returns A disposable that can be used to unregister the callback.
|
|
1673
|
+
*/
|
|
1674
|
+
onProjectsUpdate(callback: () => void): Disposable;
|
|
1675
|
+
private getWorkspaceFolder;
|
|
1676
|
+
private notifyListeners;
|
|
1677
|
+
private updateIncludesExcludes;
|
|
1678
|
+
private warnIfConfigOverride;
|
|
1679
|
+
}
|
|
1680
|
+
//#endregion
|
|
1681
|
+
//#region src/filesystem/types.d.ts
|
|
1682
|
+
interface FileNode extends FileSystemNode {
|
|
1683
|
+
readonly isFile: true;
|
|
1684
|
+
readonly isDirectory: false;
|
|
1764
1685
|
}
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1686
|
+
interface FileSystemProvider$1 extends FileSystemProvider {
|
|
1687
|
+
/**
|
|
1688
|
+
* Scans the project files for the given URI.
|
|
1689
|
+
* @returns The list of file system entries that are contained within the specified directory.
|
|
1690
|
+
*/
|
|
1691
|
+
scanProjectFiles(folderUri: URI): Promise<FileNode[]>;
|
|
1692
|
+
/**
|
|
1693
|
+
* Loads the project config from the given file.
|
|
1694
|
+
* @returns The project config.
|
|
1695
|
+
* @throws Error if the file does not exist or is not a valid project config.
|
|
1696
|
+
*/
|
|
1697
|
+
loadProjectConfig(filepath: URI): Promise<LikeC4ProjectConfig>;
|
|
1698
|
+
/**
|
|
1699
|
+
* Reads the directory and returns LikeC4 files.
|
|
1700
|
+
*
|
|
1701
|
+
* @param options.recursive If true, recursively reads the directory,
|
|
1702
|
+
* @param options.maxDepth Maximum depth to traverse when recursive is true (default: Infinity)
|
|
1703
|
+
*/
|
|
1704
|
+
readDirectory(uri: URI, options?: {
|
|
1705
|
+
recursive?: boolean;
|
|
1706
|
+
maxDepth?: number;
|
|
1707
|
+
}): Promise<FileNode[]>;
|
|
1708
|
+
/**
|
|
1709
|
+
* Finds all files in the given directory, matching the given filter.
|
|
1710
|
+
*/
|
|
1711
|
+
scanDirectory(directory: URI, filter: (filepath: string, isDirectory: boolean) => boolean): Promise<FileNode[]>;
|
|
1712
|
+
/**
|
|
1713
|
+
* Writes the content to the file system.
|
|
1714
|
+
* Used by manual layouts.
|
|
1715
|
+
*/
|
|
1716
|
+
writeFile(uri: URI, content: string): Promise<void>;
|
|
1717
|
+
/**
|
|
1718
|
+
* Deletes the file from the file system.
|
|
1719
|
+
* Used by manual layouts.
|
|
1720
|
+
* @return true if the file was deleted, false if the file did not exist.
|
|
1721
|
+
*/
|
|
1722
|
+
deleteFile(uri: URI): Promise<boolean>;
|
|
1771
1723
|
}
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
};
|
|
1775
|
-
type ParsedAstGlobals = Writable<c4.ModelGlobals>;
|
|
1776
|
-
interface ParsedAstElementView {
|
|
1777
|
-
id: c4.ViewId;
|
|
1778
|
-
viewOf?: c4.Fqn;
|
|
1779
|
-
extends?: c4.ViewId;
|
|
1780
|
-
astPath: string;
|
|
1781
|
-
title: string | null;
|
|
1782
|
-
description: c4.MarkdownOrString | null;
|
|
1783
|
-
tags: c4.NonEmptyArray<c4.Tag> | null;
|
|
1784
|
-
links: c4.NonEmptyArray<c4.Link> | null;
|
|
1785
|
-
rules: c4.ElementViewRule[];
|
|
1724
|
+
interface FileSystemModuleContext extends FileSystemWatcherModuleContext {
|
|
1725
|
+
fileSystemProvider: () => FileSystemProvider$1;
|
|
1786
1726
|
}
|
|
1787
|
-
interface
|
|
1788
|
-
|
|
1789
|
-
astPath: string;
|
|
1790
|
-
title: string | null;
|
|
1791
|
-
description: c4.MarkdownOrString | null;
|
|
1792
|
-
tags: c4.NonEmptyArray<c4.Tag> | null;
|
|
1793
|
-
links: c4.NonEmptyArray<c4.Link> | null;
|
|
1794
|
-
steps: c4.DynamicViewStep[];
|
|
1795
|
-
rules: Array<c4.DynamicViewRule>;
|
|
1796
|
-
variant: c4.DynamicViewDisplayVariant | undefined;
|
|
1727
|
+
interface FileSystemWatcherModuleContext {
|
|
1728
|
+
fileSystemWatcher: (services: LikeC4SharedServices) => FileSystemWatcher;
|
|
1797
1729
|
}
|
|
1798
|
-
interface
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
tags: c4.NonEmptyArray<c4.Tag> | null;
|
|
1804
|
-
links: c4.NonEmptyArray<c4.Link> | null;
|
|
1805
|
-
rules: Array<c4.DeploymentViewRule>;
|
|
1730
|
+
interface FileSystemWatcher extends AsyncDisposable {
|
|
1731
|
+
/**
|
|
1732
|
+
* Watches a folder for changes and triggers a reload of the documents and projects.
|
|
1733
|
+
*/
|
|
1734
|
+
watch(folder: string): void;
|
|
1806
1735
|
}
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
likec4ProjectId: c4.ProjectId;
|
|
1810
|
-
id: c4.Fqn;
|
|
1736
|
+
interface LikeC4ManualLayoutsModuleContext {
|
|
1737
|
+
manualLayouts: (services: LikeC4SharedServices) => LikeC4ManualLayouts;
|
|
1811
1738
|
}
|
|
1812
|
-
type
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1739
|
+
type ManualLayoutsSnapshot = {
|
|
1740
|
+
hash: string;
|
|
1741
|
+
views: Record<ViewId$1, LayoutedView$1>;
|
|
1742
|
+
};
|
|
1743
|
+
type ManualLayoutUpdateEvent = {
|
|
1744
|
+
updated: URI;
|
|
1745
|
+
projectId: ProjectId$1;
|
|
1746
|
+
viewId: ViewId$1;
|
|
1747
|
+
} | {
|
|
1748
|
+
removed: URI;
|
|
1749
|
+
projectId: ProjectId$1;
|
|
1750
|
+
/**
|
|
1751
|
+
* Missing if triggered by FS event (file was deleted)
|
|
1752
|
+
*/
|
|
1753
|
+
viewId?: ViewId$1;
|
|
1754
|
+
};
|
|
1755
|
+
type ManualLayoutUpdateListener = (event: ManualLayoutUpdateEvent) => void;
|
|
1756
|
+
interface LikeC4ManualLayouts extends Disposable {
|
|
1757
|
+
/**
|
|
1758
|
+
* Reads a single layouted view from the file system by its URI.
|
|
1759
|
+
* Used by the language server to get the current layout state.
|
|
1760
|
+
*/
|
|
1761
|
+
readSnapshot(uri: URI): Promise<LayoutedView$1 | null>;
|
|
1762
|
+
read(project: Project): Promise<ManualLayoutsSnapshot | null>;
|
|
1763
|
+
write(project: Project, layouted: LayoutedView$1): Promise<Location>;
|
|
1764
|
+
remove(project: Project, view: ViewId$1): Promise<Location | null>;
|
|
1765
|
+
clearCaches(): void;
|
|
1766
|
+
/**
|
|
1767
|
+
* Registers a listener for manual layout updates.
|
|
1768
|
+
* The listener will be called when a manual layout is created, updated, or deleted.
|
|
1769
|
+
*/
|
|
1770
|
+
onManualLayoutUpdate(listener: ManualLayoutUpdateListener): Disposable;
|
|
1771
|
+
/**
|
|
1772
|
+
* Handles file system updates for manual layouts.
|
|
1773
|
+
* Used by the file system watcher to notify the manual layouts module of changes.
|
|
1774
|
+
* @param event The file system event
|
|
1775
|
+
*/
|
|
1776
|
+
handleFileSystemUpdate(event: {
|
|
1777
|
+
update: URI;
|
|
1778
|
+
delete?: never;
|
|
1779
|
+
} | {
|
|
1780
|
+
delete: URI;
|
|
1781
|
+
update?: never;
|
|
1782
|
+
}): Promise<void>;
|
|
1827
1783
|
}
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1784
|
+
//#endregion
|
|
1785
|
+
//#region src/filesystem/noop.d.ts
|
|
1786
|
+
declare const NoFileSystemWatcher: FileSystemWatcherModuleContext;
|
|
1787
|
+
declare const NoFileSystem: FileSystemModuleContext;
|
|
1788
|
+
declare const NoLikeC4ManualLayouts: LikeC4ManualLayoutsModuleContext;
|
|
1789
|
+
//#endregion
|
|
1790
|
+
//#region src/filesystem/LikeC4FileSystem.d.ts
|
|
1791
|
+
declare const WithFileSystem: (enableWatcher?: boolean) => FileSystemModuleContext;
|
|
1792
|
+
//#endregion
|
|
1793
|
+
//#region src/filesystem/ChokidarWatcher.d.ts
|
|
1794
|
+
declare const WithChokidarWatcher: FileSystemWatcherModuleContext;
|
|
1795
|
+
//#endregion
|
|
1796
|
+
//#region src/filesystem/LikeC4ManualLayouts.d.ts
|
|
1797
|
+
declare const WithLikeC4ManualLayouts: LikeC4ManualLayoutsModuleContext;
|
|
1798
|
+
//#endregion
|
|
1799
|
+
//#region src/formatting/LikeC4Formatter.d.ts
|
|
1800
|
+
type QuoteStyle = 'single' | 'double' | 'ignore' | 'auto';
|
|
1801
|
+
interface LikeC4FormatterOptions {
|
|
1802
|
+
quoteStyle: QuoteStyle;
|
|
1831
1803
|
}
|
|
1832
|
-
|
|
1833
|
-
|
|
1804
|
+
type ExtendedFormattingCommandType = 'normalizeQuotes';
|
|
1805
|
+
interface ExtendedFormattingCommand {
|
|
1806
|
+
type: ExtendedFormattingCommandType;
|
|
1807
|
+
region: FormattingRegion;
|
|
1808
|
+
}
|
|
1809
|
+
declare class LikeC4Formatter extends AbstractFormatter {
|
|
1810
|
+
protected options: LikeC4FormatterOptions;
|
|
1811
|
+
extendedFormattingCommands: ExtendedFormattingCommand[];
|
|
1812
|
+
constructor(services: LikeC4Services);
|
|
1813
|
+
protected doDocumentFormat(document: LangiumDocument, options: FormattingOptions, range?: Range): TextEdit[];
|
|
1814
|
+
protected format(node: AstNode): void;
|
|
1815
|
+
protected formatTags(node: AstNode): void;
|
|
1816
|
+
protected formatDeploymentRelation(node: AstNode): void;
|
|
1817
|
+
protected formatExtendDeployment(node: AstNode): void;
|
|
1818
|
+
protected formatRelation(node: AstNode): void;
|
|
1819
|
+
protected removeIndentFromTopLevelStatements(node: AstNode): void;
|
|
1820
|
+
protected indentContentInBraces(node: AstNode): void;
|
|
1821
|
+
protected appendKeywordsWithSpace(node: AstNode): void;
|
|
1822
|
+
protected formatView(node: AstNode): void;
|
|
1823
|
+
protected formatLeafProperty(node: AstNode): void;
|
|
1824
|
+
protected formatLinkProperty(node: AstNode): void;
|
|
1825
|
+
protected formatNavigateToProperty(node: AstNode): void;
|
|
1826
|
+
protected formatAutolayoutProperty(node: AstNode): void;
|
|
1827
|
+
protected formatMetadataProperty(node: AstNode): void;
|
|
1828
|
+
protected formatElementDeclaration(node: AstNode): void;
|
|
1829
|
+
protected formatExtendElement(node: AstNode): void;
|
|
1830
|
+
protected formatGlobals(node: AstNode): void;
|
|
1831
|
+
protected formatImports(node: AstNode): void;
|
|
1832
|
+
protected formatSpecificationRule(node: AstNode): void;
|
|
1833
|
+
protected formatWithPredicate(node: AstNode): void;
|
|
1834
|
+
protected formatDeploymentNodeDeclaration(node: AstNode): void;
|
|
1835
|
+
protected formatDeployedInstance(node: AstNode): void;
|
|
1836
|
+
protected formatViewRuleGlobalStyle(node: AstNode): void;
|
|
1837
|
+
protected formatViewRuleGlobalPredicate(node: AstNode): void;
|
|
1838
|
+
protected formatViewRuleGroup(node: AstNode): void;
|
|
1839
|
+
protected formatViewRuleStyle(node: AstNode): void;
|
|
1840
|
+
protected formatWhereExpression(node: AstNode): void;
|
|
1841
|
+
protected formatWhereRelationExpression(node: AstNode): void;
|
|
1842
|
+
protected formatWhereElementExpression(node: AstNode): void;
|
|
1843
|
+
protected formatIncludeExcludeExpressions(node: AstNode): void;
|
|
1844
|
+
protected formatRelationExpression(node: AstNode): void;
|
|
1845
|
+
private findPredicateExpressionRoot;
|
|
1846
|
+
private on;
|
|
1847
|
+
private doExtendedFormatting;
|
|
1848
|
+
protected normalizeQuotes(node: AstNode): void;
|
|
1849
|
+
private quotesNormalizerFactory;
|
|
1850
|
+
private escapeQuotesInternalQuotes;
|
|
1851
|
+
private getAutoQuoteStyle;
|
|
1852
|
+
private onConfigurationUpdate;
|
|
1834
1853
|
}
|
|
1835
1854
|
//#endregion
|
|
1836
1855
|
//#region src/references/name-provider.d.ts
|
|
@@ -1987,15 +2006,6 @@ declare class LikeC4ScopeProvider extends DefaultScopeProvider {
|
|
|
1987
2006
|
protected getGlobalScope(referenceType: string, context: ReferenceInfo): Scope;
|
|
1988
2007
|
}
|
|
1989
2008
|
//#endregion
|
|
1990
|
-
//#region src/utils/disposable.d.ts
|
|
1991
|
-
declare abstract class ADisposable implements Disposable {
|
|
1992
|
-
protected toDispose: Disposable[];
|
|
1993
|
-
protected isDisposed: boolean;
|
|
1994
|
-
onDispose(...disposable: Disposable[]): void;
|
|
1995
|
-
dispose(): void;
|
|
1996
|
-
protected throwIfDisposed(): void;
|
|
1997
|
-
}
|
|
1998
|
-
//#endregion
|
|
1999
2009
|
//#region src/model/fqn-index.d.ts
|
|
2000
2010
|
declare class FqnIndex<AstNd = Element> extends ADisposable {
|
|
2001
2011
|
protected services: LikeC4Services;
|
|
@@ -2132,7 +2142,7 @@ declare class MergedSpecification {
|
|
|
2132
2142
|
* Provides access to "last seen artifacts" for a given project,
|
|
2133
2143
|
* (Results of the last successful parsing)
|
|
2134
2144
|
*/
|
|
2135
|
-
declare class LastSeenArtifacts {
|
|
2145
|
+
declare class LastSeenArtifacts extends ADisposable {
|
|
2136
2146
|
#private;
|
|
2137
2147
|
constructor(services: LikeC4Services);
|
|
2138
2148
|
/**
|
|
@@ -2267,9 +2277,10 @@ type LayoutViewParams = {
|
|
|
2267
2277
|
*/
|
|
2268
2278
|
layoutType?: LayoutType | undefined;
|
|
2269
2279
|
projectId?: ProjectId | undefined;
|
|
2270
|
-
cancelToken?: CancellationToken | undefined;
|
|
2280
|
+
cancelToken?: CancellationToken | undefined; /** Optional AI-generated layout hints */
|
|
2281
|
+
layoutHints?: AILayoutHints | undefined;
|
|
2271
2282
|
};
|
|
2272
|
-
interface LikeC4Views {
|
|
2283
|
+
interface LikeC4Views extends Disposable {
|
|
2273
2284
|
readonly layouter: GraphvizLayouter;
|
|
2274
2285
|
/**
|
|
2275
2286
|
* Returns computed views (i.e. views with predicates computed)
|
|
@@ -2285,10 +2296,12 @@ interface LikeC4Views {
|
|
|
2285
2296
|
layoutAllViews(projectId?: ProjectId | undefined, cancelToken?: CancellationToken): Promise<GraphvizOut[]>;
|
|
2286
2297
|
/**
|
|
2287
2298
|
* Layouts a view.
|
|
2288
|
-
* If layoutType is 'manual' - applies manual layout if any.
|
|
2289
|
-
* If layoutType is 'auto' - returns latest version with drifts from manual layout if any
|
|
2299
|
+
* If `layoutType` is 'manual' - applies manual layout if any.
|
|
2300
|
+
* If `layoutType` is 'auto' - returns latest version with drifts from manual layout if any
|
|
2290
2301
|
* If not specified - returns latest layout as is
|
|
2291
2302
|
*
|
|
2303
|
+
* If `layoutHints` are provided, they will be used, ignoring any manual snapshots, and the resulting layout will not be cached (i.e. it will be computed on every call)
|
|
2304
|
+
*
|
|
2292
2305
|
* If view not found in model, but there is a snapshot - it will be returned (with empty DOT)
|
|
2293
2306
|
*/
|
|
2294
2307
|
layoutView(params: LayoutViewParams): Promise<GraphvizOut | null>;
|
|
@@ -3134,7 +3147,7 @@ declare const DocumentParserFromMixins: {
|
|
|
3134
3147
|
};
|
|
3135
3148
|
} & typeof BaseParser;
|
|
3136
3149
|
declare class DocumentParser extends DocumentParserFromMixins {}
|
|
3137
|
-
declare class LikeC4ModelParser {
|
|
3150
|
+
declare class LikeC4ModelParser extends ADisposable {
|
|
3138
3151
|
private services;
|
|
3139
3152
|
protected cachedParsers: any;
|
|
3140
3153
|
constructor(services: LikeC4Services);
|
|
@@ -3160,7 +3173,7 @@ declare class LikeC4ModelChanges {
|
|
|
3160
3173
|
change
|
|
3161
3174
|
}: {
|
|
3162
3175
|
lookup: ViewLocateResult;
|
|
3163
|
-
change: Exclude<ViewChange, ViewChange.SaveViewSnapshot | ViewChange.ResetManualLayout>;
|
|
3176
|
+
change: Exclude<ViewChange, ViewChange.SaveViewSnapshot | ViewChange.ResetManualLayout | ViewChange.ChangeProperty>;
|
|
3164
3177
|
}): {
|
|
3165
3178
|
modifiedRange: Range;
|
|
3166
3179
|
edits: TextEdit[];
|
|
@@ -3319,7 +3332,7 @@ declare class LikeC4DocumentSymbolProvider implements DocumentSymbolProvider {
|
|
|
3319
3332
|
protected getSpecSymbol(astSpec: SpecificationRule): DocumentSymbol[];
|
|
3320
3333
|
protected getModelSymbol(astModel: Model): DocumentSymbol[];
|
|
3321
3334
|
protected getDeploymentModelSymbol(astModel: ModelDeployments): DocumentSymbol[];
|
|
3322
|
-
protected getElementsSymbol(el: Element | Relation | ExtendElement): DocumentSymbol[];
|
|
3335
|
+
protected getElementsSymbol(el: Element | Relation | ExtendElement, parentFqn?: string): DocumentSymbol[];
|
|
3323
3336
|
protected getExtendElementSymbol(astElement: ExtendElement): DocumentSymbol[];
|
|
3324
3337
|
protected getElementSymbol(astElement: Element): DocumentSymbol[];
|
|
3325
3338
|
protected getModelViewsSymbol(astViews: ModelViews): DocumentSymbol[];
|
|
@@ -3538,4 +3551,4 @@ declare function createLanguageServices<I1, I2, I3, I extends I1 & I2 & I3 & Lik
|
|
|
3538
3551
|
*/
|
|
3539
3552
|
declare function createSharedServices(context?: Partial<LanguageServicesContext>): LikeC4SharedServices;
|
|
3540
3553
|
//#endregion
|
|
3541
|
-
export {
|
|
3554
|
+
export { WithFileSystem as A, LikeC4ManualLayoutsModuleContext as B, ViewLocateResult as C, LangiumDocuments as D, LikeC4WorkspaceManager as E, FileSystemModuleContext as F, Project as H, FileSystemProvider$1 as I, FileSystemWatcher as L, NoFileSystemWatcher as M, NoLikeC4ManualLayouts as N, WithLikeC4ManualLayouts as O, FileNode as P, FileSystemWatcherModuleContext as R, LikeC4ModelLocator as S, FqnIndex as T, ProjectData as U, ManualLayoutsSnapshot as V, ProjectsManager as W, LikeC4ViewsModuleContext as _, LikeC4SharedModuleContext as a, LayoutViewParams as b, createLikeC4Module as c, LikeC4LanguageServices as d, DocumentParser as f, configureLanguageServerLogger as g, ConfigureLanguageServerLoggerOptions as h, LikeC4ServicesContext as i, NoFileSystem as j, WithChokidarWatcher as k, createSharedServices as l, startLanguageServer$1 as m, LikeC4AddedServices as n, LikeC4SharedServices as o, LikeC4ModelParser as p, LikeC4Services as r, createLanguageServices as s, LanguageServicesContext as t, FormatOptions as u, WithGraphviz as v, LikeC4ModelBuilder as w, LikeC4Views as x, WithWasmGraphviz as y, LikeC4ManualLayouts as z };
|