Working with multiple solutions in Rider

Since we opened the public Early Access Preview (EAP) for Rider, we have shipped a few updates that contained bugfixes as well as new features. We received great feedback from all of you, with one big request: “Make it possible to open multiple solutions at once”. Without further ado:

Multiple solutions can be opened in Rider

Let’s see how this works and how you configure Rider’s behavior.

Continue reading

Posted in How-To's | Tagged , , | 3 Comments

Redesigned filters in dotTrace 2016.3

If you are a long-term user of dotTrace Timeline Viewer, you’ve likely noticed some UI changes in dotTrace 2016.3. What has changed exactly and, more importantly, why were these changes made? Read on to find out.

Continue reading

Posted in How-To's | Tagged , , | 1 Comment

Rider front end plugin development

While JetBrains is still working on a full SDK for Rider, it is already possible to make a plugin for it – at least for the front-end part. As Rider is built on IntelliJ Platform, just like WebStorm and IntelliJ IDEA, we can write plugins for it using the IntelliJ plugin SDK.

A good example would be the REST client we have in Rider. Sure, it’s built-in, but it’s a plugin providing some awesome functionality! One could build, for example, a NuGet package explorer – just showing package contents is not something that would need the back end. Want to add an image editor into the IDE? Create a context menu action that converts a JDBC database connection string to a .NET connection string? A tool window showing Dilbert comics? All fine examples that can be built as a front end plugin!

But front end? Back end? Before we look at a simple example, let’s see what Rider is made of.

Continue reading

Posted in How-To's | Tagged , | 5 Comments

A summary of ReSharper actions around C# method parameters

ReSharper offers hundreds of quick-fixes and context actions. As you remember, quick-fixes are aimed to resolve a certain problem in your code, whereas context actions allow you to quickly introduce some minor changes.

Today we are going to review several quick-fixes and context actions that simplify your work with method parameters in C#. Some of them have been available for years, some have only been added in the most recent release.

Continue reading

Posted in How-To's | Tagged , , , , | 2 Comments

Code generation improvements in ReSharper 2016.3

ReSharper’s code generation actions can create a lot of code for us. Why manually write a constructor that initializes type members? Why manually implement interface methods and properties? ReSharper can do those things for us!

Some say developers who use tools to generate code are lazy. Personally, I like to call that efficient. Instead of writing code that is, in essence, programming language ceremony, we can let ReSharper generate it for us and focus on implementing business value and solving our customer’s problem instead. In this post, we’ll go over some of the newly introduced and updated code generation actions in ReSharper 2016.3.

Continue reading

Posted in How-To's | Tagged , , , , | 6 Comments

ReSharper Ultimate 2016.3.2

We are starting the new year with a bugfix update for ReSharper Ultimate 2016.3. All in all, it addresses 50+ issues in ReSharper, dotCover, dotTrace and ReSharper C++.

ReSharper 2016.3.2 includes minor fixes in code analysis and highlighting, automatic code completion in TypeScript, and generation of Dispose pattern implementations. It speeds up the Inline Parameter refactoring and corrects parameter positions in the Change Signature refactoring. Find Usages receives an action to stop the current search. We’ve also fixed unfortunate bugs from the previous bugfix related to ReSharper Build and unit tests run from Unit Test Explorer.

In dotCover 2016.3.2 we fixed a critical issue with Hide auto-properties option that hid only properties’ accessors, but not the properties themselves. It caused incorrect totals displayed in the Coverage Tree.

In dotTrace 2016.3.2 we added .NET Core Application type to the central panel so that it’s easier for you to handle profiling for this kind of applications. We also fixed critical bugs in Timeline Viewer and Performance Viewer, and introduced several improvements to the snapshot comparison feature.

ReSharper C++ 2016.3.2 fixes a couple of code completion bugs and addresses several performance issues with code analysis and navigation. The Introduce Type refactoring gets a new option to use type aliases instead of typedef declarations.

Download this bugfix update to make your experience with ReSharper 2016.3 even smoother. As always, please share your feedback in the comments to this post, and submit any issues you encounter to our tracker.

Posted in How-To's | Tagged , , , , | 2 Comments

Subsystems in dotTrace Timeline Viewer

If you use dotTrace, you probably know it consists of two independent applications for performance analysis: Performance Viewer and Timeline Viewer. One of the greatest features that made Performance Viewer so helpful for quick performance evaluation was Subsystems. In dotTrace 2016.3, Subsystems have finally made it into dotTrace Timeline Viewer.

What are subsystems?

The mechanics of Subsystems are quite simple. In most cases, each subsystem just groups calls made within a certain namespace or assembly: WPF, LINQ, collections, strings, and so on. There are also certain special subsystems which are calculated based on other data (like ETW). These are garbage collection, file I/O, lock contention, and some others.

