pub trait FormatContext {
    type Options: FormatOptions;

    // Required methods
    fn options(&self) -> &Self::Options;
    fn source_map(&self) -> Option<&TransformSourceMap>;
}
Expand description

Context object storing data relevant when formatting an object.

Required Associated Types§

Required Methods§

source

fn options(&self) -> &Self::Options

Returns the formatting options

source

fn source_map(&self) -> Option<&TransformSourceMap>

Returns None if the CST has not been pre-processed.

Returns Some if the CST has been pre-processed to simplify formatting. The source map can be used to map positions of the formatted nodes back to their original source locations or to resolve the source text.

Implementors§