Skip to main content

check_missing_package_declaration

Function check_missing_package_declaration 

Source
pub fn check_missing_package_declaration(
    node: &Node,
    source: &str,
    source_path: Option<&Path>,
    diagnostics: &mut Vec<Diagnostic>,
)
Expand description

Check for missing package declaration (PL200).

Walks the top-level statements of the Program node only (not recursive). If no Package node is found at the top level, emits a warning at position (0, 0).

Only the Program node’s direct children are examined. Package declarations inside eval blocks or other nested constructs are not counted — they do not establish the file’s package namespace in the same way.