Skip to main content

math_diagnostics

Function math_diagnostics 

Source
pub fn math_diagnostics(content: &SyntaxNode) -> Vec<MathDiagnostic>
Expand description

Walk a realized MATH_CONTENT subtree and report structural problems from its shape. This is the single source of truth for math diagnostics, shared by the math-syntax linter rule, the formatter (malformed math is left verbatim rather than reflowed), and the LSP. Ranges are host-aligned.

content is expected to be a MATH_CONTENT node; its own descendants are walked, so both a standalone sub-parse root and an embedded host-tree node work.