What′s New in ReSharper C++

ReSharper C++ 2017.1 finalizes Visual Studio 2017 RTM support, learns to work with the Open Folder mode and CMake projects. Changes also include improved performance, extended set of postfix templates and code cleanup tasks, as well as updates to control flow inspections.

Free 30-day trial

ReSharper C++ 2017.1

Visual Studio 2017 RTM

Visual Studio 2017 RTM support

Completing the work started in the 2016.3 release, ReSharper C++ improves compatibility with the latest Visual Studio release. It supports Open Folder and CMake projects, as well as the Faster Project Load Visual Studio setting.

Join declaration and assignment quick-fix

Inspections and code cleanup enhancements

  • The Update file header cleanup task and a set of tasks to fix common code issues are added
  • Control flow inspections are updated to handle class fields in addition to local variables and function parameters
  • The inspection Declaration and assignment can be joined is implemented, together with an accompanying quick-fix
  • In order to improve inspection results, ReSharper C++ understands several custom C++ 11 attributes that can be used to mark printf-style functions, functions with side effects, and guard classes for which the Unused variable highlighting should be suppressed
Postfix templates settings page

Postfix templates

The set of postfix templates is 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 C++ postfix templates and some other settings on a Postfix templates page of the ReSharper options.

Indenting of preprocessor directives

Code formatting

  • ReSharper C++ understands formatting rules defined in the EditorConfig files
  • Indent size and style can be auto-detected
  • Indenting of preprocessor directives is now supported
  • New formatter options: Indent namespace members, Space after parentheses in cast expressions and Break line in simple 'case' statement

Performance improvements

ReSharper C++ significantly lowers its memory usage, including both memory footprint after indexing and memory traffic during the indexing, thus reducing lags caused by GC pauses and overall indexing time. Moreover, the reindexing process should trigger less often during the normal workflow, as ReSharper C++ will not, by default, invalidate includers after preprocessing directives change in an included file. A number of issues that previously caused excessive memory usage due to the background editor and Find Results window tabs have also been resolved

Other improvements

Other improvements in ReSharper C++ 2017.1 include:

  • The Find Results window gets a new option to group and filter results by kind of usage
  • Go to Everything and Go to Text popups support inline commands for advanced filtering of search results
  • Context menu on the file status indicator provides quick access to a number of code inspections and commands
Free 30-day trial

ReSharper C++ 2016.3

Introduce or inline a typedef with ReSharper C++

Typedef refactorings

The Introduce typedef refactoring allows you to quickly create a typedef for the selected data type and replace this data type and all its occurrences with the newly created typedef.

The Inline typedef refactoring does the inverse: it replaces an existing typedef with the actual data type.

Postfix templates for C++

Postfix completion

Postfix code completion allows you to focus on your data, rather than the syntax. When you type a dot (.) or an arrow (->) after an expression, ReSharper C++ will suggest free functions that would accept that expression as the first parameter. If you accept the suggestion, ReSharper C++ rewrites your code so that the expression is passed as the first argument.

ReSharper C++ gets some postfix template goodness as well. Postfix templates can help you transform expressions without the need to go back in the code. You can now quickly wrap an expression with one of the following templates: if, else, while, do, return, switch and foreach.

Support for Catch unit testing framework

Catch support

In addition to Boost.Test and Google Test frameworks, unit testing assistance is now available for the Catch C++ test framework. Therefore, you can now use ReSharper C++ unit test runner to discover, run, and debug Catch tests in Visual Studio.

Initial support for Visual Studio 2017 RC

Visual Studio 2017 RC initial support

ReSharper C++ 2016.3 can be installed into Visual Studio 2017 RC just like all other ReSharper Ultimate 2016.3 tools.

Please note that in order to work with ReSharper C++, you should set Enable Faster Project Load to false under Tools | Options | Text Editor | C/C++ | Experimental. We plan to support this new project load mode in further updates.

Support for C# style XML documentation

