Skip to main content

load_import_closure

Function load_import_closure 

Source
pub fn load_import_closure(
    entry_path: &Path,
    preview_features: &PreviewFeatures,
    overlay: Option<&ImportOverlay>,
) -> Result<Vec<LoadedFile>, ImportLoadError>
Expand description

Load the entry file plus every file it transitively @imports.

The first returned LoadedFile is always the entry file with FileId::new(1). Subsequent files get monotonically increasing FileIds in the order they’re first discovered.

Resolution mirrors sema’s existing rules ([gruel_air::ModulePath::resolve]). Imports that can’t be resolved to a known file (yet) are simply skipped — sema will emit ModuleNotFound once the closure is parsed.