ReSharper C++ 2023.3

Released: Dec 6, 2023

Actualizaciones en 2023.3

Características

AI Assistant is out of preview [General Availability]

  • JetBrains AI Assistant is now generally available with a number of new and improved features to increase your productivity. Our latest set of improvements includes better project awareness for AI Actions and a prompt library.
  • You can use AI Assistant in ReSharper C++ as a supplemental feature with a JetBrains AI Service subscription.

HLSL and Unreal Engine updates

  • HLSL 2021 introduced C++-like template functions and data types. The latest ReSharper C++ update brings full support for HLSL templates.
  • This release introduces support for the HLSL built-in RayQuery type and enhances code completion to suggest the corresponding flags.
  • Added a new inspection which helps you avoid falling into one of the common traps of the AddDynamic helper macro. You'll now get a warning when a dynamic delegate function is not marked with the UFUNCTION macro.
  • The Alt+Insert shortcut is available to automatically generate common type members. In this release, the generation of hash functions has been tuned to follow the Unreal Engine conventions.

C and C++ support

  • By using __has_cpp_attribute(operand) in preprocessor conditions, you can now test whether the compiler recognizes the attribute referenced by its operand. ReSharper C++ now correctly handles __has_cpp_attribute to better support attribute annotations in C++ standard libraries.
  • Introduced support for the pack pragma used with the __pragma keyword. The __pragma (pack) syntax is sometimes used inside macro definitions since it's not possible to use #pragma directives inside a macro definition. In cases like this, ReSharper C++ now correctly computes sizes of packed structures so that you can rely on code analysis results.
  • ReSharper C++ adds support for several C features:
    • The C99 restrict type qualifier that can be used in pointer declarations.
    • Type deduction, constexpr, and nullptr from C23.
  • Support has also been introduced for several new clang intrinsics, such as __is_const(), __is_member_pointer(), and others, to make ReSharper C++ work better with cross-platform code.

Grammar and spelling checking

  • JetBrains Grazie has become ReSharper's new built-in grammar and spelling checker. Grazie supports over 20 languages and catches natural language errors within programming languages supported by ReSharper (C#, C++, VB.NET), markup languages (HTML, XML, XAML), and comments.
    • Please note that grammar checking is currently not available in doxygen comments.

Working with inactive code

  • With platform-specific or configuration-specific code, you may often find yourself editing currently inactive code blocks inside conditional preprocessor branches. Previously, code completion in inactive code only offered macros. In this release, code completion has been improved in these scenarios to include symbols from the global scope.
  • Find Usages now finds possible usages in inactive code and macro bodies. Previously, if you wanted to find these usages, you had to use Find Usages Advanced and investigate textual occurrences. Now Find Usages results include potential usages in macro bodies and inactive code by default. These usages are grouped into separate sections to distinguish them from usages in active code.

Code analysis

  • You can use ReSharper-specific C++ attributes to make ReSharper analyze your solution with greater accuracy and insight. In this release, the [[jetbrains::...]] prefix has been added in addition to [[rscpp::...]] for the existing [[jetbrains::format]], [[jetbrains::guard]], and [[jetbrains::has_side_effects]] attributes.
  • The new [[jetbrains::pass_by_value]] attribute lets you suppress the Pass value by const reference inspection for function parameters.
  • Introduced a set of inspections for incorrect usage of the export keyword in C++20 modules. ReSharper C++ now suggests removing export when another export declaration already encloses the declaration or when the declaration is not part of a module interface unit and cannot be exported. You'll also get a suggestion to move export if you try templating the export declaration instead of exporting the template declaration.
  • Upgraded the bundled clang-tidy binary to Clang 17, bringing updates from the latest LLVM release.
  • Some clang-tidy checks output more details in addition to the warning text. ReSharper C++ now shows these additional notes in the tooltip.
  • Added a new inspection which warns about the usages of multicharacter literals. They are conditionally supported with implementation-defined values and should be used carefully in portable code.
  • ReSharper C++ now suggests a quick-fix to remove redundant conditional operators and simplify ternary conditional expressions.

Coding assistance

  • The Alt+Insert Generate menu helps you quickly create boilerplate code. In this release, a new action has been added to the list, allowing you to generate a destructor.
    • When invoked in a polymorphic class, the action will use syntax style settings to insert the required virtual and/or override specifiers. You can configure the body style of the generated destructor on the Code Editing | C++ | Code Generation options page.
  • The #pragma region and #pragma endregion directives let you specify a foldable block of code. Similar to other matching directives, you can now jump between the two using the Go to Declaration action on a #pragma directive or a new inlay hint with the region name.
  • The File Structure window now allows you to conveniently fold regions and navigate to the corresponding code blocks.
  • In C code, void should be used in the parameter list of a function to indicate that the function doesn't take any arguments. ReSharper C++ now preserves this special void when you invoke the Extract method or Change signature refactorings, generate a definition for the function, or create a new function from its usage.
  • Reference inlay hints now have a separate [>>] text so that you can spot forwarding references at a glance.
  • The new Generate inline definitions action lets you quickly generate bodies for several functions simultaneously. Similar to the existing Generate definitions, the new action is available when a class name or several function declarations are selected in the editor.
  • When you invoke the Introduce variable or Introduce field refactorings on a nested expression, ReSharper C++ now lets you choose the target expression explicitly instead of automatically using the outermost one.
  • To improve the code navigation experience, symbols that came from macro substitutions are now hidden from Go to and the File Structure window. This is helpful with macros that introduce many auxiliary symbols during their expansion, like declarations of test cases in popular unit-testing frameworks.

Code formatting

  • This release introduces several new formatting options:
    • Break line before -> in trailing return types.
    • Break line after -> in trailing return types.
    • Spaces within empty blocks.
    • Allow comments after {.
  • The bundled clang-format binary has been upgraded to Clang 17 and support has been implemented for the InsertNewlineAtEOF clang-format setting both when importing formatter settings from a .clang-format config and when using clang-format instead of the built-in formatter.