ReSharper Ultimate 2016.2 Release Candidate

Ladies and gentlemen, you can now download ReSharper Ultimate 2016.2 Release Candidate!

All new features and improvements that we have revealed and blogged about in recent months are now in pre-final state.

This includes things as exciting as textual search via Go to Text, structural navigation with Tab, and warnings in solution-wide analysis, as well as more mundane fixes, of which there are plenty.

If you still have pressing issues with 2016.2 RC or if something that we assume fixed doesn’t actually solve your issues (btw, everyone who has been unhappy about Move to Folder behavior with TFS, we’re waiting for you to confirm a fix), this is probably your last chance to let us know via comments here, or better yet, via issues in respective product trackers: ReSharper, ReSharper C++, dotTrace, dotMemory, dotPeek or dotCover.

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

ReSharper Ultimate 2016.2 EAP: What’s new in builds 9-11

ReSharper Ultimate 2016.2 EAP has been open for over two months, and we are approaching release now. Most probably, the new things described below will round up the feature set of upcoming ReSharper Ultimate 2016.2. So here is what’s new in the latest EAP builds.


In addition to 100+ fixed issues in the mainline ReSharper, there are some new features worth mentioning:

  • Go to Text navigation (Ctrl+T,T,T) lets you quickly find and navigate to any text in source and textual files. This new feature uses trigram indexing to make text search blazingly fast. Similar to other navigation commands, if there are too many matching items you can hit + on the numeric keypad to explore results in the Find Results window.
    Go to Text command
  • Warnings in solution-wide analysis will help you constantly keep track of all warnings in your solution: both actual compiler warnings and ReSharper’s inspections with the ‘Warning’ severity level. Before, the status bar indicator would turn green as soon as the last error in the solution was fixed. Now, the indicator can stay orange while there are unresolved warnings. It is still up to you whether to enable the solution-wide analysis and whether to include warnings in it: just right-click the status bar indicator to configure everything.
    Warnings in solution-wide analysis
  • A way to propagate XML documentation with the <inheritdoc/> tag, which is a good alternative to copying documentation from base types/members to derivatives. Although the tag is non-standard, it is understood by tools such as NDoc, Sandcastle, and Stylecop; and there are also requests to support it in .NET Core and Roslyn.
    So you can now use a context action to add the <inheritdoc/> comment to derived members; you can enable adding <inheritdoc/> automatically when generating missing/overriding members; the Quick Documentation popup will display the correct documentation even if the tag explicitly refers to specific symbol, i.e. <inheritdoc cref="SomeSymbol"/>.
  • The Process Explorer window (ReSharper | Windows | Process Explorer), which was previously only available in dotPeek, provides you with the list of currently running processes, allows exploring their modules and decompiling those of them that are .NET assemblies.
    Process Explorer window
  • New formatter options that let you control spaces before and after ++ and -- operators as well as spaces before and inside parenthesis of checked and default expressions.
  • In terms of TypeScript, ReSharper now fully supports TypeScript 2.0. Another long awaited feature makes the main navigation commands (Go to Declaration and Find Usages) work correctly when dealing with type aliases.

ReSharper C++

  • You can now generate documentation comments for C++ symbols simply with a context action. If necessary, you can customize the comment stub by editing the ‘doc’ live template that ReSharper uses for generation.
    Surround templates in completion lists
  • When your caret is on one of a function’s exits (return, throw, etc.) ReSharper C++ will automatically highlight all other function exits including exits from loops and switch statements.
  • New code inspections and quick-fixes: ‘Missing default case in a switch statement’ and ‘Non-explicit conversion operator’
  • Code style for default pointer initializer. You can specify 0, nullptr or NULL as the preferred initializer in the options, and ReSharper will help you maintain this style in your code base.


Recursive call stacks can be deep and difficult to analyze. Previously, Timeline Viewer would show call stacks “as is”, i.e recursive calls were simply shown as they were called: one after another in the stack trace. Of course, on complex call stacks with multiple recursive calls this would result in almost infinite stack scrolling. Now, Timeline Viewer allows you to fold such calls to streamline stack analysis.

Recursive call stack in dotTrace Timeline Viewer 2016.2


dotMemory now allows you to compare memory snapshots stored in different workspaces, or, in other words, collected in different profiling sessions.

For example, this can be useful to find out how particular changes in code affect your application’s memory usage. All you need are two snapshots taken before and after committing changes.

