@reqlan/language 1.9.5 → 1.9.7

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 (52) hide show
  1. package/README.md +14 -0
  2. package/README.template.md +2 -0
  3. package/out/file-path-rewrite.d.ts +3 -0
  4. package/out/file-path-rewrite.js +1 -0
  5. package/out/file-path-rewrite.js.map +1 -1
  6. package/out/index.d.ts +2 -1
  7. package/out/index.js +2 -1
  8. package/out/index.js.map +1 -1
  9. package/out/reqlan-code-action-provider.d.ts +1 -0
  10. package/out/reqlan-code-action-provider.js +12 -21
  11. package/out/reqlan-code-action-provider.js.map +1 -1
  12. package/out/reqlan-comment-diagnostics.d.ts +11 -0
  13. package/out/reqlan-comment-diagnostics.js +81 -11
  14. package/out/reqlan-comment-diagnostics.js.map +1 -1
  15. package/out/reqlan-comment-rename.d.ts +1 -0
  16. package/out/reqlan-comment-rename.js.map +1 -1
  17. package/out/reqlan-document-builder.d.ts +9 -0
  18. package/out/reqlan-document-builder.js +26 -0
  19. package/out/reqlan-document-builder.js.map +1 -0
  20. package/out/reqlan-document-link-provider.d.ts +3 -1
  21. package/out/reqlan-document-link-provider.js +6 -1
  22. package/out/reqlan-document-link-provider.js.map +1 -1
  23. package/out/reqlan-idea-move-imports.d.ts +24 -0
  24. package/out/reqlan-idea-move-imports.js +309 -0
  25. package/out/reqlan-idea-move-imports.js.map +1 -0
  26. package/out/reqlan-idea-refactor.d.ts +15 -4
  27. package/out/reqlan-idea-refactor.js +106 -14
  28. package/out/reqlan-idea-refactor.js.map +1 -1
  29. package/out/reqlan-import-edits.d.ts +1 -0
  30. package/out/reqlan-import-edits.js +8 -0
  31. package/out/reqlan-import-edits.js.map +1 -1
  32. package/out/reqlan-module.js +3 -1
  33. package/out/reqlan-module.js.map +1 -1
  34. package/out/reqlan-path-references.js +8 -2
  35. package/out/reqlan-path-references.js.map +1 -1
  36. package/out/reqlan-validator.d.ts +5 -0
  37. package/out/reqlan-validator.js +17 -0
  38. package/out/reqlan-validator.js.map +1 -1
  39. package/package.json +1 -1
  40. package/src/file-path-rewrite.ts +3 -0
  41. package/src/index.ts +4 -0
  42. package/src/reqlan-code-action-provider.ts +12 -24
  43. package/src/reqlan-comment-diagnostics.ts +108 -11
  44. package/src/reqlan-comment-rename.ts +1 -0
  45. package/src/reqlan-document-builder.ts +35 -0
  46. package/src/reqlan-document-link-provider.ts +18 -3
  47. package/src/reqlan-idea-move-imports.ts +398 -0
  48. package/src/reqlan-idea-refactor.ts +152 -15
  49. package/src/reqlan-import-edits.ts +9 -0
  50. package/src/reqlan-module.ts +3 -1
  51. package/src/reqlan-path-references.ts +9 -2
  52. package/src/reqlan-validator.ts +23 -0
@@ -11,6 +11,7 @@ import {
11
11
  type AnonymousBlock,
12
12
  type Model
13
13
  } from './generated/ast.js';
14
+ import { collectCommentReferenceIssues } from './reqlan-comment-diagnostics.js';
14
15
  import {
15
16
  collectFileLinks,
16
17
  fileLinkTargetIssueMessage
@@ -36,6 +37,8 @@ import {
36
37
  * rq:["../../../reqlan rq/language/imports.rq".import_error_recovery]
37
38
  * rq:["../../../reqlan rq/language/imports.rq".import_tokenisation]
38
39
  * rq:["../../../reqlan rq/language/syntax.rq".no_name_idea_safe_warning]
40
+ * rq:["../../../reqlan rq/language/syntax.rq".comment_reference_resolution_error]
41
+ * rq:["../../../reqlan rq/extension/features-non-rq-code-comment/functional-code-comment-references.rq".comment_reference_resolution_error_state]
39
42
  */
40
43
  export function registerValidationChecks(services: ReqlanServices) {
41
44
  const registry = services.validation.ValidationRegistry;
@@ -53,6 +56,8 @@ export function registerValidationChecks(services: ReqlanServices) {
53
56
  * rq:["../../../reqlan rq/language/imports.rq".import_error_recovery]
54
57
  * rq:["../../../reqlan rq/language/imports.rq".import_tokenisation]
55
58
  * rq:["../../../reqlan rq/language/syntax.rq".no_name_idea_safe_warning]
59
+ * rq:["../../../reqlan rq/language/syntax.rq".comment_reference_resolution_error]
60
+ * rq:["../../../reqlan rq/extension/features-non-rq-code-comment/functional-code-comment-references.rq".comment_reference_resolution_error_state]
56
61
  */
57
62
  export class ReqlanValidator {
58
63
 
@@ -64,6 +69,7 @@ export class ReqlanValidator {
64
69
  this.checkImportSyntax(model, accept);
65
70
  this.checkImportTargets(model, accept);
66
71
  this.checkFileReferenceTargets(model, accept);
72
+ this.checkCommentReferences(model, accept);
67
73
  this.checkWildcardReferences(model, accept);
68
74
  }
69
75
 
@@ -212,6 +218,23 @@ export class ReqlanValidator {
212
218
  }
213
219
  }
214
220
 
221
+ checkCommentReferences(model: Model, accept: ValidationAcceptor): void {
222
+ const document = AstUtils.getDocument(model);
223
+ const { shared } = this.services;
224
+ for (const issue of collectCommentReferenceIssues(
225
+ document,
226
+ shared.workspace.LangiumDocuments,
227
+ shared.workspace.FileSystemProvider,
228
+ pathResolveContextFromServices(this.services)
229
+ )) {
230
+ accept('error', issue.message, {
231
+ node: model,
232
+ range: issue.range,
233
+ code: issue.code
234
+ });
235
+ }
236
+ }
237
+
215
238
  checkWildcardReferences(model: Model, accept: ValidationAcceptor): void {
216
239
  const { shared } = this.services;
217
240
  const context = pathResolveContextFromServices(this.services);