0

Using the javaparser library:

Is there a way to print out a compilation unit and preserve whitespace?

I tried the toString() method on compilationUnit but that throws away newlines.

Seeing as how each ASTNode stores line and column number information, am I just missing the proper method?

cciollaro
  • 354
  • 4
  • 10

1 Answers1

0

I have found the answer. A quote from the dev:

The DumpVisitor needs to be rewrite because it don't respects the token positions, when it has been done will be more easy to treat comments into the dumper.

Unfortunately this project seems pretty dead anyway: the last activity was circa 2008.

cciollaro
  • 354
  • 4
  • 10