use of org.eclipse.cdt.core.dom.rewrite.ASTRewrite in project ch.hsr.ifs.cdttesting by IFS-HSR.
the class ILTISDummyRenameRefactoring method collectModifications.
@Override
protected void collectModifications(IProgressMonitor pm, ModificationCollector collector) throws CoreException, OperationCanceledException {
IASTTranslationUnit ast = refactoringContext.getAST(tu, pm);
IASTSimpleDeclaration funcDeclaration = (IASTSimpleDeclaration) ast.getDeclarations()[0];
IASTFunctionDeclarator declarator = (IASTFunctionDeclarator) funcDeclaration.getDeclarators()[0];
IASTFunctionDeclarator newDeclarator = declarator.copy();
IASTName newName = CPPNodeFactory.getDefault().newName("b".toCharArray());
newDeclarator.setName(newName);
ASTRewrite rewrite = collector.rewriterForTranslationUnit(ast);
rewrite.replace(declarator, newDeclarator, new TextEditGroup(""));
}
use of org.eclipse.cdt.core.dom.rewrite.ASTRewrite in project ch.hsr.ifs.cdttesting by IFS-HSR.
the class DummyRenameRefactoring method collectModifications.
@Override
protected void collectModifications(IProgressMonitor pm, ModificationCollector collector) throws CoreException, OperationCanceledException {
IASTTranslationUnit ast = refactoringContext.getAST(tu, pm);
IASTSimpleDeclaration funcDeclaration = (IASTSimpleDeclaration) ast.getDeclarations()[0];
IASTFunctionDeclarator declarator = (IASTFunctionDeclarator) funcDeclaration.getDeclarators()[0];
IASTFunctionDeclarator newDeclarator = declarator.copy();
IASTName newName = CPPNodeFactory.getDefault().newName("b".toCharArray());
newDeclarator.setName(newName);
ASTRewrite rewrite = collector.rewriterForTranslationUnit(ast);
rewrite.replace(declarator, newDeclarator, new TextEditGroup(""));
}
Aggregations