Package org.eclipse.php.internal.core.ast.rewrite

Examples of org.eclipse.php.internal.core.ast.rewrite.ASTRewrite.rewriteAST()


    }
   

    classListRewrite.insertAfter(method, fCoveringDeclarationFinder.getCoveringMethodDeclaration(), newMethodEdit);
   
    TextEdit fullDocumentEdit = rewriter.rewriteAST(document, null);

    anotherChange.addEdit(fullDocumentEdit);
   
    return anotherChange;
  }
View Full Code Here


        Block.STATEMENTS_PROPERTY);
    ASTNode placeHolder = rewrite.createStringPlaceholder("//mycomment",
        ASTNode.COMMENT);
    listRewrite.insertFirst(placeHolder, null);

    TextEdit textEdits = rewrite.rewriteAST(document, null);
    textEdits.apply(document);
    checkResult("<?php\n class A { \n  //mycomment\n  public function foo(int $a){}\n }?> ");
  }

  public void testException() throws Exception {
View Full Code Here

    rewrite.replace(
        allthrows.get(0),
        rewrite.createGroupNode(new ASTNode[] { allthrows.get(0),
            program.getAST().newBreakStatement() }), null);
    rewrite.rewriteAST(document, null).apply(document);

    checkResult("<?php\n function A() { throw new Exception(); break; }");

  }
View Full Code Here

      throws CoreException {
    super.addEdits(document, editRoot);
    ASTRewrite rewrite = getRewrite();
    if (rewrite != null) {
      try {
        TextEdit edit = rewrite.rewriteAST(document, null);
        editRoot.addChild(edit);
      } catch (IllegalArgumentException e) {
        throw new CoreException(DLTKUIStatus.createError(IStatus.ERROR,
            e));
      }
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.