fix cache and imports (#6647)

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix clippy

Signed-off-by: Jess Frazelle <github@jessfraz.com>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2025-05-02 10:41:14 -07:00
committed by GitHub
parent 09ebb517d9
commit ace9a59a45
43 changed files with 4205 additions and 3916 deletions

View File

@ -21,8 +21,9 @@ type Dependency = (String, String);
type Graph = Vec<Dependency>;
type DependencyInfo = (AstNode<ImportStatement>, ModuleId, ModulePath, ModuleRepr);
type Universe = HashMap<String, DependencyInfo>;
pub(crate) type DependencyInfo = (AstNode<ImportStatement>, ModuleId, ModulePath, ModuleRepr);
pub(crate) type UniverseMap = HashMap<PathBuf, AstNode<ImportStatement>>;
pub(crate) type Universe = HashMap<String, DependencyInfo>;
/// Process a number of programs, returning the graph of dependencies.
///
@ -184,7 +185,7 @@ pub(crate) async fn import_universe(
repr: &ModuleRepr,
out: &mut Universe,
exec_state: &mut ExecState,
) -> Result<HashMap<PathBuf, crate::parsing::ast::types::Node<ImportStatement>>, KclError> {
) -> Result<UniverseMap, KclError> {
let modules = import_dependencies(repr, ctx)?;
let mut module_imports = HashMap::new();
for (filename, import_stmt, module_path) in modules {