Package org.eclipse.cdt.core.formatter

Examples of org.eclipse.cdt.core.formatter.CodeFormatter.format()


      options.put(DefaultCodeFormatterConstants.FORMATTER_TRANSLATION_UNIT, tu);
      // Allow all comments to be indented.
      options.put(DefaultCodeFormatterConstants.FORMATTER_COMMENT_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN, DefaultCodeFormatterConstants.FALSE);
      final CodeFormatter formatter = ToolFactory.createCodeFormatter(options);
      code = document.get();
      TextEdit[] formatEdits = formatter.format(CodeFormatter.K_TRANSLATION_UNIT, code, regions, TextUtilities.getDefaultLineDelimiter(document));

      TextEdit combinedFormatEdit = new MultiTextEdit();
      for (final TextEdit formatEdit : formatEdits) {
        combinedFormatEdit = TextEditUtil.merge(combinedFormatEdit, formatEdit);
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.