Mark Miller

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!

Published Dec 14 2016, 03:50 PM by
Bookmark and Share

Comments

James S K Makumbi

Oh my goodness SMART DUPLICATE LINE!!

I have been using copy and paste THE WHOLE TIME!!

The reason we code is to automate repetitive tasks. So when you spend thirty seconds writing duplicate lines of code.... there is some guilt, self doubt, a "code whiff" (a false code smell) and self loathing.

Many a time have I gone off on a quixotic tangent try to code a clever data structure to replace the duplicate lines of code.

Thanks for scratching that itch. Now go wash your hands!!

December 14, 2016 4:27 PM

Dom Sinclair

Great to see CRR starting to gain all the goodness that was in classic, really missing the Code Rush Training window though (an immeasurable help in trying to remember some of the crazy acronyms appointed to my own templates). Do you see that being implemented any time soon?

December 15, 2016 4:26 AM

Mark Miller (DevExpress)

Hi Dom,

Porting the CodeRush training window is currently on our backlog. It is unlikely to be implemented in the next 45 days, however it is likely to ship in the next year. At this time I am unable to get you a tighter window for expected delivery..

December 16, 2016 2:08 PM

Stephen Kennedy 3

Will CR Classic be upgraded to 16.2, or is version 16.2 just for CR for Roslyn? Any idea how long CR Classic will be continuing to get these kind of updates? Is there a time where CR Classic will no longer get updates like this?

December 20, 2016 10:19 AM

Mark Miller (DevExpress)

Hi Stephen,

We expect CR Classic to continue to receive maintenance updates (correcting reported issues) in the coming years, however we do not expect CRC to receive any additional features in that time frame.

December 27, 2016 9:33 AM

OFIR BARLEV 1

Great stuff!

What about "Clipboard History"?

Is it planned to be ported? Any timelines?

December 28, 2016 9:59 AM

Mark Miller (DevExpress)

Ofir,

Clipboard History is expected to be ported later in 2017.

December 28, 2016 1:07 PM

About Mark Miller (DevExpress)

Mark Miller is a C# MVP with strong expertise in decoupled design, plug-in architectures, and great UI. Mark is Chief Architect of the IDE Tools division at Developer Express, and is the visionary force behind productivity tools like CodeRush and Refactor!, as well as the DXCore extensibility layer for Visual Studio. Mark is a popular speaker at conferences around the world and has been writing software for over two decades.
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