Cross-workspace snapshots comparison


  • Filtering processes from console runner lets you reduce unnecessary overhead by excluding child processes that are irrelevant to the coverage analysis. To enable a process filter, use the /ProcessFilters parameter. For example, /ProcessFilters=+:prA;+prB will exclude all processes except prA and prB; /ProcessFilters=-:prC will exclude prC from the coverage.
  • Hide auto-properties option allows you to exclude auto-properties from the coverage analysis.

Please feel free to download the latest 2016.2 EAP build and let us know what you think. If you have any problems, please raise issues in ReSharper, ReSharper C++, dotTrace, dotMemory or dotCover issue trackers.

Posted in News and Events | Tagged , , , , , , | 24 Comments

Rider – the story so far

Last time, we had a look at what was new in the June EAP of Rider, our .NET IDE.

This time, we’re going to go back to the beginning and have a look at some of the interesting features we’ve added during the EAP so far.

This includes:

  • Core IDE features
  • NuGet
  • File Structure
  • Solution Wide Analysis

Core IDE features

Rider is a .NET IDE, and as such, requires a certain set of functionality, such as opening and creating projects, build and debug, and of course, an excellent editing and code navigation experience.

Rider supports opening Visual Studio solutions and .csproj based projects. It also supports .NET Core applications, as long they also have a solution and .xproj files (remember, .NET Core tooling is changing back to MSBuild based .csproj files. Rider will support this, too).

And of course, it allows creating projects, too, with project templates that can create executables, class libraries and .NET Core projects.

Project templates

But Rider would be nothing if it didn’t have a good editing experience. And here, Rider takes full advantage of both its ReSharper and IntelliJ heritage, to provide all the functionality that you know and expect from a JetBrains IDE: complete statement, auto-completing brackets, tooltips and parameter info, live templates, and of course lightning fast code completion, either when you type ., or automatically, in context, like completing a type name after new.

Code completion

Rider also includes very rich navigation, making use of IntelliJ’s Search Everywhere feature to search for classes, symbols, or files, even searching for IDE actions and settings. In addition, you can Ctrl+click to go to definitions, go to file member, and of course use the Navigate To context menu to move up and down a class hierarchy or use other navigation options:

Navigate To context menu

And who can live without Find Usages?

Find Usages tool window

Rider has been designed to make the most of the investment we’ve put into ReSharper for the past 10+ years. Rider uses ReSharper as an out of process language server, so any functionality we add to ReSharper can be used in Rider (and any functionality we add for Rider can also be used by ReSharper).

The protocol we’ve designed for the Rider frontend to talk to the ReSharper language server is very lightweight, two way and asynchronous. On top of that, the data we’re sending between the two processes is designed to also be very lightweight – little more than “view models”.

For example, every advanced IDE needs to display inspection highlights – “squigglies”. With Rider, these inspections are carried out by ReSharper, out of process, and the data is passed to Rider, as a “view model” – essentially a list of offsets, highlight types and tooltip text.

This means that Rider immediately gets access to all of ReSharper’s over 2000 inspections.

Inspections with tooltips

And what would a JetBrains IDE be without Alt+Enter?

Everybody’s favourite keyboard shortcut is there, ready to safely rewrite code to apply quick-fixes to all of those inspections, or perform context specific actions like converting a string literal to string interpolation, or even marking it as a regular expression!

Alt Enter context menu

While the protocol allows us to reuse a lot of existing functionality, some features, such as refactoring, take a bit more work. Interestingly, a lot of the work is to create new UI for the workflows – ReSharper already knows how to rewrite your code, but it needs to know what you want to do. Which means we don’t have all of ReSharper’s refactoring support available in Rider right now. But we do support a number of refactorings, especially the most important – rename.

Rename dialog

NuGet Support

NuGet has changed the way we consume dependencies in a .NET project – referencing packages is a lot better than manually downloading libraries, adding them to a libs folder and checking them into source control.

So of course, Rider has to support NuGet. And of course we wanted to sprinkle a little JetBrains magic on it.

The idea behind our implementation is to be as fast as possible. When you search for a package, we return cached search results, so commonly used packages are available instantly. But we’re also updating the results in the background, so any new packages, or new versions, are added asynchronously.

The UI might be a little different to what you’re used to. The NuGet tool window is split three sections. The first is a view of the solution and project hierarchies, the second lists packages, and the third shows package details.

Selecting a node in the solution hierarchy lists the packages that are already installed, and provides a text box to search for packages to install. This list also shows when a package has an update available.

