Skip to main content

check_missing_modules

Function check_missing_modules 

Source
pub fn check_missing_modules<F>(
    node: &Node,
    _source: &str,
    resolver: F,
    diagnostics: &mut Vec<Diagnostic>,
)
where F: Fn(&str) -> bool,
Expand description

Check for use statements whose modules cannot be resolved.

Walks the AST to collect all use Module statements. For each non-pragma, non-digit, non-core module, attempts to resolve via the provided resolver. Emits PL701 Warning if resolution returns false.

§Arguments

  • node — Root AST node to walk
  • source — Source text (used for context; not searched directly here)
  • resolver — Callback: fn(module_name: &str) -> bool. Return true if the module is found (workspace or configured include paths).
  • diagnostics — Output vector; new diagnostics are pushed here

§Skipped inputs

  • Version-only use statements: use 5.010; use v5.38;
  • All entries in CORE_MODULES
  • use if form (module field is “if”; treated as pragma)