Friday, April 13, 2007

Refactory Operations

I think I'm finally finished hacking on the Navigation History feature in MonoDevelop, which started off as more-or-less a direct rip-off of the one in SharpDevelop, but quickly began incorporating improvement ideas from Miguel, Lluis, and myself.

Now on to bigger and more exciting things... namely, refactory features.

A few weeks ago I had taken a look at some of Microsoft's Visual Studio 2005's and SharpDevelop's context-menu-based refactoring functions and have just stubbed a few of them out in current MonoDevelop svn (added the Rename and Implement Interface items):

In the above screenshot, you can see the menu we get when right-clicking on the name of an interface in a class definition.

Here, I right-clicked on the name of the class in the class definition.

Going forward, I'll be looking at the refactoring functionality that Eclipse provides along with Intellij's, ReSharper's and Refactor Pro's features.

So far I've really only had time to watch the Refactor Pro demos. They are pretty awesome, but I think the UI bits (at least) are a bit over the top. Certainly not going to be easy to implement. I'll probably be looking at easier approaches.

4 comments:

Itai Bar-Haim said...

Nice! I'm using MonoDevelop at work, and these features will be a great improvement.
When will there be a new release? Is it planned sometime soon?

Itai.

swythan said...

Excellent.

As a Refactor Pro user, I thought I'd let you know that all that fancy UI they show off is cool, but not the most important feature. The real productivity difference comes from the fact that the don't ever put up a modal dialog box.

e.g "Extract Method" just does the extraction and gives the new method a default name (it can even guess one from nearby comments!) and immediately enables the "Rename" refactoring on the method name, so you can leave it as is, or type a new name straight away. Importantly, you can do it all from the keyboard without leaving the context of the code editor. It's very nice.

Similarly, the overly swishy looking "Reorder Parameters" UI is far more intuitive than the default VS2005 UI.

Miguel A. Perez said...

This is great!.

Finally monodevelop is going to get the refactoring commands done.

I'm interested in helping out with this if i can. Currently i have got some code to implement a basic "Encapsulate fields" command but i got stuck in the part where i have to rename references to the field among other things.

Anonymous said...

Wonderful!

I would take a look at ReSharper.

In my opinion it is the most productive solution out there, at least it makes VS.NET programming blazing fast.

Code Snippet Licensing

All code posted to this blog is licensed under the MIT/X11 license unless otherwise stated in the post itself.