Printable idea sheet
wildcard_references
reqlan rq/language/imports.rq:190
Katz 0.486
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 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 reference_qualified when only one idea matches
( check_wildcard_one ).
Path segment `/**/` must not be lexed as an empty block comment — see 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 wildcard_reference_edges
( owned under 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. check handles 0 - match and 1 - match fan-out
through check_wildcard_zero and check_wildcard_one
( check_wildcard_sparse ).
Ideas Summary graph toggles those edges via
wildcard_refs_toggle.
The server can answer `reqlan/wildcardReferenceAt`. Go-to-definition does not call it.
Related: reference_embedding, reference_brackets, reference_wikilink,
wildcard_reference_edges, check_wildcard_sparse,
check_wildcard_zero, check_wildcard_one.
Illustrative forms ( fenced so this file does not embed live wildcards ):
- implementation
- reqlan.langium, reqlan-wildcard-resolve.ts, reqlan-token-builder.ts, reqlan-validator.ts, reqlan-file-link-resolver.ts, reqlan-definition-provider.ts, reqlan-document-link-provider.ts, extract.rs, sync.rs, extract.rs, workspace-index-file.ts, main.ts
- status
- done
- tests
- wildcard-references.test.ts, wildcard-references.test.ts:e2e: tokenize → parse → resolve → document link → definition → command args, wildcard-references.test.ts:e2e: ** path glob matches nested fixture files, wildcard-references.test.ts:e2e: imports.rq captures wildcard ideas with status and implementation, wildcard_reference_edges.rs, wildcard_reference_edges.rs:expands_wildcard_refs_to_one_edge_per_matching_idea, wildcard_reference_edges.rs:stores_wildcard_fan_out_as_wildcard_reference_kind, wildcard_reference_edges.rs:extract_indexed_document_fans_out_edges_for_matching_catalog_ideas, wildcard_reference_edges.rs:nested_path_glob_matches_catalog_ideas, wildcard_reference_edges.rs:imports_rq_extract_includes_webview_and_path_filter_ideas, wildcard_reference_edges.rs:indexer_and_graphical_graph_rq_capture_wildcard_edge_and_toggle_ideas, wildcard_reference_edges.rs:sync_persists_wildcard_reference_edges, wildcard_reference_edges.rs:stores_wildcard_fan_out_as_wildcard_reference_kind
Interactive page: wildcard_references