@reqlan/language 1.7.0 → 1.8.2
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 +18 -0
- package/out/generated/ast.d.ts +28 -1
- package/out/generated/ast.js +27 -6
- 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 +1 -0
- package/out/index.js +1 -0
- package/out/index.js.map +1 -1
- package/out/reqlan-code-action-provider.d.ts +15 -12
- package/out/reqlan-code-action-provider.js +55 -20
- package/out/reqlan-code-action-provider.js.map +1 -1
- package/out/reqlan-comment-resolver.js +5 -0
- package/out/reqlan-comment-resolver.js.map +1 -1
- package/out/reqlan-completion-provider.d.ts +10 -0
- package/out/reqlan-completion-provider.js +63 -29
- package/out/reqlan-completion-provider.js.map +1 -1
- package/out/reqlan-definition-provider.d.ts +7 -0
- package/out/reqlan-definition-provider.js +86 -19
- package/out/reqlan-definition-provider.js.map +1 -1
- package/out/reqlan-document-link-provider.d.ts +2 -1
- package/out/reqlan-document-link-provider.js +4 -0
- package/out/reqlan-document-link-provider.js.map +1 -1
- package/out/reqlan-file-link-resolver.d.ts +17 -4
- package/out/reqlan-file-link-resolver.js +89 -14
- package/out/reqlan-file-link-resolver.js.map +1 -1
- package/out/reqlan-import-edits.d.ts +3 -1
- package/out/reqlan-import-edits.js.map +1 -1
- package/out/reqlan-inbound-reference-inlay-label.d.ts +11 -0
- package/out/reqlan-inbound-reference-inlay-label.js +60 -35
- package/out/reqlan-inbound-reference-inlay-label.js.map +1 -1
- package/out/reqlan-inlay-hint-provider.d.ts +6 -0
- package/out/reqlan-inlay-hint-provider.js +34 -6
- package/out/reqlan-inlay-hint-provider.js.map +1 -1
- package/out/reqlan-markdown-links.js +4 -0
- package/out/reqlan-markdown-links.js.map +1 -1
- package/out/reqlan-path-resolve.d.ts +8 -0
- package/out/reqlan-path-resolve.js +18 -4
- package/out/reqlan-path-resolve.js.map +1 -1
- package/out/reqlan-reference-search-site.d.ts +11 -0
- package/out/reqlan-reference-search-site.js +11 -0
- package/out/reqlan-reference-search-site.js.map +1 -1
- package/out/reqlan-scope.d.ts +11 -0
- package/out/reqlan-scope.js +28 -1
- package/out/reqlan-scope.js.map +1 -1
- package/out/reqlan-semantic-token-provider.js +6 -1
- package/out/reqlan-semantic-token-provider.js.map +1 -1
- package/out/reqlan-token-builder.d.ts +3 -2
- package/out/reqlan-token-builder.js +48 -1
- package/out/reqlan-token-builder.js.map +1 -1
- package/out/reqlan-validator.d.ts +1 -0
- package/out/reqlan-validator.js +21 -1
- package/out/reqlan-validator.js.map +1 -1
- package/out/reqlan-wildcard-resolve.d.ts +45 -0
- package/out/reqlan-wildcard-resolve.js +203 -0
- package/out/reqlan-wildcard-resolve.js.map +1 -0
- package/out/reqlan-workspace-manager.d.ts +7 -0
- package/out/reqlan-workspace-manager.js +7 -0
- package/out/reqlan-workspace-manager.js.map +1 -1
- package/package.json +1 -1
- package/src/generated/ast.ts +38 -7
- package/src/generated/grammar.ts +1 -1
- package/src/index.ts +1 -0
- package/src/reqlan-code-action-provider.ts +67 -32
- package/src/reqlan-comment-resolver.ts +5 -0
- package/src/reqlan-completion-provider.ts +81 -27
- package/src/reqlan-definition-provider.ts +91 -18
- package/src/reqlan-document-link-provider.ts +9 -1
- package/src/reqlan-file-link-resolver.ts +112 -17
- package/src/reqlan-import-edits.ts +3 -1
- package/src/reqlan-inbound-reference-inlay-label.ts +93 -38
- package/src/reqlan-inlay-hint-provider.ts +36 -6
- package/src/reqlan-markdown-links.ts +4 -0
- package/src/reqlan-path-resolve.ts +28 -5
- package/src/reqlan-reference-search-site.ts +25 -0
- package/src/reqlan-scope.ts +34 -1
- package/src/reqlan-semantic-token-provider.ts +6 -0
- package/src/reqlan-token-builder.ts +52 -3
- package/src/reqlan-validator.ts +34 -0
- package/src/reqlan-wildcard-resolve.ts +281 -0
- package/src/reqlan-workspace-manager.ts +9 -0
- package/src/reqlan.langium +14 -7
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@54"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"imports","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"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@54"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"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@54"},"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@54"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"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@54"},"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@59"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"IdeaMemberName","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"ReferenceName","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"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@64"},"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@64"},"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@65"},"arguments":[]}},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"OneLinerText","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"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@62"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"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@59"},"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@64"},"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@62"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"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@54"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"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@54"},"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@54"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[],"cardinality":"+"}]},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"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@59"},"arguments":[]}},{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"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@54"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[],"cardinality":"+"}]},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"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@54"},"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@54"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[],"cardinality":"+"}]},{"$type":"Assignment","feature":"items","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"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@62"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"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@59"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"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@54"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"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@58"},"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@43"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"FileReference","definition":{"$type":"Assignment","feature":"file","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"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@60"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"symbols","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}}],"cardinality":"*"}]},"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@46"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Assignment","feature":"qualifier","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@46"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"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@47"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"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@60"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"import"},{"$type":"Assignment","feature":"specifiers","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"specifiers","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"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@59"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"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@60"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"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@60"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"ideaset","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}},{"$type":"Keyword","value":"."},{"$type":"Assignment","feature":"idea","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"deprecatedSyntax":false,"isMulti":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"as"},{"$type":"Assignment","feature":"alias","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"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@52"},"arguments":[]}},{"$type":"Assignment","feature":"tokens","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]},"cardinality":"*"}]},"entry":false,"fragment":false,"parameters":[]},{"$type":"ParserRule","name":"InvalidImportHeadToken","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"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@59"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"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":"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 *\\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":[]}]},"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 *\\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 */"}'));
|
package/src/index.ts
CHANGED
|
@@ -23,6 +23,7 @@ export * from './reqlan-path-resolve.js';
|
|
|
23
23
|
export * from './reqlan-imports.js';
|
|
24
24
|
export * from './reqlan-quoted-strings.js';
|
|
25
25
|
export * from './reqlan-references.js';
|
|
26
|
+
export * from './reqlan-wildcard-resolve.js';
|
|
26
27
|
export * from './reqlan-reference-at-position.js';
|
|
27
28
|
export * from './reqlan-attribute-catalog.js';
|
|
28
29
|
export * from './reqlan-completion-context.js';
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Quick fixes for unresolved references: add import, rewrite qualified ref, search, create.
|
|
3
3
|
* Also offers a search code action when the cursor is inside a [reference] / [[wikilink]].
|
|
4
|
+
* File-level source actions include barrel page.
|
|
4
5
|
* rq:["../../../reqlan rq/extension/language-support/features-imports.rq".import_error]
|
|
5
6
|
* rq:["../../../reqlan rq/extension/features-commands.rq".search_code_actions]
|
|
7
|
+
* rq:["../../../reqlan rq/extension/features-commands.rq".barrel_page]
|
|
8
|
+
* rq:["../../../reqlan rq/extension/features-commands.rq".file_based_code_actions]
|
|
6
9
|
*/
|
|
7
10
|
import type { LangiumDocument, URI } from 'langium';
|
|
8
11
|
import { AstUtils, DocumentValidator, URI as UriCtor, UriUtils } from 'langium';
|
|
@@ -27,13 +30,16 @@ import {
|
|
|
27
30
|
type NameCatalogEntry,
|
|
28
31
|
type NameCatalogKind
|
|
29
32
|
} from './reqlan-name-catalog.js';
|
|
30
|
-
import { findReferenceSearchSite
|
|
33
|
+
import { findReferenceSearchSite } from './reqlan-reference-search-site.js';
|
|
31
34
|
|
|
32
35
|
export const REQLAN_IMPORT_ERROR_SEARCH_COMMAND = 'reqlan.importError.search';
|
|
33
36
|
export const REQLAN_IMPORT_ERROR_CREATE_COMMAND = 'reqlan.importError.createFile';
|
|
34
37
|
export const REQLAN_SEARCH_REFERENCE_COMMAND = 'reqlan.searchReference';
|
|
35
38
|
export const REQLAN_REFACTOR_DELETE_IDEA_COMMAND = 'reqlan.refactor.deleteIdea';
|
|
36
39
|
export const REQLAN_REFACTOR_MOVE_IDEA_COMMAND = 'reqlan.refactor.moveIdea';
|
|
40
|
+
export const REQLAN_BARREL_PAGE_COMMAND = 'reqlan.barrelPage';
|
|
41
|
+
/** Source-action kind for whole-file barrel page. */
|
|
42
|
+
export const REQLAN_BARREL_PAGE_KIND = `${CodeActionKind.Source}.barrelPage`;
|
|
37
43
|
|
|
38
44
|
/** Args for idea move/delete refactor commands. */
|
|
39
45
|
export interface IdeaRefactorCommandArgs {
|
|
@@ -58,18 +64,7 @@ export interface ImportErrorCommandArgs {
|
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
/** Args for reference search webview (replace existing ref or wrap prose). */
|
|
61
|
-
export
|
|
62
|
-
documentUri: string;
|
|
63
|
-
refText: string;
|
|
64
|
-
range: Diagnostic['range'];
|
|
65
|
-
mode: 'replace' | 'wrap';
|
|
66
|
-
context?: {
|
|
67
|
-
ideaName: string;
|
|
68
|
-
before: string;
|
|
69
|
-
target: string;
|
|
70
|
-
after: string;
|
|
71
|
-
};
|
|
72
|
-
}
|
|
67
|
+
export type SearchReferenceCommandArgs = import('./reqlan-reference-search-site.js').ReferenceSearchSiteRequestResult;
|
|
73
68
|
|
|
74
69
|
interface SymbolMatch {
|
|
75
70
|
name: string;
|
|
@@ -99,9 +94,40 @@ export class ReqlanCodeActionProvider implements CodeActionProvider {
|
|
|
99
94
|
actions.push(searchFromCursor);
|
|
100
95
|
}
|
|
101
96
|
actions.push(...this.createIdeaRefactorActions(document, params));
|
|
97
|
+
const barrelPage = this.createBarrelPageAction(document, params);
|
|
98
|
+
if (barrelPage) {
|
|
99
|
+
actions.push(barrelPage);
|
|
100
|
+
}
|
|
102
101
|
return actions;
|
|
103
102
|
}
|
|
104
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Whole-file source action: barrel top-level ideas into sibling files + container.
|
|
106
|
+
* rq:["../../../reqlan rq/extension/features-commands.rq".barrel_page]
|
|
107
|
+
* rq:["../../../reqlan rq/extension/features-commands.rq".file_based_code_actions]
|
|
108
|
+
*/
|
|
109
|
+
private createBarrelPageAction(
|
|
110
|
+
document: LangiumDocument,
|
|
111
|
+
params: CodeActionParams
|
|
112
|
+
): CodeActionLike | undefined {
|
|
113
|
+
if (!actionKindAllowed(params.context.only, REQLAN_BARREL_PAGE_KIND)) {
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
if (!documentHasTopLevelIdeas(document)) {
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
// No command arguments: VS Code caches arg-bearing commands and may dispose
|
|
120
|
+
// them when code actions refresh. The extension resolves the active editor.
|
|
121
|
+
return {
|
|
122
|
+
title: 'Barrel page into container…',
|
|
123
|
+
kind: REQLAN_BARREL_PAGE_KIND,
|
|
124
|
+
command: {
|
|
125
|
+
title: 'Barrel page',
|
|
126
|
+
command: REQLAN_BARREL_PAGE_COMMAND
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
105
131
|
/**
|
|
106
132
|
* rq:["../../../reqlan rq/extension/refactor_support.rq".refactor_symbol_move]
|
|
107
133
|
* rq:["../../../reqlan rq/extension/refactor_support.rq".refactor_symbol_delete]
|
|
@@ -163,13 +189,11 @@ export class ReqlanCodeActionProvider implements CodeActionProvider {
|
|
|
163
189
|
if (alreadyHasSearch) {
|
|
164
190
|
return undefined;
|
|
165
191
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
context: site.context
|
|
172
|
-
};
|
|
192
|
+
// No command arguments: VS Code caches arg-bearing commands and disposes
|
|
193
|
+
// them when code actions refresh (common under Langium revalidation),
|
|
194
|
+
// which surfaces as "Actual command not found, wanted to execute
|
|
195
|
+
// reqlan.searchReference /N". The extension resolves the site from the
|
|
196
|
+
// active editor when the command runs.
|
|
173
197
|
const title = site.mode === 'wrap'
|
|
174
198
|
? (site.refText
|
|
175
199
|
? `Wrap '${site.refText}' as idea reference…`
|
|
@@ -182,8 +206,7 @@ export class ReqlanCodeActionProvider implements CodeActionProvider {
|
|
|
182
206
|
kind: CodeActionKind.Refactor,
|
|
183
207
|
command: {
|
|
184
208
|
title: 'Search for idea reference',
|
|
185
|
-
command: REQLAN_SEARCH_REFERENCE_COMMAND
|
|
186
|
-
arguments: [args]
|
|
209
|
+
command: REQLAN_SEARCH_REFERENCE_COMMAND
|
|
187
210
|
}
|
|
188
211
|
};
|
|
189
212
|
}
|
|
@@ -335,25 +358,17 @@ export class ReqlanCodeActionProvider implements CodeActionProvider {
|
|
|
335
358
|
}
|
|
336
359
|
|
|
337
360
|
private createSearchCommand(
|
|
338
|
-
|
|
361
|
+
_document: LangiumDocument,
|
|
339
362
|
diagnostic: Diagnostic,
|
|
340
363
|
refText: string
|
|
341
364
|
): CodeActionLike {
|
|
342
|
-
const args: SearchReferenceCommandArgs = {
|
|
343
|
-
documentUri: document.textDocument.uri,
|
|
344
|
-
refText,
|
|
345
|
-
range: diagnostic.range,
|
|
346
|
-
mode: 'replace',
|
|
347
|
-
context: buildContextForRange(document, diagnostic.range)
|
|
348
|
-
};
|
|
349
365
|
return {
|
|
350
366
|
title: `Search for idea to replace '${refText}'…`,
|
|
351
367
|
kind: CodeActionKind.QuickFix,
|
|
352
368
|
diagnostics: [diagnostic],
|
|
353
369
|
command: {
|
|
354
370
|
title: `Search for idea to replace '${refText}'`,
|
|
355
|
-
command: REQLAN_SEARCH_REFERENCE_COMMAND
|
|
356
|
-
arguments: [args]
|
|
371
|
+
command: REQLAN_SEARCH_REFERENCE_COMMAND
|
|
357
372
|
}
|
|
358
373
|
};
|
|
359
374
|
}
|
|
@@ -385,6 +400,26 @@ function isResolvableIdeaProperty(property: string | undefined): boolean {
|
|
|
385
400
|
return property === 'idea' || property === 'ideaset' || property === 'members';
|
|
386
401
|
}
|
|
387
402
|
|
|
403
|
+
/** True when `only` is unset or the action kind matches a requested kind (LSP subtype rules). */
|
|
404
|
+
export function actionKindAllowed(only: readonly string[] | undefined, kind: string): boolean {
|
|
405
|
+
if (!only || only.length === 0) {
|
|
406
|
+
return true;
|
|
407
|
+
}
|
|
408
|
+
return only.some(requested =>
|
|
409
|
+
kind === requested
|
|
410
|
+
|| kind.startsWith(`${requested}.`)
|
|
411
|
+
|| requested.startsWith(`${kind}.`)
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
function documentHasTopLevelIdeas(document: LangiumDocument): boolean {
|
|
416
|
+
const model = document.parseResult.value;
|
|
417
|
+
if (!isModel(model)) {
|
|
418
|
+
return false;
|
|
419
|
+
}
|
|
420
|
+
return model.elements.some(element => isRefactorIdeaDeclaration(element));
|
|
421
|
+
}
|
|
422
|
+
|
|
388
423
|
function rangesOverlap(
|
|
389
424
|
left: { start: { line: number; character: number }; end: { line: number; character: number } },
|
|
390
425
|
right: { start: { line: number; character: number }; end: { line: number; character: number } }
|
|
@@ -169,6 +169,11 @@ export function findCommentSpansInText(text: string): CommentSpan[] {
|
|
|
169
169
|
continue;
|
|
170
170
|
}
|
|
171
171
|
if (char === '/' && next === '*') {
|
|
172
|
+
// Empty slash-star-star-slash is a glob segment, not a block comment (same as .rq lexer).
|
|
173
|
+
if (text[index + 2] === '*' && text[index + 3] === '/') {
|
|
174
|
+
index += 4;
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
172
177
|
blockComment = 'slash';
|
|
173
178
|
lineCommentStart = index;
|
|
174
179
|
index += 2;
|