ReSharper C++ 2023.1

Agrega vistas previas de sustitución de macros en información sobre herramientas y ventanas emergentes de Quick Documentation.
Abril 6, 2023
Nueva versión

Características

Macro substitution previews

  • When hovering over a macro, you can now see its expansion preview in the tooltip, with full syntax highlighting and proper code formatting. You can still use the Substitute macro call context action to expand it right in the editor, but the instant preview makes working with macros easier.
  • The Quick Documentation popup (Ctrl+Shift+F1) also now allows you to click on any entity from the substitution preview and check out its documentation. If the macro expansion contains an unknown identifier, it will be highlighted in the substitution preview in both the on-hover tooltip and the Quick Documentation popup to help you spot issues.

C++20 modules

  • Improved handling of more corner cases and improved support for real-world projects that make use of them. The list of ReSharper C++ features that help you write modularized code has also been expanded.
    • Find usages now lets you find all locations where a given module is imported.
    • The Rename refactoring now helps you safely rename modules and module partitions, updating all the relevant declarations and imports in your code.
    • Code completion offers improved support for the C++20 modules syntax. Names of known modules are suggested when you are about to import one, and the completion list also includes the module-related keywords where they are allowed.
    • Updated several coding assistance features to support C++20 modules. The code formatter and Rearrange code now handle export blocks and exported entities.

C++23 support

  • 'Deducing this' is a major C++23 feature that introduces a new way to specify member functions. You can now make the object parameter explicit with the this keyword, which simplifies the implementation of several C++ idioms. For example, you can now replace identical function overloads that differ only by their const and reference qualifiers with just one function that deduces the type and value category of the object parameter.
  • C++23 brings more ways to use auto. With auto(x) and auto{x} you can now make a copy of the argument as if it were passed as a function argument by value.
  • ReSharper C++ also supports the following C++23 updates that streamline the existing language syntax:
    • Empty parentheses () in lambdas are now optional in many cases.
    • Alias declarations are now allowed in init statements.
    • Labels are now allowed at the end of compound statements.

Unreal Engine

  • You can now quickly add a simple or a complex Unreal Engine test using the new built-in file templates. Just go to Solution Explorer and right-click on the preferred project folder to open the Add menu (or use Ctrl+Alt+Insert).
  • ReSharper C++ provides a new UINTERFACE live template, complementing the existing UCLASS, USTRUCT, and UENUM templates. Simply select the corresponding item in the code completion list to add a new interface class when working on an Unreal Engine project.
  • You can now specify source directory mappings that will be used to resolve #include directives in shader files. If you have RiderLink installed in the game or engine project, you can also load shader mappings directly from Unreal Engine.
  • A new completion item lets you generate a lambda expression where a delegate, TFunction, or TFunctionRef argument is expected.

Call tracking

  • You can now view and navigate through call chains in the hierarchy of incoming calls. Just place the caret at any function and select Inspect | Incoming calls from the context menu or press Ctrl+Shift+Alt+A to invoke it from the Inspect This menu. In the call tracking results window, you can double-click on the hierarchy entry to navigate to the corresponding call in the editor or expand any node to check out its incoming calls. Tracking outgoing calls is currently not supported.

Code analysis

  • Introduced an inspection that flags function parameters of expensive-to-copy types that are passed by value. In such cases, ReSharper C++ suggests passing the parameter by const reference instead. On the other hand, the Create function from usage fix will now prefer to pass parameters of types that are cheap to copy by value. The following new code inspections warn you about potential code smells:
    • One inspection identifies unused template parameters and type aliases in a local scope, as well as redundant base class initializers.
    • Another inspection marks unused return values of functions that return HRESULT or NTSTATUS error codes.
  • Added an inspection that lets you know when C++17 class template argument deduction fails to deduce the template arguments, allowing you to quickly add the required arguments with a fix.
  • ReSharper C++ now also includes many improvements for the compile-time evaluation engine, such as the evaluation of range-based for loops and better support for unions.

Refactorings

  • You can now access most of the refactorings easily from the Alt+Enter menu in addition to the dedicated Refactor This popup (Ctrl+Shift+R).
  • The new Create parameter fix provides a convenient shortcut to the Change signature refactoring. When you need to add a new parameter to a containing function, just invoke the fix and enter the type of the new parameter. The refactoring will update all the function declarations and usages, notifying you of any conflicts.
  • Calling the Extract method and Change signature refactorings is now more straightforward:
    • If you need to extract a one-line function, you no longer have to select the whole line, since the refactoring now extracts the current line when no selection is active.
    • Change signature can now be invoked while the caret is anywhere in the function signature instead of just on the name of the function, as was previously the case.

Other enhancements

  • ReSharper C++ now supports the __VA_OPT__ macro, which was introduced in C++20 to help define variadic macros. This special functional macro expands to its arguments when the variable argument list is not empty and expands to nothing otherwise.
  • By default, file paths are put before folders when sorting #include directives. If you prefer to have all includes in alphabetical order, you can now disable the new Put files before folders option.
  • A new postfix template allows you to quickly make a const reference with std::as_const or AsConst in Unreal Engine projects.
  • Comments beginning with /* are no longer auto-closed with */ by default. You can enable auto-insertion of the closing comment with the new Insert */ after /* typing-assist option.
ReSharper C++

ReSharper C++

Extensión de Visual Studio para desarrollo C++.

¿Alguna pregunta?

Chatee en vivo ahora mismo con nuestros especialistas en licencias de JetBrains.