Rory Becker - DevExpress CodeRush Blog

CodeRush for Roslyn – Setup Wizard

Everyone is different. Everyone has their own preferences and their own approach.

If you’ve never used CodeRush before (or even if you have) its a good idea to use our new setup wizard to configure things at a high level, before diving into your next coding session.

The wizard will give you the chance to set base settings for several of our main features, so that they behave the way you’d like them to. There is no requirement to use the wizard, but we feel that doing so will improve your CodeRush experience greatly.

So what can you configure using the wizard?

Structural Highlighting

CRRSetupWizardStructuralHighlightingWhat is it?
Structural highlighting is where CodeRush lines are drawn between the start and end of various different types of block. This helps make sense of what is commonly called arrow code (Code which is heavily nested in successive blocks of different type). By using different colors to show the the blocks of ‘properties’, ‘accessors’, ‘foreach loops’, ‘conditional blocks’, ‘switch statements’ and ‘exception handling blocks’, CodeRush makes it much easier to determine very quickly where each of these start and end.

What can I configure?
The wizard options here are simple: Would you like Structural highlighting on, or off?

What if I need more?
The ‘Editor\Painting\Structural Highlighting’ section of our options screen (Ctrl+Alt+Shift+O) will let you change which block types are linked, their color and style.

Numeric Keypad Bindings

CRRSetupWizardNumericKeypadWhat is it?
Put simply this option causes CodeRush to assign a few additional shortcuts to the keys of your numeric keypad. This keypad goes unused by the majority of people and this option will reclaim several of it’s keys for quick access to some of our more popular functions.

Which shortcuts will be added?
Num-Plus - Selection Increase - Increase your code selection in logical block rather than character by character.
Num-Minus - Selection Decrease - Reverse the effects of ‘Selection Increase’ by similar logical blocks.
Num-Period – Jump to Menu –  Our general purpose go-to navigation menu (Full details here)
Num-Enter – Jump to Symbol – Our Symbol-specific navigation menu (Full details here)
Num-Zero – Code / Refactor Menu – The ever popular CodeRush/Refactor key. Quick access to all the Refactorings and CodeProviders suited to your current context.

These shortcuts involve fewer keystrokes than their default equivalents. They are also typically easier to hit given their increased size and useful location.

Spell Checker

CRRSetupWizardSpellCheckerWhat is it?
As you might expect, CodeRush’s Spell Checker is the simple ability to check the spelling of certain specified parts of your document. It is disabled by default but can be enabled from the wizard in any of 3 ways.

What can be checked?
This screen lets you enable spell checking for 3 distinct parts of your code: Comments, Strings and API-level Members and Identifiers.
(For our purposes, API-Level members and identifiers are those that are public, protected or internal )

What if I need more?
These settings can be tweaked and fine-tuned on our options screen (Ctrl+Alt+Shift+O) within the ‘Editor\Spell Checker’ page.
From here you can specify more locations to check, filter others out and specify the dictionary you’d like to use.

Tab to Next Reference

CRRSetupWizardTabToNextReferenceWhat is it?
Tab to Next Reference is the ability to place your caret within an identifier (method, variable, method) and hit Tab to initiate navigation between all the references to that identifier. I find this one as least as useful as the built in Go To Definition (F12)

Any other associated shortcuts?
Yes. Shift+Tab will carry you back through your references in the reverse direction, and once you are finished navigating through the references, you can hit Esc (or Alt+End) to return directly to your start point via a hidden marker.

This has to be one of the the easiest way to navigate through your code.

Smart Semi-Colon

CRRSetupWizardSmartSemiColonWhat is it?
Intelligently repositions your caret when you hit the semi-colon key, so that the semi-colon is emitted in the most sensible location.

Why would I need that though?
Consider features like the auto-completion of braces and parenthesis. These features are great because they finish what you start, so that you don’t have to. They leave your caret where it is, enabling you to continue working on your inner code.
A few method calls later, and you are potentially buried in parenthesis. Smart semi-colon is a simple but effective feature which allows you to hit the semi-colon without digging yourself out from under the parenthesis mountain first.

CodeRush will determine where the semi-colon should go, and position your caret there first before emitting the character.

One Key Selection Embeddings

