ReSharper Ultimate 2017.1 EAP: what’s new in build 1

Last week we launched an Early Access Program for ReSharper Ultimate 2017.1. We hope that you’ve already downloaded the build and discovered some of the new features. Today we’d like to take a closer look at the most notable updates, which relate to the following product areas:

Visual Studio 2017

Long-awaited support for the Lightweight Solution Load mode is finally here. Some issues are still to be expected, but ReSharper should work correctly for most solutions.

ReSharper C++ works with the Faster Project Load option, which you can enable in Tools | Options | Text Editor | C/C++ | Experimental.

We’ve also been working to improve your folder-based experience that comes with the new Open Folder mode in Visual Studio 2017. ReSharper sees all files in the folder and supports .xml and .js file types. We are aiming to support C++ codebases in the next EAP update, and it would help us greatly if you could share your C++ Open Folder use scenarios in the comments below.

Local functions in C# 7

The new version of C# brought us local functions that can be defined in the body of any method, constructor or property’s getter and setter. Compared to lambda expressions, which you would normally use to define local helpers, local functions are more efficient when you want to write a function that is called only from the context of another method. They are your perfect choice for iterators, async methods and recursive algorithms. That said, we’ve extended ReSharper’s support for local functions and added two context actions that allow you to:

  • Convert lambda expression or anonymous method into a local function
  • Convert local function into a regular method

There’s also a new quick-fix that suggests converting a read-only delegate variable into a local function. Let’s see when it can be useful:
Convert to local function quick-fix

If needed, you can then convert the generated local function into a regular method:
Convert local function into a regular method

EditorConfig support

We’ve introduced initial support for EditorConfig, which is enabled by default. This means that formatting styles defined in the .editorconfig files will override your current formatting preferences set in ReSharper and Visual Studio. If you want to ignore EditorConfig styles, clear the corresponding check-box on the Code Editing | General Formatter Style options page.

ReSharper understands standard EditorConfig properties, most of Roslyn EditorConfig properties, and provides a rich set of custom EditorConfig properties, which allow for much more granular configuration of formatting rules. This means that you can maintain the entire configuration of formatting rules in EditorConfig files. Below is an example of .editorconfig file settings supported by ReSharper:

When EditorConfig support is enabled, ReSharper helps you understand which EditorConfig styles are applied and where these settings come from. On ReSharper formatting options pages, you will see a yellow warning if at least one preference on a page is overridden by EditorConfig styles. Each overridden preference will be also highlighted with yellow:
Code formatting options overridden by EditorConfig styles

The EditorConfig information window (which can be opened by clicking the EditorConfig indicator in the Visual Studio status bar) displays the scopes and properties defined in all active .editorconfig files.

EditorConfig indicator in the status bar

Code formatting and navigation

The whole C# code formatting engine has been significantly rewritten: the new wrapping engine now handles the alignment correctly, and comma-first style is now supported and can be enabled on the Line Breaks and Wrapping options page. We’ve also fixed a lot of bugs.

Comma-first style

Please note that all these changes to the formatting engine in EAP builds may cause new unexpected issues to appear. If you come across any unpleasant bugs, please report them to us and then go to the Other page in C# | Formatting Style options and select the Revert to old formatting engine check-box.

You can now quickly define formatting rules for any selected block of С# code with a context action. Press Alt+Enter over the selected block of code that you want to reformat and choose Format selection | Configure in the action list. The Configure Format dialog shows all formatting rules that affect the selected code block. As you change the formatting rules, you will see how they affect the code. Context configuration of formatting rules also works in C++, JavaScript, and TypeScript.

Context configuration of formatting rules

ReSharper can reformat any code you paste by applying its own formatting rules. The Reindent option is set by default and you can change it on the Editor Behavior options page.

Formatting Style for all languages receives a new options page Tabs and indents, which allows you to set your own indent size and style and save it for future use in the ReSharper settings layer. The indent size and style from Visual Studio is used by default.

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.

ReSharper code analysis

Your coding experience with ReSharper in large solutions can sometimes be sluggish. We’ve already discussed the two major sources of performance problems and provided a list of actions you can take to speed up ReSharper and Visual Studio. The simplest option is to add certain files to the ignore list. For large files ReSharper does this automatically, so that sometimes you might wonder why code analysis doesn’t work. To mitigate this confusion we’ve introduced a new context action menu for the Status Indicator (a small icon at the top of the Error Stripe). If ReSharper code analysis is suspended, you’ll see a gray Pause icon in the Status Indicator. With a right-click on this icon you can quickly toggle not only ReSharper code analysis, but also identifier highlightings and Visual Studio code analysis (lightbulb and squiggles).

Pause code analysis

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. For HTML pages Angular markup is disabled by default. You can enable it in the ReSharper Options (Code Editing | HTML | Editor). Currently there are a few limitations to templates syntax support that will be addressed in the next builds:

  • Code completion currently doesn’t work for angular attributes and component tags;
  • Rename refactoring works for NgFor and template variables, but in some cases it may fail for class properties that are referenced in Angular expressions;
    Angular 2 Rename refactoring
  • Angular 1 is not supported yet, but this feature doesn’t conflict with our AngularJS plugin, if Support Angular markup in HTML pages is set to ‘None’ in ReSharper options.

TypeScript and JavaScript

We finally implemented full support for TypeScript 2.1, and initial support for version 2.2.

In TypeScript 2.1 ReSharper now understands 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. In the example below, we are finding usages of ‘prop2’:

Finding usages of a symbol in TypeScript 2.1

