Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 332347

Summary: ASTRewrite should provide an insertAfter method
Product: [Tools] CDT Reporter: Fredrik Berg Kjolstad <fredrikbk>
Component: cdt-refactoringAssignee: Project Inbox <cdt-refactoring-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: enhancement    
Priority: P3 CC: cdtdoug, eclipse.sprigogin, malaperle
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Patch that adds an insertAfter method to the ASTRewrite class none

Description Fredrik Berg Kjolstad CLA 2010-12-10 17:31:44 EST
Build Identifier: M20100909-0800

The ASTRewrite class does not currently provide insertAfter functionality similar to JDT's getListRewrite().insertAfter().  This makes it awkward to insert statements after another statement.

Reproducible: Always
Comment 1 Fredrik Berg Kjolstad CLA 2010-12-10 17:34:11 EST
Created attachment 185007 [details]
Patch that adds an insertAfter method to the ASTRewrite class
Comment 2 Marc-André Laperle CLA 2011-03-03 01:52:40 EST
Hi Fredrik, I haven't really looked at the patch (yet?) but in org.eclipse.cdt.core.parser.tests.rewrite.changegenerator.* I see tests for append, insertbefore, remove and replace. So this might need some tests too.
Comment 3 Sergey Prigogin CLA 2011-11-13 00:51:47 EST
The patch doesn't apply to the latest code. Please update it.