ReSharper C++ 2022.3

C++20 모듈에 대한 지원을 추가하고, clang-format을 대체 코드 포맷터로 통합하는 기능을 추가합니다.
12월 12, 2022
신규 버전

기능

C++20 modules

  • ReSharper C++ now adds experimental support for C++20 modules. Modules introduce a new compilation model, where instead of using header files, you split your code into independently compiled components.
  • In new code, you should use named modules, which explicitly declare their interface in .ixx module interface files. But in order to make the transition easier, C++20 also provides a way to use existing, well-behaved header files as modules through header units. Both ways to create and consume modules are now supported by ReSharper C++.
  • ReSharper C++ now properly handles the new syntax: module declarations that introduce modules and module partitions, import declarations that consume other modules, and the export of entities from module interfaces. And like it does for include directives, ReSharper C++ will warn you about unresolved module names or paths in import declarations.
  • In code navigation, all the features you’re used to now work for entities imported from modules. With support for module declarations, you can now use Go to Declaration on the module name in import declarations, navigate to module declarations from File Structure, and search for modules with Go to Symbol.
  • If you want to quickly create a module, you can now use a new built-in file template - Module interface unit.
  • The code completion list now includes items from all the imported modules and header units.

C++ support

  • Introduced support for the #pragma pack directive, which modifies the current alignment for classes and structures. ReSharper C++ now correctly computes the size of packed structures.
  • Added a lot of improvements for working with emplace-like and make-like function calls. However, these features were limited to classes and functions from the standard library. In this release, ReSharper C++ can show you parameter info and inlay hints for any similar function defined in your code.
  • Introduced support for the extended C++20 version of [[nodiscard]], which includes a reason why a function or a class has been marked with the attribute. Now you’ll get a clearer warning with the specified reason when the result of a function call is not used.
  • This release also brings improvements for compile-time evaluation. ReSharper C++ now correctly handles various forms of object initialization, including the evaluation of constructors of any kind – default, implicitly generated, inherited, and user-defined.
  • Improved support for calling conventions. ReSharper C++ now understands the GNU style for specifying calling conventions in function declarations for compilers that support this syntax (void __attribute__((stdcall)) bar()).

Unreal Engine

  • If an asset is affected by renaming a symbol, Unreal Engine will no longer recognize it. To prevent data loss, ReSharper C++ now suggests adding a Core Redirect when you perform the Rename refactoring. If accepted, the corresponding .ini file is updated automatically.
  • The Add Core Redirect option was already available for UCLASS and UPROPERTY, and now it also works for UFUNCTION, USTRUCT, and UENUM.
  • Added a new Blueprint-specific inlay hint. You can now quickly check how many blueprints use a function marked with the BlueprintCallable specifier and get a list of all usages from the hint’s context menu.
  • ReSharper C++ no longer offers unwanted entities from system headers and shader files in auto-import suggestions.
  • Included updates for the latest Unreal Engine 5.1 version.

Code formatting

  • Added seamless integration with clang-format as an alternative code formatter. You can now switch between ReSharper’s own formatting engine and сlang-format when formatting files.
  • ReSharper C++ runs the clang-format binary in a separate process, ensuring full compatibility with the industry-standard formatter, as well as better performance and a more extensive range of formatting options.
  • By default, ReSharper C++ uses the built-in clang-format binary. You can now configure ReSharper C++ to run any other clang-format binary on the Code Editing | C++ | Formatting Style | General page of the ReSharper options.
  • For those who prefer ReSharper’s own formatter or would like to quickly set up the formatting style via Detect formatting settings, ReSharper C++ now introduces some new formatting options to configure:
    • Spaces before and after ellipses (…) in parameter packs.
    • The number of blank lines that are acceptable in declarations and in the rest of the code.
    • Whether blank lines are kept or removed after an opening brace ({) and before a closing one in declarations and in the rest of the code.
    • Blank lines before and after access specifiers.
    • Alignment of enumerator initializers in columns.

Coding assistance

  • ReSharper C++ now shows the origin of a function in parameter info and other tooltips, identifying whether a function is implicitly generated (e.g. constructors or assignment operators), built-in (e.g. operator + for fundamental types), or a compiler intrinsic (e.g. functions with the __builtin_ prefix).
  • Added two useful new additions to help you make conditions more readable:
    • A context action that replaces && with || and vice versa inside boolean expressions, following De Morgan’s laws.
    • An inspection with a quick-fix that simplifies negated comparison expressions.
  • Updated the bundled Clang-Tidy binary to Clang 15, adding new checks from the latest LLVM release.
C++20 modules

ReSharper C++

C++ 개발을 위한 Visual Studio 확장.

ReSharper C++ 도 구매할 수 있습니다:

궁금한 점이 있으세요?

JetBrains 사 제품 라이선스 담당자와 라이브 채팅