Module partial

Source
Expand description

Range-based formatting and analysis utilities for Typstyle.

All byte ranges in this module are specified as UTF-8 offsets. If you have a UTF-16 range or line-column range (as used in LSP or some editors), you must convert it to a UTF-8 byte offset before calling these functions. The typst_syntax::Source API provides helpers for converting between line-column, UTF-16, and UTF-8 offsets.

Structs§

RangeResult
Result of a range-based formatting or analysis operation.

Functions§

format_range_ast
Formats the smallest syntax node covering the given byte range as a debug AST string with 2-space indentation. Returns the node’s actual source range and formatted AST.