Pass the visitor's cursor to printTrimmed()
MSALReplace the deprecated J.printTrimmed() with printTrimmed(getCursor()) inside a JavaVisitor written in Java, so that the tree prints with the printer of its source file's language, such as Kotlin or Groovy, rather than always as Java. A private static helper method of the visitor becomes an instance method, when only the visitor's own instance methods call it.
org. openrewrite. java. recipes. PrintTrimmedWithCursormod run . --recipe= org. openrewrite. java. recipes. PrintTrimmedWithCursorInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.