Monday, June 15, 2009

Resharper top 5 features

Resharper has tons of ideas that can significantly improve your performance in Visual Studio making it an essencial tool for any developer who ever used it.



I wanna share what I find the most useful, so without further delay

1. Quick "goto" context menu

Where is this function used? How does the class of this variable look like? What is the implementation of this interface method? All of this questions lead to a single shortcut [Ctrl+`] It opens context menu with appropriate gotos.



2. Quick navigate to Type/Filename by name.

What? More navigation rutine? Well couldn't live without this in any mediocre to large scale solution. It's actually becomes very natural way to navigate around in time, you'll forget about forest of files in solution explorer. It is possible to navigate to class, to file and to class member by name with use of [Ctrl+T] (for types) and [Ctrl+Shift+T] (for files). Just press shortcut and type few first letters. Note that wildcards are supported as well.


3. Generation of rutine code.

[Alt+Ins] pops up a menu for fast constructor/property creation. Just hit this combo, select operation, few specifications of what you really want and you are done.



4. Reformat code

While working with source files it becomes pretty messy over time, you have public methods mixed up with private, field declarations all over the place, etc. And since you must implement features fast you don't have much time to clean up visual aspects of code. However with resharper it's just the matter of issuing a single command named full clean up - [Ctrl+E, Ctrl+C] (you might create lesser jobs too). It will move everything around to match the pattern of file layout you provide, add this. qualifiers and do some other nice stuff to keep your code well styled. Pattern should be shared among teammates to keep considtent look of source files.

5. Duplicate code. [Ctrl+D] is very nifty when it comes to duplicating. Put a cursor on a line you'd like to dup and just press Ctrl+D. Hidden benefit of this that it doesn't even touch your clipboard! (so everything in buffer stays) Duplication works horizontally too, just select a piece of line and dups will be created to the right.

6. Beyond that

Resharper extends refactorings supported by VS. Extract method [Ctrl+M] and Introduce variable [Ctrl+V] are the most commonly used by me. There are also tons of other useful refactorings waiting for you.

No comments:

Post a Comment