Clicking on one of these packages shows details in the final section of the window. This shows the package description, authors, license, project URL and so on. It also lists the available versions in a drop down – selecting one of these and clicking Apply will install, update or rollback to that version. Clicking the Remove button will of course remove the package.

And finally, the Restore button next to the solution hierarchy will restore all packages, downloading any that are missing.

NuGet tool window

Along the top of the tool window, you’ll notice some tabs:

  • Packages – the default view, for managing packages.
  • Sources lists all of the config files that NuGet is using to figure out what package sources are available. Rider will show what the effective list of sources are, and clicking on the config file will open it up in the editor.
  • Options allows configuring various aspects of Rider’s NuGet support, such as whether the search should include pre-release packages, and the default behaviour for resolving loosely specified dependencies.
  • Log shows the output of any NuGet operations, including errors and conflicts.

File Structure

The File Structure window shows an outline of the current file in the editor. So for a C# file, it will show classes, and under each class is a list of class members – methods, properties, fields, etc. Double clicking one of these will navigate the editor to the appropriate location in the source, and if you toggle the Autoscroll from source toolbar button, whenever you navigate around in the editor, the matching type member will be highlighted.

File Structure tool window

See the title of the tool window tab docked to the side of the window? 7: Structure – the “7” means that you can quickly get to the tool window by pressing Alt+7. This works for any tool window that has a number in front.

Solution Wide Analysis

Another feature that Rider has brought over from ReSharper is Solution Wide Analysis. When enabled, ReSharper will analyse all files in a solution, rather than just open files.

This gives ReSharper a much better view of your solution, which it can use to power a number of features. For example, it tracks cross-file symbol usage, so it can highlight public classes or methods that aren’t used in any file. It also maintains a list of errors in all files across the solution, and uses the cross-file usage information to intelligently and efficiently rescan only
affected files to keep the list up-to-date as you type.

The Errors in solution tool window in Rider will display the list of errors in your files, grouped by file. Double-clicking on an error will take you straight there, while using the Next error action in the editor will cycle through all errors in the list, across all files.

Errors in solution tool window

And just like in ReSharper, there is a little icon in the bottom right of the status bar, showing if the solution has errors or not, allowing you to use the feature without having to have the tool window open. Clicking the number of errors cycles through them, while clicking the icon will open a small context menu to get quick access to useful features.

Errors in solution status bar icon

Solution Wide Analysis is disabled by default. Scanning all of the files in a solution obviously has an impact on resource usage, and we would rather you opt in to this behaviour. For most real world solutions, the disk-based caches happily handle the extra data required, and once the initial scan of all files is done, the cross-file usage data makes keeping the list of errors up-to-date very efficient.

And since Rider uses ReSharper as an out of process backend language server, ReSharper has much more headroom to allocate and use memory that won’t affect other aspects of the IDE. So give Solution Wide Analysis a go on your solution!

Rider is still in private EAP, although we are getting ready for a public preview. If you’d like to give it a go right now, please head over to the signup page, and we’ll send you a download link.

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

ReSharper Ultimate 2016.2 EAP: Builds 7 and 8

ReSharper Ultimate 2016.2 EAP goes on, and we’ve recently published two more builds. Here is what has been fixed, and below are some new features in these builds.

Improvements in surround templates

We have been working towards merging live and surround templates as well as improving the availability of templates.

As of now, each non-file template can be used for generating code, for surrounding code, or for both, which lets you reuse your custom surround templates as live templates and vice versa, reducing their total count.

Another new thing here is that surround templates become available in the completion list, so you can start typing the name of a surround template as soon as a selection is made without pressing any additional shortcuts:

Surround templates in completion lists

The traditional way of invoking surround templates with Ctrl+E,U (ReSharper | Edit | Surround With Template) is also improved. The problem of too many templates in the Surround With pop-up, previously addressed with the editable ‘quick access list’, is now solved another way: while the pop-up shows all available templates, you can start typing a template name to shrink the list.

Marking language injections with comments

When a string literal contains a formal language, ReSharper can provide its code analysis and assistance features right inside this literal. Since v. 9.0, this has been available for regular expressions, and v. 2016.2 brings support for injected HTML.

