@domainlang/language 0.5.2 → 0.6.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/out/domain-lang-module.js +3 -1
- package/out/domain-lang-module.js.map +1 -1
- package/out/generated/ast.d.ts +24 -0
- package/out/generated/ast.js.map +1 -1
- package/out/generated/grammar.js +22 -32
- package/out/generated/grammar.js.map +1 -1
- package/out/index.d.ts +2 -5
- package/out/index.js +10 -6
- package/out/index.js.map +1 -1
- package/out/lsp/domain-lang-code-actions.js +14 -8
- package/out/lsp/domain-lang-code-actions.js.map +1 -1
- package/out/lsp/domain-lang-completion.d.ts +3 -0
- package/out/lsp/domain-lang-completion.js +41 -13
- package/out/lsp/domain-lang-completion.js.map +1 -1
- package/out/lsp/domain-lang-formatter.js +24 -18
- package/out/lsp/domain-lang-formatter.js.map +1 -1
- package/out/lsp/domain-lang-index-manager.d.ts +102 -0
- package/out/lsp/domain-lang-index-manager.js +221 -0
- package/out/lsp/domain-lang-index-manager.js.map +1 -0
- package/out/lsp/domain-lang-scope.js +31 -17
- package/out/lsp/domain-lang-scope.js.map +1 -1
- package/out/lsp/domain-lang-workspace-manager.d.ts +51 -9
- package/out/lsp/domain-lang-workspace-manager.js +86 -63
- package/out/lsp/domain-lang-workspace-manager.js.map +1 -1
- package/out/lsp/hover/domain-lang-hover.d.ts +45 -1
- package/out/lsp/hover/domain-lang-hover.js +308 -232
- package/out/lsp/hover/domain-lang-hover.js.map +1 -1
- package/out/lsp/hover/domain-lang-keywords.d.ts +3 -7
- package/out/lsp/hover/domain-lang-keywords.js +115 -38
- package/out/lsp/hover/domain-lang-keywords.js.map +1 -1
- package/out/lsp/manifest-diagnostics.js +95 -50
- package/out/lsp/manifest-diagnostics.js.map +1 -1
- package/out/main.js +109 -17
- package/out/main.js.map +1 -1
- package/out/services/import-resolver.d.ts +16 -2
- package/out/services/import-resolver.js +37 -11
- package/out/services/import-resolver.js.map +1 -1
- package/out/services/types.d.ts +2 -2
- package/out/services/workspace-manager.d.ts +33 -31
- package/out/services/workspace-manager.js +92 -148
- package/out/services/workspace-manager.js.map +1 -1
- package/out/utils/document-utils.d.ts +41 -0
- package/out/utils/document-utils.js +64 -0
- package/out/utils/document-utils.js.map +1 -0
- package/out/utils/import-utils.d.ts +0 -17
- package/out/utils/import-utils.js +2 -32
- package/out/utils/import-utils.js.map +1 -1
- package/out/utils/manifest-utils.d.ts +56 -0
- package/out/utils/manifest-utils.js +119 -0
- package/out/utils/manifest-utils.js.map +1 -0
- package/out/validation/import.d.ts +1 -2
- package/out/validation/import.js +33 -20
- package/out/validation/import.js.map +1 -1
- package/package.json +1 -1
- package/src/domain-lang-module.ts +4 -1
- package/src/domain-lang.langium +37 -13
- package/src/generated/ast.ts +24 -0
- package/src/generated/grammar.ts +22 -32
- package/src/index.ts +12 -6
- package/src/lsp/domain-lang-code-actions.ts +13 -8
- package/src/lsp/domain-lang-completion.ts +61 -13
- package/src/lsp/domain-lang-formatter.ts +28 -23
- package/src/lsp/domain-lang-index-manager.ts +256 -0
- package/src/lsp/domain-lang-scope.ts +29 -17
- package/src/lsp/domain-lang-workspace-manager.ts +89 -66
- package/src/lsp/hover/domain-lang-hover.ts +332 -226
- package/src/lsp/hover/domain-lang-keywords.ts +129 -43
- package/src/lsp/manifest-diagnostics.ts +100 -59
- package/src/main.ts +127 -16
- package/src/services/import-resolver.ts +39 -11
- package/src/services/types.ts +2 -2
- package/src/services/workspace-manager.ts +101 -175
- package/src/utils/document-utils.ts +80 -0
- package/src/utils/import-utils.ts +2 -40
- package/src/utils/manifest-utils.ts +132 -0
- package/src/validation/import.ts +32 -22
- package/out/lsp/hover/ddd-pattern-explanations.d.ts +0 -50
- package/out/lsp/hover/ddd-pattern-explanations.js +0 -196
- package/out/lsp/hover/ddd-pattern-explanations.js.map +0 -1
- package/out/services/dependency-analyzer.d.ts +0 -58
- package/out/services/dependency-analyzer.js +0 -254
- package/out/services/dependency-analyzer.js.map +0 -1
- package/out/services/dependency-resolver.d.ts +0 -146
- package/out/services/dependency-resolver.js +0 -452
- package/out/services/dependency-resolver.js.map +0 -1
- package/out/services/git-url-resolver.browser.d.ts +0 -10
- package/out/services/git-url-resolver.browser.js +0 -19
- package/out/services/git-url-resolver.browser.js.map +0 -1
- package/out/services/git-url-resolver.d.ts +0 -158
- package/out/services/git-url-resolver.js +0 -416
- package/out/services/git-url-resolver.js.map +0 -1
- package/out/services/governance-validator.d.ts +0 -44
- package/out/services/governance-validator.js +0 -153
- package/out/services/governance-validator.js.map +0 -1
- package/out/services/semver.d.ts +0 -98
- package/out/services/semver.js +0 -195
- package/out/services/semver.js.map +0 -1
- package/src/lsp/hover/ddd-pattern-explanations.ts +0 -237
- package/src/services/dependency-analyzer.ts +0 -321
- package/src/services/dependency-resolver.ts +0 -551
- package/src/services/git-url-resolver.browser.ts +0 -26
- package/src/services/git-url-resolver.ts +0 -517
- package/src/services/governance-validator.ts +0 -177
- package/src/services/semver.ts +0 -213
|
@@ -3,19 +3,61 @@ import type { CancellationToken } from 'vscode-languageserver-protocol';
|
|
|
3
3
|
/**
|
|
4
4
|
* Langium WorkspaceManager override implementing manifest-centric import loading per PRS-010.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* -
|
|
10
|
-
* -
|
|
6
|
+
* **Three Operational Modes:**
|
|
7
|
+
*
|
|
8
|
+
* **Mode A (Pure Workspace with model.yaml):**
|
|
9
|
+
* - model.yaml exists at workspace root
|
|
10
|
+
* - Loads entry file (default: index.dlang, or custom via model.entry)
|
|
11
|
+
* - Pre-builds entry and follows import graph
|
|
12
|
+
* - All imported documents built to Validated state before workspace ready
|
|
13
|
+
* - LSP features have immediate access to complete reference information
|
|
14
|
+
*
|
|
15
|
+
* **Mode B (Pure Standalone files):**
|
|
16
|
+
* - No model.yaml anywhere in workspace
|
|
17
|
+
* - No pre-loading of .dlang files during workspace scan
|
|
18
|
+
* - Documents loaded on-demand when user opens them
|
|
19
|
+
* - Imports resolved lazily via ImportResolver
|
|
20
|
+
* - Each document built individually when opened
|
|
21
|
+
* - Works with relative imports only (no path aliases or external deps)
|
|
22
|
+
*
|
|
23
|
+
* **Mode C (Mixed - Standalone + Module folders):**
|
|
24
|
+
* - Workspace contains both standalone .dlang files AND folders with model.yaml
|
|
25
|
+
* - Each model.yaml folder treated as a module/package:
|
|
26
|
+
* - Module entry + import graph pre-loaded
|
|
27
|
+
* - Path aliases and external deps work within module
|
|
28
|
+
* - Standalone files outside modules loaded on-demand
|
|
29
|
+
* - Example structure:
|
|
30
|
+
* ```
|
|
31
|
+
* workspace/
|
|
32
|
+
* ├── standalone.dlang ← Mode B (on-demand)
|
|
33
|
+
* ├── core/
|
|
34
|
+
* │ ├── model.yaml ← Module root
|
|
35
|
+
* │ ├── index.dlang ← Pre-loaded
|
|
36
|
+
* │ └── domains/
|
|
37
|
+
* │ └── sales.dlang ← Pre-loaded via imports
|
|
38
|
+
* └── util.dlang ← Mode B (on-demand)
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* **Performance Characteristics:**
|
|
42
|
+
* - Mode A/C modules: Slower initial load, instant LSP features afterward
|
|
43
|
+
* - Mode B/C standalone: Instant workspace init, per-file build on open
|
|
44
|
+
* - All modes cache import resolution for subsequent access
|
|
45
|
+
*
|
|
46
|
+
* **Never performs network fetches** - relies on cached dependencies/lock files.
|
|
47
|
+
* Missing cache produces diagnostics upstream via ImportValidator.
|
|
11
48
|
*/
|
|
12
49
|
export declare class DomainLangWorkspaceManager extends DefaultWorkspaceManager {
|
|
50
|
+
private readonly sharedServices;
|
|
13
51
|
constructor(services: LangiumSharedCoreServices);
|
|
14
52
|
shouldIncludeEntry(entry: FileSystemNode): boolean;
|
|
15
53
|
initializeWorkspace(folders: WorkspaceFolder[], cancelToken?: CancellationToken): Promise<void>;
|
|
16
54
|
protected loadAdditionalDocuments(folders: WorkspaceFolder[], collector: (document: LangiumDocument) => void): Promise<void>;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
55
|
+
/**
|
|
56
|
+
* Finds ALL model.yaml files in the workspace.
|
|
57
|
+
* Delegates to shared manifest utilities.
|
|
58
|
+
*
|
|
59
|
+
* @param folders - Workspace folders to search
|
|
60
|
+
* @returns Array of manifest info (one per model.yaml found)
|
|
61
|
+
*/
|
|
62
|
+
private findAllManifestsInFolders;
|
|
21
63
|
}
|
|
@@ -1,19 +1,56 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import YAML from 'yaml';
|
|
3
1
|
import { DefaultWorkspaceManager, URI, UriUtils } from 'langium';
|
|
4
2
|
import { ensureImportGraphFromDocument } from '../utils/import-utils.js';
|
|
3
|
+
import { findManifestsInDirectories } from '../utils/manifest-utils.js';
|
|
5
4
|
/**
|
|
6
5
|
* Langium WorkspaceManager override implementing manifest-centric import loading per PRS-010.
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
7
|
+
* **Three Operational Modes:**
|
|
8
|
+
*
|
|
9
|
+
* **Mode A (Pure Workspace with model.yaml):**
|
|
10
|
+
* - model.yaml exists at workspace root
|
|
11
|
+
* - Loads entry file (default: index.dlang, or custom via model.entry)
|
|
12
|
+
* - Pre-builds entry and follows import graph
|
|
13
|
+
* - All imported documents built to Validated state before workspace ready
|
|
14
|
+
* - LSP features have immediate access to complete reference information
|
|
15
|
+
*
|
|
16
|
+
* **Mode B (Pure Standalone files):**
|
|
17
|
+
* - No model.yaml anywhere in workspace
|
|
18
|
+
* - No pre-loading of .dlang files during workspace scan
|
|
19
|
+
* - Documents loaded on-demand when user opens them
|
|
20
|
+
* - Imports resolved lazily via ImportResolver
|
|
21
|
+
* - Each document built individually when opened
|
|
22
|
+
* - Works with relative imports only (no path aliases or external deps)
|
|
23
|
+
*
|
|
24
|
+
* **Mode C (Mixed - Standalone + Module folders):**
|
|
25
|
+
* - Workspace contains both standalone .dlang files AND folders with model.yaml
|
|
26
|
+
* - Each model.yaml folder treated as a module/package:
|
|
27
|
+
* - Module entry + import graph pre-loaded
|
|
28
|
+
* - Path aliases and external deps work within module
|
|
29
|
+
* - Standalone files outside modules loaded on-demand
|
|
30
|
+
* - Example structure:
|
|
31
|
+
* ```
|
|
32
|
+
* workspace/
|
|
33
|
+
* ├── standalone.dlang ← Mode B (on-demand)
|
|
34
|
+
* ├── core/
|
|
35
|
+
* │ ├── model.yaml ← Module root
|
|
36
|
+
* │ ├── index.dlang ← Pre-loaded
|
|
37
|
+
* │ └── domains/
|
|
38
|
+
* │ └── sales.dlang ← Pre-loaded via imports
|
|
39
|
+
* └── util.dlang ← Mode B (on-demand)
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* **Performance Characteristics:**
|
|
43
|
+
* - Mode A/C modules: Slower initial load, instant LSP features afterward
|
|
44
|
+
* - Mode B/C standalone: Instant workspace init, per-file build on open
|
|
45
|
+
* - All modes cache import resolution for subsequent access
|
|
46
|
+
*
|
|
47
|
+
* **Never performs network fetches** - relies on cached dependencies/lock files.
|
|
48
|
+
* Missing cache produces diagnostics upstream via ImportValidator.
|
|
13
49
|
*/
|
|
14
50
|
export class DomainLangWorkspaceManager extends DefaultWorkspaceManager {
|
|
15
51
|
constructor(services) {
|
|
16
52
|
super(services);
|
|
53
|
+
this.sharedServices = services;
|
|
17
54
|
}
|
|
18
55
|
shouldIncludeEntry(entry) {
|
|
19
56
|
// Prevent auto-including .dlang files; we'll load via entry/import graph
|
|
@@ -27,67 +64,53 @@ export class DomainLangWorkspaceManager extends DefaultWorkspaceManager {
|
|
|
27
64
|
await super.initializeWorkspace(folders, cancelToken);
|
|
28
65
|
}
|
|
29
66
|
async loadAdditionalDocuments(folders, collector) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
67
|
+
// Find ALL model.yaml files in workspace (supports mixed mode)
|
|
68
|
+
const manifestInfos = await this.findAllManifestsInFolders(folders);
|
|
69
|
+
if (manifestInfos.length === 0) {
|
|
70
|
+
return; // Pure Mode B: no manifests, all files loaded on-demand
|
|
33
71
|
}
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
72
|
+
// Mode A or Mode C: Load each module's entry + import graph
|
|
73
|
+
for (const manifestInfo of manifestInfos) {
|
|
74
|
+
try {
|
|
75
|
+
const entryUri = URI.file(manifestInfo.entryPath);
|
|
76
|
+
const entryDoc = await this.langiumDocuments.getOrCreateDocument(entryUri);
|
|
77
|
+
collector(entryDoc);
|
|
78
|
+
// Build entry document first to ensure it's ready for import resolution
|
|
79
|
+
await this.sharedServices.workspace.DocumentBuilder.build([entryDoc], {
|
|
80
|
+
validation: true
|
|
81
|
+
});
|
|
82
|
+
const uris = await ensureImportGraphFromDocument(entryDoc, this.langiumDocuments);
|
|
83
|
+
const importedDocs = [];
|
|
84
|
+
for (const uriString of uris) {
|
|
85
|
+
const uri = URI.parse(uriString);
|
|
86
|
+
const doc = await this.langiumDocuments.getOrCreateDocument(uri);
|
|
87
|
+
collector(doc);
|
|
88
|
+
importedDocs.push(doc);
|
|
89
|
+
}
|
|
90
|
+
// Build all imported documents in batch for performance
|
|
91
|
+
if (importedDocs.length > 0) {
|
|
92
|
+
await this.sharedServices.workspace.DocumentBuilder.build(importedDocs, {
|
|
93
|
+
validation: true
|
|
94
|
+
});
|
|
95
|
+
}
|
|
51
96
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
let current = path.resolve(URI.parse(startUri).fsPath);
|
|
57
|
-
const { root } = path.parse(current);
|
|
58
|
-
while (true) {
|
|
59
|
-
const candidate = path.join(current, 'model.yaml');
|
|
60
|
-
if (await this.pathExists(candidate)) {
|
|
61
|
-
return candidate;
|
|
97
|
+
catch (error) {
|
|
98
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
99
|
+
console.error(`Failed to load import graph from ${manifestInfo.manifestPath}: ${message}`);
|
|
100
|
+
// Continue with other modules - partial failure is acceptable
|
|
62
101
|
}
|
|
63
|
-
if (current === root) {
|
|
64
|
-
return undefined;
|
|
65
|
-
}
|
|
66
|
-
const parent = path.dirname(current);
|
|
67
|
-
if (parent === current) {
|
|
68
|
-
return undefined;
|
|
69
|
-
}
|
|
70
|
-
current = parent;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
async readEntryFromManifest(manifestPath) {
|
|
74
|
-
try {
|
|
75
|
-
const content = await this.fileSystemProvider.readFile(URI.file(manifestPath));
|
|
76
|
-
const manifest = (YAML.parse(content) ?? {});
|
|
77
|
-
return manifest.model?.entry;
|
|
78
|
-
}
|
|
79
|
-
catch {
|
|
80
|
-
return undefined;
|
|
81
102
|
}
|
|
82
103
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Finds ALL model.yaml files in the workspace.
|
|
106
|
+
* Delegates to shared manifest utilities.
|
|
107
|
+
*
|
|
108
|
+
* @param folders - Workspace folders to search
|
|
109
|
+
* @returns Array of manifest info (one per model.yaml found)
|
|
110
|
+
*/
|
|
111
|
+
async findAllManifestsInFolders(folders) {
|
|
112
|
+
const directories = folders.map(f => URI.parse(f.uri).fsPath);
|
|
113
|
+
return findManifestsInDirectories(directories);
|
|
91
114
|
}
|
|
92
115
|
}
|
|
93
116
|
//# sourceMappingURL=domain-lang-workspace-manager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-lang-workspace-manager.js","sourceRoot":"","sources":["../../src/lsp/domain-lang-workspace-manager.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
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O,CAAC,KAAK,CAAC,oCAAoC,YAAY,CAAC,YAAY,KAAK,OAAO,EAAE,CAAC,CAAC;gBAC3F,8DAA8D;YAClE,CAAC;QACL,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACK,KAAK,CAAC,yBAAyB,CAAC,OAA0B;QAC9D,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;QAC9D,OAAO,0BAA0B,CAAC,WAAW,CAAC,CAAC;IACnD,CAAC;CACJ"}
|
|
@@ -5,15 +5,59 @@ import type { Hover, HoverParams } from 'vscode-languageserver';
|
|
|
5
5
|
import { QualifiedNameProvider } from '../domain-lang-naming.js';
|
|
6
6
|
/**
|
|
7
7
|
* Provides hover information for DomainLang elements.
|
|
8
|
+
*
|
|
9
|
+
* Extends Langium's AstNodeHoverProvider with DDD-specific hover content
|
|
10
|
+
* for domains, bounded contexts, relationships, and other DSL constructs.
|
|
8
11
|
*/
|
|
9
12
|
export declare class DomainLangHoverProvider extends AstNodeHoverProvider {
|
|
10
13
|
protected readonly documentationProvider: DocumentationProvider;
|
|
11
14
|
protected readonly commentProvider: CommentProvider;
|
|
12
15
|
protected readonly qualifiedNameProvider: QualifiedNameProvider;
|
|
16
|
+
/**
|
|
17
|
+
* Registry of type-specific hover content generators.
|
|
18
|
+
* Each generator returns content for its node type, or undefined to skip.
|
|
19
|
+
*/
|
|
20
|
+
private readonly hoverGenerators;
|
|
13
21
|
constructor(services: LangiumServices);
|
|
14
22
|
getHoverContent(document: LangiumDocument, params: HoverParams): Promise<Hover | undefined>;
|
|
23
|
+
/**
|
|
24
|
+
* Try to get hover for a declaration node (AST node).
|
|
25
|
+
*/
|
|
26
|
+
private tryGetDeclarationHover;
|
|
27
|
+
/**
|
|
28
|
+
* Try to get hover for a keyword node.
|
|
29
|
+
* Uses the keyword dictionary for all keywords.
|
|
30
|
+
*/
|
|
31
|
+
private tryGetKeywordHover;
|
|
15
32
|
protected getAstNodeHoverContent(node: AstNode): MaybePromise<string | undefined>;
|
|
33
|
+
private getDomainHover;
|
|
34
|
+
private getThisRefHover;
|
|
35
|
+
private getBoundedContextHover;
|
|
36
|
+
private getNamespaceHover;
|
|
37
|
+
private getContextMapHover;
|
|
38
|
+
private getDomainMapHover;
|
|
39
|
+
private getDecisionHover;
|
|
40
|
+
private getPolicyHover;
|
|
41
|
+
private getBusinessRuleHover;
|
|
42
|
+
private getDomainTermHover;
|
|
43
|
+
private getTeamHover;
|
|
44
|
+
private getClassificationHover;
|
|
45
|
+
private getMetadataHover;
|
|
46
|
+
private getRelationshipHover;
|
|
47
|
+
private getImportHover;
|
|
48
|
+
private getDefaultHover;
|
|
49
|
+
/**
|
|
50
|
+
* Formats a relationship line for hover display.
|
|
51
|
+
*/
|
|
52
|
+
private formatRelationshipLine;
|
|
53
|
+
/**
|
|
54
|
+
* Wraps text in a domain-lang code block.
|
|
55
|
+
*/
|
|
56
|
+
private codeBlock;
|
|
57
|
+
/**
|
|
58
|
+
* Formats the final hover content with consistent structure.
|
|
59
|
+
*/
|
|
60
|
+
private formatHover;
|
|
16
61
|
private getRefName;
|
|
17
62
|
private refLink;
|
|
18
|
-
protected getKeywordHoverContent(node: AstNode): MaybePromise<Hover | undefined>;
|
|
19
63
|
}
|