final CodeFormatter cf = ToolFactory.createCodeFormatter(options);
cf.createIndentationString(4);
- final TextEdit te = cf.format(CodeFormatter.K_UNKNOWN, source, 0,
- source.length(), 0, null);
+ final TextEdit te = cf.format(CodeFormatter.K_COMPILATION_UNIT
+ | CodeFormatter.F_INCLUDE_COMMENTS, source, 0, source.length(),
+ 0, null);
IDocument doc = new Document(source);
try {
te.apply(doc);
+
+ if (true)
+ System.out.println("TRACE: " + doc.get());
+
return doc.get();
} catch (MalformedTreeException e) {
e.printStackTrace();