Tooltips and XML documentation

ReSharper C++ can now display rich, syntax highlighted tooltips for C++ code elements. The tooltips will display function and variable types, as well as documentation. In addition, \tparam references in Doxygen comments are now properly resolved and can be renamed.

C#-style XML documentation comments are also sometimes used for C++ symbols . With ReSharper C++ 2016.3 they are correctly displayed in the Quick Documentation pop-up (Ctrl+Shift+F1) and in the quick info tooltip.

C++ code analysis from the command line

Starting from version 2016.3, ReSharper C++ code inspections become available via InspectCode, a free command line tool that allows running ReSharper inspections outside of Visual Studio.

To use InspectCode, please download and unzip the command line tools package and run InspectCode.exe with your solution file as a parameter. To learn more about using InspectCode, please read this article.

Other improvements

Other improvements in ReSharper C++ 2016.3 include:

  • Support for nested namespace definitions introduced in C++17 and a context action to use the new syntax for nested namespaces.
  • Third-party code settings page that allows to exclude files from indexing: this page allows adding files, folders and wildcards to be treated either as "skipped" or "library".
  • Support for asynchronous Find Results.
  • New options for C++ code formatter: Spaces within parentheses in cast expressions, Place enumerators on new line, Align chained method calls and Align chained binary expressions.
  • Support for Boost.Test in Boost 1.62.
Free 30-day trial

ReSharper C++ 2016.2

Inline Variable refactoring in C++

Inline Variable refactoring

The mainline ReSharper's refactorings continue to make their way into ReSharper C++.

The latest update adds Inline Variable, which replaces all occurrences of a given variable or local constant with its initializer. The reverse functionality is provided by Introduce Variable.

Quick Documentation pop-up

Quick Documentation pop-up

ReSharper C++ 2016.2 adds the Quick Documentation pop-up to display documentation based on Doxygen comment blocks without having to navigate to a symbol's definition: just hit Ctrl+Shift+F1 in the default keymap.

Even if there is no Doxygen documentation available for a symbol, Quick Documentation will show the symbol's signature.

Generating stubs for C++ documentation comments

Generate and maintain doc comments

In a related change, you can now generate documentation comments for C++ declarators, classes and macro definitions via Alt+Enter. If you're not a fan of the comment stub that ReSharper C++ uses by default, you can customize it by editing the doc live template.

Speaking of documentation, ReSharper C++ can now complete, find usages and rename symbols in Doxygen comments.

Quick-fix to generate a missing switch default case

New code inspections and quick-fixes

ReSharper C++ 2016 further extends its assortment of code inspections and automated fixes.

For example, there's a new code inspection that warns you about missing include guards in your header files. An associated quick-fix helps automatically add a #pragma once directive.

Another new inspection detects a missing default case in a switch statement and suggests a quick-fix to add one.

In other news, ReSharper 2016 can now warn you about usages of classes and functions marked as [[deprecated]] or __declspec(deprecated).

Code style settings for default pointer initializer

More code style preferences

ReSharper C++ 2016.2 introduces code style preferences for default pointer initializer. You can specify 0, nullptr or NULL as the preferred initializer style, and ReSharper C++ will respect your choice when it generates new initializers for you. A similar code style preference is added for #include directives.

The code formatter is also evolving with new options for single-line functions and lambdas, blank lines around single-line function definitions, space between closing angle brackets in template arguments, and more ways to tune formatting to your or your team's preferences.

Auto-completion for C++ symbols not included in current file

Auto-completion adds includes

Automatic code completion in ReSharper C++ 2016.2 learns to suggest symbols that are not yet included in the current file. When you select a symbol like this in the completion list, the corresponding #include directive is added automatically.

Auto-highlighting for exit points

Auto-highlighting exit points

When you put the caret on one of exit points from a function, loop or a switch statement (return, throw, break etc.), ReSharper C++ will now automatically highlight all other exits.

Free 30-day trial