Skip to main content

Module registry

Module registry 

Source
Expand description

Component registry: loads and merges all components.jsonld files.

See the components module doc for the two-phase loading overview.

§Span extraction

Every file is parsed with rdf_parsers::jsonld::convert::parse_json before any processing, which yields a JsonLdVal tree carrying byte-range spans for every token. collect_id_spans walks the tree and records expanded_iri → byte_range in a flat map. These spans are threaded through both collection phases so that every CjsModule, CjsComponent, and CjsParameter ends up with an iri_span that the LSP can use for goto-definition without re-reading the source file.

Structs§

ComponentRegistry
Registry of all discovered CJS components and modules.

Functions§

collect_id_sources
Walk a JsonLdVal tree and record the source file for every @id value (first-seen wins, consistent with collect_id_spans).
collect_id_spans
Walk a JsonLdVal tree and collect the byte spans of every @id value, keyed by the expanded IRI (resolved via resolver).
resolve_iri_to_url
Resolve an IRI to a local file URL using the import_paths mapping.