|[jdt-dev] AST rewrite on other AST.|
Currently I tried with: ASTNode newOldNode= ASTNode.copySubtree(newNode.getAST(), oldNode);to create the newOldNode and connect it to the AST, but if I add changes to newOldNode it doesn't update the CompilationUnit.
I've also tried with:CompilationUnit oldNodeCompilationUnit= ASTResolving.findParentCompilationUnit(oldNode); ASTRewrite oldNodeRewrite= ASTRewrite.create(oldNodeCompilationUnit.getAST());
and work with oldNodeRewrite, but that doesn't work either.I've read the article "Abstract Syntax Tree", and it states to use a TextEdit and manipulate files using ITextFileBufferManager, But I hope there a a shorter path to do what I want.
All help appreciated. Regards, Kenneth
Back to the top