OSDN Git Service

adding comment func.
authoriga <tosiki.iga@nifty.ne.jp>
Mon, 31 Mar 2014 21:30:15 +0000 (06:30 +0900)
committeriga <tosiki.iga@nifty.ne.jp>
Mon, 31 Mar 2014 21:30:15 +0000 (06:30 +0900)
jcfa/src/jp/igapyon/jcfa/util/JcfaEclipseUtil.java

index 5d80486..1dd407e 100644 (file)
@@ -40,11 +40,16 @@ public class JcfaEclipseUtil {
 
                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();