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.
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:
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:
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.
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!