@reqlan/language 1.9.7 → 1.10.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.
Files changed (62) hide show
  1. package/README.md +41 -0
  2. package/out/file-path-rewrite.d.ts +1 -1
  3. package/out/generated/ast.d.ts +2 -2
  4. package/out/generated/ast.js +1 -1
  5. package/out/generated/ast.js.map +1 -1
  6. package/out/generated/grammar.js +1 -1
  7. package/out/generated/grammar.js.map +1 -1
  8. package/out/index.d.ts +1 -0
  9. package/out/index.js +1 -0
  10. package/out/index.js.map +1 -1
  11. package/out/reqlan-comment-resolver.d.ts +1 -1
  12. package/out/reqlan-completion-provider.d.ts +2 -2
  13. package/out/reqlan-definition-provider.js +1 -1
  14. package/out/reqlan-definition-provider.js.map +1 -1
  15. package/out/reqlan-document-link-provider.d.ts +2 -0
  16. package/out/reqlan-document-link-provider.js +3 -0
  17. package/out/reqlan-document-link-provider.js.map +1 -1
  18. package/out/reqlan-embedded-file-references.d.ts +3 -0
  19. package/out/reqlan-embedded-file-references.js +47 -5
  20. package/out/reqlan-embedded-file-references.js.map +1 -1
  21. package/out/reqlan-file-link-resolver.d.ts +8 -0
  22. package/out/reqlan-file-link-resolver.js +46 -11
  23. package/out/reqlan-file-link-resolver.js.map +1 -1
  24. package/out/reqlan-file-references.d.ts +1 -0
  25. package/out/reqlan-file-references.js +24 -16
  26. package/out/reqlan-file-references.js.map +1 -1
  27. package/out/reqlan-ignore-error.d.ts +2 -1
  28. package/out/reqlan-ignore-error.js +4 -17
  29. package/out/reqlan-ignore-error.js.map +1 -1
  30. package/out/reqlan-imports.d.ts +3 -1
  31. package/out/reqlan-imports.js +2 -5
  32. package/out/reqlan-imports.js.map +1 -1
  33. package/out/reqlan-module.js +1 -0
  34. package/out/reqlan-module.js.map +1 -1
  35. package/out/reqlan-reference-at-position.d.ts +3 -0
  36. package/out/reqlan-reference-at-position.js +8 -2
  37. package/out/reqlan-reference-at-position.js.map +1 -1
  38. package/out/reqlan-scope.d.ts +14 -0
  39. package/out/reqlan-scope.js +58 -15
  40. package/out/reqlan-scope.js.map +1 -1
  41. package/out/reqlan-validator.d.ts +7 -1
  42. package/out/reqlan-validator.js +21 -4
  43. package/out/reqlan-validator.js.map +1 -1
  44. package/package.json +3 -2
  45. package/src/file-path-rewrite.ts +1 -1
  46. package/src/generated/ast.ts +2 -2
  47. package/src/generated/grammar.ts +1 -1
  48. package/src/index.ts +5 -0
  49. package/src/reqlan-comment-resolver.ts +1 -1
  50. package/src/reqlan-completion-provider.ts +2 -2
  51. package/src/reqlan-definition-provider.ts +1 -1
  52. package/src/reqlan-document-link-provider.ts +5 -0
  53. package/src/reqlan-embedded-file-references.ts +54 -5
  54. package/src/reqlan-file-link-resolver.ts +56 -11
  55. package/src/reqlan-file-references.ts +26 -16
  56. package/src/reqlan-ignore-error.ts +4 -18
  57. package/src/reqlan-imports.ts +4 -5
  58. package/src/reqlan-module.ts +1 -0
  59. package/src/reqlan-reference-at-position.ts +16 -2
  60. package/src/reqlan-scope.ts +73 -16
  61. package/src/reqlan-validator.ts +25 -4
  62. package/src/reqlan.langium +4 -1
@@ -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
@@ -8,6 +8,11 @@ export * from './reqlan-comment-resolver.js';
8
8
  export * from './reqlan-comment-diagnostics.js';
