Skip to main content

Module diagnostics

Module diagnostics 

Source

Structs§

AnalysisDiagnostic

Enums§

DiagnosticKind
DiagnosticSeverity
Severity for analysis-emitted diagnostics. The analyser populates it for every diagnostic — lex-lsp reads diag.severity directly when mapping onto the LSP wire. (Earlier the LSP layer derived severity from DiagnosticKind; that mapping moved upstream once the extension-emitted diagnostics needed per-instance severities.)
SchemaValidationKind
One of the schema pre-validation checks the analyser owns before dispatching to a handler. Wire spec / proposal §13.2.

Functions§

analyze
Run the analyser without an extension registry — equivalent to running with an empty registry. Provided for callers that haven’t adopted the extension system yet.
analyze_with_registry
Run the analyser with a populated extension registry. Labels whose namespace is registered get pre-validated against their schema and, if pre-validation passes, dispatched to the handler’s on_validate hook. Handler-emitted diagnostics are merged into the same stream as the built-in checks.
analyze_with_rules
Run the analyser with both an extension registry and a [diagnostics.rules] configuration. The configuration is applied after all checks run, so rule overrides (Severity::Allow / Severity::Deny) take effect uniformly across the diagnostic stream.
apply_rules
Apply a [diagnostics.rules] configuration to a stream of analyser diagnostics in place. Drops diagnostics whose resolved severity is allow, and remaps the remaining diagnostics’ severity field: