Visual Studio Extension for C++ Developers
ReSharper C++ helps C/C++ developers by providing on-the-fly code analysis, quick-fixes, powerful search and navigation, smart code completion, refactorings, a variety of code generation options and other features to help increase your everyday productivity
ReSharper C++ extends Visual Studio with over 60 C++ code inspections that highlight errors and problems in your code as you type. For many of these inspections, ReSharper C++ provides quick-fixes (light bulbs) to improve code in one way or another
How ReSharper C++ Helps Visual Studio Users
Analyze and improve code quality
ReSharper C++ starts analyzing code as soon as you open your project in Visual Studio, and keeps reanalysing files as you edit them, detecting errors and possible problems before you even compile.
ReSharper C++ comes with 40+ quick-fixes to instantly solve many of the code issues that is detects. Whenever you see a light bulb to the left of your code, hit Alt+Enter to apply a suggested quick-fix.
For example, ReSharper C++ detects uninitialized variables and helps initializing them with the default value. It also offers quick-fixes to add missing 'include' directives or remove redundant qualifiers in a particular statement, or in a larger scope such as a file or even the entire solution.
Quick-fixes in ReSharper C++ are also useful in that they help you start using classes, methods, variables, properties and fields before you declare them. When ReSharper detects an undeclared symbol, it suggests quick-fixes to generate the corresponding symbol declaration based on its usage.
Clang-Tidy is a powerful open-source code analysis tool, based on the popular clang compiler. It comes with the extensive set of code checks and accompanying fixes. ReSharper C++ provides seamless integration with Clang-Tidy, meaning that it simply works in the background as you edit your code, with inspection results shown on-the-fly in the code editor along with built-in inspections. ReSharper C++ also lets you apply the fixes provided by Clang-Tidy individually, as scope actions, or from Code Cleanup.
Find usages and navigate the solution
Find Usages in C++ code lets you find all usages of a specific symbol in the solution. It comes up with a preview window, with options for filtering and grouping items in the list of found occurrences.
With ReSharper C++, you can view the structure of the current document using the File Structure window, which greatly simplifies navigation in large files. As you switch to another editor tab, the tool window displays the structure of the corresponding file.
ReSharper C++ helps you find your way through the source code by letting you search for declarations, members, method calls, or members of an inheritance hierarchy.
For all symbols that have separate declarations and definitions, ReSharper C++ displays the Navigate to declaration/definition icon on the left.
Other context-sensitive navigation options in ReSharper C++ include navigating from a selected symbol to its usages, base or derived symbols.
ReSharper C++ also offers context-insensitive navigation commands including Go to File, Go to Symbol, Go to File Member and Go to Everything. All these commands support lowerCamelCase-based search and filtering by path.
Generate common code
ReSharper C++ provides a wide variety of ways to generate boilerplate code. One way of generating code relies on quick-fixes to automatically generate symbols based on their existing usages. Additionally, you can use ReSharper C++ to generate definitions based on existing declarations.
ReSharper C++ also offers a handy way to generate missing members, overriding members, equality or relational operators, hash and swap functions and constructors:
Finally, ReSharper C++ comes with 29 customizable templates. Some of them are regular code snippets, others are specifically used to wrap around code selections. You can use and create file templates as well. Pressing Ctrl+Alt+Ins helps you quickly add a class to the project you're working on.
Refactor and transform code
Code refactorings for C++ help safely change your code base, which is especially important in a language as non-trivial as C++.![Refactorings in ReSharper C++](introduce_field_1_.png)
Context actions help switch between alternative syntax constructs and serve as shortcuts to code generation actions. ReSharper provides a set of context actions that target C++ code. Context actions are optional code transformations that usually help switch between alternative syntax options.
For example, you can quickly merge or invert
There are also actions to reorder member initializer, create declaration by definition, merge nested if statements, substitute a macro call or typedef, generate missing case statements when switching over an enum, or initialize a field from a constructor parameter.
In addition, ReSharper C++ highlights various matching items when you set the caret at one item in a pair, be it matching delimiters, macros or a format specifier and argument in a printf function call.
Use a consistent code style
Configuring code formatting options and naming style, sharing settings with your teammates, and maintaining a consistent code style should never be a problem again.![Code formatter in ReSharper C++](configure_format_1_.png)
ReSharper C++ allows you to configure and apply code formatting rules and a naming style that you prefer to use when working on a specific solution. To ensure a consistent code style across the entire team, you can save your formatting and naming preferences to a settings file and share it among your teammates.
As an alternative to digging through all available code style options, you can select a block of code and configure only those formatting rules that are applicable to this block observing the changes right in this block.
Compilation times are one of the biggest problems in large real-world C++ projects. ReSharper C++ comes with the Includes Analyzer, a code inspection tool which helps you gauge which header files in your project contribute the most in terms of lines of code to the total compilation workload. ReSharper C++ analyzes the files in the given scope and give a report in a dedicated tool window. The report lists files sorted by the number of lines of code they contribute together with their transitively included files.