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.
These declarations are now available:
- Automatic Constructor generation (which also automatically initializes selected members).
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.
So given this starting point:
The generated code for this provider might look something like this: - 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:
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:
Which would generate code looking something like this:
Delegate Members makes object composition easy. - Equality Members generates two Equals methods and a GetHashCode override, and can optionally generate equality/inequality operator overloads.
- Override Members overrides virtual and abstract methods. For example, given the following code:
And with the caret inside the CellPos3D class, pressing Alt+Insert to bring up the Declare window, and then setting these options:
The following code is generated: - Properties and Read-only Properties generate properties for the selected fields. For example, given the following code:
And these options:
The following code is generated: - 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:
And these options:
The following code is generated: - Missing Members implements any interface members missing from the active class. For example, given the following starting code:
And with the caret inside CellPos3D, applying the Missing Members provider with these options:
will generate the following code:
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.
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.
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.
- Smart Duplicate Line now supports binary literals and digit separators.
- 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.