Code reference detail
reqlan-validator.ts
packages/language/src/reqlan-validator.ts
| Idea | Status | Tags | Summary | Katz |
|---|---|---|---|---|
| check | done | `reqlan check` should run perform the following checks: - ensure all rq [reference] point to real nodes, unless rq ignored with [comment_reference_ignore]. - this tests rqcomments point to real parts of the namespace, that code references exist, and that rq references exists. - report unresolved imports: [check_unresolved_imports]. - report a comment reference with invalid syntax: [code_comment_syntax_errors]. - report a qualified reference whose file is not on disk: [check_qualified_missing_file]. - report a qualified reference whose `.rq` file does not declare the idea: [check_qualified_missing_idea]. - it should really just be a wrapper of the [index] and return the issues ( as a pipe, terminal output, or json ). Issue order: [check_order_by_target]. Sparse wildcards: [check_wildcard_sparse] via flags [check_wildcard_zero] and [check_wildcard_one]. Path globs: [check_glob_patterns]. Skip missing targets: [check_skip_targets] [check_skip_gitignored_targets]. CLI: ["../cli/cli_package.rq".commands]. MCP: ["../extension/agent/skills-and-mcp.rq".mcp_check]. CI: [check_meta_implementation]. Site demo: ["../site/site.rq".broken_links_showcase]. | 1.000 | |
| check_wildcard_sparse | done | A ["../reference_types.rq".wildcard_reference] is for many matches. [check] recounts each wildcard against the full idea catalog, not the stored edges, so files that the indexer visited first still get the true match count. How 0 - match and 1 - match rows are handled is controlled by [check_wildcard_zero] and [check_wildcard_one] ( both default `warn` ). Ignore a site with [comment_reference_ignore]. The language server already warns when a wildcard matches nothing ( ["../language/imports.rq".wildcard_references] ); it also warns when the match count is 1. Related: [check] ["../language/imports.rq".wildcard_references] | 0.417 | |
| comment_reference_resolution_error_state | done | [comment_reference_resolution_error] The language server must share one resolution result for clickable links and the error underline. Resolve comment references once against the loaded idea index, then reuse that result for both consumers. When you create an idea that matches a comment reference, the language server must clear the underline and the missing-idea message. Resolution and the index should be performed once and shared between consumers. | 0.053 | |
| references_in_functional_code_comments | done | Comments in functional code should be able to reference reqlan ideas using the an `rq:` prefixed to an idea: `rq:[idea]` as demonstrated in python, but actually applicable to any language's comment context: Editor hosts are every language except [comment_reference_language_blocklist]. With the rust language server, a resolved `rq:[…]` site is Ctrl + click navigable via go-to-definition. File document links stay out of the editor ( ["../syntax/features-syntax-highlighting.rq".editor_reference_activation] ). Comment `rq:[…]` sites use TextMate `meta.link.reqlan markup.underline` so the resting editor shows they are link-shaped ( [comment_reference_resting_underline] ). After that goto, Alt + Left restores the comment-host caret ( [comment_reference_navigate_back] ). Missing ideas keep the error underline and have no definition target. Relates to ["../../mutation/refactor_support.rq".comment_reference_refactor_support], [comment_reference_import_root_alias], ["../support/language-server-rust.rq".language_server_rust], ["../syntax/features-syntax-highlighting.rq".editor_reference_activation]. | 0.300 | |
| import_does_not_exist_error | Imports show an underline error when the target file or folder does not exist. Imports also show an underline error when a named imported idea does not exist in the target file. An existing folder is not an error: [import_folder_targets]. CI: ["../../../core_analysis/check.rq".check_unresolved_imports]. [general_errors] | 0.151 | ||
| import_folder_targets | done | An import path may refer to a folder. A folder is a valid import target when that path exists as a directory. Namespace import of a folder binds the alias to that folder, the same as a file. Extensionless paths still prefer a `.rq` file: [implicit_file_extension]. Related: ["../../../language/imports.rq".import_paths], [import_does_not_exist_error], ["../syntax/features-syntax.rq".file_references]. | 0.164 | |
| remote_imports | Reqlan files should support importing requirements from remote urls. Remote import syntax should follow import " https://company.com/reqs/style.rq" as styleguide. The extension should resolve, cache, and validate remote imports. Barrel imports should be recommended for token efficiency when many symbols are needed from one remote file. | 0.040 | ||
| file_reference_errors | done | If a [file_reference] is not found, is broken, or cannot be resolved, the language server must show an underline. Do not show the underline when [comment_reference_ignore] ( `//rq-ignore-error` ) is on the line before. Missing files: error underline, no document link. Do not underline examples inside [inline_code] or ["../../../language/syntax.rq".code_snippets]. Empty files and files with parse errors: warning underline; the document link stays. Import-root aliases such as `@/` resolve the same way as ["../../../core_analysis/check.rq".check] and ["../../../language/imports.rq".configuration_import_root_alias]. Related: [general_errors], [comment_reference_resolution_error], [inline_code], ["./features-imports.rq".import_does_not_exist_error], ["../syntax/features-syntax.rq".file_references]. | 0.092 | |
| general_errors | error messages should be deliberate and developer friendly. recommendations should be offerred where appropriate. | 0.083 | ||
| complementary_information_rendering | The extension should render computed information inline in the editor as complementary text. Complementary rendering should include resolved references and optionally indirect references behind a toggle. Complementary rendering should not mutate source files unless the user explicitly applies a change. | 0.040 | ||
| unresolved_reference_diagnostics | in-progress | Unresolved idea references must report a linking error diagnostic. A same-file miss and an import-target miss have an error and no document link. A qualified reference may link to its file before the idea line is confirmed. After confirmation, a missing idea has an error and no document link ( ["../support/open-file-sequencing.rq".missing_reference_colour_sequence] ). A false idea link looked like a happy reference while Ctrl + click could not navigate. Missing file references stay on ["./features-syntax.rq".file_references] / ["../support/language-server-errors.rq".file_reference_errors] ( error, no document link ). Related: [reference_rendering], [non_web_reference_navigation]. | 0.117 | |
| file_references | A file reference should act as a link in the editor. If the target file is empty or has a parse error, the link should remain available and clickable, but should show a warning underline. If the target file is missing, show an error underline and do not create a document link — see ["../support/language-server-errors.rq".file_reference_errors]. Same-file and imported idea bracket references use the same editor activation as file targets. See ["./features-syntax-highlighting.rq".editor_reference_activation]. Implemented by ["../../../../packages/language/src/reqlan-file-link-resolver.ts"], ["../../../../packages/language/src/reqlan-document-link-provider.ts"], ["../../../../packages/language/src/reqlan-definition-provider.ts"], and ["../../../../packages/language/src/reqlan-validator.ts"]. | 0.118 | ||
| syntax_features | The extension should provide language support for. rq files via the lsp. Syntax features should cover ideas, ideasets, imports, references, attributes, comments, and lists. Broken imports and references should be validated and reported in the editor. Go-to-definition and find-references should work for ideas, imports, and cross-file links. Find-references is served by ["../support/language-server-rust.rq".language_server_rust] ( `textDocument/references` ). Autoformatting should be supported for. rq files. | 0.046 | ||
| import_error_recovery | A malformed import must not invalidate the rest of the file. Recoverable invalid `from` shapes parse as local import nodes with a line-level diagnostic: - `from "path" as alias` ( mistaken namespace form ) — suggest `import "path" as alias` or `from "path" import <idea>` - bare `from "path"` — require the `import <idea>` clause - `from` without a quoted path — consume the remainder of the line as an invalid import Later imports and top-level ideas continue to parse and link normally. Same recovery posture for nameless top-level braces: ["./syntax.rq".no_name_idea_safe_warning]. If lex / parse never completes, see ["./parser_lexer.rq".parse_budget_timeout]. | 0.058 | ||
| import_keywords | The keywords import, from, and as are reserved for import statements. Import keywords may also appear as ordinary words in idea body text when not at statement start. | 0.047 | ||
| import_tokenisation | if an import is given an alias, then the base name is still available as a variable name and should not cause a conflict. Only the alias binds in the importing file; the imported idea's base name may be reused for a local idea. e. g. The same rule applies to qualified imports with `as`. Unaliased imports still bind the idea name and conflict with a local idea of that name. Related: ["../extension/language/syntax/features-syntax.rq".sensible_alias_support]. | 0.053 | ||
| wildcard_references | done | Qualified path + idea-pattern references match multiple ideas across files. Surface forms: bracket `[…]` and wikilink `[[…]]` ( same `WildcardReference` target ). Path is a quoted string that may include shell-style globs ( `*`, `**`, `?` ) and `@/` import-root aliases ( [configuration_import_root_alias] ). Relative globs resolve against the defining document directory; `.` / `..` segments are collapsed before matching. Idea pattern is an unquoted `WILDCARD_NAME` that must contain at least one `*` or `?` Exact quoted-path plus idea stays ["./syntax.rq".reference_qualified]. Matching uses anchored globs ( not full JS regex ): path `*` is one segment, `**` crosses segments; idea `*` / `?` match within the idea name. Zero matches produce a warning diagnostic. One match also produces a warning — a wildcard is for many ideas; use a concrete ["./syntax.rq".reference_qualified] when only one idea matches ( ["../core_analysis/check.rq".check_wildcard_one] ). Path segment `/**/` must not be lexed as an empty block comment — see ["./syntax.rq".comments]. Lexer note: `ID` is a prefix of many wildcard names ( `import_` vs `import_*` ); the token builder sets `ID.LONGER_ALT = WILDCARD_NAME` so `import_*` is one token. Body prose `*` tokens are accepted via `WILDCARD_NAME` in PlainText so ordinary `*` characters still parse. Without that longer-alt, a live wildcard inside a block body can fail Idea recovery and leave later top-level ideas unindexed ( soft mtime sync will not rebuild until the `.rq` file changes ). Navigation does not emit N LocationLinks. A document-link click opens `reqlan.openWildcardReference` with `{ pathPattern, ideaPattern, fromUri }` ( see [wildcard_references_webview] ). Go-to-definition does not open that panel. Indexing fans out per ["../indexer/indexer.rq".wildcard_reference_edges] ( owned under ["../indexer/indexer.rq".index] ): native extract writes one `wildcard_reference` edge per catalog match; empty catalog / zero matches → one unresolved edge of that kind labeled with the pattern text. ["../core_analysis/check.rq".check] handles 0 - match and 1 - match fan-out through ["../core_analysis/check.rq".check_wildcard_zero] and ["../core_analysis/check.rq".check_wildcard_one] ( ["../core_analysis/check.rq".check_wildcard_sparse] ). Ideas Summary graph toggles those edges via ["../extension/workspace-summary/ideas_summary/graphical_graph.rq".wildcard_refs_toggle]. The server can answer `reqlan/wildcardReferenceAt`. Go-to-definition does not call it. Related: ["./syntax.rq".reference_embedding], ["./syntax.rq".reference_brackets], ["./syntax.rq".reference_wikilink], ["../indexer/indexer.rq".wildcard_reference_edges], ["../core_analysis/check.rq".check_wildcard_sparse], ["../core_analysis/check.rq".check_wildcard_zero], ["../core_analysis/check.rq".check_wildcard_one]. Illustrative forms ( fenced so this file does not embed live wildcards ): | 0.486 | |
| file_suffix | Reqlan requirement documents use the. rq file suffix. | 0.052 | ||
| idea_name | Idea names are identifiers or double-quoted strings. Unquoted names follow identifier rules and may use letters, digits, underscores, and dashes, for example myidea, my_idea, or dash-or_underscore_delimited-idea. Quoted names allow spaces and other characters when wrapped in double quotes. Idea names must be unique within their ideaset or file. An idea, one-liner, and ideaset must not share a name in the same file. Idea names should not use reserved keywords. | 0.063 | ||
| no_name_idea_safe_warning | done | A top-level nameless curly-brace block — `{... }` with no idea name — must not take down the parser or the language server workspace. Parse the block as a recoverable anonymous top-level element, emit a descriptive warning that a name is required before `{`, and continue so later ideas, imports, and links still work. Nameless blocks inside parenthesized lists remain valid list items per [lists]; only top-level nameless blocks warn. Related recovery posture: ["./imports.rq".import_error_recovery]. Block shape: [block_idea]. Fenced examples must stay opaque per [code_snippets] so braces inside snippets cannot desync structural depth. Non-termination ( lex / parse never finishes ) is a different failure mode: ["./parser_lexer.rq".parse_budget_timeout]. | 0.072 |
Reference labels
"../../../../packages/language/src/reqlan-validator.ts", "../../packages/language/src/reqlan-validator.ts", ../../../../packages/language/src/reqlan-validator.ts, ../../packages/language/src/reqlan-validator.ts