Place named import for this symbol at the bottom of the global import list
Add this importer to the global import list.
Add this string to the left of this tree.
Add this string to the left of this token.
Add this string to the right of this tree.
Add this string to the right of this token.
Do nothing: no diff, no diagnostics.
Combine a sequence of patches into a single patch.
Reports error/warning/info message at a position.
Remove named imports for this symbol.
Remove named imports for this symbol.
Does not remove wildcard imports for the enclosing package or class.
Remove this importee reference.
Remove this single token from the source file.
Remove all of the these tokens from the source file.
Replace occurrences of fromSymbol to use toName instead
Replace occurrences of fromSymbol to reference toSymbol instead.
Replace occurrences of fromSymbol to reference toSymbol instead.
toSymbol
must be a global symbol such as an object/class or a static method.
May produce broken code in some cases, works best when toSymbol has the same depth as fromSymbol, example: - good: replace:com.foo.Bar/org.qux.Buz - bad: replace:com.Bar/org.qux.Buz
Remove the token and insert this string at the same position.
Remove all tokens from this tree and add a string add the same position.
Remove all tokens from this tree and add a string add the same position.
Beware that this patch does not compose with other patches touching the same tree node or its children. Avoid using this method for large tree nodes like classes of methods. It's recommended to target as precise tree nodes as possible.
It is better to use addRight/addLeft if you only insert new code, example: - bad: Patch.replaceTree(tree, "(" + tree.syntax + ")") - good: Patch.addLeft(tree, "(") + Patch.addRight(tree, + ")")