Skip to main content

Module diagnostics

Module diagnostics 

Source

Structs§

AnalysisDiagnostic
FileReference
A non-include file-path reference and the range to blame it on.

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_references
Opt-in pass: validate internal cross-references over the (merged) document and emit a missing-*-target diagnostic for each dangling in-document reference.
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:
collect_file_references
Collect every non-include file-path reference in the (merged) document: inline ReferenceType::File ([./x.txt], [../y], [/abs]) and the src= parameter of any verbatim block (image, data, video, …) — lex.include excepted (see below).