ReSharper 2017.1

ReSharper 2017.1
Full support for Microsoft Visual Studio 2017, including new inspections to comply with the C# 7 compiler.


Feature Release

April 06, 2017 - 11:43
ReSharper 2017.1
Unit testing.
  • Microsoft Visual Studio 2017 RTM support - Full support for Visual Studio 2017 new features is finally here. You can now work with solutions loaded in a lightweight mode. When you use the Open Folder option, ReSharper sees all files in the folder and supports .xml and .js file types. Move to Folder refactoring works in this mode. ReSharper respects the current target framework context. This is set by the drop-down at the top of the editor window, and can change settings such as the assemblies being referenced, as well as symbols defined in the build and pre-processor.
  • C# 7 support - ReSharper receives a lot of new inspections to comply with the C# 7 compiler. For example, it can detect typos in tuple variable names when overriding a method or implementing an interface. ReSharper supports local functions with a new quick-fix to Convert a read-only delegate variable into a local function, as well as two new context actions:
    • Convert lambda expression or anonymous method into a local function
    • Convert local function into a regular method
    • The Join null check with assignment quick-fix makes the code more readable by combining the assignment, the null-coalescing operator, and throw. The existing context action Convert to '?:' operator and the .throw postfix template also support C# 7 throw expressions.
  • Unit testing - ReSharper’s unit testing works in both project.json- and .csproj-based projects in Visual Studio 2017 RTM. It discovers and runs MSTest and xUnit tests and supports code coverage and profiling as well as targeting multiple frameworks. NUnit tests that target .NET 4x frameworks are supported. There’s also DataRow support for MSTest v2. Note that ReSharper currently doesn't support continuous testing for .NET Core unit tests. This will be fixed in the next updates.
  • EditorConfig support - EditorConfig support is enabled by default. ReSharper understands standard EditorConfig properties, most of Roslyn EditorConfig properties, and provides a rich set of custom EditorConfig properties for much more granular configuration of formatting rules. This means that you can maintain the entire configuration of formatting rules in EditorConfig files. The File Formatting Info window displays the scopes and properties defined in all active .editorconfig files. This window also shows the source of indentation settings and its value, and the status of indent autodetection.
  • Code cleanup and formatting improvements
    • ReSharper’s Code Cleanup gets usability improvements. Now you can create and configure your custom task-specific profiles right in the Code Cleanup dialog box, simply by pressing Ctrl+E,C.
    • Contextual configuration of formatting rules is available in С#, C++, JavaScript and TypeScript. Press Alt+Enter over the selected block of code that you need to reformat, and then choose Format Selection | Configure in the actions list to see all formatting rules that affect the code.
    • Tabs and indents in all supported languages can now be configured on a corresponding options page and stored in ReSharper’s layered settings.
    • ReSharper applies its formatting rules to any code you paste. The Reindent option that affects only the indentation settings is set by default and you can change it on the Editor Behavior options page.
    • When you reformat a part of code in a file, or when code is auto-formatted on editing or pasting, ReSharper can calculate and apply indentation based on the existing indents in that file. This feature comes in handy when you want to contribute to existing projects where indentation differs from your settings.
  • New C# code style and formatting options - C# formatting styles were enhanced with several new options:
    • Code style settings for type members bodies: choose between always using a body block, with braces, or using the expression format.
    • The new wrapping engine now handles the alignment correctly, and comma-first wrapping style is supported.
    • Set spaces before and inside the parentheses of 'nameof'.
    • Choose preferred wrapping style for chained binary expressions.
    • Add line breaks in a single 'case' statement.
  • Navigation and search
    • The Find Results window gets a new option to group search results by kind of usage, new filters to select occurrences of a specific usage, and using quotes to search for exact matches.
    • ReSharper's Search & Navigation page adds a new option to open files in the preview tab from everywhere. This option is turned off by default.
    • The Go to Everything and Go to Text popups support inline commands for advanced filtering of search results.
  • Angular 2 templates syntax
    • ReSharper understands the following elements of Angular 2 templates syntax: template expressions, template statements, NgFor directive and template variables. Support is implemented for the template: property in Angular @Component decorator as well as for pure HTML referenced by templateUrl: property in @Component. Only relative paths are supported in templateUrl. For HTML pages, Angular markup is switched off by default and can be enabled in ReSharper Options (Code Editing | HTML | Editor).
    • Code completion works for Angular attributes and component tags, as well as for [attr., [style. and [class.. Component attributes receive support for the Go to Declaration (F12) command. The Rename refactoring works for component tags and for 'foo' in [].
    • Note that Angular 1 is not yet supported. You can use the AngularJS plugin for code completion and live templates, if Support Angular markup in HTML pages is set to 'None' in ReSharper options.
  • TypeScript and JavaScript support
    • Full support for TypeScript 2.1: mapped and indexed types, object rest and spread properties, updated logic for literal types, configuration inheritance, untyped imports, combined types normalization, partially annotated signatures, and control flow analysis for implicit any and implicit any arrays.
    • Initial support for TypeScript 2.2: 'object' type, JSX spread syntax and deriving (extends/implements) from signatures/tuples/intersections/mapped types.
    • Inspection and quick-fixes for unused imports in TypeScript ES6-style imports.
    • Postfix Templates in JavaScript and TypeScript.
    • Improved relevance of code completion items in TypeScript and JavaScript.
    • The Generate Code menu gets a new option to generate properties or read-only properties for TypeScript classes. The Generate Overriding Members command now calls 'super' whenever possible.
    • Navigate to Implementing Members in TypeScript.
    • Navigate to Function Exits in TypeScript and JavaScript.
    • The Rename refactoring in TypeScript works faster for local symbols and gets a new option to disable dynamic search for TypeScript.
  • Code analysis - ReSharper's File Status Indicator (the small icon at the top of the Error Stripe) receives a new context menu. With a right-click on the icon, you can quickly toggle not only ReSharper code analysis but also identifier highlightings and Visual Studio code analysis (lightbulb and squiggles). If there are code issues in the current file, you'll also see commands for navigating between issues of the highest severity level. Note that for large files ReSharper suspends code analysis automatically. In this case, you'll see a gray Pause icon in the Status Indicator.