Subsystems in Timeline Viewer

Why would you care about subsystems when you profile?

The purpose of Subsystems is to quickly answer the main question “What the heck is going on in my app?”, along with more specific questions like “What causes the performance drop?” or “What allocates so much memory?” In dotTrace 2016.2 and earlier, you had to check different filters scattered around the UI to answer these questions. Now, the Subsystems filter is the single place* that shows you how time on the selected time interval is distributed among various activities.

*A group of filters previously known as Interval Filters is now also partly incorporated into Subsystems.

Quickly check what's going on in your app


UI freeze caused by user code

UI freeze caused by file operations

If you switch the Events filter to Memory Allocation, Subsystems will show you how much memory a particular subsystem allocates:

Memory allocation and subsystems

Subsystems are available not only as a filter but also as a bar in Call Stack | Methods and Subsystems. The bar shows exactly the same data as the Subsystems filter does. The reason for having it here is to visually evaluate the contribution of certain subsystems in a call subtree. If you enable Follow selection in call tree, the bar will show subsystems for the node currently selected in Call Tree.

Subsystems in call tree

Don’t forget that as everything in Timeline Viewer, Subsystems are able to work as a filter.
To turn on a filter by a certain subsystem, simply check the subsytem in Filters | Subsystems or click on it on the bar in Methods and Subsystems.

Filter by subsystem

Create your own subsystems

By default, all your code is calculated within the User Code subsystem. Of course this can be too vague in solutions containing multiple projects and/or using third-party frameworks. No worries! Subsystems are very flexible – you can create a new subsystem for any assembly, class or method you want to be shown separately in Subsystems.

For example, our app uses the Ionic zip library to handle zip files. We want to be able to quickly see how much time our application spends on zip processing. All we need to do is create a new subsystem that aggregates time spent in the Ionic assembly.

How to add your own subsystem

After you add the new subsystem, Subsystems will be instantly recalculated:

After adding a subsystem

As always, we suggest that you download ReSharper Ultimate and try subsystems in Timeline Viewer on your own!

Posted in How-To's | Tagged , , | Leave a comment

Navigation and search improvements in ReSharper 2016.3

Today we’d like to recap the most important changes in navigation and search that were introduced in ReSharper 2016.3.

Find Results window is populated asynchronously

If your solution is large enough, finding references of heavily used symbols can take time, delaying work with your code. To address this issue, we updated the usage search mechanism to make it async. Both Usages of Symbol pop-up and Find Results window are filled asynchronously, allowing you to work with partial search results. If you invoke Usages of Symbol (Shift + Alt + F12) and notice that search is taking a long time, press + on the number pad to open the Find Results window: as a result, you will be able to continue working on the project while search is being completed.

Usages of Symbol pop-up

Remembering the last search

We enhanced the Go to… family of search actions with a setting to remember the last search. This behavior is turned off by default and can be enabled on the Environment | Search and Navigation page of the ReSharper options. When this option is selected, ReSharper will also use your selection in the editor as the search string.

Remember the last search

Redesigned Recent Files and Recent Edits

We made minor improvements to Recent Files (Ctrl + ,) and Recent Edits (Ctrl + Shift + ,) pop-up windows. They now show the path to the file so that you don’t confuse files with similar names. The list of opened files or recent edits is saved separately for each solution you open and is not cleared when you close it. This means that you can invoke these commands right after opening the solution to get the list of files you worked with or items you modified in your previous working sessions. Any unwanted item can be easily removed from the list by pressing the Delete key.

Recent Edits pop-up

Recent Edits displays each edit in the same method as a separate entry by default. If you want to merge locations, you can select Merge locations in recent edits on the Environment | Search & Navigation page of ReSharper options. In this case, the most recent edit in the method will be shown.

Advanced matching in SSR

Let’s take a look at a small but powerful update to the ReSharper’s structural search and replace (SSR) that helps you find and replace blocks of code matching a particular pattern. In C#, integer constants can now be matched by value regardless of how they are encoded:

Match a particular pattern

Go to Text supports more file types

Another navigation feature, Go to text, received support for additional file formats. On top of existing file types, it now supports finding text in .less, .hbs, .coffee, .scss, .dart, .as and .styl files. This navigation command works in global scope and you can invoke it by pressing Ctrl+T three times.

Go to text navigation

Structural navigation in more languages

We do hope that since ReSharper 2016.2 release you’ve been enjoying increased productivity with structural navigation when coding in C#, HTML, XML or XAML. This feature allows you to use Tab and Shift+Tab keys to quickly move between code elements you need to edit without using a mouse cursor. For example, when editing a for statement, Tab will select the initializer statement, then the terminating condition and then the iterator statement. Shift+Tab will do the same but in reverse.

