Crate rustfmt_nightly [] [src]

Re-exports

pub use config::Config;
pub use config::summary::Summary;

Modules

codemap

This module contains utilities that work with the CodeMap from libsyntax / syntex_syntax. This includes extension traits and methods for looking up spans and line ranges for AST nodes.

config
filemap
modules
rustfmt_diff
visitor

Macros

impl_enum_serialize_and_deserialize

Macro for deriving implementations of Serialize/Deserialize for enums

Structs

FormatReport
FormattingError
ModifiedChunk

A single span of changed lines, with 0 or more removed lines and a vector of 0 or more inserted lines.

ModifiedLines

Set of changed sections of a file.

ModifiedLinesResult

The successful result of formatting via get_modified_lines().

Enums

ErrorKind
FileName

Differentiates between real files and common virtual files

Input

Functions

format_code_block

Format the given code block. Mainly targeted for code block in comment. The code block may be incomplete (i.e. parser may be unable to parse it). To avoid panic in parser, we wrap the code block with a dummy function. The returned code block does not end with newline.

format_input
format_snippet

Format the given snippet. The snippet is expected to be complete code. When we cannot parse the given snippet, this function returns None.

get_modified_lines

Format a file and return a ModifiedLines data structure describing the changed ranges of lines.

run

Type Definitions

FileMap
FileRecord