Archive

Archive for the ‘CodeRush’ Category

Coderush Quick File Navigation tool window

May 5th, 2011 4 comments

Quick File Nav navigation CodeRush feature allows you to switch between all files in a solution. The shortcut key for this tool window is the Ctrl+Alt+F. Once you press the shortcut, the following window appears at the editor caret position or at the center of the Visual Studio main window:

CodeRush Quick File Nav main window

Read more…

Code Issues – Base type constructors are not implemented

April 26th, 2011 Comments off

The Base type constructors are not implemented code issue is an alternative code issue to the “Can implement base type constructors“. The different between these two is in their type – one is an error and another one is a hint. When the current type doesn’t implement non-default constructors from a base type the “Base type constructors are not implemented” error is shown.

Read more…

Code Generation – Add Missing Constructors code provider

April 26th, 2011 Comments off

The Add Missing Constructors code provider from CodeRush allows you to add constructors from the ancestor class to the current class or structure, which are not implemented.

Imagine you are creating a descendant of the System.Exception class:

CodeRush - New Exception descendant (CS)

Read more…

Code Issues – Can implement base type constructors

April 26th, 2011 Comments off

Cause:

The Can Implement base type constructor code issue of type hint suggests that you implement the constructors that are missing for the current class, but exist in the ancestor (base) class.

For instance, once you implement your custom exception class derived from the System.Exception, you have to provide the full set of its constructors. Failure to provide all of the constructors of the Exception class can make it difficult to correctly handle exceptions. For example, the constructor with the signature “Exception(string, Exception)” is used to create exceptions that are caused by other exceptions. Without this constructor, you cannot create and throw an instance of your exception descendant that contains an inner exception, which is what managed code should do in such situations.

Read more…

Browsing recently accessed files in Visual Studio using CodeRush

April 25th, 2011 Comments off

CodeRush has a special tool window for browsing recently opened (accessed) files inside Visual Studio called Browse Recent Files. It is available via the corresponding File -> Browse Recent Files… menu item, or via the Ctrl+Shift+. (dot at the end) shortcut. This is what it looks like:

CodeRush Recent Files preview

Read more…

Intelligent code lines enhancement and modification using the Duplicate Line feature

April 19th, 2011 Comments off

The Duplicate Line CodeRush feature intelligently creates a copy of an existing line of code, allowing you to easily modify it. If the code line is recognized as a predefined pattern, the line is copied and a portion of it is selected for further modification. Note that some code line bits can be modified automatically for you as well.

The predefined duplication patterns are configurable. They are stored and presented as regular expressions that contain one or several DXCore built-in reg-ex aliases for easy understanding. If the line doesn’t match any of the existing patterns – nothing happens, by default. However, there an option to copy-paste the entire line of the text if no matches are found when the feature is performed. All available options are listed later.

Read more…

Smart Constructor – Generating advanced type constructors in three keystrokes

April 19th, 2011 Comments off

The Smart Constructor CodeRush feature allows you to add constructors to the current class or structure, and pass type members, like fields and properties for initialization through its parameters. Creating a constructor is as simple as just typing three keys: “cc & Space”:

CodeRush Smart Constructor preview

Read more…

Coding Helpers – Smart Parentheses and Smart Brackets

April 18th, 2011 Comments off

Let’s talk about two similar features – the Smart Parentheses (also known as Smart Parens) and Smart Brackets. These two features allow you to easily type parens and brackets without having to close them with the corresponding closing paren or bracket, because they will be inserted automatically.

In this article the ‘paren’ means the opening or closing parenthesis ‘(‘ or ‘)’, and the bracket means the ‘[‘ (opening) and ‘]’ (closing) characters.

Read more…