@domainlang/language 0.5.2 → 0.7.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.
Files changed (116) hide show
  1. package/README.md +1 -1
  2. package/out/domain-lang-module.js +5 -1
  3. package/out/domain-lang-module.js.map +1 -1
  4. package/out/generated/ast.d.ts +24 -0
  5. package/out/generated/ast.js.map +1 -1
  6. package/out/generated/grammar.js +22 -32
  7. package/out/generated/grammar.js.map +1 -1
  8. package/out/index.d.ts +2 -5
  9. package/out/index.js +10 -6
  10. package/out/index.js.map +1 -1
  11. package/out/lsp/domain-lang-code-actions.js +14 -8
  12. package/out/lsp/domain-lang-code-actions.js.map +1 -1
  13. package/out/lsp/domain-lang-completion.d.ts +3 -0
  14. package/out/lsp/domain-lang-completion.js +41 -13
  15. package/out/lsp/domain-lang-completion.js.map +1 -1
  16. package/out/lsp/domain-lang-formatter.js +24 -18
  17. package/out/lsp/domain-lang-formatter.js.map +1 -1
  18. package/out/lsp/domain-lang-index-manager.d.ts +170 -0
  19. package/out/lsp/domain-lang-index-manager.js +389 -0
  20. package/out/lsp/domain-lang-index-manager.js.map +1 -0
  21. package/out/lsp/domain-lang-scope-provider.d.ts +67 -0
  22. package/out/lsp/domain-lang-scope-provider.js +95 -0
  23. package/out/lsp/domain-lang-scope-provider.js.map +1 -0
  24. package/out/lsp/domain-lang-scope.js +31 -17
  25. package/out/lsp/domain-lang-scope.js.map +1 -1
  26. package/out/lsp/domain-lang-workspace-manager.d.ts +76 -9
  27. package/out/lsp/domain-lang-workspace-manager.js +176 -54
  28. package/out/lsp/domain-lang-workspace-manager.js.map +1 -1
  29. package/out/lsp/hover/domain-lang-hover.d.ts +45 -1
  30. package/out/lsp/hover/domain-lang-hover.js +308 -232
  31. package/out/lsp/hover/domain-lang-hover.js.map +1 -1
  32. package/out/lsp/hover/domain-lang-keywords.d.ts +3 -7
  33. package/out/lsp/hover/domain-lang-keywords.js +115 -38
  34. package/out/lsp/hover/domain-lang-keywords.js.map +1 -1
  35. package/out/lsp/manifest-diagnostics.js +95 -50
  36. package/out/lsp/manifest-diagnostics.js.map +1 -1
  37. package/out/main.js +204 -17
  38. package/out/main.js.map +1 -1
  39. package/out/services/import-resolver.d.ts +39 -2
  40. package/out/services/import-resolver.js +77 -12
  41. package/out/services/import-resolver.js.map +1 -1
  42. package/out/services/types.d.ts +2 -2
  43. package/out/services/workspace-manager.d.ts +33 -31
  44. package/out/services/workspace-manager.js +92 -148
  45. package/out/services/workspace-manager.js.map +1 -1
  46. package/out/utils/document-utils.d.ts +41 -0
  47. package/out/utils/document-utils.js +64 -0
  48. package/out/utils/document-utils.js.map +1 -0
  49. package/out/utils/import-utils.d.ts +0 -17
  50. package/out/utils/import-utils.js +2 -32
  51. package/out/utils/import-utils.js.map +1 -1
  52. package/out/utils/manifest-utils.d.ts +56 -0
  53. package/out/utils/manifest-utils.js +119 -0
  54. package/out/utils/manifest-utils.js.map +1 -0
  55. package/out/validation/constants.d.ts +13 -0
  56. package/out/validation/constants.js +18 -0
  57. package/out/validation/constants.js.map +1 -1
  58. package/out/validation/import.d.ts +12 -2
  59. package/out/validation/import.js +95 -22
  60. package/out/validation/import.js.map +1 -1
  61. package/out/validation/maps.js +51 -2
  62. package/out/validation/maps.js.map +1 -1
  63. package/package.json +1 -1
  64. package/src/domain-lang-module.ts +6 -1
  65. package/src/domain-lang.langium +37 -13
  66. package/src/generated/ast.ts +24 -0
  67. package/src/generated/grammar.ts +22 -32
  68. package/src/index.ts +12 -6
  69. package/src/lsp/domain-lang-code-actions.ts +13 -8
  70. package/src/lsp/domain-lang-completion.ts +61 -13
  71. package/src/lsp/domain-lang-formatter.ts +28 -23
  72. package/src/lsp/domain-lang-index-manager.ts +447 -0
  73. package/src/lsp/domain-lang-scope-provider.ts +134 -0
  74. package/src/lsp/domain-lang-scope.ts +29 -17
  75. package/src/lsp/domain-lang-workspace-manager.ts +201 -53
  76. package/src/lsp/hover/domain-lang-hover.ts +332 -226
  77. package/src/lsp/hover/domain-lang-keywords.ts +129 -43
  78. package/src/lsp/manifest-diagnostics.ts +100 -59
  79. package/src/main.ts +258 -16
  80. package/src/services/import-resolver.ts +91 -12
  81. package/src/services/types.ts +2 -2
  82. package/src/services/workspace-manager.ts +101 -175
  83. package/src/utils/document-utils.ts +80 -0
  84. package/src/utils/import-utils.ts +2 -40
  85. package/src/utils/manifest-utils.ts +132 -0
  86. package/src/validation/constants.ts +24 -0
  87. package/src/validation/import.ts +107 -24
  88. package/src/validation/maps.ts +59 -2
  89. package/out/lsp/hover/ddd-pattern-explanations.d.ts +0 -50
  90. package/out/lsp/hover/ddd-pattern-explanations.js +0 -196
  91. package/out/lsp/hover/ddd-pattern-explanations.js.map +0 -1
  92. package/out/services/dependency-analyzer.d.ts +0 -58
  93. package/out/services/dependency-analyzer.js +0 -254
  94. package/out/services/dependency-analyzer.js.map +0 -1
  95. package/out/services/dependency-resolver.d.ts +0 -146
  96. package/out/services/dependency-resolver.js +0 -452
  97. package/out/services/dependency-resolver.js.map +0 -1
  98. package/out/services/git-url-resolver.browser.d.ts +0 -10
  99. package/out/services/git-url-resolver.browser.js +0 -19
  100. package/out/services/git-url-resolver.browser.js.map +0 -1
  101. package/out/services/git-url-resolver.d.ts +0 -158
  102. package/out/services/git-url-resolver.js +0 -416
  103. package/out/services/git-url-resolver.js.map +0 -1
  104. package/out/services/governance-validator.d.ts +0 -44
  105. package/out/services/governance-validator.js +0 -153
  106. package/out/services/governance-validator.js.map +0 -1
  107. package/out/services/semver.d.ts +0 -98
  108. package/out/services/semver.js +0 -195
  109. package/out/services/semver.js.map +0 -1
  110. package/src/lsp/hover/ddd-pattern-explanations.ts +0 -237
  111. package/src/services/dependency-analyzer.ts +0 -321
  112. package/src/services/dependency-resolver.ts +0 -551
  113. package/src/services/git-url-resolver.browser.ts +0 -26
  114. package/src/services/git-url-resolver.ts +0 -517
  115. package/src/services/governance-validator.ts +0 -177
  116. package/src/services/semver.ts +0 -213