Let’s recap how it works. As it’s impossible to automatically detect whether the formal language is intended in the literal, you have to mark the injection explicitly in one of the following ways:

  • Use the context action, which actually tells ReSharper to mark the symbol range corresponding to the string as Regexp/HTML, save this range in its internal database and keep track of it as the containing file changes. This way is very quick and straightforward, but there are two downsides: the range can be lost after an external file change, such as a VCS merge, and the injection marked this way will only be tracked locally.
  • Mark method parameters accepting regular expressions with RegexPatternAttribute from JetBrains.Annotations. This is the recommended way for regular expressions in parameters.
  • ReSharper 2016.2 introduces a third way: you can put a comment /*language=html|regexp|jsregexp*/ before the string literal. Granted, these comments require some typing and you can even think of them as contaminating your code. However, they make your intention clear to everyone who reads your code, they won’t get lost, and anyone opening your code with ReSharper will get the same features in the marked strings. By the way, the format of comments is compatible with IntelliJ Platform-based IDEs.
    Language injection with comments

More C# typing assistance

In addition to the smart behavior of dot and semicolon inside braces, which
we mentioned previously, ReSharper now automatically corrects mistyped @$ prefixes for verbatim string interpolations:

Generating abstract members in TypeScript

In TypeScript, you can now generate implementations for abstract members using either the Generate menu (Alt+Insert) or a quick-fix:

Generating abstract members in TypeScript

Please download the latest 2016.2 EAP build and give the new functionality a try. As usual, we would love to get your feedback via ReSharper issue tracker.

Posted in News and Events | Tagged , , | 19 Comments

Rider EAP update: unit testing, .NET Core, and more

We recently (June 20) published a new private build of Project Rider, our standalone, cross platform C# IDE. We’re getting closer to starting the public preview, and so we’ve decided to start sharing details of the new features that are making it into the latest private EAP builds.

Obviously, previous EAP builds have had their fair share of new features, such as the File Structure view, Solution Wide Analysis, and the NuGet Explorer, as well as more fundamental architectural work, such as enabling inspections, the Alt+Enter menu, various refactorings and of course build and debug. We’ll take a look at some of these existing features in posts closer to the public EAP release, but for now, we’re going to start talking a bit more about what’s in the latest builds.

So, what’s new with the latest EAP?

As well as fixing a number of bugs (including some with the NuGet support), we’ve added some new things that we think you’ll like. Here are the highlights:

  • Unit test runner
  • ASP.NET Core support
  • To-do Explorer
  • Stack Trace Explorer

Unit Test Runner

The big news for this release is the addition of the unit test runner. This has been a very heavily requested feature, and we’ve worked hard to bring an initial version to Rider.

You should find the functionality very familiar if you’re already used to ReSharper. Rider has support for NUnit and xUnit by default. It does not currently support MSTest, as MSTest is too closely tied to Visual Studio.

Rider will discover tests in the editor, as you type, just like in ReSharper, and add a gutter icon to indicate test classes and test methods. You can either click this icon or use the Alt+Enter menu to run tests, which will be displayed in a test runner window very similar to the one in ReSharper.

Run tests from the alt enter menu

The tool window has multiple tabs, one for each session. The tab will show a tree view of the tests that are going to be run, with status icons to show pass, failed, skipped, etc. The output pane shows any output or failure messages, with the stack trace parsed and click-able for easy navigation. Double clicking the test in the tree will also navigate to the test method in the editor, and there is a toolbar to control running, stopping, deleting, grouping and so on.

Running tests

This is initial support, and there are still a number of features that we haven’t yet implemented, such as debugging, or more ubiquitous means of running tests. But don’t worry, we’re not done yet. We wanted to get this feature into your hands as soon as we could, so you can try it out, and let us have your feedback!

ASP.NET Core support

Rider uses ReSharper as an out of process language server, and is built from the same codebase that is the current 2016.2 EAP. This means it benefits from ReSharper’s support for ASP.NET Core projects, and can create new and open existing .NET Core projects. Furthermore, Rider includes project templates that allow you to create a new .NET Core executable or class library, so you can build your own projects from scratch.

Like Visual Studio, Rider requires existing projects to have both  .sln and  .xproj files; it doesn’t support opening a  project.json file directly. And of course, with the recent announcements that  project.json is being replaced by MSBuild  .csproj files, it is now very unlikely that we will implement this support only for it be obsolete in a few months time. If you have an existing project that only has  project.json, you can create a new project in a temporary folder and copy the  .sln and  .xproj files across and Rider will be able to open the project.

Once a project is open, Rider fully recognises the new style of referencing packages rather than assemblies, and the References node in the Solution Explorer will show packages and dependencies. Other functionality – smart editing, code completion, navigation and so on – just works.

