Skip to main content

semantic_diagnostics

Function semantic_diagnostics 

Source
pub fn semantic_diagnostics(
    uri: &Url,
    doc: &ParsedDoc,
    codebase: &Codebase,
    cfg: &DiagnosticsConfig,
    php_version: Option<&str>,
) -> Vec<Diagnostic>
Expand description

Run semantic checks on doc using the backend’s persistent codebase. The codebase is updated incrementally: the current file’s definitions are evicted and re-collected, then finalize() rebuilds inheritance tables.

php_version is a version string like "8.1" sourced from LspConfig. Parsed to mir_analyzer::PhpVersion and forwarded to StatementsAnalyzer.

Legacy mutating path — runs remove_file_definitions + collect + finalize on the codebase. Kept for benchmarks (benches/semantic.rs) and as the reference implementation while Phase D wraps Pass-2 in salsa. Not used by the LSP handlers anymore (they use semantic_diagnostics_no_rebuild against the salsa-built codebase).