Expand description
Project-wide state: the shared lookup tables built from all discovered packages.
ModuleState is the first thing an LSP session should create. Call
ModuleState::build with the workspace root and it will:
- Walk all ancestor
node_modules/directories (viacrate::discovery). - Parse every
package.jsonthat haslsd:fields. - Build three lookup tables consumed by the registries:
component_modules— maps module IRI → URL tocomponents.jsonldcontexts— maps context IRI → parsedrdf_parsers::jsonld::convert::JsonLdValimport_paths— maps IRI prefix → local directory URL (for resolvingrdfs:seeAlsoimports)
The state is read-only after construction; pass &state into
crate::components::registry::ComponentRegistry and
crate::config::registry::ConfigRegistry.
Structs§
- Module
State - Represents the fully-resolved state of all discoverable CJS modules.
Mirrors the TypeScript
IModuleState.