Writer
Writer that converts AST nodes back to source code. When the withExtras is true, which is the default, it will preserve the original whitespaces, comments, semicolons and trailing commas. Even when the withExtras is false, it will still insert minimal whitespaces and semicolons automatically to avoid compilation errors or loss of meaning.
Example usage:
// Write with extras
val source = Writer.write(node)
// Write without extras
val sourceWithoutExtras = Writer.write(node, withExtras = false)
Content copied to clipboard