Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] CDT Refactoring Question

On Thu, Dec 18, 2008 at 3:58 AM, Adam Neal <Adam_Neal@xxxxxxxxxx> wrote:

Hi, I tried asking this on the newsgroup, but to no avail.

I would like to reuse the CDT refactor engine to implement a feature I am working on (in non CDT source).  A few quick questions while I am investigating:
1) Is it possible for me to invoke the refactor engine programmatically rather than just through the UI?

Yes, check out  org.eclipse.cdt.ui.tests.refactoring.RefactoringTest and its subclasses.

2) Can we provide multiple elements to refactor rather than one at a time? (e.g. a pair of method's)

That's up to the refactoring you write.  Rename, for example, may appear to only change one element, but it has a ripple effect as it changes the dependencies to that element. 

3) Can we suppress the UI during the refactor if we want?

Again, that's up to your refactoring.  User feedback is an important part of any good refactoring tool's design, however. 

4) Where is a good starting point in the source for me to accomplish this?

Look at the simpler refactorings, such as ExtractConstant, to get your feet wet.   If that's too complicated for your needs, consider using LTK instead.  LTK is the common refactoring support which JDT, CDT, and other language support modules extend.


Thanks in advance,

cdt-dev mailing list

Back to the top