Mainstream D Programming

BCS ao at pathlink.com
Sun Oct 14 20:02:22 PDT 2007


Reply to Bill,

> Jussi Jumppanen wrote:
> 
>> Ary Manzana Wrote:
>> 
>>> Does nobody refactor their code?
>>> 
>> I do have to admit the refactoring rename feature found in the MS
>> Visual Studio IDE is very nice, but I'm not going to change my text
>> editor just for one feature.
>> 
>>> If so, how a text editor helps?
>>> 
>> Refactoring is still possible in a text editor:
>> 
>> Syep 1) Run a grep to find all the instances of text
>> Syep 2) Load up all the files found
>> Syep 3) Change each name one at a time or all in one hit
>> Syep 4) Run a build to check your changes
>> This might take an extra minute or two, but it's still pretty easy
>> todo.
>> 
> Where grep doesn't work so well is when you want to rename a variable
> called 's' to something else.  Or a better example is changing the
> name of a member of one class only.  Say we want to change the "name"
> member of one class.   That's likely to have a lot of false hits that
> grep, without any semantic knowledge, won't be able to help you with.
> A good refactoring IDE can (I think!) distinguish between things
> called 'name' that are referring to the member of the class in
> question and those that aren't.
> 
> --bb
> 

how about a Refactoring primitives tool set:

tool1: runs like DMD but dumps the name of the symbol at a given location

tool2: same as tool1 but in reverse, lists the location of every reference 
to symbol "____"

a few more tools along this line (and a lib of the code behind them) and 
you could whip out a lot of refactoring stuff really quick





More information about the Digitalmars-d mailing list