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

Bug 339073

Summary: When ASTNodes are moved (as in Extract Method) formatting is not preserved
Product: [Tools] CDT Reporter: Emanuel Graf <emanuel>
Component: cdt-refactoringAssignee: Project Inbox <cdt-refactoring-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: cdtdoug, yevshif
Version: 8.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Emanuel Graf CLA 2011-03-07 06:17:31 EST
In the current refactoring infrastructure formatting does not follow ASTNodes. 
Therefore, when these are moved, as happens in Extract Method when code is
moved from one method to another, the code is pretty-printed and code
formatting does not follow the nodes.

The result is that whitespaces in the code are replaced with those inserted by
the pretty-printer.

This bug was first reported by Alex Richardson in bug 296192, but that bug has
become an aggregate of many bugs, so I am splitting them.

Reproducible: Always

Steps to Reproduce:
1. Create some code with strange formatting and use of macros
2. Select the code and choose Refactor -> Extract method
3. The new code in the new method has now been reformatted according to the
rules of the pretty-printer and the macros has been expanded.