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

Bug 317875

Summary: AST utility class for quick fixes
Product: [Tools] CDT Reporter: Tomasz Wesolowski <kosashi>
Component: cdt-codanAssignee: Elena Laskavaia <elaskavaia.cdt>
Status: RESOLVED FIXED QA Contact: Elena Laskavaia <elaskavaia.cdt>
Severity: enhancement    
Priority: P3 CC: cdtdoug
Version: 7.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 312736    
Bug Blocks:    
Attachments:
Description Flags
ASTQuickFixUtil class
none
CxxAstUtils extended, TextUtils created cdtdoug: iplog+

Description Tomasz Wesolowski CLA 2010-06-24 15:06:03 EDT
Build Identifier: 3.6.0

Some AST traversal/manipulation routines common to many quick fixes can be encapsulated in one class.

Reproducible: Always
Comment 1 Tomasz Wesolowski CLA 2010-06-24 15:07:31 EDT
Created attachment 172668 [details]
ASTQuickFixUtil class

used in a few fixes (soon to be committed)
Comment 2 Elena Laskavaia CLA 2010-06-25 20:24:37 EDT
Location of utility is not correct. checkers.ui is only intended for checker quickfixes itself. All framework parts should in codan.ui.

Second it has two independent group of functions ast manipulation and text manipulaton. 
Ast manipulation can go into class org.eclipse.cdt.codan.core.cxx.CxxAstUtils
(already exists). And we can create one in ui for text manipulation and name it appropriately.
Comment 3 Tomasz Wesolowski CLA 2010-06-28 12:30:00 EDT
Created attachment 172923 [details]
CxxAstUtils extended, TextUtils created

I agree.
Changed according to your suggestions
Comment 4 Elena Laskavaia CLA 2010-06-29 20:43:47 EDT
I cannot commit it because it depends on a class that does not exist in the 
patch import org.eclipse.cdt.core.dom.rewrite.DeclarationGenerator
I assume it is part of patch for refactoring: 312736.
I added dependency.
Comment 5 Elena Laskavaia CLA 2010-07-01 09:40:31 EDT
I applied it, but I renamed TextUtils to JFaceTextUtils for clarity
Thanks