ReSharper 2017.2

ReSharper 2017.2
Use code inspections, navigation actions and refactorings with .NET Core 2.0 projects.


Feature Release

September 01, 2017 - 10:46
ReSharper 2017.2
ReSharper 2017.2
  • .NET Core 2.0 - With ReSharper 2017.2, you can safely use your favorite code inspections, navigation actions and refactorings with .NET Core 2.0 projects. If you're a web developer, expect ReSharper to work in ASP.NET Core Razor Pages projects as well as in MVC-based web applications. ReSharper's Solution Builder now supports .NET Core projects, helping you reduce the time you spend recompiling your applications.
  • Improved C# 7.0 support
    • The switch postfix template is now available on variables of non-sealed reference types.
    • A new context action, Generate type patterns, helps easily generate switch cases for selected types.
    • The Convert to switch quick-fix has been completely reworked to transform multiple if statements into a single switch statement with patterns.
    • ReSharper can now suggest using var (or, depending on your code style, the use of explicit types) in out variables. In addition, it adds inspections and quick-fixes to introduce out variables instead of variables that are only used for method calls with out parameters.
  • Understanding C# 7.1
    • C# 7.1 adds the default literal that can be used instead of the default(T) expression, inferring target type based on usage context. ReSharper recognizes the default literal syntax, provides an inspection when default(T) is used, and suggests a quick-fix to remove redundant type specification.
    • ReSharper also supports tuple projection initializers with an inspection that reveals redundant tuple value component names when they can be inferred from initializer.
    • ReSharper understands async main and pattern matching with generics.
  • New IEnumerable inspections - ReSharper's set of IEnumerable inspections was extended to accommodate new scenarios:
    • The Possible multiple enumeration code inspection can now consider types derived from IOrderedEnumerable and ParallelQuery.
    • A new code inspection detects possibly unintended transformation from IQueryable to IEnumerable.
  • More code inspections and context actions - In C# 7.1, a value tuple's element names are inferred, and ReSharper will help you spot redundant value tuple component names. Also, the Initialize auto-property from parameter context action is now aligned with the quick-fix, providing the same extensive set of options.
  • Null checking preferences - A new options page, Null checking has been added, where the priority of null checking patterns used by quick-fixes, context actions and code generation actions can be configured. You can even create your own custom checks.
  • Navigation and search improvements - Go to Everything and other navigation actions are now able to match elements containing words in the target query in any order: for example, a search for exactMatching will match isMatchingExactly. Also, there is now an exact search feature. However, while using exact search to filter out compound names, you can still use wildcard symbols * and ? to allow exactly as much variation as you need. Go to text is now integrated in Go to Everything (Ctrl+T): if there's no code that corresponds to your search term, ReSharper will start looking for text instead. In addition, you can now search for extension methods using the dot separator: Class.ExtensionMethod. Finally, ReSharper 2017.2 brings a new shortcut to explore search results in the Find Results window. Press Shift+Enter instead of + on the numeric keypad.
  • Navigate to file nearby - Contextual navigation in ReSharper 2017.2 received a boost as well: using the Navigate To menu, you can now look at and navigate to files that are adjacent to the current file in the structure of your project: browse folders and files in the same directory level as the current file, easily jump to these files or create new ones.
  • inheritdoc support improvements
    • New inspections were introduced to support the usage of inheritdoc in XML documentation.
    • ReSharper detects when there are multiple candidates for inherited documentation, shows a warning and suggests a quick-fix to insert a cref reference. In the generated cref attribute, ReSharper will conveniently show the completion list with all possible types to reference.
    • A warning is now shown when a derived class overrides documentation of its base class.
  • New C# typing assists
    • ReSharper allows you to quickly mark arguments with NotNull and CanBeNull attributes without actually typing the whole attribute name. Typing ! or ? after a type name, name in parameter or member declaration inserts a NotNull or CanBeNull annotation, respectively. If a name is already marked with NotNull, typing ! automatically adds a null check at the beginning of the method's body.
    • Typing { after => quickly transforms an expression into a block of code in curly braces.
    • Pressing Enter ahead of a closing brace will leave the caret on the same line but shift it to the right by one indent.
  • TypeScript, JavaScript, JSON support improvements
    • Full support for TypeScript 2.3, including async iterators, optional generics, overload resolution for stateless JSX components, contextual this for object literals, and the --strict option.
    • TypeScript 2.4: support for enums with string values and mixed string/number values, improved support of generic inference from contextual type returns and generic contextual signatures.
    • Improved Find Usages and Rename for mapped type members in TypeScript.
    • New Introduce type alias and Inline type alias refactorings in TypeScript.
    • Improved performance of code completion in pure JavaScript.
    • Improved JSON support, including Quick Documentation in JSON and support for scoped packages in package.json: code completion, tooltips and Quick Documentation are now available in these packages.
    • Language injections in literals: injected XML, injected path references in C# and JavaScript/TypeScript.
  • Angular support
    • ReSharper 2017.2 supports Angular input/output aliases and attribute directives. Angular 2 components added via NPM are now supported as well.
    • ReSharper provides code completion, shows Quick Documentation and helps navigate to component declarations. Note that Support Angular markup in HTML pages must be configured in the ReSharper options under HTML | JavaScript and Frameworks for this to work.
    • In Angular 4, ReSharper 2017.2 adds support for ; else in *ngIf, as well as for variable assignments (e.g. people as person) in both *ngIf and *ngFor.
  • ReSharper interactive tutorials - ReSharper 2017.2 helps you learn as much as possible about its updates by integrating the ReSharper Tutorials plugin. For an easy way to try a feature instead of only reading about it, go to ReSharper | Help | Tutorials... and choose one of the available tutorials.
  • More ReSharper updates
    • Asynchronous refresh in the Find Results tool window.
    • A new option to make properties mutable when implementing interfaces with get-only properties.
    • Improved code completion response time.
    • Smart indent on Enter to improve code formatting. This feature is disabled by default but can be configured under ReSharper | Options | Environment | Editor | Editor Behavior | Typing assist.
    • Enable Debugging action in the context menu of Visual Studio's Modules tool window and ReSharper's Process Explorer tool window (this action replaces Generate PDB).
    • You can now set breakpoints in decompiled code.