@domainlang/language 0.1.20
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/README.md +163 -0
- package/out/ast-augmentation.d.ts +6 -0
- package/out/ast-augmentation.js +2 -0
- package/out/ast-augmentation.js.map +1 -0
- package/out/domain-lang-module.d.ts +57 -0
- package/out/domain-lang-module.js +67 -0
- package/out/domain-lang-module.js.map +1 -0
- package/out/generated/ast.d.ts +759 -0
- package/out/generated/ast.js +556 -0
- package/out/generated/ast.js.map +1 -0
- package/out/generated/grammar.d.ts +6 -0
- package/out/generated/grammar.js +2407 -0
- package/out/generated/grammar.js.map +1 -0
- package/out/generated/module.d.ts +13 -0
- package/out/generated/module.js +21 -0
- package/out/generated/module.js.map +1 -0
- package/out/index.d.ts +16 -0
- package/out/index.js +22 -0
- package/out/index.js.map +1 -0
- package/out/lsp/domain-lang-code-actions.d.ts +55 -0
- package/out/lsp/domain-lang-code-actions.js +143 -0
- package/out/lsp/domain-lang-code-actions.js.map +1 -0
- package/out/lsp/domain-lang-completion.d.ts +37 -0
- package/out/lsp/domain-lang-completion.js +452 -0
- package/out/lsp/domain-lang-completion.js.map +1 -0
- package/out/lsp/domain-lang-formatter.d.ts +15 -0
- package/out/lsp/domain-lang-formatter.js +43 -0
- package/out/lsp/domain-lang-formatter.js.map +1 -0
- package/out/lsp/domain-lang-naming.d.ts +34 -0
- package/out/lsp/domain-lang-naming.js +49 -0
- package/out/lsp/domain-lang-naming.js.map +1 -0
- package/out/lsp/domain-lang-scope.d.ts +59 -0
- package/out/lsp/domain-lang-scope.js +102 -0
- package/out/lsp/domain-lang-scope.js.map +1 -0
- package/out/lsp/domain-lang-workspace-manager.d.ts +21 -0
- package/out/lsp/domain-lang-workspace-manager.js +93 -0
- package/out/lsp/domain-lang-workspace-manager.js.map +1 -0
- package/out/lsp/hover/ddd-pattern-explanations.d.ts +50 -0
- package/out/lsp/hover/ddd-pattern-explanations.js +196 -0
- package/out/lsp/hover/ddd-pattern-explanations.js.map +1 -0
- package/out/lsp/hover/domain-lang-hover.d.ts +19 -0
- package/out/lsp/hover/domain-lang-hover.js +302 -0
- package/out/lsp/hover/domain-lang-hover.js.map +1 -0
- package/out/lsp/hover/domain-lang-keywords.d.ts +13 -0
- package/out/lsp/hover/domain-lang-keywords.js +47 -0
- package/out/lsp/hover/domain-lang-keywords.js.map +1 -0
- package/out/lsp/manifest-diagnostics.d.ts +82 -0
- package/out/lsp/manifest-diagnostics.js +230 -0
- package/out/lsp/manifest-diagnostics.js.map +1 -0
- package/out/main-browser.d.ts +1 -0
- package/out/main-browser.js +11 -0
- package/out/main-browser.js.map +1 -0
- package/out/main.d.ts +1 -0
- package/out/main.js +74 -0
- package/out/main.js.map +1 -0
- package/out/sdk/ast-augmentation.d.ts +136 -0
- package/out/sdk/ast-augmentation.js +62 -0
- package/out/sdk/ast-augmentation.js.map +1 -0
- package/out/sdk/index.d.ts +94 -0
- package/out/sdk/index.js +97 -0
- package/out/sdk/index.js.map +1 -0
- package/out/sdk/indexes.d.ts +16 -0
- package/out/sdk/indexes.js +97 -0
- package/out/sdk/indexes.js.map +1 -0
- package/out/sdk/loader-node.d.ts +51 -0
- package/out/sdk/loader-node.js +119 -0
- package/out/sdk/loader-node.js.map +1 -0
- package/out/sdk/loader.d.ts +49 -0
- package/out/sdk/loader.js +85 -0
- package/out/sdk/loader.js.map +1 -0
- package/out/sdk/patterns.d.ts +93 -0
- package/out/sdk/patterns.js +123 -0
- package/out/sdk/patterns.js.map +1 -0
- package/out/sdk/query.d.ts +90 -0
- package/out/sdk/query.js +679 -0
- package/out/sdk/query.js.map +1 -0
- package/out/sdk/resolution.d.ts +52 -0
- package/out/sdk/resolution.js +68 -0
- package/out/sdk/resolution.js.map +1 -0
- package/out/sdk/types.d.ts +280 -0
- package/out/sdk/types.js +8 -0
- package/out/sdk/types.js.map +1 -0
- package/out/services/dependency-analyzer.d.ts +58 -0
- package/out/services/dependency-analyzer.js +254 -0
- package/out/services/dependency-analyzer.js.map +1 -0
- package/out/services/dependency-resolver.d.ts +146 -0
- package/out/services/dependency-resolver.js +452 -0
- package/out/services/dependency-resolver.js.map +1 -0
- package/out/services/git-url-resolver.browser.d.ts +10 -0
- package/out/services/git-url-resolver.browser.js +19 -0
- package/out/services/git-url-resolver.browser.js.map +1 -0
- package/out/services/git-url-resolver.d.ts +158 -0
- package/out/services/git-url-resolver.js +416 -0
- package/out/services/git-url-resolver.js.map +1 -0
- package/out/services/governance-validator.d.ts +44 -0
- package/out/services/governance-validator.js +153 -0
- package/out/services/governance-validator.js.map +1 -0
- package/out/services/import-resolver.d.ts +77 -0
- package/out/services/import-resolver.js +240 -0
- package/out/services/import-resolver.js.map +1 -0
- package/out/services/performance-optimizer.d.ts +60 -0
- package/out/services/performance-optimizer.js +140 -0
- package/out/services/performance-optimizer.js.map +1 -0
- package/out/services/relationship-inference.d.ts +11 -0
- package/out/services/relationship-inference.js +98 -0
- package/out/services/relationship-inference.js.map +1 -0
- package/out/services/semver.d.ts +98 -0
- package/out/services/semver.js +195 -0
- package/out/services/semver.js.map +1 -0
- package/out/services/types.d.ts +340 -0
- package/out/services/types.js +46 -0
- package/out/services/types.js.map +1 -0
- package/out/services/workspace-manager.d.ts +123 -0
- package/out/services/workspace-manager.js +489 -0
- package/out/services/workspace-manager.js.map +1 -0
- package/out/syntaxes/domain-lang.monarch.d.ts +76 -0
- package/out/syntaxes/domain-lang.monarch.js +29 -0
- package/out/syntaxes/domain-lang.monarch.js.map +1 -0
- package/out/utils/import-utils.d.ts +49 -0
- package/out/utils/import-utils.js +128 -0
- package/out/utils/import-utils.js.map +1 -0
- package/out/validation/bounded-context.d.ts +11 -0
- package/out/validation/bounded-context.js +79 -0
- package/out/validation/bounded-context.js.map +1 -0
- package/out/validation/classification.d.ts +3 -0
- package/out/validation/classification.js +3 -0
- package/out/validation/classification.js.map +1 -0
- package/out/validation/constants.d.ts +180 -0
- package/out/validation/constants.js +235 -0
- package/out/validation/constants.js.map +1 -0
- package/out/validation/domain-lang-validator.d.ts +2 -0
- package/out/validation/domain-lang-validator.js +27 -0
- package/out/validation/domain-lang-validator.js.map +1 -0
- package/out/validation/domain.d.ts +11 -0
- package/out/validation/domain.js +63 -0
- package/out/validation/domain.js.map +1 -0
- package/out/validation/import.d.ts +68 -0
- package/out/validation/import.js +237 -0
- package/out/validation/import.js.map +1 -0
- package/out/validation/manifest.d.ts +144 -0
- package/out/validation/manifest.js +327 -0
- package/out/validation/manifest.js.map +1 -0
- package/out/validation/maps.d.ts +21 -0
- package/out/validation/maps.js +60 -0
- package/out/validation/maps.js.map +1 -0
- package/out/validation/metadata.d.ts +7 -0
- package/out/validation/metadata.js +16 -0
- package/out/validation/metadata.js.map +1 -0
- package/out/validation/model.d.ts +12 -0
- package/out/validation/model.js +29 -0
- package/out/validation/model.js.map +1 -0
- package/out/validation/relationships.d.ts +12 -0
- package/out/validation/relationships.js +94 -0
- package/out/validation/relationships.js.map +1 -0
- package/out/validation/shared.d.ts +6 -0
- package/out/validation/shared.js +12 -0
- package/out/validation/shared.js.map +1 -0
- package/package.json +110 -0
- package/src/ast-augmentation.ts +5 -0
- package/src/domain-lang-module.ts +112 -0
- package/src/domain-lang.langium +351 -0
- package/src/generated/ast.ts +986 -0
- package/src/generated/grammar.ts +2409 -0
- package/src/generated/module.ts +25 -0
- package/src/index.ts +24 -0
- package/src/lsp/domain-lang-code-actions.ts +189 -0
- package/src/lsp/domain-lang-completion.ts +514 -0
- package/src/lsp/domain-lang-formatter.ts +51 -0
- package/src/lsp/domain-lang-naming.ts +56 -0
- package/src/lsp/domain-lang-scope.ts +137 -0
- package/src/lsp/domain-lang-workspace-manager.ts +104 -0
- package/src/lsp/hover/ddd-pattern-explanations.ts +237 -0
- package/src/lsp/hover/domain-lang-hover.ts +338 -0
- package/src/lsp/hover/domain-lang-keywords.ts +50 -0
- package/src/lsp/manifest-diagnostics.ts +290 -0
- package/src/main-browser.ts +15 -0
- package/src/main.ts +85 -0
- package/src/sdk/README.md +297 -0
- package/src/sdk/ast-augmentation.ts +157 -0
- package/src/sdk/index.ts +126 -0
- package/src/sdk/indexes.ts +155 -0
- package/src/sdk/loader-node.ts +146 -0
- package/src/sdk/loader.ts +99 -0
- package/src/sdk/patterns.ts +147 -0
- package/src/sdk/query.ts +802 -0
- package/src/sdk/resolution.ts +78 -0
- package/src/sdk/types.ts +323 -0
- package/src/services/dependency-analyzer.ts +321 -0
- package/src/services/dependency-resolver.ts +551 -0
- package/src/services/git-url-resolver.browser.ts +26 -0
- package/src/services/git-url-resolver.ts +517 -0
- package/src/services/governance-validator.ts +177 -0
- package/src/services/import-resolver.ts +292 -0
- package/src/services/performance-optimizer.ts +170 -0
- package/src/services/relationship-inference.ts +121 -0
- package/src/services/semver.ts +213 -0
- package/src/services/types.ts +415 -0
- package/src/services/workspace-manager.ts +607 -0
- package/src/syntaxes/domain-lang.monarch.ts +29 -0
- package/src/utils/import-utils.ts +152 -0
- package/src/validation/bounded-context.ts +99 -0
- package/src/validation/classification.ts +5 -0
- package/src/validation/constants.ts +304 -0
- package/src/validation/domain-lang-validator.ts +33 -0
- package/src/validation/domain.ts +77 -0
- package/src/validation/import.ts +295 -0
- package/src/validation/manifest.ts +439 -0
- package/src/validation/maps.ts +76 -0
- package/src/validation/metadata.ts +18 -0
- package/src/validation/model.ts +37 -0
- package/src/validation/relationships.ts +154 -0
- package/src/validation/shared.ts +14 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grammar.js","sourceRoot":"","sources":["../../src/generated/grammar.ts"],"names":[],"mappings":"AAAA;;;gFAGgF;AAGhF,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C,IAAI,uBAA4C,CAAC;AACjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAY,EAAE,CAAC,uBAAuB,IAAI,CAAC,uBAAuB,GAAG,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+1ExH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/******************************************************************************
|
|
2
|
+
* This file was generated by langium-cli 4.2.0.
|
|
3
|
+
* DO NOT EDIT MANUALLY!
|
|
4
|
+
******************************************************************************/
|
|
5
|
+
import type { LangiumSharedCoreServices, LangiumCoreServices, LangiumGeneratedCoreServices, LangiumGeneratedSharedCoreServices, Module } from 'langium';
|
|
6
|
+
export declare const DomainLangLanguageMetaData: {
|
|
7
|
+
readonly languageId: "domain-lang";
|
|
8
|
+
readonly fileExtensions: readonly [".dlang"];
|
|
9
|
+
readonly caseInsensitive: false;
|
|
10
|
+
readonly mode: "development";
|
|
11
|
+
};
|
|
12
|
+
export declare const DomainLangGeneratedSharedModule: Module<LangiumSharedCoreServices, LangiumGeneratedSharedCoreServices>;
|
|
13
|
+
export declare const DomainLangGeneratedModule: Module<LangiumCoreServices, LangiumGeneratedCoreServices>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/******************************************************************************
|
|
2
|
+
* This file was generated by langium-cli 4.2.0.
|
|
3
|
+
* DO NOT EDIT MANUALLY!
|
|
4
|
+
******************************************************************************/
|
|
5
|
+
import { DomainLangAstReflection } from './ast.js';
|
|
6
|
+
import { DomainLangGrammar } from './grammar.js';
|
|
7
|
+
export const DomainLangLanguageMetaData = {
|
|
8
|
+
languageId: 'domain-lang',
|
|
9
|
+
fileExtensions: ['.dlang'],
|
|
10
|
+
caseInsensitive: false,
|
|
11
|
+
mode: 'development'
|
|
12
|
+
};
|
|
13
|
+
export const DomainLangGeneratedSharedModule = {
|
|
14
|
+
AstReflection: () => new DomainLangAstReflection()
|
|
15
|
+
};
|
|
16
|
+
export const DomainLangGeneratedModule = {
|
|
17
|
+
Grammar: () => DomainLangGrammar(),
|
|
18
|
+
LanguageMetaData: () => DomainLangLanguageMetaData,
|
|
19
|
+
parser: {}
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/generated/module.ts"],"names":[],"mappings":"AAAA;;;gFAGgF;AAGhF,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACtC,UAAU,EAAE,aAAa;IACzB,cAAc,EAAE,CAAC,QAAQ,CAAC;IAC1B,eAAe,EAAE,KAAK;IACtB,IAAI,EAAE,aAAa;CACc,CAAC;AAEtC,MAAM,CAAC,MAAM,+BAA+B,GAA0E;IAClH,aAAa,EAAE,GAAG,EAAE,CAAC,IAAI,uBAAuB,EAAE;CACrD,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAA8D;IAChG,OAAO,EAAE,GAAG,EAAE,CAAC,iBAAiB,EAAE;IAClC,gBAAgB,EAAE,GAAG,EAAE,CAAC,0BAA0B;IAClD,MAAM,EAAE,EAAE;CACb,CAAC"}
|
package/out/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './domain-lang-module.js';
|
|
2
|
+
export * from './generated/ast.js';
|
|
3
|
+
export * from './generated/grammar.js';
|
|
4
|
+
export * from './generated/module.js';
|
|
5
|
+
export * from './ast-augmentation.js';
|
|
6
|
+
export * from './services/types.js';
|
|
7
|
+
export * from './services/workspace-manager.js';
|
|
8
|
+
export * from './services/dependency-resolver.js';
|
|
9
|
+
export * from './services/dependency-analyzer.js';
|
|
10
|
+
export * from './services/governance-validator.js';
|
|
11
|
+
export * from './services/import-resolver.js';
|
|
12
|
+
export * from './services/relationship-inference.js';
|
|
13
|
+
export * from './services/git-url-resolver.js';
|
|
14
|
+
export * from './services/performance-optimizer.js';
|
|
15
|
+
export * from './services/semver.js';
|
|
16
|
+
export * from './lsp/manifest-diagnostics.js';
|
package/out/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './domain-lang-module.js';
|
|
2
|
+
export * from './generated/ast.js';
|
|
3
|
+
export * from './generated/grammar.js';
|
|
4
|
+
export * from './generated/module.js';
|
|
5
|
+
// Note: main.js is intentionally NOT exported here - it's the LSP entry point
|
|
6
|
+
// and creates a connection when imported, which breaks CLI/SDK standalone usage
|
|
7
|
+
export * from './ast-augmentation.js';
|
|
8
|
+
// Export centralized types (canonical source for all service types)
|
|
9
|
+
export * from './services/types.js';
|
|
10
|
+
// Export services
|
|
11
|
+
export * from './services/workspace-manager.js';
|
|
12
|
+
export * from './services/dependency-resolver.js';
|
|
13
|
+
export * from './services/dependency-analyzer.js';
|
|
14
|
+
export * from './services/governance-validator.js';
|
|
15
|
+
export * from './services/import-resolver.js';
|
|
16
|
+
export * from './services/relationship-inference.js';
|
|
17
|
+
export * from './services/git-url-resolver.js';
|
|
18
|
+
export * from './services/performance-optimizer.js';
|
|
19
|
+
export * from './services/semver.js';
|
|
20
|
+
// Export LSP services
|
|
21
|
+
export * from './lsp/manifest-diagnostics.js';
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
package/out/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,8EAA8E;AAC9E,gFAAgF;AAChF,cAAc,uBAAuB,CAAC;AAEtC,oEAAoE;AACpE,cAAc,qBAAqB,CAAC;AAEpC,kBAAkB;AAClB,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,sBAAsB,CAAC;AAErC,sBAAsB;AACtB,cAAc,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Action Provider for DomainLang.
|
|
3
|
+
*
|
|
4
|
+
* Provides quick-fix code actions for validation diagnostics.
|
|
5
|
+
*
|
|
6
|
+
* Key Features:
|
|
7
|
+
* - "Add dependency to model.yaml" for unknown import aliases
|
|
8
|
+
* - "Run dlang install" for uninstalled dependencies
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
import type { CodeAction, CodeActionParams, Command } from 'vscode-languageserver';
|
|
13
|
+
import type { MaybePromise, LangiumDocument } from 'langium';
|
|
14
|
+
import type { CodeActionProvider } from 'langium/lsp';
|
|
15
|
+
/**
|
|
16
|
+
* Code action provider for DomainLang LSP features.
|
|
17
|
+
*
|
|
18
|
+
* Implements quick fixes for:
|
|
19
|
+
* - Import validation errors (add to model.yaml, run install)
|
|
20
|
+
*/
|
|
21
|
+
export declare class DomainLangCodeActionProvider implements CodeActionProvider {
|
|
22
|
+
/**
|
|
23
|
+
* Generates code actions for the given diagnostics.
|
|
24
|
+
*
|
|
25
|
+
* @param document - The document containing the diagnostics
|
|
26
|
+
* @param params - Code action request parameters including diagnostics
|
|
27
|
+
* @returns Array of code actions, or undefined if none applicable
|
|
28
|
+
*/
|
|
29
|
+
getCodeActions(document: LangiumDocument, params: CodeActionParams): MaybePromise<Array<Command | CodeAction> | undefined>;
|
|
30
|
+
/**
|
|
31
|
+
* Creates code actions for a specific diagnostic.
|
|
32
|
+
*
|
|
33
|
+
* Matches on diagnostic.data.code to determine which quick fix to offer.
|
|
34
|
+
*/
|
|
35
|
+
private createCodeActions;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a code action to add a dependency to model.yaml.
|
|
38
|
+
*
|
|
39
|
+
* This generates a WorkspaceEdit that modifies model.yaml to add
|
|
40
|
+
* the missing dependency with a placeholder version.
|
|
41
|
+
*/
|
|
42
|
+
private createAddToManifestAction;
|
|
43
|
+
/**
|
|
44
|
+
* Creates a code action to create model.yaml with the dependency.
|
|
45
|
+
*/
|
|
46
|
+
private createCreateManifestAction;
|
|
47
|
+
/**
|
|
48
|
+
* Creates a code action to run dlang install.
|
|
49
|
+
*/
|
|
50
|
+
private createRunInstallAction;
|
|
51
|
+
/**
|
|
52
|
+
* Creates a code action to add ref to dependency.
|
|
53
|
+
*/
|
|
54
|
+
private createAddRefAction;
|
|
55
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Action Provider for DomainLang.
|
|
3
|
+
*
|
|
4
|
+
* Provides quick-fix code actions for validation diagnostics.
|
|
5
|
+
*
|
|
6
|
+
* Key Features:
|
|
7
|
+
* - "Add dependency to model.yaml" for unknown import aliases
|
|
8
|
+
* - "Run dlang install" for uninstalled dependencies
|
|
9
|
+
*
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
import { CodeActionKind } from 'vscode-languageserver';
|
|
13
|
+
import { IssueCodes } from '../validation/constants.js';
|
|
14
|
+
/**
|
|
15
|
+
* Code action provider for DomainLang LSP features.
|
|
16
|
+
*
|
|
17
|
+
* Implements quick fixes for:
|
|
18
|
+
* - Import validation errors (add to model.yaml, run install)
|
|
19
|
+
*/
|
|
20
|
+
export class DomainLangCodeActionProvider {
|
|
21
|
+
/**
|
|
22
|
+
* Generates code actions for the given diagnostics.
|
|
23
|
+
*
|
|
24
|
+
* @param document - The document containing the diagnostics
|
|
25
|
+
* @param params - Code action request parameters including diagnostics
|
|
26
|
+
* @returns Array of code actions, or undefined if none applicable
|
|
27
|
+
*/
|
|
28
|
+
getCodeActions(document, params) {
|
|
29
|
+
const result = [];
|
|
30
|
+
const acceptor = (ca) => {
|
|
31
|
+
if (ca)
|
|
32
|
+
result.push(ca);
|
|
33
|
+
};
|
|
34
|
+
for (const diagnostic of params.context.diagnostics) {
|
|
35
|
+
this.createCodeActions(diagnostic, document, acceptor);
|
|
36
|
+
}
|
|
37
|
+
return result.length > 0 ? result : undefined;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Creates code actions for a specific diagnostic.
|
|
41
|
+
*
|
|
42
|
+
* Matches on diagnostic.data.code to determine which quick fix to offer.
|
|
43
|
+
*/
|
|
44
|
+
createCodeActions(diagnostic, document, accept) {
|
|
45
|
+
const data = diagnostic.data;
|
|
46
|
+
if (!data?.code)
|
|
47
|
+
return;
|
|
48
|
+
switch (data.code) {
|
|
49
|
+
case IssueCodes.ImportNotInManifest:
|
|
50
|
+
if (data.alias) {
|
|
51
|
+
accept(this.createAddToManifestAction(diagnostic, document, data.alias));
|
|
52
|
+
}
|
|
53
|
+
break;
|
|
54
|
+
case IssueCodes.ImportRequiresManifest:
|
|
55
|
+
if (data.specifier) {
|
|
56
|
+
accept(this.createCreateManifestAction(diagnostic, document, data.specifier));
|
|
57
|
+
}
|
|
58
|
+
break;
|
|
59
|
+
case IssueCodes.ImportNotInstalled:
|
|
60
|
+
if (data.alias) {
|
|
61
|
+
accept(this.createRunInstallAction(diagnostic, data.alias));
|
|
62
|
+
}
|
|
63
|
+
break;
|
|
64
|
+
case IssueCodes.ImportMissingRef:
|
|
65
|
+
if (data.alias) {
|
|
66
|
+
accept(this.createAddRefAction(diagnostic, data.alias));
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Creates a code action to add a dependency to model.yaml.
|
|
73
|
+
*
|
|
74
|
+
* This generates a WorkspaceEdit that modifies model.yaml to add
|
|
75
|
+
* the missing dependency with a placeholder version.
|
|
76
|
+
*/
|
|
77
|
+
createAddToManifestAction(diagnostic, _document, alias) {
|
|
78
|
+
// Create a command that will be executed to add the dependency
|
|
79
|
+
// Since we can't directly edit model.yaml from here (it's not the current document),
|
|
80
|
+
// we provide a command that the extension can handle
|
|
81
|
+
return {
|
|
82
|
+
title: `Add '${alias}' to model.yaml`,
|
|
83
|
+
kind: CodeActionKind.QuickFix,
|
|
84
|
+
diagnostics: [diagnostic],
|
|
85
|
+
isPreferred: true,
|
|
86
|
+
command: {
|
|
87
|
+
title: `Add '${alias}' to model.yaml`,
|
|
88
|
+
command: 'domainlang.addDependency',
|
|
89
|
+
arguments: [alias]
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Creates a code action to create model.yaml with the dependency.
|
|
95
|
+
*/
|
|
96
|
+
createCreateManifestAction(diagnostic, _document, specifier) {
|
|
97
|
+
const alias = specifier.split('/')[0];
|
|
98
|
+
return {
|
|
99
|
+
title: `Create model.yaml with '${alias}' dependency`,
|
|
100
|
+
kind: CodeActionKind.QuickFix,
|
|
101
|
+
diagnostics: [diagnostic],
|
|
102
|
+
isPreferred: true,
|
|
103
|
+
command: {
|
|
104
|
+
title: `Create model.yaml`,
|
|
105
|
+
command: 'domainlang.createManifest',
|
|
106
|
+
arguments: [alias, specifier]
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Creates a code action to run dlang install.
|
|
112
|
+
*/
|
|
113
|
+
createRunInstallAction(diagnostic, alias) {
|
|
114
|
+
return {
|
|
115
|
+
title: `Run 'dlang install' to fetch '${alias}'`,
|
|
116
|
+
kind: CodeActionKind.QuickFix,
|
|
117
|
+
diagnostics: [diagnostic],
|
|
118
|
+
isPreferred: true,
|
|
119
|
+
command: {
|
|
120
|
+
title: 'Install dependencies',
|
|
121
|
+
command: 'domainlang.install',
|
|
122
|
+
arguments: []
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Creates a code action to add ref to dependency.
|
|
128
|
+
*/
|
|
129
|
+
createAddRefAction(diagnostic, alias) {
|
|
130
|
+
return {
|
|
131
|
+
title: `Add git ref to '${alias}' in model.yaml`,
|
|
132
|
+
kind: CodeActionKind.QuickFix,
|
|
133
|
+
diagnostics: [diagnostic],
|
|
134
|
+
isPreferred: false,
|
|
135
|
+
command: {
|
|
136
|
+
title: 'Add ref',
|
|
137
|
+
command: 'domainlang.addRef',
|
|
138
|
+
arguments: [alias]
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=domain-lang-code-actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-lang-code-actions.js","sourceRoot":"","sources":["../../src/lsp/domain-lang-code-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAaxD;;;;;GAKG;AACH,MAAM,OAAO,4BAA4B;IAErC;;;;;;OAMG;IACH,cAAc,CACV,QAAyB,EACzB,MAAwB;QAExB,MAAM,MAAM,GAAiB,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAG,CAAC,EAA0B,EAAQ,EAAE;YAClD,IAAI,EAAE;gBAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5B,CAAC,CAAC;QAEF,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YAClD,IAAI,CAAC,iBAAiB,CAAC,UAAU,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AK,EAAE,mBAAmB,KAAK,iBAAiB;YAChD,IAAI,EAAE,cAAc,CAAC,QAAQ;YAC7B,WAAW,EAAE,CAAC,UAAU,CAAC;YACzB,WAAW,EAAE,KAAK;YAClB,OAAO,EAAE;gBACL,KAAK,EAAE,SAAS;gBAChB,OAAO,EAAE,mBAAmB;gBAC5B,SAAS,EAAE,CAAC,KAAK,CAAC;aACrB;SACJ,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Completion provider for DomainLang - context-aware, grammar-aligned.
|
|
3
|
+
*
|
|
4
|
+
* **Design:**
|
|
5
|
+
* - Context-aware: Only suggests what's valid at cursor position
|
|
6
|
+
* - Grammar-aligned: Completions match grammar structure exactly
|
|
7
|
+
* - Simple: Uses parent node to determine context
|
|
8
|
+
* - Maintainable: Clear mapping from grammar to completions
|
|
9
|
+
*/
|
|
10
|
+
import { CompletionAcceptor, CompletionContext, DefaultCompletionProvider, NextFeature } from 'langium/lsp';
|
|
11
|
+
export declare class DomainLangCompletionProvider extends DefaultCompletionProvider {
|
|
12
|
+
protected completionFor(context: CompletionContext, next: NextFeature, acceptor: CompletionAcceptor): void;
|
|
13
|
+
private addTopLevelSnippets;
|
|
14
|
+
/**
|
|
15
|
+
* Add property/collection completions for BoundedContext.
|
|
16
|
+
*/
|
|
17
|
+
private addBoundedContextCompletions;
|
|
18
|
+
/**
|
|
19
|
+
* Add property completions for Domain.
|
|
20
|
+
*/
|
|
21
|
+
private addDomainCompletions;
|
|
22
|
+
/**
|
|
23
|
+
* Add completions for ContextMap.
|
|
24
|
+
* Suggests relationship patterns and context references.
|
|
25
|
+
*/
|
|
26
|
+
private addContextMapCompletions;
|
|
27
|
+
/**
|
|
28
|
+
* Add completions for DomainMap.
|
|
29
|
+
* Suggests domain references.
|
|
30
|
+
*/
|
|
31
|
+
private addDomainMapCompletions;
|
|
32
|
+
/**
|
|
33
|
+
* Add completions for relationships.
|
|
34
|
+
* Provides integration patterns and relationship types.
|
|
35
|
+
*/
|
|
36
|
+
private addRelationshipCompletions;
|
|
37
|
+
}
|