Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333940 - The rewrite infrastructure pretty-prints all code between the first and last change in every block
Summary: The rewrite infrastructure pretty-prints all code between the first and last ...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-refactoring (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 normal with 1 vote (vote)
Target Milestone: 8.0.2   Edit
Assignee: Sergey Prigogin CLA
QA Contact: Emanuel Graf CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 296192
  Show dependency tree
 
Reported: 2011-01-10 23:09 EST by Fredrik Berg Kjolstad CLA
Modified: 2011-11-07 18:34 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fredrik Berg Kjolstad CLA 2011-01-10 23:09:51 EST
Build Identifier: M20100909-0800

The rewrite infrastructure scans each block that has been changed and finds the first and last edit in that block. It then inserts a pretty printing of the modified AST into the space between those edits. 

As a result, if a refactoring, for example inserts a statement at the beginning and end of a method all the code in the method between those statements, that was never actually touched by the refactoring, is pretty-printed. As a consequence the users code formatting is lost and macros expanded. This holds for any code block including that of a class.

Reproducible: Always

Steps to Reproduce:
1. Use the ASTRewrite class to insert a statement at the beginning and end of a method
2. Observe that the formatting of the code in the method is changed, and that macros are expanded.
Comment 1 Sergey Prigogin CLA 2011-11-07 18:34:13 EST
I believe this is fixed now. Please reopen if you can provide a an example that still reproduces this problem.