CRRSetupWizardOneKeySelectionEmbeddingWhat is it?
Selection Embeddings are best described as CodeRush Templates that envelop your selected code.
A One-Key Selection Embedding is one which is triggered by the pressing of a single key. You select your code and then hit a trigger key. Instead of replacing the selected code with the key, the code is wrapped in text according to which embedding was invoked.

CodeRush provides several out of the box.

C – Wrap code in Try..Catch
F – Wrap code in Try…Finally
T – Wrap code in Try…Catch…Finally
B
– Wrap code in a set of braces. { … }

 Code Template Expansion

CRRSetupWizardTemplateExpansionWhat are CodeRush Templates?
Often described as VS snippets on steroids, CodeRush Templates are short sequences of characters which generate more verbose text within the editor. Templates can be used to create methods, classes enumerations, block constructs, unit tests, test assertions and much more.

What can I configure?
On this page of the wizard, you’ll decide how Templates will be triggered.

Personally I like to pick the Space key for maximum speed and ease of activation (After all that space bar is nice and big and easy to hit). Others pick the Tab key in order to reduce the risk of accidental template expansion. You can also elect to disable the template system from this page.

 

Markers

CRRSetupWizardMarkersWhat are Markers?
Markers are your virtual breadcrumbs. They are like stack based transient bookmarks in your code.

Why would I need another kind of bookmark?
So your coding along. Everything is going well, when you realise that you need to check something. Drop a marker. (Alt+Home) to mark your place and go investigate whatever you feel like. When your done, hit a single key (Esc or Alt+End) and return not just to when you were previously, but to the exact frame of reference you had before.

Markers stack, which means you can drop as many as you like digging deeper and deeper into your code. When you’re ready, you collect them in reverse order (just like virtual breadcrumbs) leading you back to where you started.

CodeRush will drop additional markers when you navigate away from where you are. Go To Definition (F12), Go To Symbol (Ctrl+Shift+Q or Num+Enter) or Jump To (Ctrl+Alt+N) will all drop markers allowing you to navigate away to investigate something and then hit Esc to return once you’re done.

What can I configure?
On this page you can decide if you’re like to enable Markers and further which shortcut you’d like to use to collect them.

Note: Since VS2013, Visual Studio has altered it’s behaviour when navigating. Following jumping to an identifier’s declaration (F12), Visual studio selects the name at that declaration assuming that you want to do something with its name. This means that those have grown used to using Esc to collect markers have had to press Esc once to remove the selection and once more to collect the marker. You can opt to let CodeRush work around this behaviour by choosing the last option on this page of the wizard. 

We highly recommend choosing the final option for your marker configuration in order to make your navigation experience as smooth as possible.

IntelliRush

CRRSetupWizardIntelliRushWhat is it?
IntelliRush is the CodeRush version of IntelliSense.
It does every thing normal intellisense does, and more.

What extras do I get with IntelliRush?
You can Resize IntelliRush. Just grab the edge and expand your view.

You can filter content by member type: Restrict content to only Events, Properties or Extension methods (or something else) to quickly find the exact member you’re after.

You can filter content by hierarchy: Restrict content to a specific level of the hierarchy. Show only members declared on the class of the object being inspected, or choose another ancestor and show only members declared on that ancestor.

All filtering achievable using simple on-screen keystrokes whilst losing none of the power of intellisense.
 

Menu

CRRSetupWizardMenu

The preferences you set in the Setup wizard are not permanent. You can return to the Wizard and change any of your choices at any time. Just open the ‘CodeRush’ menu and choose the ‘Setup Wizard’ option to begin amending your choices.

The choices you make within the wizard have been chosen to get you up and running as quickly as possible. However there is a lot more customization available via our main Options screen also available from the ‘CodeRush’ menu or via the Ctrl+Shift+Alt+O shortcut.

 

 

 

Everyone is different and we all have our own preferences and approach. It is our hope that the minimal amount of configuration requested by our Setup Wizard, will greatly improve your CodeRush experience.

CodeRush for Roslyn is now available for as little as $50 a seat and a 30 day trial can be found in the Visual Studio Gallery.

Published Sep 12 2016, 07:26 PM by
Bookmark and Share

Comments

No Comments
LIVE CHAT

Chat is one of the many ways you can contact members of the DevExpress Team.
We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.

If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

FOLLOW US

DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

Copyright © 1998-2017 Developer Express Inc.
All trademarks or registered trademarks are property of their respective owners