@@ -11,6 +11,7 @@ import { DomainLangGeneratedModule, DomainLangGeneratedSharedModule } from './ge
11
11
  import { registerValidationChecks } from './validation/domain-lang-validator.js';
12
12
  import { QualifiedNameProvider } from './lsp/domain-lang-naming.js';
13
13
  import { DomainLangScopeComputation } from './lsp/domain-lang-scope.js';
14
+ import { DomainLangScopeProvider } from './lsp/domain-lang-scope-provider.js';
14
15
  import { DomainLangFormatter } from './lsp/domain-lang-formatter.js';
15
16
  import { DomainLangHoverProvider } from './lsp/hover/domain-lang-hover.js';
16
17
  import { DomainLangCompletionProvider } from './lsp/domain-lang-completion.js';
@@ -18,6 +19,7 @@ import { DomainLangCodeActionProvider } from './lsp/domain-lang-code-actions.js'
18
19
  import { ImportResolver } from './services/import-resolver.js';
19
20
  import { WorkspaceManager } from './services/workspace-manager.js';
20
21
  import { DomainLangWorkspaceManager } from './lsp/domain-lang-workspace-manager.js';
22
+ import { DomainLangIndexManager } from './lsp/domain-lang-index-manager.js';
21
23
 
22
24
  /**
23
25
  * Declaration of custom services - add your own service classes here.
@@ -46,7 +48,8 @@ export type DomainLangServices = LangiumServices & DomainLangAddedServices
46
48
 
47
49
  const DomainLangSharedModule: Module<LangiumSharedServices, PartialLangiumSharedServices> = {
48
50
  workspace: {
49
- WorkspaceManager: (services: LangiumSharedServices) => new DomainLangWorkspaceManager(services)
51
+ WorkspaceManager: (services: LangiumSharedServices) => new DomainLangWorkspaceManager(services),
52
+ IndexManager: (services: LangiumSharedServices) => new DomainLangIndexManager(services)
50
53
  }
51
54
  };
52
55
 
@@ -62,6 +65,7 @@ export const DomainLangModule: Module<DomainLangServices, PartialLangiumServices
62
65
  },
63
66
  references: {
64
67
  ScopeComputation: (services) => new DomainLangScopeComputation(services),
68
+ ScopeProvider: (services) => new DomainLangScopeProvider(services),
65
69
  QualifiedNameProvider: () => new QualifiedNameProvider()
66
70
  },
67
71
  lsp: {
@@ -103,6 +107,7 @@ export function createDomainLangServices(context: DefaultSharedModuleContext): {
103
107
  );
104
108
  shared.ServiceRegistry.register(DomainLang);
105
109
  registerValidationChecks(DomainLang);
110
+
106
111
  if (!context.connection) {
107
112
  // We don't run inside a language server
108
113
  // Therefore, initialize the configuration provider instantly
@@ -64,9 +64,11 @@ Type:
64
64
  * Can be nested via `in` to show subdomain hierarchy.
65
65
  * The `type` property indicates strategic importance (Core, Supporting, Generic) per Bounded Context Canvas.
66
66
  * Body is optional - allows header-only Domain definitions.
67
+ *
68
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#domains)
67
69
  */
