Skip to main content

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

Thanks for your answers!

Tom Ball wrote:
> That's what the JDT has, and like a lot of other CDT functionality, the
> design was copied.  My guess is that the reason the JDT has it in UI is
> due to the chances of any useful refactoring breaking code -- adding it
> as an editor enhancement with previews and undo support makes that risk
> more acceptable to developers who use it.

Good to know.

I might be missing something here, but I thought that refactoring
actions returned Change objects which could be used both for previews
and undos, but do not require any UI themselves, so some kind of
separation would still seem possible. But well I understand that CDT
would mimic JDT. Well -- maybe for e4! :).

> Cut&paste (really).  You'll find early on that most of the refactoring
> support only works on C++ code (different AST node types), so it will
> need major rewriting anyway.  The C++ refactoring code's real value to
> your project is as sample code.

I saw that most actions worked on C++ but at least Rename worked on C
code. In all cases I would have had to write most actions by myself, but
I would have liked to integrate more tightly with the current
refactoring support.

In the end I think I will go for your solution: most my actions are new
anyway (I read in the archive that I shouldn't call them refactoring as
they clearly change the execution semantics ;)), and as much as I hate
duplicate code I think it makes more sense than the other way.


> My guess is yes, depending on what the benefit to all CDT users might be
> compared to the cost of integrating your changes (those sorts of patches
> tend to be big, and thus a lot of work).  I submitted a small
> refactoring for 6.0, and found the CDT team to be very supportive and
> accepting.  It probably helped that I used their existing framework and
> design patterns as much as possible, and included lots of tests to
> reduce the risk of adding that feature.

I will try to do likewise, again thanks for your advices! I'll also be
waiting for some feedback from the CDT team regarding my endeavor.

Thanks,

-- 
Simon Chemouil
Anyware Technologies


Back to the top