Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339073 - When ASTNodes are moved (as in Extract Method) formatting is not preserved
Summary: When ASTNodes are moved (as in Extract Method) formatting is not preserved
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-refactoring (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-07 06:17 EST by Emanuel Graf CLA
Modified: 2020-09-04 15:26 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.