68
70
  Domain:
69
- (/** A Domain represents a sphere of knowledge, influence, or activity. In DDD, it is the subject area to which the user applies a program. Example: Sales, Shipping, Accounting. */ 'Domain' | 'dom') name=ID ('in' parent=[Domain:QualifiedName])?
71
+ ('Domain' | 'dom') name=ID ('in' parent=[Domain:QualifiedName])?
70
72
  ('{'
71
73
  (
72
74
  ('description' Assignment description=STRING) |
@@ -84,9 +86,11 @@ Domain:
84
86
  * The `classification` property indicates strategic importance per Bounded Context Canvas.
85
87
  * The `evolution` property indicates maturity stage per Wardley Maps/BC Canvas.
86
88
  * The `archetype` property indicates behavioral role per DDD archetypes (Gateway, Execution, etc).
89
+ *
90
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#bounded-contexts)
87
91
  */
88
92
  BoundedContext:
89
- (/** A Bounded Context defines the boundary within which a particular domain model is defined and applicable. It is a central pattern in DDD for managing complexity. Example: SalesContext, SupportContext. */ 'BoundedContext' | 'bc') name=ID
93
+ ('BoundedContext' | 'bc') name=ID
90
94
  ('for' domain=[Domain:QualifiedName])?
91
95
  (
92
96
  ('as' classification+=[Classification:QualifiedName])?
@@ -101,7 +105,7 @@ BoundedContext:
101
105
  ('evolution' Assignment evolution=[Classification:QualifiedName]) |
102
106
  ('archetype' Assignment archetype=[Classification:QualifiedName]) |
103
107
  (('metadata' | 'meta') '{' (metadata+=MetadataEntry)* '}') |
104
- (('relationships' | 'integrations') '{'
108
+ (('relationships' | 'integrations') '{'
105
109
  (relationships += Relationship ((",")? relationships += Relationship)*)*
106
110
  '}') |
107
111
  (('terminology' | 'glossary') '{'
@@ -126,26 +130,32 @@ MetadataEntry:
126
130
  /**
127
131
  * Team - People responsible for a Bounded Context or Domain.
128
132
  * Represents organizational boundaries in DDD.
133
+ *
134
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#teams)
129
135
  */
130
136
  Team:
131
- (/** A Team represents the people responsible for a Bounded Context or Domain. */ 'Team') name=ID
137
+ 'Team' name=ID
132
138
  ;
133
139
 
134
140
  /**
135
141
  * Classification - Reusable label for categorizing elements.
136
142
  * Examples: Core, Supporting, Generic, Strategic, Commodity, Architectural, Business, Technical.
143
+ *
144
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#classifications)
137
145
  */
138
146
  Classification:
139
- (/** A Classification is a reusable label for categorizing domains, contexts, patterns, and decisions (e.g., Core, Supporting, Generic, Architectural, Business, Technical). */ 'Classification') name=ID
147
+ 'Classification' name=ID
140
148
  ;
141
149
 
142
150
  /**
143
151
  * Metadata - Defines a key that can be used in metadata blocks.
144
152
  * Examples: Language, Framework, Database, Repository.
145
153
  * Can be defined locally or imported from stdlib.
154
+ *
155
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#metadata)
146
156
  */
147
157
  Metadata:
148
- (/** A Metadata defines a key that can be used in metadata blocks. Examples: Language, Framework, Database, Repository. Can be defined locally or imported from stdlib. */ 'Metadata') name=ID
158
+ 'Metadata' name=ID
149
159
  ;
150
160
 
151
161
 
@@ -164,9 +174,11 @@ ObjectMap:
164
174
  /**
165
175
  * Context Map - Visualizes relationships between Bounded Contexts.
166
176
  * Shows integration patterns and team interactions.
177
+ *
178
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#context-maps)
167
179
  */
168
180
  ContextMap:
169
- (/** A Context Map visualizes and documents the relationships between Bounded Contexts, including their integration patterns. */ 'ContextMap' | 'cmap') name=ID
181
+ ('ContextMap' | 'cmap') name=ID
170
182
  '{'
171
183
  ('contains' boundedContexts += [+BoundedContext:QualifiedName] ((",")? boundedContexts += [+BoundedContext:QualifiedName])*)*
172
184
  (relationships += Relationship ((",")? relationships += Relationship)*)*
@@ -176,9 +188,11 @@ ContextMap:
176
188
  /**
177
189
  * Domain Map - Visualizes relationships between Domains.
178
190
  * Shows high-level domain organization and subdomain structure.
191
+ *
192
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#domain-maps)
179
193
  */
180
194
  DomainMap:
181
- (/** A Domain Map visualizes and documents the relationships between Domains. */ 'DomainMap' | 'dmap') name=ID
195
+ ('DomainMap' | 'dmap') name=ID
182
196
  '{'
183
197
  ('contains' domains += [+Domain:QualifiedName] ((",")? domains += [+Domain:QualifiedName])*)*
184
198
  '}'
@@ -191,6 +205,8 @@ DomainMap:
191
205
  /**
192
206
  * Relationship - Connection between two Bounded Contexts.
193
207
  * Supports DDD integration patterns (ACL, OHS, PL, etc.) and relationship types.
208
+ *
209
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#relationships)
194
210
  */
195
211
  Relationship:
196
212
  ('[' leftPatterns+=IntegrationPattern (',' leftPatterns+=IntegrationPattern)* ']')?
@@ -252,6 +268,8 @@ RelationshipType returns string:
252
268
  /**
253
269
  * Domain Terminology - Ubiquitous language terms with definitions.
254
270
  * Supports synonyms and examples for richer glossaries.
271
+ *
272
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#terminology)
255
273
  */
256
274
  DomainTerm:
257
275
  ('Term' | 'term') name=ID (Assignment meaning=STRING)?
@@ -262,6 +280,8 @@ DomainTerm:
262
280
  /**
263
281
  * Decisions, Policies, and Business Rules.
264
282
  * All types are interchangeable - use what reads best for your domain.
283
+ *
284
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#decisions-policies-rules)
265
285
  */
266
286
  AbstractDecision:
267
287
  Decision |
@@ -270,19 +290,19 @@ AbstractDecision:
270
290
  ;
271
291
 
272
292
  Decision:
273
- (/** A documented choice or rule that affects the model or process. */ 'Decision' | 'decision')
293
+ ('Decision' | 'decision')
274
294
  ('[' classification=[Classification:QualifiedName] ']')?
275
295
  name=ID Assignment value=STRING
276
296
  ;
277
297
 
278
298
  Policy:
279
- (/** A business rule or guideline that governs behavior within a context. */ 'Policy' | 'policy')
299
+ ('Policy' | 'policy')
280
300
  ('[' classification=[Classification:QualifiedName] ']')?
281
301
  name=ID Assignment value=STRING
282
302
  ;
283
303
 
284
304
  BusinessRule:
285
- (/** A business rule or guideline that governs behavior within a context. */ 'Rule' | 'rule')
305
+ ('Rule' | 'rule')
286
306
  ('[' classification=[Classification:QualifiedName] ']')?
287
307
  name=ID Assignment value=STRING
288
308
  ;
@@ -301,17 +321,21 @@ BusinessRule:
301
321
  *
302
322
  * All resolution details (source, version, integrity) live in model.yaml manifest.
303
323
  * Named imports and inline integrity checks have been removed per PRS-010.
324
+ *
325
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#imports)
304
326
  */
305
327
  ImportStatement:
306
- /** Imports types or namespaces from another file or module, enabling reuse and modularity. */ ('Import' | 'import') uri=STRING ('as' alias=ID)?
328
+ ('Import' | 'import') uri=STRING ('as' alias=ID)?
307
329
  ;
308
330
 
309
331
  /**
310
332
  * Namespace Declaration - Hierarchical namespacing for organizing models.
311
333
  * Combines package modularity with group-style nesting.
334
+ *
335
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#namespaces)
312
336
  */
313
337
  NamespaceDeclaration:
314
- (/** Namespaces organize large models into hierarchical qualified names for symbol resolution. */ 'Namespace' | 'ns') name=QualifiedName '{'
338
+ ('Namespace' | 'ns') name=QualifiedName '{'
315
339
  (children+=StructureElement)*
316
340
  '}'
317
341
  ;
@@ -101,6 +101,8 @@ export type DomainLangTokenNames = DomainLangTerminalNames | DomainLangKeywordNa
101
101
  /**
102
102
  * Decisions, Policies, and Business Rules.
103
103
  * All types are interchangeable - use what reads best for your domain.
104
+ *
105
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#decisions-policies-rules)
104
106
  */
105
107
  export type AbstractDecision = BusinessRule | Decision | Policy;
106
108
 
@@ -129,6 +131,8 @@ export function isAssignment(item: unknown): item is Assignment {
129
131
  * The `classification` property indicates strategic importance per Bounded Context Canvas.
130
132
  * The `evolution` property indicates maturity stage per Wardley Maps/BC Canvas.
131
133
  * The `archetype` property indicates behavioral role per DDD archetypes (Gateway, Execution, etc).
134
+ *
135
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#bounded-contexts)
132
136
  */
133
137
  export interface BoundedContext extends langium.AstNode {
134
138
  readonly $container: Model | NamespaceDeclaration;
@@ -206,6 +210,8 @@ export function isBusinessRule(item: unknown): item is BusinessRule {
206
210
  /**
207
211
  * Classification - Reusable label for categorizing elements.
208
212
  * Examples: Core, Supporting, Generic, Strategic, Commodity, Architectural, Business, Technical.
213
+ *
214
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#classifications)
209
215
  */
210
216
  export interface Classification extends langium.AstNode {
211
217
  readonly $container: Model | NamespaceDeclaration;
@@ -235,6 +241,8 @@ export function isContainer(item: unknown): item is Container {
235
241
  /**
236
242
  * Context Map - Visualizes relationships between Bounded Contexts.
237
243
  * Shows integration patterns and team interactions.
244
+ *
245
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#context-maps)
238
246
  */
239
247
  export interface ContextMap extends langium.AstNode {
240
248
  readonly $container: Model | NamespaceDeclaration;
@@ -279,6 +287,8 @@ export function isDecision(item: unknown): item is Decision {
279
287
  * Can be nested via `in` to show subdomain hierarchy.
280
288
  * The `type` property indicates strategic importance (Core, Supporting, Generic) per Bounded Context Canvas.
281
289
  * Body is optional - allows header-only Domain definitions.
290
+ *
291
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#domains)
282
292
  */
283
293
  export interface Domain extends langium.AstNode {
284
294
  readonly $container: Model | NamespaceDeclaration;
@@ -306,6 +316,8 @@ export function isDomain(item: unknown): item is Domain {
306
316
  /**
307
317
  * Domain Map - Visualizes relationships between Domains.
308
318
  * Shows high-level domain organization and subdomain structure.
319
+ *
320
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#domain-maps)
309
321
  */
310
322
  export interface DomainMap extends langium.AstNode {
311
323
  readonly $container: Model | NamespaceDeclaration;
@@ -327,6 +339,8 @@ export function isDomainMap(item: unknown): item is DomainMap {
327
339
  /**
328
340
  * Domain Terminology - Ubiquitous language terms with definitions.
329
341
  * Supports synonyms and examples for richer glossaries.
342
+ *
343
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#terminology)
330
344
  */
331
345
  export interface DomainTerm extends langium.AstNode {
332
346
  readonly $container: BoundedContext;
@@ -359,6 +373,8 @@ export function isDomainTerm(item: unknown): item is DomainTerm {
359
373
  *
360
374
  * All resolution details (source, version, integrity) live in model.yaml manifest.
361
375
  * Named imports and inline integrity checks have been removed per PRS-010.
376
+ *
377
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#imports)
362
378
  */
363
379
  export interface ImportStatement extends langium.AstNode {
364
380
  readonly $container: Model;
@@ -390,6 +406,8 @@ export function isIntegrationPattern(item: unknown): item is IntegrationPattern
390
406
  * Metadata - Defines a key that can be used in metadata blocks.
391
407
  * Examples: Language, Framework, Database, Repository.
392
408
  * Can be defined locally or imported from stdlib.
409
+ *
410
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#metadata)
393
411
  */
394
412
  export interface Metadata extends langium.AstNode {
395
413
  readonly $container: Model | NamespaceDeclaration;
@@ -446,6 +464,8 @@ export function isModel(item: unknown): item is Model {
446
464
  /**
447
465
  * Namespace Declaration - Hierarchical namespacing for organizing models.
448
466
  * Combines package modularity with group-style nesting.
467
+ *
468
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#namespaces)
449
469
  */
450
470
  export interface NamespaceDeclaration extends langium.AstNode {
451
471
  readonly $container: Model | NamespaceDeclaration;
@@ -508,6 +528,8 @@ export function isQualifiedName(item: unknown): item is QualifiedName {
508
528
  /**
509
529
  * Relationship - Connection between two Bounded Contexts.
510
530
  * Supports DDD integration patterns (ACL, OHS, PL, etc.) and relationship types.
531
+ *
532
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#relationships)
511
533
  */
512
534
  export interface Relationship extends langium.AstNode {
513
535
  readonly $container: BoundedContext | ContextMap;
@@ -575,6 +597,8 @@ export function isStructureElement(item: unknown): item is StructureElement {
575
597
  /**
576
598
  * Team - People responsible for a Bounded Context or Domain.
577
599
  * Represents organizational boundaries in DDD.
600
+ *
601
+ * [Read more on domainlang.net](https://domainlang.net/reference/language#teams)
578
602
  */
579
603
  export interface Team extends langium.AstNode {
580
604
  readonly $container: Model | NamespaceDeclaration;
@@ -144,8 +144,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
144
144
  "elements": [
145
145
  {
146
146
  "$type": "Keyword",
147
- "value": "Domain",
148
- "$comment": "/** A Domain represents a sphere of knowledge, influence, or activity. In DDD, it is the subject area to which the user applies a program. Example: Sales, Shipping, Accounting. */"
147
+ "value": "Domain"
149
148
  },
150
149
  {
151
150
  "$type": "Keyword",
@@ -312,7 +311,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
312
311
  "entry": false,
313
312
  "fragment": false,
314
313
  "parameters": [],
315
- "$comment": "/**\\n * Domain - A sphere of knowledge or activity in DDD.\\n * Can be nested via \`in\` to show subdomain hierarchy.\\n * The \`type\` property indicates strategic importance (Core, Supporting, Generic) per Bounded Context Canvas.\\n * Body is optional - allows header-only Domain definitions.\\n */"
314
+ "$comment": "/**\\n * Domain - A sphere of knowledge or activity in DDD.\\n * Can be nested via \`in\` to show subdomain hierarchy.\\n * The \`type\` property indicates strategic importance (Core, Supporting, Generic) per Bounded Context Canvas.\\n * Body is optional - allows header-only Domain definitions.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#domains)\\n */"
316
315
  },
317
316
  {
318
317
  "$type": "ParserRule",
@@ -325,8 +324,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
325
324
  "elements": [
326
325
  {
327
326
  "$type": "Keyword",
328
- "value": "BoundedContext",
329
- "$comment": "/** A Bounded Context defines the boundary within which a particular domain model is defined and applicable. It is a central pattern in DDD for managing complexity. Example: SalesContext, SupportContext. */"
327
+ "value": "BoundedContext"
330
328
  },
331
329
  {
332
330
  "$type": "Keyword",
@@ -879,7 +877,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
879
877
  "entry": false,
880
878
  "fragment": false,
881
879
  "parameters": [],
882
- "$comment": "/**\\n * Bounded Context - A boundary within which a domain model is defined.\\n * Central pattern in DDD for managing complexity and team boundaries.\\n * Belongs to exactly ONE domain (fundamental DDD principle).\\n * Body properties can appear in any order. Validation enforces at-most-once constraint.\\n * The \`classification\` property indicates strategic importance per Bounded Context Canvas.\\n * The \`evolution\` property indicates maturity stage per Wardley Maps/BC Canvas.\\n * The \`archetype\` property indicates behavioral role per DDD archetypes (Gateway, Execution, etc).\\n */"
880
+ "$comment": "/**\\n * Bounded Context - A boundary within which a domain model is defined.\\n * Central pattern in DDD for managing complexity and team boundaries.\\n * Belongs to exactly ONE domain (fundamental DDD principle).\\n * Body properties can appear in any order. Validation enforces at-most-once constraint.\\n * The \`classification\` property indicates strategic importance per Bounded Context Canvas.\\n * The \`evolution\` property indicates maturity stage per Wardley Maps/BC Canvas.\\n * The \`archetype\` property indicates behavioral role per DDD archetypes (Gateway, Execution, etc).\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#bounded-contexts)\\n */"
883
881
  },
884
882
  {
885
883
  "$type": "ParserRule",
@@ -959,7 +957,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
959
957
  "entry": false,
960
958
  "fragment": false,
961
959
  "parameters": [],
962
- "$comment": "/**\\n * Team - People responsible for a Bounded Context or Domain.\\n * Represents organizational boundaries in DDD.\\n */"
960
+ "$comment": "/**\\n * Team - People responsible for a Bounded Context or Domain.\\n * Represents organizational boundaries in DDD.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#teams)\\n */"
963
961
  },
964
962
  {
965
963
  "$type": "ParserRule",
@@ -988,7 +986,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
988
986
  "entry": false,
989
987
  "fragment": false,
990
988
  "parameters": [],
991
- "$comment": "/**\\n * Classification - Reusable label for categorizing elements.\\n * Examples: Core, Supporting, Generic, Strategic, Commodity, Architectural, Business, Technical.\\n */"
989
+ "$comment": "/**\\n * Classification - Reusable label for categorizing elements.\\n * Examples: Core, Supporting, Generic, Strategic, Commodity, Architectural, Business, Technical.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#classifications)\\n */"
992
990
  },
993
991
  {
994
992
  "$type": "ParserRule",
@@ -1017,7 +1015,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
1017
1015
  "entry": false,
1018
1016
  "fragment": false,
1019
1017
  "parameters": [],
1020
- "$comment": "/**\\n * Metadata - Defines a key that can be used in metadata blocks.\\n * Examples: Language, Framework, Database, Repository.\\n * Can be defined locally or imported from stdlib.\\n */"
1018
+ "$comment": "/**\\n * Metadata - Defines a key that can be used in metadata blocks.\\n * Examples: Language, Framework, Database, Repository.\\n * Can be defined locally or imported from stdlib.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#metadata)\\n */"
1021
1019
  },
1022
1020
  {
1023
1021
  "$type": "ParserRule",
@@ -1057,8 +1055,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
1057
1055
  "elements": [
1058
1056
  {
1059
1057
  "$type": "Keyword",
1060
- "value": "ContextMap",
1061
- "$comment": "/** A Context Map visualizes and documents the relationships between Bounded Contexts, including their integration patterns. */"
1058
+ "value": "ContextMap"
1062
1059
  },
1063
1060
  {
1064
1061
  "$type": "Keyword",
@@ -1193,7 +1190,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
1193
1190
  "entry": false,
1194
1191
  "fragment": false,
1195
1192
  "parameters": [],
1196
- "$comment": "/**\\n * Context Map - Visualizes relationships between Bounded Contexts.\\n * Shows integration patterns and team interactions.\\n */"
1193
+ "$comment": "/**\\n * Context Map - Visualizes relationships between Bounded Contexts.\\n * Shows integration patterns and team interactions.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#context-maps)\\n */"
1197
1194
  },
1198
1195
  {
1199
1196
  "$type": "ParserRule",
@@ -1206,8 +1203,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
1206
1203
  "elements": [
1207
1204
  {
1208
1205
  "$type": "Keyword",
1209
- "value": "DomainMap",
1210
- "$comment": "/** A Domain Map visualizes and documents the relationships between Domains. */"
1206
+ "value": "DomainMap"
1211
1207
  },
1212
1208
  {
1213
1209
  "$type": "Keyword",
@@ -1301,7 +1297,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
1301
1297
  "entry": false,
1302
1298
  "fragment": false,
1303
1299
  "parameters": [],
1304
- "$comment": "/**\\n * Domain Map - Visualizes relationships between Domains.\\n * Shows high-level domain organization and subdomain structure.\\n */"
1300
+ "$comment": "/**\\n * Domain Map - Visualizes relationships between Domains.\\n * Shows high-level domain organization and subdomain structure.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#domain-maps)\\n */"
1305
1301
  },
1306
1302
  {
1307
1303
  "$type": "ParserRule",
@@ -1471,7 +1467,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
1471
1467
  "entry": false,
1472
1468
  "fragment": false,
1473
1469
  "parameters": [],
1474
- "$comment": "/**\\n * Relationship - Connection between two Bounded Contexts.\\n * Supports DDD integration patterns (ACL, OHS, PL, etc.) and relationship types.\\n */"
1470
+ "$comment": "/**\\n * Relationship - Connection between two Bounded Contexts.\\n * Supports DDD integration patterns (ACL, OHS, PL, etc.) and relationship types.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#relationships)\\n */"
1475
1471
  },
1476
1472
  {
1477
1473
  "$type": "ParserRule",
@@ -1830,7 +1826,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
1830
1826
  "entry": false,
1831
1827
  "fragment": false,
1832
1828
  "parameters": [],
1833
- "$comment": "/**\\n * Domain Terminology - Ubiquitous language terms with definitions.\\n * Supports synonyms and examples for richer glossaries.\\n */"
1829
+ "$comment": "/**\\n * Domain Terminology - Ubiquitous language terms with definitions.\\n * Supports synonyms and examples for richer glossaries.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#terminology)\\n */"
1834
1830
  },
1835
1831
  {
1836
1832
  "$type": "ParserRule",
@@ -1864,7 +1860,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
1864
1860
  "entry": false,
1865
1861
  "fragment": false,
1866
1862
  "parameters": [],
1867
- "$comment": "/**\\n * Decisions, Policies, and Business Rules.\\n * All types are interchangeable - use what reads best for your domain.\\n */"
1863
+ "$comment": "/**\\n * Decisions, Policies, and Business Rules.\\n * All types are interchangeable - use what reads best for your domain.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#decisions-policies-rules)\\n */"
1868
1864
  },
1869
1865
  {
1870
1866
  "$type": "ParserRule",
@@ -1877,8 +1873,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
1877
1873
  "elements": [
1878
1874
  {
1879
1875
  "$type": "Keyword",
1880
- "value": "Decision",
1881
- "$comment": "/** A documented choice or rule that affects the model or process. */"
1876
+ "value": "Decision"
1882
1877
  },
1883
1878
  {
1884
1879
  "$type": "Keyword",
@@ -1968,8 +1963,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
1968
1963
  "elements": [
1969
1964
  {
1970
1965
  "$type": "Keyword",
1971
- "value": "Policy",
1972
- "$comment": "/** A business rule or guideline that governs behavior within a context. */"
1966
+ "value": "Policy"
1973
1967
  },
1974
1968
  {
1975
1969
  "$type": "Keyword",
@@ -2059,8 +2053,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
2059
2053
  "elements": [
2060
2054
  {
2061
2055
  "$type": "Keyword",
2062
- "value": "Rule",
2063
- "$comment": "/** A business rule or guideline that governs behavior within a context. */"
2056
+ "value": "Rule"
2064
2057
  },
2065
2058
  {
2066
2059
  "$type": "Keyword",
@@ -2156,8 +2149,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
2156
2149
  "$type": "Keyword",
2157
2150
  "value": "import"
2158
2151
  }
2159
- ],
2160
- "$comment": "/** Imports types or namespaces from another file or module, enabling reuse and modularity. */"
2152
+ ]
2161
2153
  },
2162
2154
  {
2163
2155
  "$type": "Assignment",
@@ -2193,13 +2185,12 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
2193
2185
  ],
2194
2186
  "cardinality": "?"
2195
2187
  }
2196
- ],
2197
- "$comment": "/** Imports types or namespaces from another file or module, enabling reuse and modularity. */"
2188
+ ]
2198
2189
  },
2199
2190
  "entry": false,
2200
2191
  "fragment": false,
2201
2192
  "parameters": [],
2202
- "$comment": "/**\\n * Import Statement - Manifest-centric import system per PRS-010.\\n * \\n * Simplified syntax where import statements use short specifiers:\\n * - External dependencies (from manifest): import \\"core\\" as Core\\n * - Local files: import \\"./shared/types.dlang\\"\\n * - Workspace-relative: import \\"~/contexts/sales.dlang\\"\\n * \\n * All resolution details (source, version, integrity) live in model.yaml manifest.\\n * Named imports and inline integrity checks have been removed per PRS-010.\\n */"
2193
+ "$comment": "/**\\n * Import Statement - Manifest-centric import system per PRS-010.\\n * \\n * Simplified syntax where import statements use short specifiers:\\n * - External dependencies (from manifest): import \\"core\\" as Core\\n * - Local files: import \\"./shared/types.dlang\\"\\n * - Workspace-relative: import \\"~/contexts/sales.dlang\\"\\n * \\n * All resolution details (source, version, integrity) live in model.yaml manifest.\\n * Named imports and inline integrity checks have been removed per PRS-010.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#imports)\\n */"
2203
2194
  },
2204
2195
  {
2205
2196
  "$type": "ParserRule",
@@ -2212,8 +2203,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
2212
2203
  "elements": [
2213
2204
  {
2214
2205
  "$type": "Keyword",
2215
- "value": "Namespace",
2216
- "$comment": "/** Namespaces organize large models into hierarchical qualified names for symbol resolution. */"
2206
+ "value": "Namespace"
2217
2207
  },
2218
2208
  {
2219
2209
  "$type": "Keyword",
@@ -2259,7 +2249,7 @@ export const DomainLangGrammar = (): Grammar => loadedDomainLangGrammar ?? (load
2259
2249
  "entry": false,
2260
2250
  "fragment": false,
2261
2251
  "parameters": [],
2262
- "$comment": "/**\\n * Namespace Declaration - Hierarchical namespacing for organizing models.\\n * Combines package modularity with group-style nesting.\\n */"
2252
+ "$comment": "/**\\n * Namespace Declaration - Hierarchical namespacing for organizing models.\\n * Combines package modularity with group-style nesting.\\n * \\n * [Read more on domainlang.net](https://domainlang.net/reference/language#namespaces)\\n */"
2263
2253
  },
2264
2254
  {
2265
2255
  "$type": "ParserRule",
package/src/index.ts CHANGED
@@ -9,16 +9,22 @@ export * from './ast-augmentation.js';
9
9
  // Export centralized types (canonical source for all service types)
10
10
  export * from './services/types.js';
11
11
 
12
- // Export services
12
+ // Export services (read-only for LSP - no network operations)
13
13
  export * from './services/workspace-manager.js';
14
- export * from './services/dependency-resolver.js';
15
- export * from './services/dependency-analyzer.js';
16
- export * from './services/governance-validator.js';
17
14
  export * from './services/import-resolver.js';
18
15
  export * from './services/relationship-inference.js';
19
- export * from './services/git-url-resolver.js';
20
16
  export * from './services/performance-optimizer.js';
21
- export * from './services/semver.js';
17
+
18
+ // Export shared utilities
19
+ export * from './utils/manifest-utils.js';
20
+
21
+ // Note: The following services have been moved to CLI package:
22
+ // - git-url-resolver.ts → @domainlang/cli/services
23
+ // - dependency-resolver.ts → @domainlang/cli/services
24
+ // - dependency-analyzer.ts → @domainlang/cli/services
25
+ // - governance-validator.ts → @domainlang/cli/services
26
+ // - semver.ts → @domainlang/cli/services
22
27
 
23
28
  // Export LSP services
24
29
  export * from './lsp/manifest-diagnostics.js';
30
+ export { DomainLangIndexManager } from './lsp/domain-lang-index-manager.js';
@@ -46,16 +46,21 @@ export class DomainLangCodeActionProvider implements CodeActionProvider {
46
46
  document: LangiumDocument,
47
47
  params: CodeActionParams
48
48
  ): MaybePromise<Array<Command | CodeAction> | undefined> {
49
- const result: CodeAction[] = [];
50
- const acceptor = (ca: CodeAction | undefined): void => {
51
- if (ca) result.push(ca);
52
- };
49
+ try {
50
+ const result: CodeAction[] = [];
51
+ const acceptor = (ca: CodeAction | undefined): void => {
52
+ if (ca) result.push(ca);
53
+ };
53
54
 
54
- for (const diagnostic of params.context.diagnostics) {
55
- this.createCodeActions(diagnostic, document, acceptor);
56
- }
55
+ for (const diagnostic of params.context.diagnostics) {
56
+ this.createCodeActions(diagnostic, document, acceptor);
57
+ }
57
58
 
58
- return result.length > 0 ? result : undefined;
59
+ return result.length > 0 ? result : undefined;
60
+ } catch (error) {
61
+ console.error('Error in getCodeActions:', error);
62
+ return undefined;
63
+ }
59
64
  }
60
65
 
61
66
  /**