Safely format contents of a Scala compilation unit.
Safely format contents of a Scala compilation unit.
The original code is returned in case of any unexpected failure.
For a more flexible method, see format_!.
Note. Formatting sbt files is not yet supported.
The code to format.
The coding style to use for formatting.
EXPERIMENTAL. Format only certain ranges of the file.
The code formatted if successful, the original code otherwise.
Formats any kind of Scala tree structure.
Formats any kind of Scala tree structure.
WARNING. Could run for a very long time on large input.
Safe alternatives: format.
The type of the source code, refer to scala.meta.parsers.Api for available types.
The source code to format.
See scala.meta.parsers for available parsers.
The source code formatted.