Mark Miller
  • CodeRush for Roslyn 17.1.8 is Available

    Another 30 days, another release of CodeRush for Roslyn. This release brings improvements in .NET Core 2.0 support, code formatting, code analysis, code providers, and templates.

    .NET Core 2.0 Support

    The Unit Test Runner now runs .NET Core 2.0 tests and can calculate Code Coverage in Portable PDB debug-symbols-format projects. Also, the Unit Test Runner gets a performance boost when running .NET Core tests.

    Code Formatting

    We have added a new code formatting feature that controls spacing options in your code. Now you can add or omit spaces around virtually every part of code, with more formatting options available than what you get with Visual Studio alone. Spacing style code formatting rules are applied with the Code Cleanup feature.

    Formatting_Spaces

    We have also improved XAML formatting, adding the ability to format markup extensions. You can now control the following options:

    • Break arguments apart only if the argument count for an element exceeds a specified count.
    • Align markup extension arguments with first argument.


    Code Analysis

    This release includes a preview of a new feature we’ve been working on, NullReferenceException Analysis. This feature identifies unprotected code that may unintentionally raise NullReferenceExceptions.

    Null-reference exceptions are often thrown in unexpected, edge-case scenarios, and can easily remain undetected even after publishing your software. These code defects are challenging to find and are often discovered by customers after the application has shipped.

    CodeRush for Roslyn now identifies code that may be prone to throwing a NullReferenceException. You can turn this feature on for C# (it is disabled by default) on the Editor | All Languages | Static Code Analysis options page:

    NullRefSearch

    Turn this feature on and let us know what you think.

    Refactorings and Code Providers

    We have added a new Add XML Comments code provider, which lets you instantly add new XML doc comments to members.

    If you use Add XML Comments for a member that is an override or an interface implementation, the XML doc comment is based on the documentation found in the interface or ancestor class. If the target method has no base method or its base method or interface declaration has no XML comment, the code provider generates an empty XML comment with the correct structure.

    Local Function Templates

    Templates for creating methods are now available inside members in C# (for C# version 7 and above) to create local functions:

    LocalFunctionTemplates

    For more information on using templates to create methods and write code quickly, see the M for Methods video in the CodeRush Feature of the Week series.

    ClickToWatch_0C42A107

    Thanks For Your Support!

    You can always download CodeRush for Roslyn from the Visual Studio Marketplace.

    If you’re already using CodeRush for Roslyn and enjoying it, please share a review with other Visual Studio developers!

  • CodeRush 17.1.7 Released

    This release of CodeRush for Roslyn, our Visual Studio productivity boosting add-in includes enhancements to code coverage, code analysis, and more. This release also includes a preview release of project-wide code cleanup.

    Code Coverage

    You can now exclude specific projects from Code Coverage analysis using the *.runsettings file. For details refer to Microsoft’s article, Customizing Code Coverage Analysis.

    ExcludeFromCoverage

    You can now create and apply Filters to the Code Coverage report. For example, you can create a filter that only shows members with less than 70% coverage.

    FilterCoverage

    Code Analysis - Unused Members

    We have added a new analyzer that detects unused members.

    HighlightUnused

    You can also configure unused member highlighting in the CodeRush options dialog (Editor | All Languages | Static Code Analysis | Highlight unused members).

    HighlightUnused2

    Unused members can be safely deleted without changing program behavior.

    Refactorings and Code Providers

    The Use string.Format refactoring is now available on interpolated strings.

    Project-wide Code Cleanup (Preview)

    You can now run Code Cleanup for the entire project. Simply right-click the project you want to clean in the Solution Explorer and select Cleanup Project from the context menu.

    CleanupProject1

    As CodeRush cleans the project, a window shows progress.

    CleanupProject

    If code cleanup is cancelled, all code files will remain unchanged.

    Reminder: This feature is in a preview state, and may break or change the behavior of your code. If you find Code Cleanup yields unexpected results, please let us know. You can globally undo the entire operation using the Visual Studio’s Undo action (available when any document changed by code cleanup is open).

    Download CodeRush for Roslyn from the Visual Studio Marketplace.

  • How Visual Studio’s Private Gallery Helps Us Create a Better Product

    When we started working on CodeRush for Roslyn, we realized we needed a convenient way to deliver updates to our customers.

    We knew that Visual Studio already provided a great tool for extension developers - the Extensions Gallery on the Visual Studio Marketplace. This public repository makes it easy to deliver polished updates to the world, but we also wanted internal developers using CodeRush for Roslyn to have the same experience in their daily work. We wanted to make it as easy for them to participate in beta testing and getting new beta updates as it is for customers to get new releases of CodeRush: Automatically.

    Fortunately the Visual Studio Extensions Gallery lets us add a private source for extensions, which can be used to deliver updates for a selected group of beta testers.

    I’d like to share our experiences with the Private Gallery and show how we found it to be an effective tool in creating better products for customers.

    Daily Builds

    When you are working in an agile environment, it is crucial to have a rapid update cadence and a stable channel to reliably deliver those updates to testers, internal users, and customers.

    In building our products at DevExpress, we use an internal build farm that executes the entirety of the test and build process automatically, running on dedicated hardware. This allows developers to remotely generate new builds in a matter of minutes. Once a build is ready, we can distribute that build using the Private Gallery. This combination of dedicated build farm plus effortless & precisely-targeted distribution allows us to easily provide updates for our beta testers daily, or more frequently if needed.

    Quality Assurance

    This workflow is indeed fast with barely a hit on resources, but what about quality? Since our developers are constantly pushing code out to our development branch through version control, we must take preventative steps to ensure that new code doesn’t break existing features before giving it to our testers. And since CodeRush is an extension to Visual Studio, our beta testers are also using it to create production code. So every beta we ship has to be solid. For us, we found having a comprehensive suite of unit and integration test cases goes a long way in ensuring solid builds. If one test case fails, the build farm doesn’t allow an upload to the Private Gallery.

    So what does a comprehensive testing suite look like? For us, that means about 36,000 unit tests, which thoroughly covers about 75% of our code. We also have nearly 500 full-blown integration tests, which start instances of Visual Studio and ensure CodeRush for Roslyn properly loads, MEF composition binds as expected, and integrated features are operating correctly.

    Having a comprehensive suite of tests is essential to being able to deliver high-quality daily builds to your testers. It is so important, that it has changed how we work. For example, developers on our team are not allowed to check in any new features without also checking in supporting test cases to prove the code works as expected (and that it doesn’t work in unexpected ways). And developers are not allowed to submit bug fixes without also submitting new test cases proving that the fix works.

    So we definitely consider our test suite to be a valuable company asset, one that every developer continues to invest in as we move forward.

    Setting up the Private Gallery

    The first step in setting up a Private Gallery is to specify which URLs Visual Studio will use to download details about any updated extensions.

    To do this, open the Options window using the Tools | Options menu, then navigate to Environment | Extensions and Updates options page. To the right of the Additional Extension Galleries list box, click the Add button, then specify name and URL for the Private Gallery:

    AdditionalExtensionGalleries

    In the example above, we’ve named our gallery “Custom Gallery�� and specified http://localhost:5000/custom.xml as the URL.

    Click OK to close the Options dialog.

    Now, if you bring up the Extensions and Updates dialog, and open the Online category, Visual Studio will show our new Private Gallery:

    NewPrivateGalleryAppears

    Unfortunately, if you try to use it right now, Visual Studio will likely complain about its inability to connect to the remote server. Don’t worry. This is expected at this point because we also need to setup a server to supply an Atom Feed file for the extensions we want to distribute.

    The Atom Feed File

    The Atom Feed file is an XML file containing a list of all the extensions available in the gallery. Each entry in the list includes essential information, such as extension ID, version details, author, etc. Official documentation on Atom Feed files already exists in the Atom Feed for a Private Gallery article, so we won’t dive into the details and structure here. However, we will show you how we dealt with the hardest part: generating and updating this file.

    Check out the code in this project which updates the Atom Feed file each time you build and publish your extension. It is a console application expecting two command line parameters: the VSIX file path and the destination folder to be served by an HTTP(s) server. For example, you might add a call like this to the UpdateAtomFeed application inside your build script:

    UpdateAtomFeed.exe "C:\Builds\TestExtension.vsix" "C:\GalleryServer\wwwroot"

     
    The UpdateAtomFeed application copies the VSIX file to the specified server folder, then extracts the VSIX information and creates a custom.xml Atom Feed file (or updates an existing Atom Feed file if found).

    A Simple .NET Core Atom Feed Server

    Both the Atom Feed file and your VSIX files need to be hosted on a server available to your network, so let’s create a small .NET Core server application that does just that.

    Start by creating a new .NET Core console application and name it “GalleryServer”. Then add the following NuGet dependencies:

    • Microsoft.AspNetCore
    • Microsoft.AspNetCore.Hosting
    • Microsoft.AspNetCore.StaticFiles


    Next, add the following code which creates and configures our static file server:

    using System.IO;     
    using Microsoft.AspNetCore.Hosting;  
    using Microsoft.AspNetCore.Builder;  
    using Microsoft.AspNetCore.StaticFiles; namespace GalleryServer {
        public class Startup {
            public void Configure(IApplicationBuilder app) {
                var provider = new FileExtensionContentTypeProvider();
                provider.Mappings[".vsix"] = "application/vsix";
               
                app.UseStaticFiles(new StaticFileOptions() {
                    ContentTypeProvider = provider
                });
            }
            public static void Main(string[] args) {
                string path = Directory.GetCurrentDirectory();
                string wwwRootPath = Path.Combine(path, "wwwroot");
                new WebHostBuilder()
                    .UseKestrel()
                    .UseWebRoot(wwwRootPath)
                    .UseContentRoot(wwwRootPath)
                    .UseStartup<Startup>()
                    .Build()
                    .Run();
            }
        }
    }

    This console app listens to the  http://localhost:5000 address and starts serving static files from wwwroot folder:

    ListeningLocalHost

    Note that in the code we have also specified a FileExtensionContentTypeProvider and registered the .vsix extension mapping as an application/vsix MIME type. This is necessary to serve VSIX files, because VSIX is not one of the standard file types.

    Now when you open Tools and Extensions, Visual Studio should reveal our new test extension:

    NewTestExtension

    Nice. And now we can now use our Private Gallery to easily install & update new builds of this extension.

    Of course, we also need to allow connections from outside our local host, so the gallery becomes available to users outside our network. On Windows we can use IIS to accomplish this.

    Wrapping Up

    For us, the benefits of agile development are amplified when the edit/compile/test/build/distribute/feedback cycles are short. Thanks to Visual Studio’s Private Gallery options, along with our build farm and comprehensive test cases to ensure product quality, we were able to shrink that typical feedback loop (which can lumber on for days, distracting valuable resources) down to a cycle measured in just a few hours and with very little impact on existing resources.

    Full source code and samples are here.

    Written by Alex Zakharov & Mark Miller

  • CodeRush for Roslyn, Version 17.1.6, is Available

    This month’s release of CodeRush for Roslyn adds new code formatting options, expands the capabilities of the source code spell checker, improves the ForEach to Linq refactoring, and ports over a useful organizational feature from CodeRush Classic.

    New Code Wrapping Rules

    New formatting rules let you specify exactly how you would like to align code when it needs to wrap across multiple lines. Just specify the right margin column, and then decide what to wrap and how those wrapped lines will line up.

    17.1.6-Wrapping

    Check out the before & after previews in the screenshot above to get a sense of how cool this is.

    This is a great feature, and an easy way to improve the code readability. You can create custom wrapping rules for a wide range of expressions and initializers.

    Formatting options are applied through the Format Document rule, which can be included as part of CodeRush’s Code Cleanup feature. You can specify which rules to apply on the Code Cleanup options page:

    17.1.6-wrapping-cleanup

    Spell Checker

    The CodeRush Spell Checker gets an update. In this release we can now:

    • Check XML comments (<c> and <code> tags are ignored).
    • Check File Names.
    • Exclude ToString() expressions.
    • Properly handle Microsoft.Naming suppressions. The Spell Checker now ignores words suppressed using the SuppressMessage attribute.
       

    We have also added a new toolbar button to toggle the Spell Checker on and off.

    17.1.6-SpellChecker

    Code Style

    Now you can set your preferred order for member modifiers keywords (“static”, “public”, “virtual”, etc.). CodeRush for Roslyn features will maintain this order when adding or removing modifiers. For instance, you can set public and private modifiers to be placed before the static modifier. This feature is available for C# only, as Visual Studio automatically sorts modifiers in Visual Basic.

    We are also synchronizing the following Code Style settings with similar code style settings found in Visual Studio:

    • Local Declaration Style
    • Built-in Type Names
    • this/Me Qualifier Usage

    If you change any of these settings in Visual Studio, the corresponding settings in CodeRush will be updated to match your changes. If you subsequently change the CodeRush settings, that will not alter the Visual Studio settings.

    And we have added the new Attribute List Code Style & Code Cleanup rule, allowing you to combine two or more attributes when they are applied to a single member.

    17.1.6-AttributeList

    See the before & after previews in the screenshot above to see an example.
     

    Improved Refactoring

    We have improved the ForEach to Linq refactoring so it generates cleaner code in more complex cases. The following Linq functions are now nicely supported by the query generator:

    • Aggregate
    • All
    • Any
    • Cast
    • Count
    • Distinct
    • FirstOrDefault
    • LastOrDefault
    • Select
    • Where

    Move Member to Region

    We have ported the Move Member to Region feature from CodeRush Classic. You can now create regions and move members to them easily. Simply click a member icon, select Move To Region and choose the target region.

    17.1.6-MoveToRegion

    Thanks For Your Support!

    You can always download CodeRush for Roslyn from the Visual Studio Marketplace.

    If you’re already using CodeRush for Roslyn and enjoying it, please share a review with other Visual Studio developers!

  • CodeRush for Roslyn, Version 17.1.5 is Available

    Another 30 days, another CodeRush for Roslyn release. In this update we port a popular feature for XPO developers, add code generation options, add commands to extend the selection outwards by sibling nodes, and increase the speed of Tab to Next Reference. See the What’s New list for complete details.

    As always, you can download CodeRush for Roslyn from the Visual Studio Marketplace.

    If you’re already using CodeRush for Roslyn and you’re enjoying it, please share your review with other VS developers.

    Also, be sure to check out our CodeRush Feature of the Week series on YouTube, where Rory Becker and I dive into CodeRush features in detail. Here’s a link to the first in the series, where you can see the Tab to Next Reference feature we tuned in this release:


    ClickToWatch

  • CodeRush for Roslyn 17.1.4 is Available

    Another sub-30-day sprint, another release. Here’s what’s new in this version of CodeRush for Roslyn:

    Navigation

    • Drop Marker gets enhanced, gaining the ability to mark and restore selections (in addition to caret positions). Useful when you have the selection you want but then realize you need to do something else first before you modify/cut/copy/delete the selection. Just drop a marker, move the caret to wherever you want to be, and when you’re ready press Escape to restore the selection. Also useful for presenters who want to need do quickly highlight code.

      CollectSelections
    • Jump to File and Jump to Symbol both gain a new Recent Items section.

      JumpToFileRecentItems

    Refactorings and Code Providers

    We widened the accessibility of many refactorings and code providers, making them available when the caret is anywhere on the line containing the relevant code you want to change. Providers with broader accessibility include:

    • Collapse/Expand
    • Compress/Expand ternary expression
    • Flatten Conditional
    • Reverse conditional
    • Use Expression Body

    Unit Testing

    In this release we have excluded the PhantomJS library from the install, allowing you to specify the path to your preferred PhantomJS library. If the PhantomJS library is not found, the Jasmine Test Runner prompts you to install it through npm or NuGet.

    Code Generation

    • You can now choose where you’d like CodeRush to place newly-generated type declarations. Locations include: Above the active type, Below the active type, or In a newly-created file. Use the Editor | <Language> | Code Actions | Code Actions Settings options page to change this option.
    • You can now configure naming conventions for generic types.

    Install the Latest Version Today

    You can download and install the latest version of CodeRush for Roslyn from the Visual Studio Marketplace. Give it a try and let us know what you think.

  • CodeRush for Rosyln 16.2.8 is Available

    Another sprint, another release of CodeRush for Roslyn. You might have noticed we’ve stepped up our update frequency, with sprint/release cycles occurring in 30 day intervals.

    Here’s what’s new in this release:

    This release introduces the Declare menu, a quick and easy way to add needed code to your types.

    DeclareMenu

    These declarations are now available:

    • Automatic Constructor generation (which also automatically initializes selected members).

      Constructor1
      Just select the type’s members that you want to initialize, and press Enter. Some of the Declare providers have additional options, which can be accessed by tapping the Ctrl key. For example, with the Constructor UI, tapping the Ctrl key will offer options for constructor visibility, as well as an option to generate properties.

      Constructor2

      So given this starting point:

      ConstructorCode1

      The generated code for this provider might look something like this:

      ConstructorCode2

    • Delegate Members is useful when you want to surface a field’s or property’s members up to the active type. This provider creates members that wrap around the contained field’s or property’s members. For example, if your type contains a generic List of strings (as a field or property), like this:

      NewListStr

      Delegate Members can wrap that List’s Count property in its own property, as well as its indexing methods in delegating methods, surfacing these members in your class, like this:

      DelegateMembers

      Which would generate code looking something like this:

      DelegateMembersCode2

      Delegate Members makes object composition easy.
    • IDisposable Implementation generates the Dispose pattern, disposing the specified fields and properties. For example, given this starting point:

      IDisposable1

      And these options:

      iDisposableUI

      The generated code would look something like this:

      IDisposable2
    • Equality Members generates two Equals methods and a GetHashCode override, and can optionally generate equality/inequality operator overloads.

      EqualityMembers
    • Override Members overrides virtual and abstract methods. For example, given the following code:

      OverrideCode1

      And with the caret inside the CellPos3D class, pressing Alt+Insert to bring up the Declare window, and then setting these options:

      OverrideMembers

      The following code is generated:

      Override2
    • Properties and Read-only Properties generate properties for the selected fields. For example, given the following code:

      ReadOnlyPropertiesCode1

      And these options:

      PropertiesUI

      The following code is generated:

      ReadOnlyPropertiesCode2
    • Comparison Members generates a CompareTo implementation, individually comparing the specified fields, and optionally implements the IComparable<T> and IComparable interfaces. For example, given this starting code:

      ReadOnlyPropertiesCode1

      And these options:

      ComparisonMembers

      The following code is generated:

      ComparisonMembersCode2
    • Missing Members implements any interface members missing from the active class. For example, given the following starting code:

      MissingMembersCode1

      And with the caret inside CellPos3D, applying the Missing Members provider with these options:

      MissingMembersUI

      will generate the following code:

      MissingMembersCode2

    You get the idea. To try out the new Declare features, just position the caret inside the class you want to modify and press Alt+Insert.

    Clipboard History

    Version 16.2.8 introduces the Clipboard History list, providing complete visual access to your ten most-recent clipboard operations. Instantly paste with the Ctrl+number shortcut. Filter through the list just by entering the text you’re looking for. Ctrl+Shift+V brings up the Clipboard History list.

    ClipboardHistory

    Jasmine Test Runner (beta)

    In this release, we’re introducing the beta version of the Jasmine Test Runner for JavaScript and TypeScript. This feature, in its current state, should be considered a technical preview, but you can already run Jasmine tests with it using the CodeRush Test Runner window. This beta works with the following restrictions:

    • Test discovery is not implemented yet. Every file with unit tests should reference the Jasmine framework (e.g., contain the following string at the beginning: “/// <reference path=‘path/to/jasmine.js’ />”).
    • Currently all of the project’s JS files will appear in the Test Runner. You can Ctrl+click to multi-select the test files you want to run, or you can right-click a file and add it to a new or existing Test Runner session, allowing you to easily run all tests in all files held by that session at once.
    • Test Debugging and Code Coverage are not yet implemented.

    JasmineTestRunner

    More C# 7 and VB 15 Syntax Support

    The following features have gained new capabilities to more deeply support the latest language features, including:

    • Debug Visualizer now supports for the new switch language features.

      DebugVisualizerSwitch
    • Smart Duplicate Line now supports binary literals and digit separators.

      SDL_VB15
    • Expand Method, Expand Property, Expand Getter and Expand Setter refactorings all now support the new language features.

    Other Improvements

    • Asynchronous extension loading, so CodeRush for Roslyn loads even faster.
    • Paste Replace Word (default shortcut is Ctrl+B) is now available in XAML markup.
    • Added support for directories and projects in the Jump To File window.
    • Implement IDisposable code provider implements the dispose pattern in your types.
    • Encapsulate Property wraps a field’s properties (declared by the field’s type) in new properties declared in the active class/struct.

    You can get the latest what’s new list and a list of corrected issues here.

    Give it a Try!

    We encourage you to download CodeRush for Roslyn and give it a try.

    As always, we thank you for your continued support and feedback. Let us know what we can do to make your coding experience even better.

  • CodeRush for Roslyn 16.2.7 is Available

    Today Team CodeRush completed another 45-day sprint, releasing version 16.2.7 of CodeRush for Roslyn. This shiny new version includes C# 7 support, new refactorings, and code declaration tools.

    C# 7 Syntax

    CS7

    We have updated a number of features to support the new C# 7.0 language spec. The Expand\Compress Ternary refactorings, the Smart Return (‘r’ template), and our Declare providers have all been updated to exploit new language features.

    New Code Style Rules

    You can now choose one of three styles for placing new namespace reference imports/using declarations: place new imports/using references at the top of the file, place new imports/using statements inside the active namespace, or use fully qualified type names.

    NamespaceOptions

    New XAML Features

    XAML developers get two new refactorings: Convert Nested Element to Attribute and Convert Attribute to Nested Element. These refactorings move attribute from a XAML tag to become a child element (and vice versa, moving a child element up to become an attribute of the parent tag). These refactorings can improve XAML readability when there are excessive complicated attributes or when the nesting level gets excessively deep.

    ConvertNestedElementToAttribute

    Also, for the C# & VB code behind the XAML, we’ve added two new code providers to make it easier to declare properties in classes that implement the INotifyPropertyChanged interface (more details below).

    Refactorings and Code Providers

    In addition to the new C# 7.0 upgrades mentioned above, we have improved and broadened a number of existing code gen/mod features, including:

    • Use Expression Body now works on constructors, destructors, getters and setters.
    • Move Type to Namespace and Extract String to Resource are now more organized and easier to execute with the new Code Actions sub-menu.

      OrganizedSubmenu
    • Two new Code Providers, Introduce Change Notification and Convert to Property with Change Notification make implementing the INotifyPropertyChanged interface for the active property effortless.

    Consolidated Install

    To simplify the installation experience across multiple versions of Visual Studio, we now have a single CodeRush for Roslyn installer designed to install CodeRush to all supported IDE versions at once, available through the DevExpress Download Manager.

    ConsolidatedInstall

    Give CodeRush a Try

    You can get the latest version of CodeRush for Roslyn from the Visual Studio Marketplace.

    If you’re an existing customer, we thank you for your business. We are working hard to keep CodeRush fast & lean while we continue to ship powerful and intelligent features every 45 days.

    If you’re thinking about giving CodeRush a try, we encourage you to install CodeRush today. We expect you’ll find it a powerful addition to Visual Studio, and one that’s easy to use.

    As always, let us know what you think!

  • What’s New in CodeRush for Roslyn v.16.2.5

    Team CodeRush continues our 45-day sprint/release cycle, and we have some treats for you in this update.

    All-new Symbol Naming Assistant

    This is a brand new feature designed to help you quickly name new symbols (members, variables, and parameters).

    The Naming Assistant window automatically opens when you start typing a new symbol name. The suggestion list is filtered as you type, and you can use a subset of the letters in the symbol you want to filter quickly. For example, in the screencast below, typing “mb” filters the suggestions to only show “modelBuilder”.

    NamingAssistant

     

    Code Metrics Are Back

    Code Metrics were a popular feature in CodeRush Classic, and we’re pleased to announce the feature has been ported to CodeRush for Roslyn.

    Code Metrics reveal the complexity of each member, using one of three popular metrics (Cyclomatic Complexity, Maintenance Complexity, or Line Count).

    You can enable the feature on the Editor\All Languages\Code Metrics options page:

    EnableCodeMetrics

    Once enabled, metrics will appear to the left of the member declaration:

    CodeMetricsCU

    You can select a different metric with the mouse, by clicking the metric number and using the menu:

    MetricsAreBack

    Decompiler

    The CodeRush Decompiler gets some improvements. Anonymous methods now appear inline, nullable types are listed with the “?” modifier (e.g., “int?” instead of “Nullable<int>”), and XML documentation comments now appear in decompiled code.

    Navigation

    The References Window now lets you jump quickly among references. When the window is open, press F8 to jump to the next item and press Shift+F8 to jump to the previous item. Also, you can now use the Jump To dialog to navigate through all currently open files.

    Refactorings

    Two new refactorings:

    • Move Type to Namespace changes the namespace of the active type and updates all references.
    • Introduce Using Statement replaces object creation and dispose code blocks with a using statement, improving code readability and ensuring locally-used objects are properly disposed.

    Smart Duplicate Line

    Now, when duplicating items in collection initializers and in parameter lists, commas are added automatically if needed.

    New Visualizations

    Two improvements to make it easier to understand what’s happening in your code:

    • Region Painting, which implements a low-contrast visual representation of **#region** directives, reducing visual noise where regions are used:

      RegionPainting

    • Output Window Highlighting, where errors and warnings in the Output window can be emphasized with saturation, making it easier to recognize important messages faster.

      ErrorHighlighting

    We also addressed a number of reported issues. As always, we welcome your feedback.

    You can download the latest version of CodeRush for Roslyn from the Visual Studio Marketplace. Give it a try and let us know what you think!

  • CodeRush for Roslyn, v. 16.2.3 is Available

    Continuing our 45-day sprint/release cycle, today we release another update to CodeRush for Roslyn. Highlights of this release include powerful new refactorings & code providers, along with enhancements to Smart Duplicate Line.

    New Refactorings and Code Providers

    • Convert to Function – Allows you to easily convert a method that returns void into a function that returns the appropriate type (matching the type of the expression returned). I find myself frequently using this refactoring because it's fast, smart, and I can invoke it from inside the method (with the caret on a return statement). There’s no need to reach for the mouse or move the caret up to the declaration. Here’s what it looks like:

      ConvertToFunction
    • Convert to Procedure – This code provider is the opposite of Convert to Function. It converts a method that returns a value of any type to a proc that returns void (or a Sub in VB).
    • Extract Interface – This refactoring creates an interface based on the public members of the active class, and modifies the active class so it implements the extracted interface. 
    • Widen Scope (promote to field) - Use this to move a local variable declaration from inside a method body out to become a private field of the parenting class.

    Smart Duplicate Line Gets Smarter

    In our last release, we introduced Smart Duplicate Line (Shift+Enter). This feature is a real time saver, allowing you to create new lines of code modeled on existing lines of code. Smart Duplicate Line (SDL) looks for patterns in the surrounding code, and attempts to predict the parts you’re likely to change. As a result, SDL is great for declaring constants, enum elements, properties, and POCOs.

    In this release, we make SDL even smarter.

    For starters, SDL now works in XAML:

    SDL_Xaml

    And SDL now recognizes (and increments) patterns of numeric primitives of type integer, double, decimal, octal, float, and hex:

    SDL - Enums Hex

    And SDL can cycle through enum elements in the code automatically:

    SDL - enum cycle

    SDL is one of my favorite new features. Be sure to try it out (Shift+Enter) and let us know what you think, and also send us your suggestions for how we can make it even smarter.

    Other Enhancements

    • Paste Replace Word – Replaces the identifier under caret with the one on the clipboard in a single keystroke. Press Ctrl+B when the caret is on an identifier to immediately replace it with the contents on the clipboard.
    • Navigation features now support XAML bindings.
    • We added submenu support to the Code Actions menu, offering contextually-related actions (e.g., contract actions, spelling suggestions, etc.) in a single submenu (thereby cleaning up the main Code Actions menu).

      AddContract
    • We have added the ability to collect a marker and immediately paste clipboard contents at the target location using a single keystroke (Shift+Esc).
    • We have added a menu item allowing you to clear all markers dropped in the document.
    • You can now group Code Issues and References by folder containing the source code file.

      GroupByFolder

    We also addressed a number of reported issues. As always, we welcome your feedback.

    You can always download the latest version of CodeRush for Roslyn from the Visual Studio Marketplace. Give it a try and let us know what you think!

1
2 3 4 5 6 7 8 9 10
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