We even get to take advantage of ReSharper’s advanced functionality, such as code completion and navigation for controller actions, and that includes from ASP.NET Core’s new tag helpers in  .cshtml files (oh yes, we support  .cshtml files too, with syntax highlighting, code completion, navigation, and even code completion and find usages on CSS classes).

Tag helper in code completion

To-do Explorer and Stack Trace Explorer

Another couple of new tool windows that we have added in this release are the To-do
Explorer and the Stack Trace Explorer.

The To-do Explorer works very much like you’d expect from ReSharper – scanning comments in your code that match // TODO: Fix this and pulling those out into IntelliJ’s own To-do Explorer tool window. Each item is shown as a node in the tree, grouped by file, and double clicking the item will take you to the line in the editor.

The To Do Explorer

Even better, we get to take advantage of existing IntelliJ functionality. From the Commit Changes dialog, if the Check TODO checkbox is selected, Rider will look for to-do items in the changes being committed, and allow you to review them – but only if it’s a new to-do item! The comment has to be in a block of text that has been changed.

Commit dialog checking for TODO items

The Stack Trace Explorer is simple, under the Tools menu, select Analyse Stack Trace. A new dialog opens that shows a simple text control, which shows the contents of the clipboard by default. Clicking OK on this dialog opens the Stack Trace Explorer, which parses the stack trace and makes each element clickable, so you can use it to navigate to any method or type in the stack trace.

Stack trace explorer


One thing to point out is that it’s not just updates to ReSharper that make it into Rider, but updates to the IntelliJ Platform, too. This build of Rider is based on a newer version of the IntelliJ Platform that gives new features over previous builds, such as improved log views for Git and Mercurial in the source control integration, and even font ligature support in the editor!

However, while it is nice to pull in the latest platform updates, this version of the IntelliJ Platform is still in EAP, which means some of the plugins in the default plugin repository are not yet marked as being compatible. For example, IdeaVim, which adds Vim emulation to the editor, requires an install of an EAP build, from an additional EAP plugin repository, as detailed in the readme.

As ever, please remember that this is still a private EAP build – we’re actively building the product and implementing features, and still require as much feedback as possible. Please try it out (if you haven’t already signed up, you can easily do so on the website), and let us know about any issues you encounter.

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

ReSharper Ultimate 2016.2 EAP: Builds 5 and 6

Another couple of ReSharper 2016.2 EAP builds has appeared since our last post. If you haven’t done it yet, it’s the right time to download and try out new features and fixes. In these builds, we have fixed a numbers of issues as we normally do, improved support for the recently released .NET Core 1.0 and ASP.NET Core 1.0, and below are descriptions of some new features.

HTML analysis inside .cs, .js, and .ts files

If you wanted to cut corners and define some constant piece of HTML right in a string literal, you could miss some errors there… but not any longer. In C#, JavaScript or TypeScript, you can now use the Make HTML here action to enjoy syntax highlighting, error detection and other HTML goodies right inside the string literal:

Injecting HTML inside a string literal

New decompiler features in ReSharper and dotPeek

  • The code that the IL Viewer displays becomes more readable: types, members, type parameters, local variables, etc. are highlighted with distinct colors; loops in your code can be distinguished by corresponding indents and comments:

    IL viewer with highlighting and formatted loops

  • The arsenal of visual dependency analysis tools (Type Dependency Diagram and Project Dependency Diagram) is now extended with the new Assembly Dependency Diagram. You can invoke it on selected assemblies in the Assembly Explorer and study how those and referenced assemblies are linked with each other:

    Hierarchy of assembly references

ReSharper C++

  • The latest 2016.2 EAP build includes an important optimization of C++ code analysis. For example, this optimization makes indexing (first opening) of the Unreal engine project several times faster.
  • Auto-completion in C++ now also suggests symbols that are not included in the current file. Of course, the corresponding #include directives are added automatically:

    Import suggestions in C++ auto-completion

  • There is a new code inspection that warns you about missing include guards in your header files. As a quick-fix, it lets you automatically add #pragma once directive.
  • And there are also a couple of new code formatting options: a line break in a member initializer list, and a space between closing angle brackets in template arguments (for conformance with pre-C++11 compilers).

You are welcome to download the latest 2016.2 EAP build. Should you come across any problems, please let us know in ReSharper, ReSharper C++ or dotPeek issue trackers.