9
9
  export * from './reqlan-ignore-error.js';
10
10
  export * from './reqlan-file-references.js';
11
+ export {
12
+ FILE_REFERENCE_MISSING,
13
+ fileLinkMissingMessage,
14
+ fileLinkTargetIssueMessage
15
+ } from './reqlan-file-link-resolver.js';
11
16
  export * from './reqlan-embedded-file-references.js';
12
17
  export * from './file-path-rewrite.js';
13
18
  export * from './reqlan-path-references.js';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Locates and parses rq:[target] references embedded in source-file comments.
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]
@@ -2,8 +2,8 @@
2
2
  * Code completion for references, import paths, file paths, and attributes.
3
3
  * rq:["../../../reqlan rq/extension/configuration.rq".configuration_import_roots]
4
4
  * rq:["../../../reqlan rq/language/imports.rq".configuration_import_root_alias]
5
- * rq:["../../../reqlan rq/extension/features-syntax-highlighting.rq".reference_code_completion]
6
- * rq:["../../../reqlan rq/extension/features-syntax-highlighting.rq".reference_code_completion_sequencing]
5
+ * rq:["../../../reqlan rq/extension/syntax/features-syntax-highlighting.rq".reference_code_completion]
6
+ * rq:["../../../reqlan rq/extension/syntax/features-syntax-highlighting.rq".reference_code_completion_sequencing]
7
7
  * rq:["../../../reqlan rq/extension/language-support/features-imports.rq".import_code_completion]
8
8
  * rq:["../../../reqlan rq/extension/language-support/features-imports.rq".import_code_completion_ranking]
9
9
  * rq:["../../../reqlan rq/extension/language-support/features-imports.rq".import_code_completion_rendering]
