pub fn try_fmt_file(
contents: &str,
parsed: &File,
indent: IndentOptions,
) -> Result<Vec<FormattedBlock>>
Expand description
Format a file into a list of FormattedBlock
s to be applied by an IDE for autoformatting.
This function expects a complete file, not just a block of code. To format individual rsx! blocks, use fmt_block instead.
The point here is to provide precise modifications of a source file so an accompanying IDE tool can map these changes back to the file precisely.
Nested blocks of RSX will be handled automatically
This returns an error if the rsx itself is invalid.
Will early return if any of the expressions are not complete. Even though we could return the expressions, eventually we’ll want to pass off expression formatting to rustfmt which will reject those.