Automatic code refactoring

Christopher Wright dhasenan at gmail.com
Sat Aug 4 12:19:14 PDT 2007


Ingo Oeser wrote:
> Robert Fraser wrote:
>> - Expand a mixin/compile-time function/etc. to its actual value/code
>> (again, either in a single place or everywhere).
> 
> Very useful for readability! Undo would be important here :-)

What about an open/close box (the little square button kind that has a + 
when collapsed and a - when expanded) that doesn't modify the source but 
displays the template or mixin as it would be instantiated, with 
arguments propagated? For instance:

    template Bar (T) {
       T bar () { return T.init; }
    }

    class Foo {
[+]  mixin Bar!(int);
    }

Click the button...

    template Bar (T) {
       T bar () { return T.init; }
    }

    class Foo {
[-]   int bar () { return int.init; }
    }

That way, I don't have to refactor code to see what my mixin does, so I 
don't have to worry about checking its contents by refactoring and then 
forgetting to put it back and having that portion of the code out of 
sync with the rest.

-cbw



More information about the Digitalmars-d mailing list