Home > Clipboard Tools, Options/Settings > Options – Intelligent Paste

Options – Intelligent Paste

March 14th, 2011

There are two options pages for the Intelligent Paste CodeRush clipboard feature inside IDETools Options Dialog. The first one defines the main expansions and the second one allows you to manage Intelligent Paste extensions. Note the difference between “expansions” and “extensions”; in other words, extensions provide expansions. For example, the “Regular Expressions” extension provides the main list of Intelligent Paste expansions from the first options page:

CodeRush Intelligent Paste options page

This options page lists the main Intelligent Paste expansions available, and enables you to customize options for each expansion.

The page consists of the expansions list on the left, and the options for the selected expansion on the right. Under the list with expansions on the left there are two buttons: “New” and “Delete…“. These buttons are used for adding and removing expansion items. As an alternative you can use the context menu available via right-clicking on the list and choosing the single “Duplicate” menu item. This way you can easily add a new item based on the existing one and modify its context, replacement and Match With values of the selected expansion.

Once you selected an expansion, the following options related to the expansion are available:



Enabled If this option is on, the selected expansion under the Name label will be enabled and CodeRush Intelligent Paste Engine will try to perform a replacement conversion operation of the text on the clipboard, if appropriate.
Match With Specifies the clipboard text template using the build-in DXCore reg-ex aliases engine. If the text from the clipboard matches this template, the expansion activates.
Replacement Specifies the code block pasted by the expansion instead of the initial clipboard text content.
Comment The additional information to describe the expansion. The value of this option does not affect the expansion functionality.
Match across line breaks If this option is on, Intelligent Paste Engine compares each text line from the clipboard with the template, and activates the expansion for each matched line.
Allow partial-line matches If this option is on, the expansion is activated, even if only a part of the clipboard content matches the template. In this case, the expansion changes only the part that matches the template.
Treat single spaces as optional whitespace If this option is on, Intelligent Paste Engine treats single spaces as an optional whitespace from the Match With and Replacement values. This allows you to enter these values easily, which makes them more flexible in regard to whitespaces (tabs, spaces, several spaces in a row, etc).
Preserve original whitespace Specifies whether whitespace from the clipboard is preserved in the replacement expansion.
Сontext Specifies the context where the expansion is available.

On the second options page Editor | Clipboard | Intelligent Paste Setup, the extensions that provide Intelligent Paste expansions are listed:

CodeRush Intelligent Paste Setup options page

There are four extensions shipped with CodeRush and Refactor!:



Regular Expressions These expansions are listed on the first options page.
Declare Method Stub Intelligent Paste Invokes the Declare Method code provider to construct the method with appropriate parameters when method invoke expression is copied and then pasted into the class or struct.
Extract Method Refactoring Invokes the Extract Method refactoring for the selected block of code when it is pasted into a class or struct.
Introduce Local Refactoring Invokes the Introduce Local refactoring for the selected code expression when it is pasted into a new line inside of the same member scope.

The Maximum # of lines to trigger option specifies the upper limit of the lines of the text on the clipboard for the selected Intelligent Paste extension. If the clipboard contains a larger text content than specified with this option, the extension is not triggered.

If you add a new Intelligent Paste extension using the DXCore Intelligent Paste Extension component, the new extension will appear on this options page.

Products: CodeRush Pro
Versions: 10.2 and up
VS IDEs: any
Updated: Mar/14/2011
ID: C082

Similar Posts: