Rory Becker - DevExpress CodeRush Blog

August 2010 - Posts

  • CodeRush Notifications

    In this post, I’m going to show you some of the types of notification that you might see within CodeRush. Let’s start at the beginning…

    Welcome


    WelcomeDialog

    The ‘Welcome’ dialog is the screen you see when you start CodeRush for the first time.

    It asks you 2 things:

    • Are you a new user?
    • Would you like CodeRush to load automatically in future?

    The default answer to both of these is yes. So if this suits you, simply click Ok.

    New Users are treated to explanations of CodeRush functionality, as it occurs via the ‘What happened’ popup.

    What happened?

    The “What happened” popup is a notification that only presents itself, if you previously asked to be considered a ‘new user’ from the ‘Welcome’ dialog (above)

    It’s purpose is, as the name implies, to explain what just happened.

    Let’s demonstrate with a small example.

    Image you have the following line of code in a method:

       var Fred = 6;

    Place your caret on the line of code, and hit Shift+Enter. The line of code is duplicated beneath the original, and CodeRush highlights the name of the variable for you so that you can give this new variable a different name.

    In addition, the ‘what happened popup’ appears to let you know what happened.

     WhatHappenedDuplicateLine

    It tells you the name of the operation that happened ‘Duplicate Line: Local Variable’ explaining this particular duplication has duplicated a locally initialized variable.

    It gives you 3 options: ‘Ok’, ‘Disable’ and ‘Options’.

    • If you like what CodeRush did, and would prefer it to continue doing so without popping this screen up next time, click ‘ok’.
    • If instead you don’t like what you saw, click ‘Disable’ and CodeRush will not perform this operation next time the shortcut in question is triggered.
    • Finally if you’d like to visit the options for the item in question, click ‘Options’ and not only will you be take to the correct page of the options screen, but CodeRush will also select the item in question (in this case ‘Local Variable’) from the available list of options.

    Although the ‘What happened’ popup appears to give you only 3 options, there is another alternative. You can simply ignore the popup and keep on typing.
    In this case you can change the name of the newly generated variable to something else, and as you do so, the ‘What happened’ popup simply disappears. This is an example of CodeRush avoiding the use of modal dialogs and letting you continue to code without getting in your way.

    VS Suppression
    Sometimes the use of a shortcut will trigger CodeRush functionality instead of some VS functionality which you might have been expecting.

    For example: If you use ‘Esc’ key to ‘Collect Marker’ (Previously dropped using the ‘Alt+Home’ key combo)...

    WhatHappenedMarkerCollect

    …the ‘What happened?’ popup appears to let you know that CodeRush has suppressed Visual Studio’s ‘SelectionCancel’ command, in favour of ‘Collect Marker’.

    As expected your options are summarised in the body of the ‘What happened?’ popup.

    • If you’d like CodeRush to continue to do it’s thing under these circumstances, click ‘Always do this’.
    • If you’d prefer CodeRush to take a back seat and have Visual studio perform ‘SelectionCancel’ instead, then choose the bottom option.
    • If you like to change either of the bindings so that they don’t conflict in this way, CodeRush offers you some links to the appropriate screens from which this can be done.

    As before you can simply ignore this dialog for now, by continuing to type.

    Sometime CodeRush has more information to offer you about what happened.

     WhatHappenedPS

    In the case of a template expansion, you’ll be treated to at least a partial view of the expansion that occurred, and the exact name of the template which was expanded. Additionally the ‘Template Options’ link will load up the options screen at the exact template that was expanded back in the editor.

    If you wish to do so, you can disable the ‘What happened?’ popup from the options screen (Ctrl+Shift+Alt+O), choose the ‘Core\Features’ page and then un-tick the first checkbox.

    Action Hints

    Action hints are arrows drawn on screen to alert you to something that CodeRush did, which might not be obvious at first glance.
    The previously mentioned Duplicate line and Template Expansions (at least the smaller ones) are good examples of this.

    ActionHintTemplateVSSmall

    Action hints have built in natural limits and will only display a pre-set number of times for each operation, before auto-disabling themselves. If you’d like to re-enable these or prematurely disable them, this can be done from the Options screen (Ctrl+Shift+Alt+O) on the ‘Hinting\Action Hints’ page. This page is only visible if the level dropdown is set to ‘Advanced’ or higher.

    Big Hints

    Big Hints are large tool tips that describe the currently active feature. These are especially useful for explaining the effect of an item on the ‘Refactoring’ or ‘Code’ Smart Menu, prior to actually clicking it.

    Simple examples include Create Setter Method and Encapsulate Method.

     

    BigHintCreateSetter    BigHintEncapsulateField

    A more complex example is the Extract Method refactoring.

    This refactoring analyses the highlighted section of code and calculates extracts this code into a separate method. In order to do this, it needs to figure out what parameters and return type such a method would need.

    The ‘Big Hint’ includes this information in order to help you decide if you truly want to extract the code you’ve got highlighted, or if you’d prefer to extract something slightly different.

    Here the same ‘Big hint’ is shown for 2 potential extractions. See how the hint reconfigures itself to show what sort of parameters will be created.

    BigHintExtractMethodSimple    BigHintExtractMethodComplex

    Big hints are controllable from the ‘Hinting\Big Hints’ options page. This page is only visible if the level dropdown is set to ‘Advanced’ or higher.

    Billboard Hints

    Billboard hints occur when you cancel interactive phases that permit typing in the editor. A good example of this is when you invoke the Add Parameter refactoring, then leave the line before specifying any new parameter details and press Enter on another line. At this point you should sees a billboard message telling you that the Add Parameter refactoring was cancelled.

    BillboardCancelAddParameter

    Billboard messages can be controlled from the ‘Hinting\Billboard Messages’ options page. This page is only visible if the level dropdown is set to ‘Advanced’ or higher.

    Shortcut Hints

    ShortcutHints

    These simple popups provide you with a list of available shortcuts for the current operation.
    Examples of said operations include ‘Tab to Next Reference’ or the ‘Reorder Parameters’ refactoring.

    To dismiss this screen, click the blue ‘minimize’ icon. Alternatively to disable this feature, click the red ‘close’ icon.
    Suppressed Shortcut hints can be re-enabled or the whole feature disabled from the ‘Hinting\Shortcut Hints’ options page. 
    This page is only visible if the level dropdown is set to ‘Advanced’ or higher.

    Summary

    This post is meant to give you a small taste of the types of notification that you might see in CodeRush as it attempts to better inform you as to what is happening.
    There are several more and indeed they are described far better in the Official CodeRush Documentation.

    So once you’re ok with those presented here, feel free to go check out some of the others

  • The CodeRush Options Screen

    The Options screen is launched via the Ctrl+Shift+Alt+O hotkey. If you have CodeRush rather than CodeRush Xpress then you can also use the ‘DevExpress \ Options’ menu.

    OptionsIDEShortcuts

    The screen is divided into a number of sections:

    The Page Tree
    PageTreeNewUser
    The left hand box is a tree of option pages.

    Note: The option pages are not hardcoded into the system. Instead plugins are detected by the DXCore at runtime and associated options pages are placed in this hierarchy as directed by the author of the plugin. This makes it very easy for 3rd parties to write plugins that integrate seamlessly into the CodeRush environment.

    As you might expect, the folders and sub folders listed in the tree are suggestive of the option pages that they contain.

    Note: It can be helpful to remember that the Editor and the IDE are not the same thing. The IDE is the whole of Visual Studio. If it’s visible, it’s part of the IDE. The editor, by contrast, refers to that area of the IDE in which code/text (Vb.Net/ C#, XML) is entered.

    Given the amount of CodeRush customization that I tend to do, I find that my most often used options pages are ‘Templates’ and ‘Shortcuts’.

    The Templates option page is located in the ‘Editor’ folder because the editor is where you enter and expand templates.

    By contrast the Shortcuts options page is found in the IDE folder because of the more global nature of shortcuts.

    The Search Box
    SearchSettingsThe box in the upper left-most of the option screen, is used to incrementally search the available pages by their title. So if you start to type ‘shortcut’ or ‘template’ into this box, the page tree will attempt to locate the first option page, whose name contains this phrase.

    The Level Dropdown
    LevelComboOptions pages are allocated a level: ‘New User’, ‘Advanced’ or ‘Expert’. This level is used to indicate the complexity of the features being touched upon. CodeRush will hide option pages who’s level exceeds the value provided in this dropdown. Since the system defaults to ‘New User’, this helps to prevent overloading a new user with too much information all at once. Additionally in the upper right corner of each page, you can see a coloured shape which represents the level of the current page. Try to get familiar with the content of the simpler pages, before enabling the 2 further tiers.

    The Nav Buttons
    NavButtonsIn the upper right corner of the screen, there are some Nav buttons. These function in the same way as the ‘back’ and ‘forward’ buttons in your favourite browser, allowing you to navigate back to a page previously visited, and then forward again to where you started.

    The Language Dropdown
    LanguageComboThe content of some pages can be filtered based on language.

    For example Templates are available for C#, VB.Net, SQL, HTML, XML and others. It wouldn’t be sensible to try and show all of these at the same time, as this would very quickly overwhelm the user. Instead the Language dropdown acts as a filter, with which the user can indicate the set of templates they wish to work with at the current time.

     

     

     


    Default Settings


    DefaultSettingsSome pages support a “Default Settings” button. This will nuke the settings for the page in question and restore them to factory settings. However if you feel the need to restore all of your settings to default status, see the next section.

    Where are my options stored?
    If you feel the need to backup, restore or just plain nuke your current settings, you can find them in a folder beneath your windows profile. One way to locate this folder is to visit the ‘DevExpress\About’ dialog and press the ‘Settings’ button.

    DevExpressAbout1015

    Alternatively you can type ‘%AppData%\CodeRush for VS .NET\1.1\Settings.xml’ into your explorer bar and hit enter.

    ExplorerBar

    The folder that opens (Settings.xml) contains everything you need to backup with regard to your settings.

    If you delete or rename this folder, then CodeRush will rebuilt it for you from factory settings when next accessed.

    Misc.

    …and finally a few minor items that don’t necessarily belong in any of the previous sections.

    • The options screen will remember and display the last options page you viewed.
    • The Shortcuts page will remember and display the shortcut you were looking at when last you visited it.
    • The Templates page will automatically locate the last Template you expanded.

    In future posts, we’ll delve into some of the more specific options found within the pages of the options screen. If you have any questions regarding the options screen in general, feel free to post them and I’ll do my best to answer.

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