Archive for the ‘CodeRush’ Category

Code Issues – Can initialize conditionally

January 21st, 2011 Comments off


This code issue may improve the efficiency of the code. It is shown if the initialization can be moved to an ‘else’ block of the following conditional statement. If the condition of the conditional statement is met, than the first initialization is unnecessary. This issue is shown as a suggestion (hint).

Read more…

Code Providers – Seal Class

January 16th, 2011 1 comment

This is one of the simplest code provider operations which simply marks the active class as ‘sealed’ (CSharp) or ‘NotInheritable‘ (Visual Basic). The sealed modifier is used to prevent inheriting from a class. For example, this can be useful when creating ‘helper’ classes containing utility methods that should never be extended by overriding the existing functionality. Another benefit of this code provider is that it enables a hypothetical run-time optimization, because having a sealed class known to never have any derivations; it is possible for the compiler to transform virtual function member invocations into non-virtual which take less time to perform.

Read more…

Unbound Actions – Google Active Word

January 11th, 2011 Comments off

The “Google Active Word” action is one of the simplest, open source sample features, useful for beginners learning CSharp .NET language in Visual Studio. It performs a search in Google for the word at the editor caret, using the following link:

where “ActiveWord” is a word at the editor caret.

Read more…

Clipboard Tools – Paste Replace Word

December 27th, 2010 Comments off

Once you have a word (identifier) on the clipboard, you can easily replace any different word (identifier) with the one on the clipboard using Ctrl+B shortcut. The Paste Replace CodeRush action will select the word (identifier) at the caret before pasting in the contents of the clipboard, so you don’t have to select it first.

Here is an example. Consider that we have the Location property, which should be returning the default “Unknown” value, but currently it returns null. Let’s see how the Paste Replace Word feature will be useful here:

Read more…

CodeRush Clipboard History

December 21st, 2010 Comments off

Clipboard History is a visual multi-clipboard viewer and manager, which makes copying and pasting of data a little easier. It allows you to extend the facility of Windows system’s clipboard, beyond its default capability and the disadvantage that you can only copy once before pasting. The next time you copy or cut another snippet, you overwrite the existing clipboard contents. CodeRush helps to keep the clipboard history that you can use to paste any selected fragment again. You can have up to 64 independent fragments and work with each of them separately, persisting these fragments across Visual Studio sessions for future use. If you copy a code fragment, Clipboard History will maintain its syntax highlighting as well:

Read more…

Unbound Actions – Reopen last closed document

December 20th, 2010 Comments off

Have you ever accidentally closed a document in Visual Studio? To reopen the file, you have to browse it in the Solution Explorer or any other file explorers. Like most browsers, which have the ability to reopen accidentally closed tabs, CodeRush has the same feature. The action providing this feature is not bound to any key. So, if you’d like to use it, you have to create a new shortcut (e.g. Ctrl+Shift+T) and bind it to the ReopenLastClosedDocument action. This feature restores up to 10 of the most recently closed documents.

Read more…

Visualization – Element Highlighting

December 13th, 2010 8 comments

Element Highlighting visualization feature paints identifiers inside source code in a different color according to your preference. It can paint the following elements:

  • classes
  • structures
  • interfaces
  • enumerations
  • methods
  • properties
  • fields
  • events
  • anonymous elements

Read more…

CodeRush Pro visualization features

December 6th, 2010 Comments off

CodeRush Pro ships with the following code editor visualization features:

Comment Painter

The Comment Painter feature draws a bubble icon over the comment “//” symbols in CSharp, or “ ‘ ” (single quote) in Visual Basic.

Comment Highlighter

Comment Highlighter is intended to visually highlight your TODO comments; it can either increase the contrast of entire TODO comment or completely change the color of both TODO word and the rest of the comment.

Read more…