Jun
01
2007

Scripted Refactoring

In the spirit of Europa, the next release train of Eclipse 3.3, I will try to post some improvements that are available in the release. These improvements will be limited to the ones that I will use and I think will be useful for most programmers (Java especially).

So, the series will be begin with scripted refactoring.

scripted-refactoring.png

Imagine macro in Microsoft Office and bring it to IDE. This certainly can reduce some boring routines that programmers do if used properly. It’s possible to select several commands that we do in the history and group it as a script. The script can be saved as a script file and loaded later.

Unfortunately, this is currently only working with Refactoring and some editing commands (Move, Copy, Paste, and Delete), so it’s not possible to record more complex action into script. Of course, they can argue that if you want such advanced capability, you should just code a plugin for it :)

Written by Nanda Firdausi in: eclipse |

2 Comments »

  • Andry says:

    It is indeed a cool feature.
    But, I was just thinking, in what scenarios would we ever need macro-ed Refactoring?

    Can this feature take a class name as parameter? Raisen d’ etre of why we record a macro is to apply common set of actions (keyboard strokes dan mouse events) to several common “symbols”. Refactoring always took parameter “symbols”. Say, class name to be renamed or public field to be pulled out into value objects getter/setter.

    Don’t you think that Eclipse Scripted Refactoring would be useless without parameterized symbol?

    Other consideration is, Refactoring is often a leghty and risky project. Even if we could prove all unit test are green and go, it could accidentally broke the build. These things often happen when we introduce a lot of mock objects in out test.

    So I guess, for now, I’ll be more confident with “manual” plain-old vanilla Refactoring.

  • Nanda Firdausi says:

    Yes, indeed, parameterized command should be a reasonable addition to this scripted refactoring. I just hope this will be a big first step to all the macro things. I have many things in my head that should be available in Eclipse but just too lazy to start learning plugin development. If you have an almost finished script in front of you, probably it will be easier for us.

    For now, the only scenario I can see is if you working with several machines and same project. But then, you’ll be still screwed. Are you not using source code management??

RSS feed for comments on this post. TrackBack URL


Leave a Reply

Powered by WordPress. Theme: TheBuckmaker. PHP Scripts, OpenID