Skip to main content

discover_with_imports

Function discover_with_imports 

pub fn discover_with_imports(
    file_path: &Path,
    source: &str,
    loader: &mut Loader,
    interner: &mut Interner,
) -> Result<TypeRegistry, String>
Expand description

Recursive discovery with module imports.

Scans a LOGOS source file for:

  1. Dependencies declared in the Abstract (Markdown links)
  2. Type definitions in ## Definition blocks

§Namespace Prefixing

Dependencies are loaded recursively, and their types are merged into the registry with namespace prefixes (e.g., Geometry::Point).

§Arguments

  • file_path - Path to the source file
  • source - Source code content
  • loader - Module loader for resolving imports
  • interner - Symbol interner

§Example

let mut loader = Loader::new(root_path);
let registry = discover_with_imports(
    Path::new("main.md"),
    source,
    &mut loader,
    &mut interner
)?;
// registry now contains types from main.md and all imports