Package org.eclipse.php.internal.core.format

Examples of org.eclipse.php.internal.core.format.ICodeFormattingProcessor


    return new DefaultCodeFormattingProcessor(new HashMap());
  }
 
  public static void format(IDocument document, IRegion region, IProject project) {
    try {
      ICodeFormattingProcessor formatter = createCodeFormatter(document, region, ProjectOptions.getPhpVersion(project), ProjectOptions.useShortTags(project));
      formatter.getTextEdits().apply(document);
     
    } catch (Exception e) {
      Logger.logException(e);
    }
  }
View Full Code Here


          // TODO: handle exception
        }
        // php format
        PHPVersion version = ProjectOptions.getPhpVersion(project);
        boolean useShortTags = ProjectOptions.useShortTags(project);
        ICodeFormattingProcessor codeFormatterVisitor = getCodeFormattingProcessor(
            project, document, version, useShortTags, region);
        if (codeFormatterVisitor instanceof CodeFormatterVisitor) {
          List<ReplaceEdit> changes = ((CodeFormatterVisitor) codeFormatterVisitor)
              .getChanges();
          if (changes.size() > 0) {
View Full Code Here

      fCodeFormatterPreferences.line_wrap_expressions_in_array_init_force_split = true;
      fCodeFormatterPreferences.line_wrap_expressions_in_array_init_line_wrap_policy = CodeFormatterVisitor.WRAP_ALL_ELEMENTS;
      fCodeFormatterPreferences.insert_space_after_list_comma_in_array = false;
      fCodeFormatterPreferences.new_line_before_close_array_parenthesis_array = true;
    }
    ICodeFormattingProcessor codeFormattingProcessor = new CodeFormatterVisitor(
        document, fCodeFormatterPreferences, getLineSeparator(project),
        phpVersion, useShortTags, region);

    if (isPasting) {
      fCodeFormatterPreferences.comment_line_length = oldCommentLength;
View Full Code Here

          // TODO: handle exception
        }
        // php format
        // PHPVersion version = ProjectOptions.getPhpVersion(project);
        boolean useShortTags = ProjectOptions.useShortTags(project);
        ICodeFormattingProcessor codeFormatterVisitor = getCodeFormattingProcessor(
            project, document, version, useShortTags, region);
        if (codeFormatterVisitor instanceof CodeFormatterVisitor) {
          List<ReplaceEdit> changes = ((CodeFormatterVisitor) codeFormatterVisitor)
              .getChanges();
          if (changes.size() > 0) {
View Full Code Here

  }

  public TextEdit formatString(int kind, String string, int offset,
      int length, int indentationLevel) {
    try {
      ICodeFormattingProcessor codeFormatter = createCodeFormatter(
          this.options, new Region(offset, length),
          createDocument(string, null));
      return codeFormatter.getTextEdits();
    } catch (Exception e) {
      Logger.logException(e);
    }
    return new MultiTextEdit();
  }
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.core.format.ICodeFormattingProcessor

Copyright © 2018 www.massapicom. 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.