@reqlan/language 1.9.6 → 1.10.1
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 +42 -0
- package/README.template.md +2 -0
- package/out/file-path-rewrite.d.ts +1 -1
- package/out/generated/ast.d.ts +2 -2
- package/out/generated/ast.js +1 -1
- package/out/generated/ast.js.map +1 -1
- package/out/generated/grammar.js +1 -1
- package/out/generated/grammar.js.map +1 -1
- package/out/index.d.ts +3 -1
- package/out/index.js +3 -1
- package/out/index.js.map +1 -1
- package/out/reqlan-code-action-provider.d.ts +1 -0
- package/out/reqlan-code-action-provider.js +12 -21
- package/out/reqlan-code-action-provider.js.map +1 -1
- package/out/reqlan-comment-diagnostics.d.ts +11 -0
- package/out/reqlan-comment-diagnostics.js +81 -11
- package/out/reqlan-comment-diagnostics.js.map +1 -1
- package/out/reqlan-comment-resolver.d.ts +1 -1
- package/out/reqlan-completion-provider.d.ts +2 -2
- package/out/reqlan-definition-provider.js +1 -1
- package/out/reqlan-definition-provider.js.map +1 -1
- package/out/reqlan-document-builder.d.ts +9 -0
- package/out/reqlan-document-builder.js +26 -0
- package/out/reqlan-document-builder.js.map +1 -0
- package/out/reqlan-document-link-provider.d.ts +5 -1
- package/out/reqlan-document-link-provider.js +9 -1
- package/out/reqlan-document-link-provider.js.map +1 -1
- package/out/reqlan-embedded-file-references.d.ts +3 -0
- package/out/reqlan-embedded-file-references.js +47 -5
- package/out/reqlan-embedded-file-references.js.map +1 -1
- package/out/reqlan-file-link-resolver.d.ts +8 -0
- package/out/reqlan-file-link-resolver.js +46 -11
- package/out/reqlan-file-link-resolver.js.map +1 -1
- package/out/reqlan-file-references.d.ts +1 -0
- package/out/reqlan-file-references.js +24 -16
- package/out/reqlan-file-references.js.map +1 -1
- package/out/reqlan-idea-move-imports.d.ts +24 -0
- package/out/reqlan-idea-move-imports.js +309 -0
- package/out/reqlan-idea-move-imports.js.map +1 -0
- package/out/reqlan-idea-refactor.d.ts +12 -4
- package/out/reqlan-idea-refactor.js +85 -13
- package/out/reqlan-idea-refactor.js.map +1 -1
- package/out/reqlan-ignore-error.d.ts +2 -1
- package/out/reqlan-ignore-error.js +4 -17
- package/out/reqlan-ignore-error.js.map +1 -1
- package/out/reqlan-import-edits.d.ts +1 -0
- package/out/reqlan-import-edits.js +8 -0
- package/out/reqlan-import-edits.js.map +1 -1
- package/out/reqlan-imports.d.ts +3 -1
- package/out/reqlan-imports.js +2 -5
- package/out/reqlan-imports.js.map +1 -1
- package/out/reqlan-module.js +4 -1
- package/out/reqlan-module.js.map +1 -1
- package/out/reqlan-reference-at-position.d.ts +3 -0
- package/out/reqlan-reference-at-position.js +8 -2
- package/out/reqlan-reference-at-position.js.map +1 -1
- package/out/reqlan-scope.d.ts +14 -0
- package/out/reqlan-scope.js +58 -15
- package/out/reqlan-scope.js.map +1 -1
- package/out/reqlan-validator.d.ts +12 -1
- package/out/reqlan-validator.js +38 -4
- package/out/reqlan-validator.js.map +1 -1
- package/package.json +3 -2
- package/src/file-path-rewrite.ts +1 -1
- package/src/generated/ast.ts +2 -2
- package/src/generated/grammar.ts +1 -1
- package/src/index.ts +9 -0
- package/src/reqlan-code-action-provider.ts +12 -24
- package/src/reqlan-comment-diagnostics.ts +108 -11
- package/src/reqlan-comment-resolver.ts +1 -1
- package/src/reqlan-completion-provider.ts +2 -2
- package/src/reqlan-definition-provider.ts +1 -1
- package/src/reqlan-document-builder.ts +35 -0
- package/src/reqlan-document-link-provider.ts +23 -3
- package/src/reqlan-embedded-file-references.ts +54 -5
- package/src/reqlan-file-link-resolver.ts +56 -11
- package/src/reqlan-file-references.ts +26 -16
- package/src/reqlan-idea-move-imports.ts +398 -0
- package/src/reqlan-idea-refactor.ts +116 -14
- package/src/reqlan-ignore-error.ts +4 -18
- package/src/reqlan-import-edits.ts +9 -0
- package/src/reqlan-imports.ts +4 -5
- package/src/reqlan-module.ts +4 -1
- package/src/reqlan-reference-at-position.ts +16 -2
- package/src/reqlan-scope.ts +73 -16
- package/src/reqlan-validator.ts +48 -4
- package/src/reqlan.langium +4 -1
package/src/generated/grammar.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { Grammar } from 'langium';
|
|
|
7
7
|
import { loadGrammarFromJson } from 'langium';
|
|
8
8
|
|
|
9
9
|
let loadedReqlanGrammar: Grammar | undefined;
|
|
10
|
-
export const ReqlanGrammar = (): Grammar => loadedReqlanGrammar ?? (loadedReqlanGrammar = loadGrammarFromJson('{"$type":"Grammar","isDeclared":true,"name":"Reqlan","rules":[{"$type":"ParserRule","entry":true,"name":"Model","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"imports","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"TopLevelElement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"OneLinerIdea","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"OneLinerBody","definition":{"$type":"Assignment","feature":"content","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"IdeaDeclaration","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Idea","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"IdeaSet","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"IdeaName","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"IdeaMemberName","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ReferenceName","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BodyElement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BodyLine","definition":{"$type":"Assignment","feature":"parts","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RichTextPart","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"Assignment","feature":"inlineCode","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]}},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"lparen","operator":"=","terminal":{"$type":"Keyword","value":"("}},{"$type":"Assignment","feature":"rparen","operator":"=","terminal":{"$type":"Keyword","value":")"}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"InlineTextPart","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"Assignment","feature":"inlineCode","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]}},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CodeSnippet","definition":{"$type":"Assignment","feature":"raw","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"OneLinerText","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"Keyword","value":"("},{"$type":"Keyword","value":")"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"`"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PlainText","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Keyword","value":"]"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"`"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PlainPunctuation","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"."},{"$type":"Keyword","value":","},{"$type":"Keyword","value":":"},{"$type":"Keyword","value":";"},{"$type":"Keyword","value":"!"},{"$type":"Keyword","value":"?"},{"$type":"Keyword","value":"-"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Attribute","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"negated","operator":"?=","terminal":{"$type":"Keyword","value":"!"}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AttributeValue","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ScalarValue","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"parts","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"parts","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NonBangInlineTextPart","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"Assignment","feature":"inlineCode","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]}},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NonBangPlainText","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Keyword","value":"]"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"`"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NonBangPunctuation","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"."},{"$type":"Keyword","value":","},{"$type":"Keyword","value":";"},{"$type":"Keyword","value":"?"},{"$type":"Keyword","value":"-"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BlockValue","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BlockElement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BlockLine","definition":{"$type":"Assignment","feature":"parts","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListValue","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"}]},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NamedList","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"}]},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NestedList","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"}]},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListItem","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"OneLinerListItem","definition":{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListItemBody","definition":{"$type":"Assignment","feature":"content","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]}]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListItemText","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Keyword","value":"("},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"`"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListItemPunctuation","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"."},{"$type":"Keyword","value":":"},{"$type":"Keyword","value":";"},{"$type":"Keyword","value":"!"},{"$type":"Keyword","value":"?"},{"$type":"Keyword","value":"-"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NamedBlockListItem","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AnonymousBlock","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"MarkdownLink","definition":{"$type":"Assignment","feature":"raw","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"WikiLink","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alias","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"]]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AliasPart","definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BracketReference","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ReferenceTarget","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"FileReference","definition":{"$type":"Assignment","feature":"file","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"FileSymbolReference","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"file","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"WildcardReference","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"pathPattern","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"ideaPattern","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedReference","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@47"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Assignment","feature":"qualifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@47"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},{"$type":"Keyword","value":"."},{"$type":"Group","elements":[{"$type":"Assignment","feature":"ideaset","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@6"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"."}],"cardinality":"?"},{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"LocalReference","definition":{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Import","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"FromImport","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"from"},{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"import"},{"$type":"Assignment","feature":"specifiers","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"specifiers","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}]}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"FromImportSpecifier","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NamespaceImport","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"import"},{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedImport","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"import"},{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"ideaset","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"InvalidFromImport","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"from"},{"$type":"Assignment","feature":"head","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]}},{"$type":"Assignment","feature":"tokens","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"InvalidImportHeadToken","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"Keyword","value":"("},{"$type":"Keyword","value":")"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"`"},{"$type":"Keyword","value":"["},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"InvalidImportToken","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"Keyword","value":"("},{"$type":"Keyword","value":")"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"`"},{"$type":"Keyword","value":"["},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"MARKDOWN_LINK","definition":{"$type":"RegexToken","regex":"/\\\\[(?!\\\\[)[^\\\\]]+\\\\]\\\\([^)]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"WILDCARD_NAME","definition":{"$type":"RegexToken","regex":"/\\\\*[\\\\w*?-]*|\\\\?[\\\\w*?-]*|[_a-zA-Z][\\\\w-]*[*?][\\\\w*?-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"(\\\\\\\\.|[^\\"\\\\\\\\\\\\r\\\\n])*\\"|\'(\\\\\\\\.|[^\'\\\\\\\\\\\\r\\\\n])*\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","definition":{"$type":"RegexToken","regex":"/\\\\d+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"WORD","definition":{"$type":"RegexToken","regex":"/[A-Za-z_][\\\\w\']*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"OTHER","definition":{"$type":"RegexToken","regex":"/[^\\\\s\\\\w\\\\[\\\\]()`]/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INLINE_CODE","definition":{"$type":"RegexToken","regex":"/`[^`\\\\n]+`/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CODE_FENCE","definition":{"$type":"RegexToken","regex":"/```[^\\\\n]*(?:\\\\r?\\\\n[\\\\s\\\\S]*?)?```/","parenthesized":false},"fragment":false,"hidden":false}],"imports":[],"interfaces":[],"types":[],"$comment":"/**\\n * Implementation of the rules described in reqlan rq/language/syntax.rq.\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".grammar_rule]\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".idea]\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".ideaset]\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".keyword]\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".import_statement]\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".reference]\\n *\\n * Design:\\n * - Imports and top-level declarations are line-oriented; import/from/as are keywords only there.\\n * - One-liner ideas are name + body on a single line; block ideas use braces for rich content.\\n * - ReferenceTarget covers local members, import-qualified, alias-qualified, and file targets.\\n */"}'));
|
|
10
|
+
export const ReqlanGrammar = (): Grammar => loadedReqlanGrammar ?? (loadedReqlanGrammar = loadGrammarFromJson('{"$type":"Grammar","isDeclared":true,"name":"Reqlan","rules":[{"$type":"ParserRule","entry":true,"name":"Model","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"imports","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}]},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"TopLevelElement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"OneLinerIdea","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"OneLinerBody","definition":{"$type":"Assignment","feature":"content","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"IdeaDeclaration","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Idea","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"IdeaSet","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"members","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"IdeaName","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"IdeaMemberName","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ReferenceName","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BodyElement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BodyLine","definition":{"$type":"Assignment","feature":"parts","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"RichTextPart","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"Assignment","feature":"inlineCode","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]}},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"lparen","operator":"=","terminal":{"$type":"Keyword","value":"("}},{"$type":"Assignment","feature":"rparen","operator":"=","terminal":{"$type":"Keyword","value":")"}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"InlineTextPart","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"Assignment","feature":"inlineCode","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]}},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CodeSnippet","definition":{"$type":"Assignment","feature":"raw","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"OneLinerText","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"Keyword","value":"("},{"$type":"Keyword","value":")"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"`"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PlainText","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Keyword","value":"]"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"`"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"PlainPunctuation","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"."},{"$type":"Keyword","value":","},{"$type":"Keyword","value":":"},{"$type":"Keyword","value":";"},{"$type":"Keyword","value":"!"},{"$type":"Keyword","value":"?"},{"$type":"Keyword","value":"-"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Attribute","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"@"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"negated","operator":"?=","terminal":{"$type":"Keyword","value":"!"}},{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AttributeValue","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ScalarValue","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"parts","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"parts","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NonBangInlineTextPart","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"Assignment","feature":"inlineCode","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]}},{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NonBangPlainText","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},{"$type":"Keyword","value":"["},{"$type":"Keyword","value":"]"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"`"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NonBangPunctuation","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"."},{"$type":"Keyword","value":","},{"$type":"Keyword","value":";"},{"$type":"Keyword","value":"?"},{"$type":"Keyword","value":"-"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BlockValue","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BlockElement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BlockLine","definition":{"$type":"Assignment","feature":"parts","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListValue","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"}]},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NamedList","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"}]},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NestedList","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"+"}]},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"Keyword","value":")"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListItem","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"OneLinerListItem","definition":{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListItemBody","definition":{"$type":"Assignment","feature":"content","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]}]},"cardinality":"+"},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListItemText","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"Keyword","value":"("},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"`"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ListItemPunctuation","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"."},{"$type":"Keyword","value":":"},{"$type":"Keyword","value":";"},{"$type":"Keyword","value":"!"},{"$type":"Keyword","value":"?"},{"$type":"Keyword","value":"-"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NamedBlockListItem","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AnonymousBlock","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"MarkdownLink","definition":{"$type":"Assignment","feature":"raw","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"WikiLink","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"[["},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"|"},{"$type":"Assignment","feature":"alias","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]},"cardinality":"+"}],"cardinality":"?"},{"$type":"Keyword","value":"]]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"AliasPart","definition":{"$type":"Assignment","feature":"text","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"BracketReference","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ReferenceTarget","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"FileReference","definition":{"$type":"Assignment","feature":"file","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"FileSymbolReference","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"file","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}],"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"WildcardReference","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"pathPattern","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"ideaPattern","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedReference","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@47"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Assignment","feature":"qualifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@47"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},{"$type":"Keyword","value":"."},{"$type":"Group","elements":[{"$type":"Assignment","feature":"ideaset","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@6"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Keyword","value":"."}],"cardinality":"?"},{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"LocalReference","definition":{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"Import","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"FromImport","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"from"},{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"import"},{"$type":"Assignment","feature":"specifiers","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"specifiers","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}]}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"FromImportSpecifier","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"NamespaceImport","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"import"},{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedImport","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"import"},{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"ideaset","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}}],"cardinality":"?"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"InvalidFromImport","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"from"},{"$type":"Assignment","feature":"head","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]}},{"$type":"Assignment","feature":"tokens","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"InvalidImportHeadToken","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"Keyword","value":"("},{"$type":"Keyword","value":")"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"`"},{"$type":"Keyword","value":"["},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"InvalidImportToken","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},{"$type":"Keyword","value":"("},{"$type":"Keyword","value":")"},{"$type":"Keyword","value":"|"},{"$type":"Keyword","value":"as"},{"$type":"Keyword","value":"import"},{"$type":"Keyword","value":"from"},{"$type":"Keyword","value":"`"},{"$type":"Keyword","value":"["},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//","parenthesized":false},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SL_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/","parenthesized":false},"fragment":false},{"$type":"TerminalRule","name":"MARKDOWN_LINK","definition":{"$type":"RegexToken","regex":"/\\\\[(?!\\\\[)[^\\\\]]+\\\\]\\\\([^)]+\\\\)/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"WILDCARD_NAME","definition":{"$type":"RegexToken","regex":"/\\\\*[\\\\w*?-]*|\\\\?[\\\\w*?-]*|[_a-zA-Z][\\\\w-]*[*?][\\\\w*?-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"(\\\\\\\\.|[^\\"\\\\\\\\\\\\r\\\\n])*\\"|\'(\\\\\\\\.|[^\'\\\\\\\\\\\\r\\\\n])*\'/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","definition":{"$type":"RegexToken","regex":"/\\\\d+/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"WORD","definition":{"$type":"RegexToken","regex":"/[A-Za-z_][\\\\w\']*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"OTHER","definition":{"$type":"RegexToken","regex":"/[^\\\\s\\\\w\\\\[\\\\]()`]/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INLINE_CODE","definition":{"$type":"RegexToken","regex":"/`[^`\\\\n]+`/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CODE_FENCE","definition":{"$type":"RegexToken","regex":"/```[^\\\\n]*(?:\\\\r?\\\\n[\\\\s\\\\S]*?)?```/","parenthesized":false},"fragment":false,"hidden":false}],"imports":[],"interfaces":[],"types":[],"$comment":"/**\\n * Implementation of the rules described in reqlan rq/language/syntax.rq.\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".grammar_rule]\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".idea]\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".ideaset]\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".keyword]\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".import_statement]\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".reference]\\n *\\n * Design:\\n * - Imports and top-level declarations are line-oriented; import/from/as are keywords only there.\\n * - One-liner ideas are name + body on a single line; block ideas use braces for rich content.\\n * - ReferenceTarget covers local members, import-qualified, alias-qualified, and file targets.\\n */"}'));
|
|
11
11
|
|
|
12
12
|
let loadedReqlanCommentGrammar: Grammar | undefined;
|
|
13
13
|
export const ReqlanCommentGrammar = (): Grammar => loadedReqlanCommentGrammar ?? (loadedReqlanCommentGrammar = loadGrammarFromJson('{"$type":"Grammar","isDeclared":true,"name":"ReqlanComment","rules":[{"$type":"ParserRule","entry":true,"name":"CommentModel","definition":{"$type":"Assignment","feature":"references","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]},"cardinality":"*"},"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CommentReference","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"rq"},{"$type":"Keyword","value":":"},{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"CommentReferenceTarget","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"QualifiedCommentReference","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"path","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"LocalCommentReference","definition":{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"TerminalRule","name":"ID","definition":{"$type":"RegexToken","regex":"/[_a-zA-Z][\\\\w-]*/","parenthesized":false},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","definition":{"$type":"RegexToken","regex":"/\\"(\\\\\\\\.|[^\\"\\\\\\\\])*\\"/","parenthesized":false},"fragment":false,"hidden":false}],"imports":[],"interfaces":[],"types":[],"$comment":"/**\\n * Embedded reqlan references in comments of arbitrary source files.\\n * Syntax: rq:[idea] or rq:[\\"./reqfile.rq\\".idea_name]\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".referenced_files]\\n * rq:[\\"../../../reqlan rq/ontology.rq\\".reference_types]\\n */"}'));
|
package/src/index.ts
CHANGED
|
@@ -2,11 +2,17 @@ export * from './reqlan-module.js';
|
|
|
2
2
|
export * from './reqlan-parse-budget.js';
|
|
3
3
|
export { ReqlanAsyncParser, resolveParseWorkerPath } from './reqlan-async-parser.js';
|
|
4
4
|
export { ReqlanLangiumDocumentFactory } from './reqlan-document-factory.js';
|
|
5
|
+
export { ReqlanDocumentBuilder } from './reqlan-document-builder.js';
|
|
5
6
|
export * from './reqlan-validator.js';
|
|
6
7
|
export * from './reqlan-comment-resolver.js';
|
|
7
8
|
export * from './reqlan-comment-diagnostics.js';
|
|
8
9
|
export * from './reqlan-ignore-error.js';
|
|
9
10
|
export * from './reqlan-file-references.js';
|
|
11
|
+
export {
|
|
12
|
+
FILE_REFERENCE_MISSING,
|
|
13
|
+
fileLinkMissingMessage,
|
|
14
|
+
fileLinkTargetIssueMessage
|
|
15
|
+
} from './reqlan-file-link-resolver.js';
|
|
10
16
|
export * from './reqlan-embedded-file-references.js';
|
|
11
17
|
export * from './file-path-rewrite.js';
|
|
12
18
|
export * from './reqlan-path-references.js';
|
|
@@ -17,7 +23,10 @@ export {
|
|
|
17
23
|
isRefactorIdeaDeclaration,
|
|
18
24
|
planIdeaDeleteEdits,
|
|
19
25
|
planIdeaMoveEdits,
|
|
26
|
+
findIdeaDeclarationAtRange,
|
|
27
|
+
listRefactorIdeaDeclarations,
|
|
20
28
|
type DocumentTextEdits,
|
|
29
|
+
type PlanIdeaMoveInput,
|
|
21
30
|
type RefactorIdeaDeclaration
|
|
22
31
|
} from './reqlan-idea-refactor.js';
|
|
23
32
|
export * from './reqlan-path-resolve.js';
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* rq:["../../../reqlan rq/extension/features-commands.rq".file_based_code_actions]
|
|
9
9
|
*/
|
|
10
10
|
import type { LangiumDocument, URI } from 'langium';
|
|
11
|
-
import {
|
|
11
|
+
import { DocumentValidator, URI as UriCtor, UriUtils } from 'langium';
|
|
12
12
|
import type { CodeActionParams, Command, Diagnostic } from 'vscode-languageserver';
|
|
13
13
|
import { CodeActionKind } from 'vscode-languageserver';
|
|
14
14
|
import type { CodeActionProvider } from 'langium/lsp';
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
buildFromImportEdit,
|
|
24
24
|
relativeRqImportPath
|
|
25
25
|
} from './reqlan-import-edits.js';
|
|
26
|
-
import { isRefactorIdeaDeclaration } from './reqlan-idea-refactor.js';
|
|
26
|
+
import { isRefactorIdeaDeclaration, findIdeaDeclarationAtRange } from './reqlan-idea-refactor.js';
|
|
27
27
|
import type { ReqlanServices } from './reqlan-module.js';
|
|
28
28
|
import {
|
|
29
29
|
sharedNameCatalog,
|
|
@@ -37,6 +37,7 @@ export const REQLAN_IMPORT_ERROR_CREATE_COMMAND = 'reqlan.importError.createFile
|
|
|
37
37
|
export const REQLAN_SEARCH_REFERENCE_COMMAND = 'reqlan.searchReference';
|
|
38
38
|
export const REQLAN_REFACTOR_DELETE_IDEA_COMMAND = 'reqlan.refactor.deleteIdea';
|
|
39
39
|
export const REQLAN_REFACTOR_MOVE_IDEA_COMMAND = 'reqlan.refactor.moveIdea';
|
|
40
|
+
export const REQLAN_REFACTOR_MOVE_IDEA_CONTENT_COMMAND = 'reqlan.refactor.moveIdeaContent';
|
|
40
41
|
export const REQLAN_BARREL_PAGE_COMMAND = 'reqlan.barrelPage';
|
|
41
42
|
/** Source-action kind for whole-file barrel page. */
|
|
42
43
|
export const REQLAN_BARREL_PAGE_KIND = `${CodeActionKind.Source}.barrelPage`;
|
|
@@ -163,6 +164,15 @@ export class ReqlanCodeActionProvider implements CodeActionProvider {
|
|
|
163
164
|
command: REQLAN_REFACTOR_MOVE_IDEA_COMMAND,
|
|
164
165
|
arguments: [args]
|
|
165
166
|
}
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
title: `Move idea '${idea.name}' content to another file…`,
|
|
170
|
+
kind: CodeActionKind.Refactor,
|
|
171
|
+
command: {
|
|
172
|
+
title: `Move idea '${idea.name}' content`,
|
|
173
|
+
command: REQLAN_REFACTOR_MOVE_IDEA_CONTENT_COMMAND,
|
|
174
|
+
arguments: [args]
|
|
175
|
+
}
|
|
166
176
|
}
|
|
167
177
|
];
|
|
168
178
|
}
|
|
@@ -468,25 +478,3 @@ export function collectImportErrorCodeActions(
|
|
|
468
478
|
export function isModelDocument(document: LangiumDocument): document is LangiumDocument<Model> {
|
|
469
479
|
return isModel(document.parseResult.value);
|
|
470
480
|
}
|
|
471
|
-
|
|
472
|
-
function findIdeaDeclarationAtRange(document: LangiumDocument, range: Diagnostic['range']) {
|
|
473
|
-
const offset = document.textDocument.offsetAt(range.start);
|
|
474
|
-
for (const node of AstUtils.streamAst(document.parseResult.value)) {
|
|
475
|
-
if (!isRefactorIdeaDeclaration(node) || !node.$cstNode) {
|
|
476
|
-
continue;
|
|
477
|
-
}
|
|
478
|
-
const start = document.textDocument.offsetAt(node.$cstNode.range.start);
|
|
479
|
-
const end = document.textDocument.offsetAt(node.$cstNode.range.end);
|
|
480
|
-
if (offset >= start && offset <= end) {
|
|
481
|
-
return node;
|
|
482
|
-
}
|
|
483
|
-
// Also match when the selection is exactly on the name token line.
|
|
484
|
-
if (
|
|
485
|
-
range.start.line === node.$cstNode.range.start.line
|
|
486
|
-
&& range.start.character <= (node.name?.length ?? 0) + 1
|
|
487
|
-
) {
|
|
488
|
-
return node;
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
return undefined;
|
|
492
|
-
}
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Diagnostics and document-link targets for `rq:[…]` comment references.
|
|
3
|
+
* One presentation supplies both, so the clickable link and the error underline stay in sync.
|
|
3
4
|
* rq:["../../../reqlan rq/language/syntax.rq".comment_reference_resolution_error]
|
|
4
5
|
* rq:["../../../reqlan rq/language/syntax.rq".comment_reference]
|
|
5
6
|
* rq:["../../../reqlan rq/language/syntax.rq".comment_reference_ignore]
|
|
7
|
+
* rq:["../../../reqlan rq/extension/features-non-rq-code-comment/functional-code-comment-references.rq".comment_reference_resolution_error_state]
|
|
6
8
|
*/
|
|
7
9
|
import type { FileSystemProvider, LangiumDocument, LangiumDocuments } from 'langium';
|
|
10
|
+
import { AstUtils, URI } from 'langium';
|
|
8
11
|
import type { Range } from 'vscode-languageserver';
|
|
9
12
|
import {
|
|
10
13
|
findCommentReferencesInText,
|
|
11
14
|
resolveCommentReferenceIdea,
|
|
15
|
+
resolveFileUri,
|
|
12
16
|
type EmbeddedCommentReference
|
|
13
17
|
} from './reqlan-comment-resolver.js';
|
|
14
18
|
import { findRqIgnoreErrorTargetLines } from './reqlan-ignore-error.js';
|
|
15
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
findImportedDocument,
|
|
21
|
+
isResolvableImportPath,
|
|
22
|
+
resolveImportCandidateUris
|
|
23
|
+
} from './reqlan-imports.js';
|
|
16
24
|
import type { PathResolveContext } from './reqlan-path-resolve.js';
|
|
17
25
|
|
|
18
26
|
export const COMMENT_REFERENCE_MISSING_FILE = 'comment-reference-missing-file';
|
|
@@ -22,11 +30,13 @@ export interface CommentReferenceFileHost {
|
|
|
22
30
|
exists(absolutePath: string): boolean;
|
|
23
31
|
declaresIdea?(absolutePath: string, idea: string): boolean;
|
|
24
32
|
workspaceDeclaresIdea?(idea: string): boolean;
|
|
33
|
+
resolveWorkspaceIdea?(idea: string): string | undefined;
|
|
25
34
|
}
|
|
26
35
|
|
|
27
36
|
export interface CommentReferenceLink {
|
|
28
37
|
range: Range;
|
|
29
38
|
targetPath: string;
|
|
39
|
+
targetUri?: string;
|
|
30
40
|
idea: string;
|
|
31
41
|
}
|
|
32
42
|
|
|
@@ -49,6 +59,10 @@ export function commentReferenceMissingIdeaMessage(idea: string): string {
|
|
|
49
59
|
return `Could not resolve comment reference to idea '${idea}'.`;
|
|
50
60
|
}
|
|
51
61
|
|
|
62
|
+
export function isCommentReferenceDiagnosticCode(code: unknown): boolean {
|
|
63
|
+
return code === COMMENT_REFERENCE_MISSING_FILE || code === COMMENT_REFERENCE_MISSING_IDEA;
|
|
64
|
+
}
|
|
65
|
+
|
|
52
66
|
export function presentCommentReferences(
|
|
53
67
|
text: string,
|
|
54
68
|
sourceDir: string,
|
|
@@ -61,10 +75,13 @@ export function presentCommentReferences(
|
|
|
61
75
|
for (const reference of findCommentReferencesInText(text)) {
|
|
62
76
|
const issue = commentReferenceFileIssue(reference, sourceDir, host, resolvePath);
|
|
63
77
|
if (!issue) {
|
|
64
|
-
|
|
78
|
+
const targetPath = reference.path
|
|
79
|
+
? resolvePath(sourceDir, reference.path)
|
|
80
|
+
: host.resolveWorkspaceIdea?.(reference.idea);
|
|
81
|
+
if (targetPath) {
|
|
65
82
|
links.push({
|
|
66
83
|
range: reference.range,
|
|
67
|
-
targetPath
|
|
84
|
+
targetPath,
|
|
68
85
|
idea: reference.idea
|
|
69
86
|
});
|
|
70
87
|
}
|
|
@@ -78,30 +95,75 @@ export function presentCommentReferences(
|
|
|
78
95
|
return { links, diagnostics };
|
|
79
96
|
}
|
|
80
97
|
|
|
81
|
-
export function
|
|
98
|
+
export function presentCommentReferencesForDocument(
|
|
82
99
|
document: LangiumDocument,
|
|
83
100
|
documents: LangiumDocuments,
|
|
84
101
|
fileSystem?: FileSystemProvider,
|
|
85
102
|
context?: PathResolveContext
|
|
86
|
-
):
|
|
103
|
+
): CommentReferencePresentation {
|
|
87
104
|
const text = document.textDocument.getText();
|
|
88
105
|
const ignoredLines = findRqIgnoreErrorTargetLines(text);
|
|
106
|
+
const links: CommentReferenceLink[] = [];
|
|
89
107
|
const diagnostics: CommentReferenceDiagnostic[] = [];
|
|
90
108
|
for (const reference of findCommentReferencesInText(text)) {
|
|
109
|
+
if (!isSlashOrBlockCommentReference(text, reference.range)) {
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
const issue = commentReferenceLangiumIssue(reference, document, documents, fileSystem, context);
|
|
113
|
+
if (!issue) {
|
|
114
|
+
const link = commentReferenceLangiumLink(reference, document, documents, context);
|
|
115
|
+
if (link) {
|
|
116
|
+
links.push(link);
|
|
117
|
+
}
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
91
120
|
if (ignoredLines.has(reference.range.start.line)) {
|
|
92
121
|
continue;
|
|
93
122
|
}
|
|
94
|
-
|
|
95
|
-
|
|
123
|
+
diagnostics.push(issue);
|
|
124
|
+
}
|
|
125
|
+
return { links, diagnostics };
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function collectCommentReferenceIssues(
|
|
129
|
+
document: LangiumDocument,
|
|
130
|
+
documents: LangiumDocuments,
|
|
131
|
+
fileSystem?: FileSystemProvider,
|
|
132
|
+
context?: PathResolveContext
|
|
133
|
+
): CommentReferenceDiagnostic[] {
|
|
134
|
+
return presentCommentReferencesForDocument(document, documents, fileSystem, context).diagnostics;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Relink this document when a changed `.rq` file can change comment-reference
|
|
139
|
+
* resolution (missing idea becomes present, or a targeted file changes).
|
|
140
|
+
*/
|
|
141
|
+
export function shouldRelinkCommentReferences(
|
|
142
|
+
document: LangiumDocument,
|
|
143
|
+
changedUris: Set<string>,
|
|
144
|
+
context?: PathResolveContext
|
|
145
|
+
): boolean {
|
|
146
|
+
const text = document.textDocument.getText();
|
|
147
|
+
if (!text.includes('rq:[')) {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
if (document.diagnostics?.some(diagnostic => isCommentReferenceDiagnosticCode(diagnostic.code))) {
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
for (const reference of findCommentReferencesInText(text)) {
|
|
96
154
|
if (!isSlashOrBlockCommentReference(text, reference.range)) {
|
|
97
155
|
continue;
|
|
98
156
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
157
|
+
if (!reference.path) {
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
for (const uri of resolveImportCandidateUris(reference.path, document, context)) {
|
|
161
|
+
if (changedUris.has(uri.toString())) {
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
102
164
|
}
|
|
103
165
|
}
|
|
104
|
-
return
|
|
166
|
+
return false;
|
|
105
167
|
}
|
|
106
168
|
|
|
107
169
|
function isSlashOrBlockCommentReference(text: string, range: Range): boolean {
|
|
@@ -181,3 +243,38 @@ function commentReferenceLangiumIssue(
|
|
|
181
243
|
code: COMMENT_REFERENCE_MISSING_IDEA
|
|
182
244
|
};
|
|
183
245
|
}
|
|
246
|
+
|
|
247
|
+
function commentReferenceLangiumLink(
|
|
248
|
+
reference: EmbeddedCommentReference,
|
|
249
|
+
document: LangiumDocument,
|
|
250
|
+
documents: LangiumDocuments,
|
|
251
|
+
context?: PathResolveContext
|
|
252
|
+
): CommentReferenceLink | undefined {
|
|
253
|
+
const idea = resolveCommentReferenceIdea(reference, document, documents, context);
|
|
254
|
+
if (idea) {
|
|
255
|
+
const targetDocument = documents.getDocument(AstUtils.getDocument(idea).uri);
|
|
256
|
+
if (!targetDocument) {
|
|
257
|
+
return undefined;
|
|
258
|
+
}
|
|
259
|
+
const ideaNode = idea.$cstNode;
|
|
260
|
+
const targetUri = ideaNode
|
|
261
|
+
? `${targetDocument.textDocument.uri}#L${ideaNode.range.start.line + 1}`
|
|
262
|
+
: targetDocument.textDocument.uri;
|
|
263
|
+
return {
|
|
264
|
+
range: reference.range,
|
|
265
|
+
targetPath: URI.parse(targetDocument.textDocument.uri).fsPath,
|
|
266
|
+
targetUri,
|
|
267
|
+
idea: reference.idea
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
if (!reference.path) {
|
|
271
|
+
return undefined;
|
|
272
|
+
}
|
|
273
|
+
const target = resolveFileUri(reference.path, document, context);
|
|
274
|
+
return {
|
|
275
|
+
range: reference.range,
|
|
276
|
+
targetPath: target.fsPath,
|
|
277
|
+
targetUri: target.toString(),
|
|
278
|
+
idea: reference.idea
|
|
279
|
+
};
|
|
280
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Locates and parses rq:[
|
|
2
|
+
* Locates and parses `rq:[idea]` references embedded in source-file comments.
|
|
3
3
|
* rq:["../../../reqlan rq/ontology.rq".referenced_files]
|
|
4
4
|
* rq:["../../../reqlan rq/ontology.rq".reference_types]
|
|
5
5
|
* rq:["../../../reqlan rq/extension/features-non-rq-code-comment/functional-code-comment-references.rq".references_in_functional_code_comments]
|