@@ -278,7 +278,7 @@ export class ReqlanDefinitionProvider extends DefaultDefinitionProvider {
278
278
 
279
279
  private createFileLink(source: CstNode, reference: FileReference | FileSymbolReference): GoToLink | undefined {
280
280
  const resolved = resolveFileReferenceLink(reference, this.documents, this.fileSystem, this.pathContext());
281
- if (!resolved) {
281
+ if (!resolved || resolved.resolution === 'missing') {
282
282
  return undefined;
283
283
  }
284
284
  const targetDocument = this.documents.getDocument(URI.parse(resolved.targetUri));
@@ -2,7 +2,9 @@
2
2
  * Clickable document links for idea references, file references, import paths, and comment references.
3
3
  * Same-file and cross-file idea refs both get links so the editor underline is consistent.
4
4
  * Comment-reference links come from the same presentation as the missing-idea underline.
5
+ * Missing file refs get an error underline and no document link.
5
6
  * rq:["../../../reqlan rq/extension/features-non-rq-code-comment/functional-code-comment-references.rq".comment_reference_resolution_error_state]
7
+ * rq:["../../../reqlan rq/extension/language-support/language-server-errors.rq".file_reference_errors]
6
8
  */
7
9
  import type { LangiumDocument } from 'langium';
8
10
  import { URI } from 'langium';
@@ -42,6 +44,9 @@ export class ReqlanDocumentLinkProvider implements DocumentLinkProvider {
42
44
  folderReferenceCommandTarget(link.targetUri)
43
45
  )];
44
46
  }
47
+ if (link.resolution === 'missing') {
48
+ return [];
49
+ }
45
50
  if (link.resolution === 'wildcard' && link.wildcardArgs) {
46
51
  return [LspDocumentLink.create(
47
52
  link.sourceRange,
@@ -1,5 +1,8 @@
1
1
  /**
2
2
  * Locates quoted file paths embedded in .rq source text, including @tests list entries.
3
+ * Skips inline code (`…`) and fenced ``` blocks — those are opaque examples, not live refs.
4
+ * rq:["../../../reqlan rq/language/syntax.rq".inline_code]
5
+ * rq:["../../../reqlan rq/language/syntax.rq".code_snippets]
3
6
  */
4
7
  import type { LangiumDocument } from 'langium';
5
8
  import type { Position, Range } from 'vscode-languageserver';
@@ -18,27 +21,69 @@ const FILE_REFERENCE_LIKE = /(?:\.\w[\w.]*|\/)/;
18
21
  export function findEmbeddedFileReferencesInText(text: string, lineOffset = 0): EmbeddedFileReference[] {
19
22
  const references: EmbeddedFileReference[] = [];
20
23
  const lines = text.split(/\r?\n/);
24
+ let inFence = false;
21
25
  for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {
22
26
  const line = lines[lineIndex];
27
+ if (isCodeFenceLine(line)) {
28
+ inFence = !inFence;
29
+ continue;
30
+ }
31
+ if (inFence) {
32
+ continue;
33
+ }
34
+ const opaque = inlineCodeSpans(line);
23
35
  for (const match of line.matchAll(BRACKETED_FILE_REFERENCE_PATTERN)) {
24
- pushEmbeddedReference(references, match, lineIndex, lineOffset, line);
36
+ pushEmbeddedReference(references, match, lineIndex, lineOffset, line, opaque);
25
37
  }
26
38
  for (const match of line.matchAll(QUOTED_FILE_REFERENCE_PATTERN)) {
27
39
  if (line.slice(Math.max(0, (match.index ?? 0) - 1), match.index).includes('[')) {
28
40
  continue;
29
41
  }
30
- pushEmbeddedReference(references, match, lineIndex, lineOffset, line);
42
+ pushEmbeddedReference(references, match, lineIndex, lineOffset, line, opaque);
31
43
  }
32
44
  }
33
45
  return references;
34
46
  }
35
47
 
48
+ function isCodeFenceLine(line: string): boolean {
49
+ return line.trimStart().startsWith('```');
50
+ }
51
+
52
+ function inlineCodeSpans(line: string): Array<{ start: number; end: number }> {
53
+ const spans: Array<{ start: number; end: number }> = [];
54
+ let index = 0;
55
+ while (index < line.length) {
56
+ if (line[index] !== '`') {
57
+ index++;
58
+ continue;
59
+ }
60
+ if (line.startsWith('```', index)) {
61
+ index += 3;
62
+ continue;
63
+ }
64
+ const close = line.indexOf('`', index + 1);
65
+ if (close < 0) {
66
+ break;
67
+ }
68
+ if (close > index + 1) {
69
+ spans.push({ start: index, end: close + 1 });
70
+ }
71
+ index = close + 1;
72
+ }
73
+ return spans;
74
+ }
75
+
76
+ function rangeOverlapsOpaque(start: number, end: number, opaque: Array<{ start: number; end: number }>): boolean {
77
+ return opaque.some(span => start < span.end && end > span.start);
78
+ }
79
+
36
80
  function pushEmbeddedReference(
37
81
  references: EmbeddedFileReference[],
38
82
  match: RegExpMatchArray,
39
83
  lineIndex: number,
40
84
  lineOffset: number,
41
- line: string
85
+ line: string,
86
+ opaque: Array<{ start: number; end: number }>
42
87
  ): void {
43
88
  const quoted = match[1];
44
89
  const file = parseReqlanQuotedString(quoted);
@@ -46,14 +91,18 @@ function pushEmbeddedReference(
46
91
  return;
47
92
  }
48
93
  const start = match.index ?? 0;
49
- if (isRangeInsideMarkdownLinkLabel(line, start, start + match[0].length)) {
94
+ const end = start + match[0].length;
95
+ if (rangeOverlapsOpaque(start, end, opaque)) {
96
+ return;
97
+ }
98
+ if (isRangeInsideMarkdownLinkLabel(line, start, end)) {
50
99
  return;
51
100
  }
52
101
  references.push({
53
102
  file,
54
103
  range: {
55
104
  start: { line: lineOffset + lineIndex, character: start },
56
- end: { line: lineOffset + lineIndex, character: start + match[0].length }
105
+ end: { line: lineOffset + lineIndex, character: end }
57
106
  }
58
107
  });
59
108
  }