@reqlan/language 1.4.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/README.md +24 -0
- package/out/file-path-rewrite.d.ts +25 -0
- package/out/file-path-rewrite.js +56 -0
- package/out/file-path-rewrite.js.map +1 -0
- package/out/generated/ast.d.ts +1157 -0
- package/out/generated/ast.js +980 -0
- package/out/generated/ast.js.map +1 -0
- package/out/generated/grammar.d.ts +7 -0
- package/out/generated/grammar.js +3071 -0
- package/out/generated/grammar.js.map +1 -0
- package/out/generated/module.d.ts +20 -0
- package/out/generated/module.js +32 -0
- package/out/generated/module.js.map +1 -0
- package/out/index.d.ts +34 -0
- package/out/index.js +35 -0
- package/out/index.js.map +1 -0
- package/out/reqlan-attribute-catalog.d.ts +19 -0
- package/out/reqlan-attribute-catalog.js +87 -0
- package/out/reqlan-attribute-catalog.js.map +1 -0
- package/out/reqlan-code-action-provider.d.ts +55 -0
- package/out/reqlan-code-action-provider.js +269 -0
- package/out/reqlan-code-action-provider.js.map +1 -0
- package/out/reqlan-code-lens-provider.d.ts +13 -0
- package/out/reqlan-code-lens-provider.js +27 -0
- package/out/reqlan-code-lens-provider.js.map +1 -0
- package/out/reqlan-code-lens-settings.d.ts +34 -0
- package/out/reqlan-code-lens-settings.js +12 -0
- package/out/reqlan-code-lens-settings.js.map +1 -0
- package/out/reqlan-comment-resolver.d.ts +35 -0
- package/out/reqlan-comment-resolver.js +308 -0
- package/out/reqlan-comment-resolver.js.map +1 -0
- package/out/reqlan-completion-context.d.ts +46 -0
- package/out/reqlan-completion-context.js +244 -0
- package/out/reqlan-completion-context.js.map +1 -0
- package/out/reqlan-completion-provider.d.ts +41 -0
- package/out/reqlan-completion-provider.js +317 -0
- package/out/reqlan-completion-provider.js.map +1 -0
- package/out/reqlan-definition-provider.d.ts +31 -0
- package/out/reqlan-definition-provider.js +240 -0
- package/out/reqlan-definition-provider.js.map +1 -0
- package/out/reqlan-document-highlight-provider.d.ts +10 -0
- package/out/reqlan-document-highlight-provider.js +11 -0
- package/out/reqlan-document-highlight-provider.js.map +1 -0
- package/out/reqlan-document-link-provider.d.ts +14 -0
- package/out/reqlan-document-link-provider.js +24 -0
- package/out/reqlan-document-link-provider.js.map +1 -0
- package/out/reqlan-embedded-file-references.d.ts +11 -0
- package/out/reqlan-embedded-file-references.js +50 -0
- package/out/reqlan-embedded-file-references.js.map +1 -0
- package/out/reqlan-file-link-resolver.d.ts +44 -0
- package/out/reqlan-file-link-resolver.js +347 -0
- package/out/reqlan-file-link-resolver.js.map +1 -0
- package/out/reqlan-file-references.d.ts +15 -0
- package/out/reqlan-file-references.js +72 -0
- package/out/reqlan-file-references.js.map +1 -0
- package/out/reqlan-grammar-config.d.ts +5 -0
- package/out/reqlan-grammar-config.js +9 -0
- package/out/reqlan-grammar-config.js.map +1 -0
- package/out/reqlan-idea-reference-site.d.ts +14 -0
- package/out/reqlan-idea-reference-site.js +47 -0
- package/out/reqlan-idea-reference-site.js.map +1 -0
- package/out/reqlan-idea-summary.d.ts +6 -0
- package/out/reqlan-idea-summary.js +134 -0
- package/out/reqlan-idea-summary.js.map +1 -0
- package/out/reqlan-ignore-error.d.ts +10 -0
- package/out/reqlan-ignore-error.js +42 -0
- package/out/reqlan-ignore-error.js.map +1 -0
- package/out/reqlan-import-bindings.d.ts +12 -0
- package/out/reqlan-import-bindings.js +65 -0
- package/out/reqlan-import-bindings.js.map +1 -0
- package/out/reqlan-import-edits.d.ts +17 -0
- package/out/reqlan-import-edits.js +96 -0
- package/out/reqlan-import-edits.js.map +1 -0
- package/out/reqlan-imports.d.ts +22 -0
- package/out/reqlan-imports.js +61 -0
- package/out/reqlan-imports.js.map +1 -0
- package/out/reqlan-inbound-reference-inlay-label.d.ts +27 -0
- package/out/reqlan-inbound-reference-inlay-label.js +142 -0
- package/out/reqlan-inbound-reference-inlay-label.js.map +1 -0
- package/out/reqlan-inlay-hint-provider.d.ts +15 -0
- package/out/reqlan-inlay-hint-provider.js +54 -0
- package/out/reqlan-inlay-hint-provider.js.map +1 -0
- package/out/reqlan-inlay-hint-settings.d.ts +10 -0
- package/out/reqlan-inlay-hint-settings.js +10 -0
- package/out/reqlan-inlay-hint-settings.js.map +1 -0
- package/out/reqlan-linker.d.ts +26 -0
- package/out/reqlan-linker.js +83 -0
- package/out/reqlan-linker.js.map +1 -0
- package/out/reqlan-markdown-links.d.ts +28 -0
- package/out/reqlan-markdown-links.js +113 -0
- package/out/reqlan-markdown-links.js.map +1 -0
- package/out/reqlan-module.d.ts +41 -0
- package/out/reqlan-module.js +78 -0
- package/out/reqlan-module.js.map +1 -0
- package/out/reqlan-name-catalog.d.ts +23 -0
- package/out/reqlan-name-catalog.js +63 -0
- package/out/reqlan-name-catalog.js.map +1 -0
- package/out/reqlan-name-provider.d.ts +10 -0
- package/out/reqlan-name-provider.js +38 -0
- package/out/reqlan-name-provider.js.map +1 -0
- package/out/reqlan-namespace-import-links.d.ts +10 -0
- package/out/reqlan-namespace-import-links.js +69 -0
- package/out/reqlan-namespace-import-links.js.map +1 -0
- package/out/reqlan-path-completion.d.ts +50 -0
- package/out/reqlan-path-completion.js +304 -0
- package/out/reqlan-path-completion.js.map +1 -0
- package/out/reqlan-path-references.d.ts +5 -0
- package/out/reqlan-path-references.js +124 -0
- package/out/reqlan-path-references.js.map +1 -0
- package/out/reqlan-path-resolve.d.ts +81 -0
- package/out/reqlan-path-resolve.js +245 -0
- package/out/reqlan-path-resolve.js.map +1 -0
- package/out/reqlan-quoted-strings.d.ts +9 -0
- package/out/reqlan-quoted-strings.js +26 -0
- package/out/reqlan-quoted-strings.js.map +1 -0
- package/out/reqlan-reference-at-position.d.ts +20 -0
- package/out/reqlan-reference-at-position.js +89 -0
- package/out/reqlan-reference-at-position.js.map +1 -0
- package/out/reqlan-reference-code-lens.d.ts +32 -0
- package/out/reqlan-reference-code-lens.js +240 -0
- package/out/reqlan-reference-code-lens.js.map +1 -0
- package/out/reqlan-reference-search-site.d.ts +34 -0
- package/out/reqlan-reference-search-site.js +136 -0
- package/out/reqlan-reference-search-site.js.map +1 -0
- package/out/reqlan-references.d.ts +16 -0
- package/out/reqlan-references.js +51 -0
- package/out/reqlan-references.js.map +1 -0
- package/out/reqlan-scope.d.ts +25 -0
- package/out/reqlan-scope.js +259 -0
- package/out/reqlan-scope.js.map +1 -0
- package/out/reqlan-semantic-token-provider.d.ts +8 -0
- package/out/reqlan-semantic-token-provider.js +91 -0
- package/out/reqlan-semantic-token-provider.js.map +1 -0
- package/out/reqlan-token-builder.d.ts +12 -0
- package/out/reqlan-token-builder.js +459 -0
- package/out/reqlan-token-builder.js.map +1 -0
- package/out/reqlan-validator.d.ts +25 -0
- package/out/reqlan-validator.js +119 -0
- package/out/reqlan-validator.js.map +1 -0
- package/out/reqlan-workspace-attribute-catalog.d.ts +6 -0
- package/out/reqlan-workspace-attribute-catalog.js +54 -0
- package/out/reqlan-workspace-attribute-catalog.js.map +1 -0
- package/out/src/file-path-rewrite.d.ts +25 -0
- package/out/src/file-path-rewrite.js +56 -0
- package/out/src/file-path-rewrite.js.map +1 -0
- package/out/src/generated/ast.d.ts +1173 -0
- package/out/src/generated/ast.js +994 -0
- package/out/src/generated/ast.js.map +1 -0
- package/out/src/generated/grammar.d.ts +7 -0
- package/out/src/generated/grammar.js +3045 -0
- package/out/src/generated/grammar.js.map +1 -0
- package/out/src/generated/module.d.ts +20 -0
- package/out/src/generated/module.js +32 -0
- package/out/src/generated/module.js.map +1 -0
- package/out/src/index.d.ts +29 -0
- package/out/src/index.js +30 -0
- package/out/src/index.js.map +1 -0
- package/out/src/reqlan-attribute-catalog.d.ts +19 -0
- package/out/src/reqlan-attribute-catalog.js +87 -0
- package/out/src/reqlan-attribute-catalog.js.map +1 -0
- package/out/src/reqlan-code-action-provider.d.ts +34 -0
- package/out/src/reqlan-code-action-provider.js +206 -0
- package/out/src/reqlan-code-action-provider.js.map +1 -0
- package/out/src/reqlan-comment-resolver.d.ts +35 -0
- package/out/src/reqlan-comment-resolver.js +308 -0
- package/out/src/reqlan-comment-resolver.js.map +1 -0
- package/out/src/reqlan-completion-context.d.ts +46 -0
- package/out/src/reqlan-completion-context.js +244 -0
- package/out/src/reqlan-completion-context.js.map +1 -0
- package/out/src/reqlan-completion-provider.d.ts +41 -0
- package/out/src/reqlan-completion-provider.js +320 -0
- package/out/src/reqlan-completion-provider.js.map +1 -0
- package/out/src/reqlan-definition-provider.d.ts +31 -0
- package/out/src/reqlan-definition-provider.js +240 -0
- package/out/src/reqlan-definition-provider.js.map +1 -0
- package/out/src/reqlan-document-highlight-provider.d.ts +10 -0
- package/out/src/reqlan-document-highlight-provider.js +11 -0
- package/out/src/reqlan-document-highlight-provider.js.map +1 -0
- package/out/src/reqlan-document-link-provider.d.ts +14 -0
- package/out/src/reqlan-document-link-provider.js +24 -0
- package/out/src/reqlan-document-link-provider.js.map +1 -0
- package/out/src/reqlan-embedded-file-references.d.ts +11 -0
- package/out/src/reqlan-embedded-file-references.js +50 -0
- package/out/src/reqlan-embedded-file-references.js.map +1 -0
- package/out/src/reqlan-file-link-resolver.d.ts +44 -0
- package/out/src/reqlan-file-link-resolver.js +347 -0
- package/out/src/reqlan-file-link-resolver.js.map +1 -0
- package/out/src/reqlan-file-references.d.ts +15 -0
- package/out/src/reqlan-file-references.js +72 -0
- package/out/src/reqlan-file-references.js.map +1 -0
- package/out/src/reqlan-grammar-config.d.ts +5 -0
- package/out/src/reqlan-grammar-config.js +9 -0
- package/out/src/reqlan-grammar-config.js.map +1 -0
- package/out/src/reqlan-idea-summary.d.ts +6 -0
- package/out/src/reqlan-idea-summary.js +78 -0
- package/out/src/reqlan-idea-summary.js.map +1 -0
- package/out/src/reqlan-ignore-error.d.ts +10 -0
- package/out/src/reqlan-ignore-error.js +42 -0
- package/out/src/reqlan-ignore-error.js.map +1 -0
- package/out/src/reqlan-import-bindings.d.ts +12 -0
- package/out/src/reqlan-import-bindings.js +65 -0
- package/out/src/reqlan-import-bindings.js.map +1 -0
- package/out/src/reqlan-import-edits.d.ts +17 -0
- package/out/src/reqlan-import-edits.js +96 -0
- package/out/src/reqlan-import-edits.js.map +1 -0
- package/out/src/reqlan-imports.d.ts +22 -0
- package/out/src/reqlan-imports.js +61 -0
- package/out/src/reqlan-imports.js.map +1 -0
- package/out/src/reqlan-inbound-reference-inlay-label.d.ts +23 -0
- package/out/src/reqlan-inbound-reference-inlay-label.js +128 -0
- package/out/src/reqlan-inbound-reference-inlay-label.js.map +1 -0
- package/out/src/reqlan-inlay-hint-provider.d.ts +15 -0
- package/out/src/reqlan-inlay-hint-provider.js +54 -0
- package/out/src/reqlan-inlay-hint-provider.js.map +1 -0
- package/out/src/reqlan-inlay-hint-settings.d.ts +10 -0
- package/out/src/reqlan-inlay-hint-settings.js +10 -0
- package/out/src/reqlan-inlay-hint-settings.js.map +1 -0
- package/out/src/reqlan-linker.d.ts +26 -0
- package/out/src/reqlan-linker.js +86 -0
- package/out/src/reqlan-linker.js.map +1 -0
- package/out/src/reqlan-markdown-links.d.ts +28 -0
- package/out/src/reqlan-markdown-links.js +113 -0
- package/out/src/reqlan-markdown-links.js.map +1 -0
- package/out/src/reqlan-module.d.ts +41 -0
- package/out/src/reqlan-module.js +76 -0
- package/out/src/reqlan-module.js.map +1 -0
- package/out/src/reqlan-name-catalog.d.ts +23 -0
- package/out/src/reqlan-name-catalog.js +63 -0
- package/out/src/reqlan-name-catalog.js.map +1 -0
- package/out/src/reqlan-name-provider.d.ts +10 -0
- package/out/src/reqlan-name-provider.js +38 -0
- package/out/src/reqlan-name-provider.js.map +1 -0
- package/out/src/reqlan-namespace-import-links.d.ts +10 -0
- package/out/src/reqlan-namespace-import-links.js +81 -0
- package/out/src/reqlan-namespace-import-links.js.map +1 -0
- package/out/src/reqlan-path-completion.d.ts +50 -0
- package/out/src/reqlan-path-completion.js +304 -0
- package/out/src/reqlan-path-completion.js.map +1 -0
- package/out/src/reqlan-path-references.d.ts +5 -0
- package/out/src/reqlan-path-references.js +124 -0
- package/out/src/reqlan-path-references.js.map +1 -0
- package/out/src/reqlan-path-resolve.d.ts +59 -0
- package/out/src/reqlan-path-resolve.js +173 -0
- package/out/src/reqlan-path-resolve.js.map +1 -0
- package/out/src/reqlan-quoted-strings.d.ts +9 -0
- package/out/src/reqlan-quoted-strings.js +26 -0
- package/out/src/reqlan-quoted-strings.js.map +1 -0
- package/out/src/reqlan-reference-at-position.d.ts +20 -0
- package/out/src/reqlan-reference-at-position.js +89 -0
- package/out/src/reqlan-reference-at-position.js.map +1 -0
- package/out/src/reqlan-references.d.ts +16 -0
- package/out/src/reqlan-references.js +51 -0
- package/out/src/reqlan-references.js.map +1 -0
- package/out/src/reqlan-scope.d.ts +25 -0
- package/out/src/reqlan-scope.js +266 -0
- package/out/src/reqlan-scope.js.map +1 -0
- package/out/src/reqlan-semantic-token-provider.d.ts +8 -0
- package/out/src/reqlan-semantic-token-provider.js +97 -0
- package/out/src/reqlan-semantic-token-provider.js.map +1 -0
- package/out/src/reqlan-token-builder.d.ts +12 -0
- package/out/src/reqlan-token-builder.js +459 -0
- package/out/src/reqlan-token-builder.js.map +1 -0
- package/out/src/reqlan-validator.d.ts +25 -0
- package/out/src/reqlan-validator.js +119 -0
- package/out/src/reqlan-validator.js.map +1 -0
- package/out/src/reqlan-workspace-attribute-catalog.d.ts +6 -0
- package/out/src/reqlan-workspace-attribute-catalog.js +54 -0
- package/out/src/reqlan-workspace-attribute-catalog.js.map +1 -0
- package/out/test/code-actions.test.d.ts +1 -0
- package/out/test/code-actions.test.js +126 -0
- package/out/test/code-actions.test.js.map +1 -0
- package/out/test/comment-in-string.test.d.ts +1 -0
- package/out/test/comment-in-string.test.js +100 -0
- package/out/test/comment-in-string.test.js.map +1 -0
- package/out/test/completion.test.d.ts +1 -0
- package/out/test/completion.test.js +467 -0
- package/out/test/completion.test.js.map +1 -0
- package/out/test/file-path-rewrite.test.d.ts +1 -0
- package/out/test/file-path-rewrite.test.js +64 -0
- package/out/test/file-path-rewrite.test.js.map +1 -0
- package/out/test/ignore-error.test.d.ts +1 -0
- package/out/test/ignore-error.test.js +87 -0
- package/out/test/ignore-error.test.js.map +1 -0
- package/out/test/implicit-import-extension.test.d.ts +1 -0
- package/out/test/implicit-import-extension.test.js +203 -0
- package/out/test/implicit-import-extension.test.js.map +1 -0
- package/out/test/import-edits.test.d.ts +1 -0
- package/out/test/import-edits.test.js +20 -0
- package/out/test/import-edits.test.js.map +1 -0
- package/out/test/inlay-hints.test.d.ts +1 -0
- package/out/test/inlay-hints.test.js +238 -0
- package/out/test/inlay-hints.test.js.map +1 -0
- package/out/test/linking.test.d.ts +1 -0
- package/out/test/linking.test.js +754 -0
- package/out/test/linking.test.js.map +1 -0
- package/out/test/naked-strings.test.d.ts +1 -0
- package/out/test/naked-strings.test.js +50 -0
- package/out/test/naked-strings.test.js.map +1 -0
- package/out/test/parsing.test.d.ts +1 -0
- package/out/test/parsing.test.js +773 -0
- package/out/test/parsing.test.js.map +1 -0
- package/out/test/path-resolve.test.d.ts +1 -0
- package/out/test/path-resolve.test.js +88 -0
- package/out/test/path-resolve.test.js.map +1 -0
- package/out/test/references.test.d.ts +1 -0
- package/out/test/references.test.js +168 -0
- package/out/test/references.test.js.map +1 -0
- package/out/test/rqconfig.test.d.ts +1 -0
- package/out/test/rqconfig.test.js +275 -0
- package/out/test/rqconfig.test.js.map +1 -0
- package/out/test/test-requirement-refs.d.ts +8 -0
- package/out/test/test-requirement-refs.js +35 -0
- package/out/test/test-requirement-refs.js.map +1 -0
- package/out/test/testing.test.d.ts +1 -0
- package/out/test/testing.test.js +23 -0
- package/out/test/testing.test.js.map +1 -0
- package/out/test/validating.test.d.ts +1 -0
- package/out/test/validating.test.js +117 -0
- package/out/test/validating.test.js.map +1 -0
- package/out/tsconfig.tsbuildinfo +1 -0
- package/package.json +54 -0
- package/src/chevrotain.d.ts +8 -0
- package/src/file-path-rewrite.ts +96 -0
- package/src/generated/ast.ts +1481 -0
- package/src/generated/grammar.ts +3074 -0
- package/src/generated/module.ts +38 -0
- package/src/index.ts +34 -0
- package/src/reqlan-attribute-catalog.ts +100 -0
- package/src/reqlan-code-action-provider.ts +385 -0
- package/src/reqlan-code-lens-provider.ts +54 -0
- package/src/reqlan-code-lens-settings.ts +42 -0
- package/src/reqlan-comment-resolver.ts +372 -0
- package/src/reqlan-comment.langium +23 -0
- package/src/reqlan-completion-context.ts +330 -0
- package/src/reqlan-completion-provider.ts +400 -0
- package/src/reqlan-definition-provider.ts +319 -0
- package/src/reqlan-document-highlight-provider.ts +21 -0
- package/src/reqlan-document-link-provider.ts +45 -0
- package/src/reqlan-embedded-file-references.ts +72 -0
- package/src/reqlan-file-link-resolver.ts +485 -0
- package/src/reqlan-file-references.ts +84 -0
- package/src/reqlan-grammar-config.ts +14 -0
- package/src/reqlan-idea-reference-site.ts +74 -0
- package/src/reqlan-idea-summary.ts +162 -0
- package/src/reqlan-ignore-error.ts +50 -0
- package/src/reqlan-import-bindings.ts +87 -0
- package/src/reqlan-import-edits.ts +124 -0
- package/src/reqlan-imports.ts +115 -0
- package/src/reqlan-inbound-reference-inlay-label.ts +194 -0
- package/src/reqlan-inlay-hint-provider.ts +88 -0
- package/src/reqlan-inlay-hint-settings.ts +15 -0
- package/src/reqlan-linker.ts +108 -0
- package/src/reqlan-markdown-links.ts +136 -0
- package/src/reqlan-module.ts +104 -0
- package/src/reqlan-name-catalog.ts +81 -0
- package/src/reqlan-name-provider.ts +56 -0
- package/src/reqlan-namespace-import-links.ts +92 -0
- package/src/reqlan-path-completion.ts +420 -0
- package/src/reqlan-path-references.ts +140 -0
- package/src/reqlan-path-resolve.ts +346 -0
- package/src/reqlan-quoted-strings.ts +30 -0
- package/src/reqlan-reference-at-position.ts +154 -0
- package/src/reqlan-reference-code-lens.ts +323 -0
- package/src/reqlan-reference-search-site.ts +202 -0
- package/src/reqlan-references.ts +76 -0
- package/src/reqlan-scope.ts +312 -0
- package/src/reqlan-semantic-token-provider.ts +113 -0
- package/src/reqlan-token-builder.ts +492 -0
- package/src/reqlan-validator.ts +149 -0
- package/src/reqlan-workspace-attribute-catalog.ts +62 -0
- package/src/reqlan.langium +236 -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,mBAAwC,CAAC;AAC7C,MAAM,CAAC,MAAM,aAAa,GAAG,GAAY,EAAE,CAAC,mBAAmB,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0yF5G,CAAC,CAAC,CAAC;AAEL,IAAI,0BAA+C,CAAC;AACpD,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAY,EAAE,CAAC,0BAA0B,IAAI,CAAC,0BAA0B,GAAG,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiLjI,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/******************************************************************************
|
|
2
|
+
* This file was generated by langium-cli 4.3.0.
|
|
3
|
+
* DO NOT EDIT MANUALLY!
|
|
4
|
+
******************************************************************************/
|
|
5
|
+
import type { LangiumSharedCoreServices, LangiumCoreServices, LangiumGeneratedCoreServices, LangiumGeneratedSharedCoreServices, Module } from 'langium';
|
|
6
|
+
export declare const ReqlanLanguageMetaData: {
|
|
7
|
+
readonly languageId: "reqlan";
|
|
8
|
+
readonly fileExtensions: readonly [".rq"];
|
|
9
|
+
readonly caseInsensitive: false;
|
|
10
|
+
readonly mode: "development";
|
|
11
|
+
};
|
|
12
|
+
export declare const ReqlanCommentLanguageMetaData: {
|
|
13
|
+
readonly languageId: "reqlan-comment";
|
|
14
|
+
readonly fileExtensions: readonly [];
|
|
15
|
+
readonly caseInsensitive: false;
|
|
16
|
+
readonly mode: "development";
|
|
17
|
+
};
|
|
18
|
+
export declare const ReqlanGeneratedSharedModule: Module<LangiumSharedCoreServices, LangiumGeneratedSharedCoreServices>;
|
|
19
|
+
export declare const ReqlanGeneratedModule: Module<LangiumCoreServices, LangiumGeneratedCoreServices>;
|
|
20
|
+
export declare const ReqlanCommentGeneratedModule: Module<LangiumCoreServices, LangiumGeneratedCoreServices>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/******************************************************************************
|
|
2
|
+
* This file was generated by langium-cli 4.3.0.
|
|
3
|
+
* DO NOT EDIT MANUALLY!
|
|
4
|
+
******************************************************************************/
|
|
5
|
+
import { ReqlanAstReflection } from './ast.js';
|
|
6
|
+
import { ReqlanGrammar, ReqlanCommentGrammar } from './grammar.js';
|
|
7
|
+
export const ReqlanLanguageMetaData = {
|
|
8
|
+
languageId: 'reqlan',
|
|
9
|
+
fileExtensions: ['.rq'],
|
|
10
|
+
caseInsensitive: false,
|
|
11
|
+
mode: 'development'
|
|
12
|
+
};
|
|
13
|
+
export const ReqlanCommentLanguageMetaData = {
|
|
14
|
+
languageId: 'reqlan-comment',
|
|
15
|
+
fileExtensions: [],
|
|
16
|
+
caseInsensitive: false,
|
|
17
|
+
mode: 'development'
|
|
18
|
+
};
|
|
19
|
+
export const ReqlanGeneratedSharedModule = {
|
|
20
|
+
AstReflection: () => new ReqlanAstReflection()
|
|
21
|
+
};
|
|
22
|
+
export const ReqlanGeneratedModule = {
|
|
23
|
+
Grammar: () => ReqlanGrammar(),
|
|
24
|
+
LanguageMetaData: () => ReqlanLanguageMetaData,
|
|
25
|
+
parser: {}
|
|
26
|
+
};
|
|
27
|
+
export const ReqlanCommentGeneratedModule = {
|
|
28
|
+
Grammar: () => ReqlanCommentGrammar(),
|
|
29
|
+
LanguageMetaData: () => ReqlanCommentLanguageMetaData,
|
|
30
|
+
parser: {}
|
|
31
|
+
};
|
|
32
|
+
//# 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,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEnE,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,UAAU,EAAE,QAAQ;IACpB,cAAc,EAAE,CAAC,KAAK,CAAC;IACvB,eAAe,EAAE,KAAK;IACtB,IAAI,EAAE,aAAa;CACc,CAAC;AAEtC,MAAM,CAAC,MAAM,6BAA6B,GAAG;IACzC,UAAU,EAAE,gBAAgB;IAC5B,cAAc,EAAE,EAAE;IAClB,eAAe,EAAE,KAAK;IACtB,IAAI,EAAE,aAAa;CACc,CAAC;AAEtC,MAAM,CAAC,MAAM,2BAA2B,GAA0E;IAC9G,aAAa,EAAE,GAAG,EAAE,CAAC,IAAI,mBAAmB,EAAE;CACjD,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAA8D;IAC5F,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE;IAC9B,gBAAgB,EAAE,GAAG,EAAE,CAAC,sBAAsB;IAC9C,MAAM,EAAE,EAAE;CACb,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAA8D;IACnG,OAAO,EAAE,GAAG,EAAE,CAAC,oBAAoB,EAAE;IACrC,gBAAgB,EAAE,GAAG,EAAE,CAAC,6BAA6B;IACrD,MAAM,EAAE,EAAE;CACb,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from './reqlan-module.js';
|
|
2
|
+
export * from './reqlan-validator.js';
|
|
3
|
+
export * from './reqlan-comment-resolver.js';
|
|
4
|
+
export * from './reqlan-ignore-error.js';
|
|
5
|
+
export * from './reqlan-file-references.js';
|
|
6
|
+
export * from './reqlan-embedded-file-references.js';
|
|
7
|
+
export * from './file-path-rewrite.js';
|
|
8
|
+
export * from './reqlan-path-references.js';
|
|
9
|
+
export * from './reqlan-path-resolve.js';
|
|
10
|
+
export * from './reqlan-imports.js';
|
|
11
|
+
export * from './reqlan-quoted-strings.js';
|
|
12
|
+
export * from './reqlan-references.js';
|
|
13
|
+
export * from './reqlan-reference-at-position.js';
|
|
14
|
+
export * from './reqlan-attribute-catalog.js';
|
|
15
|
+
export * from './reqlan-completion-context.js';
|
|
16
|
+
export * from './reqlan-completion-provider.js';
|
|
17
|
+
export * from './reqlan-path-completion.js';
|
|
18
|
+
export * from './reqlan-code-action-provider.js';
|
|
19
|
+
export * from './reqlan-import-edits.js';
|
|
20
|
+
export * from './reqlan-import-bindings.js';
|
|
21
|
+
export * from './reqlan-namespace-import-links.js';
|
|
22
|
+
export * from './reqlan-name-catalog.js';
|
|
23
|
+
export * from './reqlan-workspace-attribute-catalog.js';
|
|
24
|
+
export * from './reqlan-inlay-hint-settings.js';
|
|
25
|
+
export { ReqlanInlayHintProvider } from './reqlan-inlay-hint-provider.js';
|
|
26
|
+
export { truncateSummary } from './reqlan-idea-summary.js';
|
|
27
|
+
export * from './generated/ast.js';
|
|
28
|
+
export * from './generated/grammar.js';
|
|
29
|
+
export * from './generated/module.js';
|
package/out/src/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export * from './reqlan-module.js';
|
|
2
|
+
export * from './reqlan-validator.js';
|
|
3
|
+
export * from './reqlan-comment-resolver.js';
|
|
4
|
+
export * from './reqlan-ignore-error.js';
|
|
5
|
+
export * from './reqlan-file-references.js';
|
|
6
|
+
export * from './reqlan-embedded-file-references.js';
|
|
7
|
+
export * from './file-path-rewrite.js';
|
|
8
|
+
export * from './reqlan-path-references.js';
|
|
9
|
+
export * from './reqlan-path-resolve.js';
|
|
10
|
+
export * from './reqlan-imports.js';
|
|
11
|
+
export * from './reqlan-quoted-strings.js';
|
|
12
|
+
export * from './reqlan-references.js';
|
|
13
|
+
export * from './reqlan-reference-at-position.js';
|
|
14
|
+
export * from './reqlan-attribute-catalog.js';
|
|
15
|
+
export * from './reqlan-completion-context.js';
|
|
16
|
+
export * from './reqlan-completion-provider.js';
|
|
17
|
+
export * from './reqlan-path-completion.js';
|
|
18
|
+
export * from './reqlan-code-action-provider.js';
|
|
19
|
+
export * from './reqlan-import-edits.js';
|
|
20
|
+
export * from './reqlan-import-bindings.js';
|
|
21
|
+
export * from './reqlan-namespace-import-links.js';
|
|
22
|
+
export * from './reqlan-name-catalog.js';
|
|
23
|
+
export * from './reqlan-workspace-attribute-catalog.js';
|
|
24
|
+
export * from './reqlan-inlay-hint-settings.js';
|
|
25
|
+
export { ReqlanInlayHintProvider } from './reqlan-inlay-hint-provider.js';
|
|
26
|
+
export { truncateSummary } from './reqlan-idea-summary.js';
|
|
27
|
+
export * from './generated/ast.js';
|
|
28
|
+
export * from './generated/grammar.js';
|
|
29
|
+
export * from './generated/module.js';
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sCAAsC,CAAC;AACrD,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Endorsed attribute keys and workspace-wide attribute value catalog for completion.
|
|
3
|
+
*/
|
|
4
|
+
/** Common attributes from reqlan rq/language/syntax.rq attribute_forms. */
|
|
5
|
+
export declare const ENDORSED_ATTRIBUTE_KEYS: readonly ["plan", "status", "priority", "criticality", "confirmation", "owner", "log", "tags", "references", "refs", "required", "deprecated", "tests"];
|
|
6
|
+
export interface AttributeCatalog {
|
|
7
|
+
keys: string[];
|
|
8
|
+
valuesByKey: Record<string, string[]>;
|
|
9
|
+
}
|
|
10
|
+
export declare class AttributeCatalogStore {
|
|
11
|
+
private catalog;
|
|
12
|
+
get(): AttributeCatalog;
|
|
13
|
+
update(catalog: AttributeCatalog): void;
|
|
14
|
+
reset(): void;
|
|
15
|
+
mergeWorkspaceKeys(keys: Iterable<string>, valuesByKey: Record<string, Iterable<string>>): void;
|
|
16
|
+
}
|
|
17
|
+
export declare const REQLAN_ATTRIBUTE_CATALOG_NOTIFICATION = "reqlan/attributeCatalog";
|
|
18
|
+
export declare const sharedAttributeCatalog: AttributeCatalogStore;
|
|
19
|
+
export declare function mergeAttributeCatalogs(...catalogs: AttributeCatalog[]): AttributeCatalog;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Endorsed attribute keys and workspace-wide attribute value catalog for completion.
|
|
3
|
+
*/
|
|
4
|
+
/** Common attributes from reqlan rq/language/syntax.rq attribute_forms. */
|
|
5
|
+
export const ENDORSED_ATTRIBUTE_KEYS = [
|
|
6
|
+
'plan',
|
|
7
|
+
'status',
|
|
8
|
+
'priority',
|
|
9
|
+
'criticality',
|
|
10
|
+
'confirmation',
|
|
11
|
+
'owner',
|
|
12
|
+
'log',
|
|
13
|
+
'tags',
|
|
14
|
+
'references',
|
|
15
|
+
'refs',
|
|
16
|
+
'required',
|
|
17
|
+
'deprecated',
|
|
18
|
+
'tests'
|
|
19
|
+
];
|
|
20
|
+
export class AttributeCatalogStore {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.catalog = {
|
|
23
|
+
keys: [...ENDORSED_ATTRIBUTE_KEYS],
|
|
24
|
+
valuesByKey: {}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
get() {
|
|
28
|
+
return this.catalog;
|
|
29
|
+
}
|
|
30
|
+
update(catalog) {
|
|
31
|
+
this.catalog = mergeAttributeCatalogs(this.catalog, catalog);
|
|
32
|
+
}
|
|
33
|
+
reset() {
|
|
34
|
+
this.catalog = {
|
|
35
|
+
keys: [...ENDORSED_ATTRIBUTE_KEYS],
|
|
36
|
+
valuesByKey: {}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
mergeWorkspaceKeys(keys, valuesByKey) {
|
|
40
|
+
const mergedKeys = new Set([...ENDORSED_ATTRIBUTE_KEYS, ...this.catalog.keys]);
|
|
41
|
+
for (const key of keys) {
|
|
42
|
+
mergedKeys.add(key);
|
|
43
|
+
}
|
|
44
|
+
const mergedValues = { ...this.catalog.valuesByKey };
|
|
45
|
+
for (const [key, values] of Object.entries(valuesByKey)) {
|
|
46
|
+
mergedKeys.add(key);
|
|
47
|
+
const existing = new Set(mergedValues[key] ?? []);
|
|
48
|
+
for (const value of values) {
|
|
49
|
+
if (value) {
|
|
50
|
+
existing.add(value);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
mergedValues[key] = [...existing].sort((left, right) => left.localeCompare(right));
|
|
54
|
+
}
|
|
55
|
+
this.catalog = {
|
|
56
|
+
keys: [...mergedKeys].sort((left, right) => left.localeCompare(right)),
|
|
57
|
+
valuesByKey: mergedValues
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
export const REQLAN_ATTRIBUTE_CATALOG_NOTIFICATION = 'reqlan/attributeCatalog';
|
|
62
|
+
export const sharedAttributeCatalog = new AttributeCatalogStore();
|
|
63
|
+
export function mergeAttributeCatalogs(...catalogs) {
|
|
64
|
+
const keys = new Set(ENDORSED_ATTRIBUTE_KEYS);
|
|
65
|
+
const valuesByKey = new Map();
|
|
66
|
+
for (const catalog of catalogs) {
|
|
67
|
+
for (const key of catalog.keys) {
|
|
68
|
+
keys.add(key);
|
|
69
|
+
}
|
|
70
|
+
for (const [key, values] of Object.entries(catalog.valuesByKey)) {
|
|
71
|
+
keys.add(key);
|
|
72
|
+
if (!valuesByKey.has(key)) {
|
|
73
|
+
valuesByKey.set(key, new Set());
|
|
74
|
+
}
|
|
75
|
+
for (const value of values) {
|
|
76
|
+
if (value) {
|
|
77
|
+
valuesByKey.get(key).add(value);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
keys: [...keys].sort((left, right) => left.localeCompare(right)),
|
|
84
|
+
valuesByKey: Object.fromEntries([...valuesByKey.entries()].map(([key, values]) => [key, [...values].sort()]))
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=reqlan-attribute-catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reqlan-attribute-catalog.js","sourceRoot":"","sources":["../../src/reqlan-attribute-catalog.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACnC,MAAM;IACN,QAAQ;IACR,UAAU;IACV,aAAa;IACb,cAAc;IACd,OAAO;IACP,KAAK;IACL,MAAM;IACN,YAAY;IACZ,MAAM;IACN,UAAU;IACV,YAAY;IACZ,OAAO;CACD,CAAC;AAOX,MAAM,OAAO,qBAAqB;IAAlC;QACY,YAAO,GAAqB;YAChC,IAAI,EAAE,CAAC,GAAG,uBAAuB,CAAC;YAClC,WAAW,EAAE,EAAE;SAClB,CAAC;IAsCN,CAAC;IApCG,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I,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAChE,WAAW,EAAE,MAAM,CAAC,WAAW,CAC3B,CAAC,GAAG,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAC/E;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quick fixes for unresolved references: add import, rewrite qualified ref, search, create.
|
|
3
|
+
* rq:["../../../reqlan rq/extension/language-support/features-imports.rq".import_error]
|
|
4
|
+
*/
|
|
5
|
+
import type { LangiumDocument } from 'langium';
|
|
6
|
+
import type { CodeActionParams, Command, Diagnostic } from 'vscode-languageserver';
|
|
7
|
+
import type { CodeActionProvider } from 'langium/lsp';
|
|
8
|
+
import { type Model } from './generated/ast.js';
|
|
9
|
+
import type { ReqlanServices } from './reqlan-module.js';
|
|
10
|
+
export declare const REQLAN_IMPORT_ERROR_SEARCH_COMMAND = "reqlan.importError.search";
|
|
11
|
+
export declare const REQLAN_IMPORT_ERROR_CREATE_COMMAND = "reqlan.importError.createFile";
|
|
12
|
+
export interface ImportErrorCommandArgs {
|
|
13
|
+
documentUri: string;
|
|
14
|
+
refText: string;
|
|
15
|
+
range: Diagnostic['range'];
|
|
16
|
+
}
|
|
17
|
+
type CodeActionLike = import('vscode-languageserver').CodeAction;
|
|
18
|
+
export declare class ReqlanCodeActionProvider implements CodeActionProvider {
|
|
19
|
+
private readonly documents;
|
|
20
|
+
private readonly indexManager;
|
|
21
|
+
constructor(services: ReqlanServices);
|
|
22
|
+
getCodeActions(document: LangiumDocument, params: CodeActionParams): Array<Command | CodeActionLike>;
|
|
23
|
+
private actionsForDiagnostic;
|
|
24
|
+
private findMatches;
|
|
25
|
+
private toMatch;
|
|
26
|
+
private createAddImportAction;
|
|
27
|
+
private createQualifiedRewriteAction;
|
|
28
|
+
private createSearchCommand;
|
|
29
|
+
private createCreateFileCommand;
|
|
30
|
+
}
|
|
31
|
+
/** Test helper: collect quick fixes for linking diagnostics on a document. */
|
|
32
|
+
export declare function collectImportErrorCodeActions(provider: ReqlanCodeActionProvider, document: LangiumDocument): Array<Command | CodeActionLike>;
|
|
33
|
+
export declare function isModelDocument(document: LangiumDocument): document is LangiumDocument<Model>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { DocumentValidator, URI as UriCtor, UriUtils } from 'langium';
|
|
2
|
+
import { CodeActionKind } from 'vscode-languageserver';
|
|
3
|
+
import { isIdea, isIdeaSet, isModel, isOneLinerIdea } from './generated/ast.js';
|
|
4
|
+
import { buildFromImportEdit, relativeRqImportPath } from './reqlan-import-edits.js';
|
|
5
|
+
import { sharedNameCatalog } from './reqlan-name-catalog.js';
|
|
6
|
+
export const REQLAN_IMPORT_ERROR_SEARCH_COMMAND = 'reqlan.importError.search';
|
|
7
|
+
export const REQLAN_IMPORT_ERROR_CREATE_COMMAND = 'reqlan.importError.createFile';
|
|
8
|
+
const MAX_IMPORT_SUGGESTIONS = 5;
|
|
9
|
+
export class ReqlanCodeActionProvider {
|
|
10
|
+
constructor(services) {
|
|
11
|
+
this.documents = services.shared.workspace.LangiumDocuments;
|
|
12
|
+
this.indexManager = services.shared.workspace.IndexManager;
|
|
13
|
+
}
|
|
14
|
+
getCodeActions(document, params) {
|
|
15
|
+
const actions = [];
|
|
16
|
+
for (const diagnostic of params.context.diagnostics) {
|
|
17
|
+
actions.push(...this.actionsForDiagnostic(document, diagnostic));
|
|
18
|
+
}
|
|
19
|
+
return actions;
|
|
20
|
+
}
|
|
21
|
+
actionsForDiagnostic(document, diagnostic) {
|
|
22
|
+
const data = diagnostic.data;
|
|
23
|
+
if (data?.code !== DocumentValidator.LinkingError || !data.refText) {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
if (!isResolvableIdeaProperty(data.property)) {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
const refText = data.refText;
|
|
30
|
+
const actions = [];
|
|
31
|
+
const matches = this.findMatches(document, refText);
|
|
32
|
+
let preferredSet = false;
|
|
33
|
+
for (const match of matches.slice(0, MAX_IMPORT_SUGGESTIONS)) {
|
|
34
|
+
if (match.kind === 'ideaset' || match.kind === 'file') {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
const addImport = this.createAddImportAction(document, diagnostic, match, !preferredSet);
|
|
38
|
+
if (addImport) {
|
|
39
|
+
actions.push(addImport);
|
|
40
|
+
preferredSet = true;
|
|
41
|
+
}
|
|
42
|
+
const rewrite = this.createQualifiedRewriteAction(document, diagnostic, match);
|
|
43
|
+
if (rewrite) {
|
|
44
|
+
actions.push(rewrite);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
actions.push(this.createSearchCommand(document, diagnostic, refText));
|
|
48
|
+
actions.push(this.createCreateFileCommand(document, diagnostic, refText));
|
|
49
|
+
return actions;
|
|
50
|
+
}
|
|
51
|
+
findMatches(document, refText) {
|
|
52
|
+
const byKey = new Map();
|
|
53
|
+
const add = (match) => {
|
|
54
|
+
if (UriUtils.equals(UriCtor.parse(match.fileUri), document.uri)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const key = `${match.kind}:${match.fileUri}:${match.name}`;
|
|
58
|
+
if (!byKey.has(key)) {
|
|
59
|
+
byKey.set(key, match);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
for (const entry of sharedNameCatalog.findExact(refText)) {
|
|
63
|
+
add(this.toMatch(document.uri, entry));
|
|
64
|
+
}
|
|
65
|
+
for (const doc of this.documents.all) {
|
|
66
|
+
if (UriUtils.equals(doc.uri, document.uri)) {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
const model = doc.parseResult.value;
|
|
70
|
+
if (!isModel(model)) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
for (const element of model.elements) {
|
|
74
|
+
if ((isIdea(element) || isOneLinerIdea(element) || isIdeaSet(element)) && element.name === refText) {
|
|
75
|
+
add({
|
|
76
|
+
name: element.name,
|
|
77
|
+
kind: isIdeaSet(element) ? 'ideaset' : isOneLinerIdea(element) ? 'oneliner' : 'idea',
|
|
78
|
+
fileUri: doc.uri.toString(),
|
|
79
|
+
importPath: relativeRqImportPath(document.uri, doc.uri)
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
for (const description of this.indexManager.allElements()) {
|
|
85
|
+
if (description.name !== refText || UriUtils.equals(description.documentUri, document.uri)) {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
const kind = nodeTypeToKind(description.type);
|
|
89
|
+
if (!kind) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
add({
|
|
93
|
+
name: description.name,
|
|
94
|
+
kind,
|
|
95
|
+
fileUri: description.documentUri.toString(),
|
|
96
|
+
importPath: relativeRqImportPath(document.uri, description.documentUri)
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return [...byKey.values()].sort((left, right) => left.importPath.length - right.importPath.length || left.name.localeCompare(right.name));
|
|
100
|
+
}
|
|
101
|
+
toMatch(fromUri, entry) {
|
|
102
|
+
return {
|
|
103
|
+
name: entry.name,
|
|
104
|
+
kind: entry.kind,
|
|
105
|
+
fileUri: entry.fileUri,
|
|
106
|
+
importPath: relativeRqImportPath(fromUri, UriCtor.parse(entry.fileUri))
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
createAddImportAction(document, diagnostic, match, isPreferred) {
|
|
110
|
+
const edit = buildFromImportEdit(document, match.importPath, match.name);
|
|
111
|
+
if (!edit) {
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
title: `Add import from "${match.importPath}"`,
|
|
116
|
+
kind: CodeActionKind.QuickFix,
|
|
117
|
+
diagnostics: [diagnostic],
|
|
118
|
+
isPreferred,
|
|
119
|
+
edit: {
|
|
120
|
+
changes: {
|
|
121
|
+
[document.textDocument.uri]: [edit]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
createQualifiedRewriteAction(document, diagnostic, match) {
|
|
127
|
+
return {
|
|
128
|
+
title: `Change to ["${match.importPath}".${match.name}]`,
|
|
129
|
+
kind: CodeActionKind.QuickFix,
|
|
130
|
+
diagnostics: [diagnostic],
|
|
131
|
+
edit: {
|
|
132
|
+
changes: {
|
|
133
|
+
[document.textDocument.uri]: [{
|
|
134
|
+
range: diagnostic.range,
|
|
135
|
+
newText: `"${match.importPath}".${match.name}`
|
|
136
|
+
}]
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
createSearchCommand(document, diagnostic, refText) {
|
|
142
|
+
const args = {
|
|
143
|
+
documentUri: document.textDocument.uri,
|
|
144
|
+
refText,
|
|
145
|
+
range: diagnostic.range
|
|
146
|
+
};
|
|
147
|
+
return {
|
|
148
|
+
title: `Search index for '${refText}'…`,
|
|
149
|
+
kind: CodeActionKind.QuickFix,
|
|
150
|
+
diagnostics: [diagnostic],
|
|
151
|
+
command: {
|
|
152
|
+
title: `Search index for '${refText}'`,
|
|
153
|
+
command: REQLAN_IMPORT_ERROR_SEARCH_COMMAND,
|
|
154
|
+
arguments: [args]
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
createCreateFileCommand(document, diagnostic, refText) {
|
|
159
|
+
const args = {
|
|
160
|
+
documentUri: document.textDocument.uri,
|
|
161
|
+
refText,
|
|
162
|
+
range: diagnostic.range
|
|
163
|
+
};
|
|
164
|
+
return {
|
|
165
|
+
title: `Create '${refText}' in a new file and import it…`,
|
|
166
|
+
kind: CodeActionKind.QuickFix,
|
|
167
|
+
diagnostics: [diagnostic],
|
|
168
|
+
command: {
|
|
169
|
+
title: `Create '${refText}' in a new file`,
|
|
170
|
+
command: REQLAN_IMPORT_ERROR_CREATE_COMMAND,
|
|
171
|
+
arguments: [args]
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
function isResolvableIdeaProperty(property) {
|
|
177
|
+
return property === 'idea' || property === 'ideaset' || property === 'members';
|
|
178
|
+
}
|
|
179
|
+
function nodeTypeToKind(type) {
|
|
180
|
+
switch (type) {
|
|
181
|
+
case 'Idea':
|
|
182
|
+
return 'idea';
|
|
183
|
+
case 'OneLinerIdea':
|
|
184
|
+
return 'oneliner';
|
|
185
|
+
case 'IdeaSet':
|
|
186
|
+
return 'ideaset';
|
|
187
|
+
default:
|
|
188
|
+
return undefined;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/** Test helper: collect quick fixes for linking diagnostics on a document. */
|
|
192
|
+
export function collectImportErrorCodeActions(provider, document) {
|
|
193
|
+
const diagnostics = (document.diagnostics ?? []).filter(diagnostic => {
|
|
194
|
+
const data = diagnostic.data;
|
|
195
|
+
return data?.code === DocumentValidator.LinkingError;
|
|
196
|
+
});
|
|
197
|
+
return provider.getCodeActions(document, {
|
|
198
|
+
textDocument: { uri: document.textDocument.uri },
|
|
199
|
+
range: diagnostics[0]?.range ?? { start: { line: 0, character: 0 }, end: { line: 0, character: 0 } },
|
|
200
|
+
context: { diagnostics }
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
export function isModelDocument(document) {
|
|
204
|
+
return isModel(document.parseResult.value);
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=reqlan-code-action-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reqlan-code-action-provider.js","sourceRoot":"","sources":["../../src/reqlan-code-action-provider.ts"],"names":[],"mappings":"AAKA,OAAO,E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AC;QACX,KAAK,MAAM;YACP,OAAO,MAAM,CAAC;QAClB,KAAK,cAAc;YACf,OAAO,UAAU,CAAC;QACtB,KAAK,SAAS;YACV,OAAO,SAAS,CAAC;QACrB;YACI,OAAO,SAAS,CAAC;IACzB,CAAC;AACL,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,6BAA6B,CACzC,QAAkC,EAClC,QAAyB;IAEzB,MAAM,WAAW,GAAG,CAAC,QAAQ,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE;QACjE,MAAM,IAAI,GAAG,UAAU,CAAC,IAAyC,CAAC;QAClE,OAAO,IAAI,EAAE,IAAI,KAAK,iBAAiB,CAAC,YAAY,CAAC;IACzD,CAAC,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC,cAAc,CAAC,QAAQ,EAAE;QACrC,YAAY,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,EAAE;QAChD,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,EAAE;QACpG,OAAO,EAAE,EAAE,WAAW,EAAE;KAC3B,CAAC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,QAAyB;IACrD,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locates and parses rq:[target] references embedded in source-file comments.
|
|
3
|
+
*/
|
|
4
|
+
import type { LangiumDocument, LangiumDocuments } from 'langium';
|
|
5
|
+
import { URI } from 'langium';
|
|
6
|
+
import type { Position, Range } from 'vscode-languageserver';
|
|
7
|
+
import { LocationLink } from 'vscode-languageserver';
|
|
8
|
+
import { type PathResolveContext } from './reqlan-path-resolve.js';
|
|
9
|
+
export interface EmbeddedCommentReference {
|
|
10
|
+
path?: string;
|
|
11
|
+
idea: string;
|
|
12
|
+
range: Range;
|
|
13
|
+
}
|
|
14
|
+
export declare function createSourceTextDocument(uri: string, text: string): LangiumDocument;
|
|
15
|
+
interface CommentSpan {
|
|
16
|
+
start: number;
|
|
17
|
+
end: number;
|
|
18
|
+
}
|
|
19
|
+
/** Line comment start outside string literals; `//` after `:` (e.g. URLs) is not a comment. */
|
|
20
|
+
export declare function findLineCommentStart(line: string): number;
|
|
21
|
+
export declare function findCommentSpansInText(text: string): CommentSpan[];
|
|
22
|
+
export declare function parseCommentReferenceTarget(target: string): {
|
|
23
|
+
path?: string;
|
|
24
|
+
idea: string;
|
|
25
|
+
} | undefined;
|
|
26
|
+
export declare function findCommentReferencesInText(text: string, lineOffset?: number): EmbeddedCommentReference[];
|
|
27
|
+
export declare function findCommentReferenceAt(document: LangiumDocument, position: Position): EmbeddedCommentReference | undefined;
|
|
28
|
+
export declare function findCommentReferencePartAt(document: LangiumDocument, position: Position): {
|
|
29
|
+
reference: EmbeddedCommentReference;
|
|
30
|
+
property: 'path' | 'idea';
|
|
31
|
+
} | undefined;
|
|
32
|
+
export declare function resolveCommentReferenceIdea(reference: EmbeddedCommentReference, document: LangiumDocument, documents: LangiumDocuments, context?: PathResolveContext): import("./generated/ast.js").TopLevelElement | undefined;
|
|
33
|
+
export declare function resolveCommentDefinitionLinks(reference: EmbeddedCommentReference, document: LangiumDocument, documents: LangiumDocuments, context?: PathResolveContext): LocationLink[] | undefined;
|
|
34
|
+
export declare function resolveFileUri(path: string, document: LangiumDocument, context?: PathResolveContext): URI;
|
|
35
|
+
export {};
|