In TypeScript 2.2 ReSharper supports ‘object’ type, JSX spread syntax and deriving (extends/implements) from signatures/tuples/intersections/mapped types.

You can now speed up your coding in JavaScript and TypeScript by taking advantage of postfix templates:
Postfix templates in JavaScript

We’ve also improved the relevance of code completion items in TypeScript and JavaScript.

The last but not least update to ReSharper’s support of TypeScript/JavaScript are the Navigate To Function Exits and Navigate To Implementing Members commands. These let you easily navigate to a function’s return statements and to all members implemented in the current class.

dotCover, dotTrace, and dotMemory

In dotCover 2016.3 we’ve implemented colored markers and completely changed the highlighting logic. Now it not only shows whether a statement is covered by tests, but also indicates test results. Since the new highlighting style may not be a good fit for all use cases, we’ve added an option to switch between markers and colored background or to display both. The old highlighting style also supports the updated logic and displays both tests coverage and test results.

dotCover now supports MSTest V2 unit testing framework that was introduced in Visual Studio 2017 RC, and the new portable PDB format.

We’ve addressed a few issues across all our .NET tools:

  • One of the performance issues was caused by the standard UTF8 converter. We’ve replaced it with a custom one and gained a noticeable increase in performance. (PROF-613, DCVR-8022).
  • Fixed a bug that affected exception filters instrumentation for the catch when instruction in C# 6 (PROF-617).
  • Startup project profiling now works for .NET Core applications. (PROF-598) Note that we cannot track which parameters were used when you created a publish profile in Visual Studio for your .NET Core project. We’ll always use the debug version of your application.

ReSharper C++

ReSharper C++ has significantly lowered its memory footprint. Our tests on a common solution showed an almost 30% decrease in managed memory usage when the solution was loaded from cache.

The set of postfix completion templates has been extended with beg..end, new, var, const_cast, dynamic_cast, reinterpret_cast, static_cast, make_shared, and make_unique. You can configure the availability of postfix templates and some other settings on a new Postfix templates page of the ReSharper options.

Postfix templates options

It’s a good coding practice to avoid declaring a variable until you have a value to initialize it. That’s why ReSharper C++ now identifies and highlights the code with a separate declaration and initialization of a variable. There’s also a new quick-fix to Join declaration and assignment.
Join declaration and assignment quick-fix

Several custom attributes in C++ 11 are now available:

  • rscpp::format marks functions which accept printf-style format strings. Usage example: RSCPP-18764;
  • rscpp::has_side_effects marks functions with side effects. Usage example: RSCPP-18615;
  • rscpp::guard suppresses highlighting of the unused local variables. Usage example: RSCPP-15890.

And lastly, ReSharper C++ formatting engine adds the following new options:

That wraps it up. Stay tuned for the next valuable features and bug fixes coming soon!

Download ReSharper 2017.1 EAP

This entry was posted in How-To's and tagged , , , , , , , , . Bookmark the permalink.

14 Responses to ReSharper Ultimate 2017.1 EAP: what’s new in build 1

  1. rosdi says:

    Bravo for the Angular 2 support!.. also more support for TypeScript is definitely welcome…

  2. Vasya Aksyonov says:

    Looks great! But there’s one problem which bothers me though% currently, it’s very cumbersome to write the new code with TypeScript, because automatic imports behave ugly (RSRP-461186) and I always have to fix/write them manually, which is also complicated, because path suggestion doesn’t work (RSRP-463093) and import braces are not being formatted automatically (RSRP-459286). And after that, there’s no way to easily clean them up (RSRP-461495). It would be great to have these basic features in the current 2017 :)

    • Anton Lobov says:

      Thanks for all the feature requests and issues you submitted.

      We’re working on them.

      Inconsistent behavior with imports will be surely fixed (seems that corresponding setting of import style is not pulled everywhere), clean-up will be added as well (it exists, but for some reason only for the old, pre-ES6 style imports).

  3. Pingback: ReSharper Ultimate 2017.1 – Alles zur neuen Version

  4. Pingback: Dew Drop - February 15. 2017 (#2422) - Morning Dew

  5. Lars Kristian Hagen says:

    How is the work on out-of-process / IPC hosting of Resharper going. I would love to see this feature implemented.

  6. Bryan Rayner says:

    Any update on improved Async / Await support in dot-trace?

    • Svetlana Emelyanova says:

      Hi Bryan. Unfortunately, support for this won’t be added in 2017.1, but it’s on the roadmap and we are targeting to implement it in 2017.2.

  7. Sergey says:

    It would be really helpful if you add some colors to ReSharper IntelliSense Parameter Info tip. To data types and annotations, for example.

  8. Mike A says:

    If I’m reading this correctly, it sounds like you found a perf bug in the .NET framework UTF-8 converter. Have you considered submitting a pull request to the corefx repo with your modifications?

  9. cwerner says:

    What exactly are you supporting with light weight solution load? I immediately tried to open a solution (300+ projects) using light weight solution load and search for a type by using -t and it won’t find any types until the projects are loaded. For my use case it would be nice to be able to navigate the solution without having to load every single project. For large solutions visual studio gets pretty unusable.

    • Maria Pleskunina says:

      The following R# functionality is available without loading the project: navigation, code completion, refactoring, running tests and so on.
      Do I understand correctly that you use Ctrl+T to search for a type?
      What will happen if you reference a type in code, which you can’t navigate to, and try using “go to declaration” feature?
      Does “go to file” show files from unloaded projects?
      However, it can be easier to solve your problem if you contact our support team via
      Thank you!

Leave a Reply

Your email address will not be published. Required fields are marked *