Posted in News and Events | Tagged , , , , , | 6 Comments

ReSharper Ultimate 2016.2 EAP: Builds 3 and 4

In recent weeks, we’ve published builds 3 and 4 of the ReSharper 2016.2 EAP, and we have a lot to share with you, including a couple of new features, as well as the usual round of issues being fixed.

So, what’s new?


First up is continued improvement to our support for .NET Core RC2 projects, with a number of issues fixed.

Secondly is a new feature we’re formally calling Structural Navigation, but is also known as “tab navigation”. The idea of this feature is to allow you to use the Tab and Shift+Tab keys to quickly move the text selection to the next or previous code element without having to use the cursor keys, allowing you to quickly navigate to the next important piece of code you need to edit.

For example, when editing a method call, repeatedly hitting Tab will select each argument in turn.

Structural Navigation navigating method arguments

Or when editing a  for statement, Tab will select the initialiser statement, then the terminating condition and then the iterator statement. Shift+Tab will do the same, but in reverse.

Structural Navigation navigating for loop elements

Of course, Tab will continue to handle template expansion, and will also indent (and Shift+Tab will outdent) when the text caret is placed at the start of a line. But when the text caret is placed with a code element, Tab and Shift+Tab will start navigating and selecting the structure of your code. You can change this behaviour in the options.

We really welcome your feedback on this feature – we’re finding it useful for quickly copying and altering code, or working with elements in string interpolation. This currently works with C#, HTML, XML and XAML as well as Razor files, and we’ll be adding support for other languages as the EAP continues.

SSR patterns can now be suppressed with a standard comment. A Structural Search and Replace pattern can be used to create your own ReSharper inspections, declaratively (see the web help for more details).

These highlights are treated just like ReSharper’s own inspections, with one big exception – until now, it’s not been possible to suppress an inspection with the standard // ReSharper disable once ... style comment.

EAP3 includes a new field in the SSR dialog, called “Suppression key” where you can specify the text that will be used and recognised in the comment.

Suppress SSR pattern with comment

C# support gets a number of new features:

  • Check all parameters of a method for  null (or empty strings) from a single Alt+Enter menu.
    Context action to add guard clauses for all arguments at once
  • You can now uncomment or even delete a comment straight from Alt+Enter.
    Uncomment or delete a comment from the Alt + Enter menu
  • We’ve added new quick-fixes for string literals containing invalid escape characters, to either replace with a verbatim string, or escape the characters.
    Quick-fixes for invalid characters in string literals
  • And interpolated strings get support for localisation, with a highlight to suggest converting the interpolated string to a resource, as well as both a quick-fix and a refactoring to automate the process.

Visual Basic gets some love:

  • String interpolation suggestions, quick-fixes and context actions for VB.NET to convert  String.Format method calls to string interpolation, as well as context actions to convert a string literal to an interpolated string, or insert an interpolated argument.
    Convert VB string concatenation to string interpolation
    Note that this requires  Option Strict to be enabled to ensure correctness of the converted expression.

And the JavaScript, TypeScript and JSON support gets updated:

  • TypeScript support gets a couple of fixes in this build, with the most notable being how we resolve definition files referenced by JSPM (RSRP-458759), by parsing details directly from calls to  System.config().
  • JavaScript rename refactorings will now update JSDoc items.
  • JSON value helpers allow you to tell ReSharper to provide code completion or validation for your own JSON files, either complementing an existing schema, or if the file doesn’t have a schema.
    You can add a helper in the JSON Value Helpers options page, matching based on a filename mask and/or schema match, and providing a path to the JSON property (such as /compilerOptions/rootDir), and the type of helper to apply – regular expression, file path or even license.
    Value helper options
    And then, in the JSON file itself, the value will now get code completion:
    Value helper showing code completion for a file path
    These value helpers are saved by default to the global settings, but using the Save To button in the options dialog, can be saved to a  .sln.dotSettings file that can be checked in and shared with the whole team.
  • Custom JSON schema catalogs can be added in the JSON options. These can be either a file, or a URL, which will be downloaded in the background, and periodically updated. More details can be found in the “Public API” section on
  • Another very useful fix in this version is the return of autocomplete of package version in bower.json files, for all versions of Visual Studio.Code completion for bower packages and versions

ReSharper C++

