Package software.amazon.smithy.syntax
Class Formatter
java.lang.Object
software.amazon.smithy.syntax.Formatter
Formats valid Smithy IDL models.
This formatter will by default sort use statements, remove unused use statements, and fix documentation comments that should be normal comments.
-
Method Summary
-
Method Details
-
format
Formats the given token tree, wrapping lines at 120 characters.- Parameters:
root
- RootTreeType.IDL
tree node to format.- Returns:
- Returns the formatted model as a string.
- Throws:
ModelSyntaxException
- if the model contains errors.
-
format
Formats the given token tree.- Parameters:
root
- RootTreeType.IDL
tree node to format.maxWidth
- Maximum line width.- Returns:
- Returns the formatted model as a string.
- Throws:
ModelSyntaxException
- if the model contains errors.
-