Archive

Author Archive

Refactorings that work with strings – Use StringBuilder

August 31st, 2011 Comments off

In addition to the refactorings that work with the concatenated strings and the String.Format call, there is another useful refactoring called Use StringBuilder. This refactoring replaces the string concatenation operations with corresponding methods of the StringBuilder class.

Read more…

String.Format-specific refactorings shipped in Refactor! Pro

August 31st, 2011 Comments off

Refactor! Pro provides several refactorings to create and organize the .NET String.Format call. The String.Format call is a static method that receives a string that specifies where the following arguments should be inserted, and how they should be formatted. You can specify the display options for each argument individually using the String.Format call.

Read more…

DXCore Services – Selection

August 30th, 2011 7 comments

The Selection DXCore service provides methods for manipulating the selected text in the code editor.

Read more…

IDE Tools (CodeRush) Shortcuts options page

August 29th, 2011 Comments off

The Shortcuts options page is an important and one of the most often used options pages. It allows you to create, modify and remove shortcut bindings for all IDE Tools products (CodeRush, DXCore, Refactor!). The page is located at the IDE | Shortcuts path in the CodeRush Options Dialog. Here is what it looks like:

Read more…

DXCore APIs related to the programming languages specification

August 29th, 2011 Comments off

Every programming language has its own language specification. There are numerous rules for each language that vary between programming languages. DXCore supports several programming languages and provides APIs to determine specific rules for them. These APIs are available primarly through the DXCore Language service. Let’s review the most important methods and properties of this service, comparing the CSharp (C#) and Visual Basic (VB) programming languages.

Read more…

How to get the declaring element (declaration) from a reference using DXCore

August 29th, 2011 Comments off

Once you have a reference to an element and would like to get its declaration, simply call the GetDeclaration() method of a reference of the Expression type (all references have the Expression base type).

Read more…

How to get ancestors and descendants of a type declaration using DXCore

August 29th, 2011 Comments off

Once you obtained an instance of a class, structure or an interface, for example, by using the DXCore SourceModel service:

CodeRush.Source.ActiveClass
CodeRush.Source.ActiveClassInterfaceOrStruct
CodeRush.Source.ActiveClassInterfaceStructOrModule
CodeRush.Source.ActiveStruct
CodeRush.Source.ActiveInterface

and would like to analyze its hierarchy by retrieving its base and/or derived types, you can use the following APIs:

Read more…

Highlighting an identifier and its references using CodeRush

August 29th, 2011 Comments off

CodeRush has the Highlighting All References feature, based on the Tab to Next Reference feature, with the difference that you do not actually navigate between references. The feature simply highlights the current identifier and all its references. The default shortcut to apply the reference highlighting is Ctrl+Alt+U. Once performed on an identifier, you will see the identifier and its references highlighted in pink:

CodeRush Highlight All References preview

Read more…