ReSharper C++ also gets a set of new features:

  • Support for C++14 language features: variable templates and  decltype(auto).
  • Warning about usages of classes and functions marked with the [[deprecated]] / __declspec(deprecated) attribute:
    ReSharper showing highlight for deprecated C++ code
  • Support for the [[noreturn]]/ __declspec(noreturn) attribute in control flow inspections.
  • A code inspection and a quick-fix to replace zero constant with false in boolean context:
    C++ code converting constant expression to boolean
  • New code style options that control the format of generated include directives.
  • Inline Variable refactoring:
    C++ inline variable
  • A new formatter option to allow single line function and lambdas.
  • The mock function generator now supports the Trompeloeil framework.
  • Support for completion, find usages and rename of symbols in doxygen comments.

As ever, please download a fresh build from the EAP page, and if you encounter any issues, please raise an issue in ReSharper or ReSharper C++ issue tracker.

Posted in News and Events | Tagged , , | 21 Comments

Smart Tooltips in dotTrace 2016.1

If you’ve used dotTrace integrated in Visual Studio before 2016.1, you probably noticed its main drawback compared to its standalone counterpart. It lacked the fully functional Threads diagram. The only ability to select threads was to use the Threads filter that had no way of selecting specific time intervals, viewing threads activity, and so on.

dotTrace 2016.1 removes this drawback by adding the exact same diagram you are used to using in the standalone dotTrace Timeline Viewer.

Threads diagram in Visual Studio

But that’s not all! The Threads diagram in both standalone and Visual Studio viewers gets smart tooltips. Hover the mouse over a specific time point on the timeline to see a tooltip showing the current thread state, executed method, and other info. Tooltips are context-sensitive: if some filter is applied, the tooltip will contain additional data on the filtered event.

Use these new tooltips to visually examine the control flow of your application without digging into the call tree.

For example, when no event filters are applied, the tooltip will show only general data for the specific time point: the name of the method that was executed, class and namespace names, as well as thread state:

Smart tooltip

When you apply a filter, the tooltip will also contain info about the filtered event. For example, when you turn on the File I/O filter, the tooltip shows data on file operation, file name and data size:

Smart tooltip with enabled filter

Note that the tooltip also shows data on the filtered time intervals: the overall length of the highlighted interval and how many events it contains:

Smart tooltip with enabled filter

If you apply more filters, the tooltip will simply add their data to the list. For example, if you add the filter by Thread State, the tooltip will additionally show the CPU core data:

Smart tooltip with enabled filters


Note that data on the filtered time intervals at the top of the tooltip also gets updated:

Smart tooltip with two enabled filters

We hope you find this new feature useful. Do try it on your own by installing the latest dotTrace 2016.1 from the ReSharper Ultimate toolset.

Posted in dotTrace Tips&Tricks, ReSharper Tips&Tricks | Tagged , | 3 Comments

ReSharper Ultimate 2016.2 EAP: Build 2

Hello everyone. Last week we have published the second EAP build of ReSharper Ultimate 2016.2.

As usual, there are some fixed issues and a couple of new features:

  • Support of .NET Core RC2 projects, which means that ReSharper now correctly resolves project references and provides its core set of features (code inspections, code completion, navigation, search and refactorings) in projects of this type.
  • Speaking about support of different project types and problems that arise here, ReSharper 2016.2 brings a universal clue to the problem of unresloved project references. While previously it just showed tons of errors in the editor and red SWA indicator, it now notifies you as soon as some project references are unresolved
    ReSharper shows unresolved project references
    and allows to address this in two ways: either list all unresolved references to fix them manually or run MSBuild and obtain correct references that Visual Studio uses for compilation:
    ReSharper helps fixing unresolved references
  • ReSharper’s code inspections, code completion, navigation, search and refactorings are now also available for custom properties and variables in CSS:
    ReSharper supports custom properties and CSS variables.

If you encounter any issues with this EAP build, please report them to ReSharper issue tracker.

That’s it for today. Stay tuned however, because EAP builds that follow will bring much more new features.

Posted in News and Events | Tagged , , | 4 Comments

Advanced course in dotMemory Unit

Some of you know one of our most recently released .NET products: dotMemory Unit, a unit testing framework that helps check your .NET code for memory issues.

In a nutshell, dotMemory Unit adds memory profiling to your unit testing framework. With dotMemory Unit, you can write tests that check your code for all kinds of memory issues, protect already fixed leaks from regression, and use the TDD approach when writing memory-consuming algorithms.

How is all this implemented? In this post, we would like to shed some light on the internals of dotMemory Unit.

