Archive

Author Archive

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…

DXCore Services – LinkedIdentifiers

December 27th, 2010 Comments off

Linked Identifiers are a built-in feature of DXCore, which allows you to simultaneously change similar pieces of the text (code) located in different places. The service provides access to the Linked Identifiers engine.

Read more…

How to perform an existing refactoring from another one

December 25th, 2010 12 comments

Refactor! Pro has numerous refactorings which perform a single task. What if we could run several refactorings at once?

For example, there is a support for optimizing namespace references added to the Move Type to File refactoring: after the new file is created, the Optimize Namespace References refactoring does its job. Here are other examples of refactoring (code provider) combinations, which can be performed:

  • Introduce Local and Promote to Parameter will create a new refactoring, called something like “Introduce Parameter”.
  • Declare Class (Struct) and Declare Method (Property) will create a new multi-declare code provider, which will declare everything at once.
  • Introduce Parameter Object and Move Type to File will add a new option for the first refactoring to create a new file.
  • And so much more…

Read more…

Refactorings – Rename

December 25th, 2010 Comments off

This refactoring provides an easy way to rename identifiers for code symbols such as locals, type members, types or namespaces and updating all their references.

Rename is one of the most useful refactorings of all. The developer can alter the name of the declaration and its occurrences (references) in the code in the whole solution.

Simply put the caret on the identifier and apply the refactoring. The refactoring will wrap all references and name of the declaration into linked identifiers, that help you easily change all occurrences simultaneously. The preview hint in Rename will show visible references in the code editor. Press Enter when you are done changing the name of the identifier to commit your changes.

Read more…

DXCore Linked Identifiers feature

December 25th, 2010 Comments off

Linked Identifiers are a built-in feature of DXCore, which allows you to simultaneously change similar pieces of the text (code) located in different places. If you change one linked identifier, the others that are associated with it will automatically be changed as well. For instance, linked identifiers are enabled when you apply the Rename refactoring.

DXCore Linked identifiers preview

Read more…

DXCore Services – Project

December 22nd, 2010 Comments off

The Project service has a pretty short list of functions. This service is intended to manipulate projects of an active solution, and provides access to the start-up project, active project, and count of opened projects. All methods and properties work with an instance of the DevExpress.CodeRush.Core.Project type.

Methods of this service:

Name

Description

GetEnumerator Returns enumerator of all projects in the active solution.

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…