UnrealHeaderTool is a parsing and code-generation tool for Unreal Engine. In the Unreal Engine code compilation workflow, the tool parses the C++ header files, looking for Unreal related macros and metadata, and uses this to generate additional code to support the UObject system, such as reflection and networking.
ReSharper provides seamless integration with UnrealHeaderTool: the first time you build the Unreal Engine project, ReSharper finds the UnrealHeaderTool used for the code compilation and can then run the tool in the background as a separate process to check the file you are editing and show the same errors and warnings that you would normally see at compile time. The code analysis results are displayed right in the editor, just like other ReSharper's inspections.
ReSharper runs UnrealHeaderTool only on the file that is currently open, and the process is optimized to have a minimal impact on overall performance.
Watch this video for the integrated UnrealHeaderTool inspections in action:
UnrealHeaderTool can detect lots of different issues with your code, such as using a specific meta tag without the required reflection specifier, using the
GENERATED_BODY macro in a private scope, when an invalid entity is exposed to a blueprint, and a lot more. Here are some examples:
Missing reflection specifiers on a
UFUNCTIONmacro inside a struct.
To distinguish between UnrealHeaderTool checks and ReSharper’s inspections, you can look at the name of the check in square brackets, appended to the inspection message.
Configuring UnrealHeaderTool inspections
As with the built-in inspections, you can use the inspection context menu to quickly change the severity of an UnrealHeaderTool check, suppress it via a comment (in specific scope or globally), or find and investigate all similar issues.