If you need an overview of dotMemory Unit before diving in, start with this blog post that explains the basics, then take a look at some usage examples, or refer to online help.

Test methods

It’s all about tests. First of all, dotMemory Unit tries to detect which of your methods are tests. Why does it need that?

First, because you might want to decorate your test with a special attribute to tell dotMemory Unit what to do. For example, you can ask it to check the amount of memory traffic in a test with [AssertTraffic(AllocatedSizeInBytes = 300000)].

The second reason is that it needs to know exactly when each test starts and ends in order to save a memory snapshot if a test fails on a “memory” assertion.

For most unit testing frameworks, namely MSTest, NUnit,, MbUnit and csUnit, dotMemory Unit detects test methods automatically by injecting its calls into the beginning and the end of all tests.

Even if your unit testing framework of choice is not on the list of frameworks supported out of the box, you still can use dotMemory Unit. You can find more details on how to do this later in this post.

Why use lambdas in dotMemory.Check()

In order to get memory state and make assertions you should write something like this in your test:

Why do we need a lambda as an argument of the dotMemory.Check() method to do such a simple thing? There are several reasons for this.

First, you don’t need to write a special “memory test” to detect memory issues, it is enough to add an assertion on memory state to your regular unit test.[1] Such a test (checking both memory and logic) can be run under dotMemory Unit or as an ordinary test. In the latter case, the test will fail as there’s no valid memory data. And this is exactly why we need dotMemory.Check(): the lambda passed into this method will not be called at all if tests are running without dotMemory Unit.[2]

The second reason of having a lambda as an argument in dotMemory.Check() is to know whether a test failed on checking memory state or on checking business logic: it is useful to have snapshots from tests failed on checking memory to go straight to memory problems.

  1. There is an example of such tests (see RemovePetriDish test). It is a normal unit test, checking that there are no items in a collection after removing the last item, but it also checks that there are no items retained in memory, which means no memory leaks.
  2. By default, if dotMemory.Check() is called without dotMemory Unit, it will fail. If you need the test to pass by ignoring dotMemory.Check(), mark the method, class or assembly with the attribute [DotMemoryUnit(FailIfRunWithoutSupport = false)]

Using dotMemoryApi instead of dotMemory.Check()

dotMemory.Check() is suitable for most common simple cases but if you don’t like its syntax or find it unsuitable for any other reason, rest assured there’s an alternative available.

In the following example, dotMemory.Check() looks out of place when memory usage data is gathered during the test and checked just once in the end:

What is the other option? At the heart of dotMemory Unit, there’s the dotMemoryApi class, which is quite simple:

The above example can be rewritten using dotMemoryApi as follows:

But how do we tell dotMemory Unit to save snapshots if a test failed on a memory assertion? Of course, you can use the “save on any fail” auto-saving strategy, but it is not always convenient. Let’s write a single method that uses a lambda as well but looks not as awkward as in the initial example…

…and rewrite the assertion block from our last example:

This call will save a workspace with memory snapshots in case of a failure. As an added bonus, it just looks neat, doesn’t it?

Let’s take a closer look at DotMemoryUnitController and see how it can be useful when dealing with testing frameworks that aren’t supported out of the box.

Unsupported testing frameworks

What should you do if your favorite unit testing framework is not supported by dotMemory Unit out of the box? The answer is, adapt it manually! In fact, all you need is to tell dotMemory Unit where your test method starts, ends and fails. All this can be done using a single DotMemoryUnitController class:

To make it easier and more elegant, you can write your own wrapper or use this one. At the end, your test will look like this (even attributes will work fine):

Although DotMemoryUnitController is mostly designed for unsupported testing frameworks, it also can be used in combination with dotMemoryApi to achieve behavior similar to the dotMemoryUnit.AssertBlock() example above.

More ways to tune

There are many ways how you can fine-tune dotMemory Unit to your liking. For example, if you don’t like the lambda in the GetObjects() method, you can write something like this:

and then completely avoid lambdas in your tests:

Also, don’t miss QueryBuilder. This powerful tool allows creating reusable queries to make your tests more maintainable. For example, we can rewrite one of the examples from this article using QueryBuilder to avoid code duplication:

If you’re using core classes dotMemoryApi, DotMemoryUnitController and QueryBuilder and have a general idea of how dotMemory Unit works inside, you can customize almost everything and write your perfect framework.

Whether you want to go that far or you use the default framework, dotMemory Unit will help you replace time-consuming manual profiling with automated memory tests.

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