In ReSharper 2016.3, we have made structural navigation available in more languages so that you can use it in JavaScript, TypeScript, and JSON files.

Structural navigation in JavaScript

Go to Implementation works in TypeScript

Go to Implementation now works for TypeScript types too: you can jump from a base type or member to any of its end implementations, bypassing intermediate steps in the inheritance chain. As usual for ReSharper’s contextual navigation actions, Go to Implementation is available from the Navigate To menu. Alternatively, you can invoke the action when you click a base type or member while holding Ctrl+Alt keys.

Get the latest ReSharper

This wraps up the list of most prominent updates to navigation and search in ReSharper 2016.3. Please download the latest ReSharper and try the new features yourself.

If you encounter any issues or have feature suggestions, please let us know!

Posted in How-To's | Tagged , , | Leave a comment

Analyzing native memory allocation with dotTrace 2016.3

With C#, we live in a comfortable managed world where everything is controlled by CLR. But sometimes, whether we like it or not, we have to work with ‘unmanaged’ objects, for example when we want to use some third-party DLL, a COM component, or a resource required for interoperability with the operating system (like a bitmap).

dotTrace 2016.2 and earlier had no way of showing you how your application worked with unmanaged memory. Version 2016.3 introduced a new event type you can analyze – Native Memory Allocation. It can be very helpful with all kinds of issues related to native memory: potential memory leaks, issues with unmanaged components used by your managed code, and more.

The Native Memory Allocation filter simply shows all events where allocations to the native heap occur. Note that dotTrace currently shows you only allocations of native objects that were not de-allocated by the time you took the snapshot. Thus, unfortunately, at the current stage you cannot use this filter to analyze excessive native memory allocations (native memory traffic).

Native memory allocation point events

A couple of notes before we take a look at how it works:

  • You must have Windows Performance Toolkit installed on your machine.
  • dotTrace collects native allocation data only in the Timeline profiling mode.

How to use it

  1. First of all, when starting a profiling session, don’t forget to enable Collect native allocations in Advanced profiling options. (The option is disabled by default as it is a resource-consuming operation.)
    Advanced profiling options, Collect native allocations
  2. When you open a profiling snapshot in the viewer, select Native Memory Allocations in the Events list:
    Native memory allocation in Visual Studio
  3. Like nearly everything in dotTrace, Native Memory Allocation works as a filter. To identify calls that are responsible for native memory allocation, perform these two steps:
    1. Select the Native Memory Allocation event. Calls in the Methods window are now sorted by the size of native memory they allocate.
    2. Select a particular method and press Enter to navigate to its code.

Native allocations. Navigate to code

We hope you find this feature useful. To try it on your own, download ReSharper Ultimate 2016.3.

Posted in How-To's | Tagged | 2 Comments

Deep event analysis with dotTrace 2016.3

dotTrace 2016.3 introduces a new Events window which is available in both standalone dotTrace and dotTrace integrated in Visual Studio.

To open the window in the standalone Timeline Viewer, use the View | Events menu:

Open Events window in Timeline Viewer

In Visual Studio, click Show Events in the Performance Profiler window:

Open Events window in Visual Studio

What is the Events window?

It’s a tool window that shows the list of events that occurred in the profiled application, including file operations, HTTP requests, SQL queries, exceptions, and JIT compilation. By default, events are sorted by the time of their occurrence. Strictly speaking, it’s just an event log.

When would you want to use it?

Use the Events window like any other event log — for analyzing complex cases and bugs when the data provided by other filters is not enough.

First of all, the Events window may help you analyze situations when a particular sequence of actions (e.g., SQL requests, file I/O, and so on) in your application leads to an exception. Regular timeline filters show you only aggregated information for a selected time interval, and it’s not easy to identify a correlation between actions and exceptions. On the contrary, the Events tool window shows the list of events in exactly the same order they occurred, which means you can determine what events preceded a particular exception.

To do this, narrow the time interval using standard timeline filters (to eliminate any events you don’t need) and then find particular events in the Events tool window. Use the search field at the top to help with your search. The Events tool window shows call stack information for every event so you can determine the call that originated the event right in place.

Events tool window

The second scenario where the list of events can help is when you need to refine your analysis results. Let’s assume that you used filters to find out that your application writes to a particular file 10 times and these writing operations are taking too long. With the Events tool window, you can go even deeper and find out which of those 10 events took the longest. If some events lasted longer than the others (simply sort the log by Duration), then it’s a good reason to look at the call stack that’s behind them.

Events window sorted by duration

As ever, we invite you to download the latest ReSharper Ultimate to try this and other new dotTrace features in practice.

Posted in How-To's | Tagged , | 3 Comments