UnrealHeaderTool not regenerating PLUGIN headers?

Normally to regenerate the files that are named like "MyClass.generated.h" in the \Intermediate directory, I right-click on the main .uproject file and select “Generate Visual Studio Files”. I do this because on occasion the \Intermediate directory will become stale and I simply trash it (along with the \Binaries folder, of course).

This works fine for the main project, but for plugins it’s pretty hit-and-miss. And the hard part is, even if I just add a new class to my plugin and need to generate the "MyClass.generated.h" file the first time, sometimes it won’t work. And without that generated header, the whole project will not compile.

Is there a solid fix for this? Or even better, is there a way to manually use the UnrealHeaderTool from the command line to regenerate the \Intermediate directory? I have been trying every combination of flags I can think of on C:\Program Files\Rocket\Engine\Binaries\Win64\UnrealHeaderTool.exe while in my project’s plugin directory, including passing it my .Build.cs and Public project header.

REQUEST: It would be great to have some documentation on the UnrealHeaderTool (or at least a -h or --help flag for it).

But more pressing, why does the “Generate Visual Studio Files” not also regenerate Plugin \Intermediate folders?

Generating Visual Studio projects is not supposed to generate intermediate headers. It’s an interesting idea though – we could make it do that. I’ll discuss it more with folks here. The main benefit that I see is that you would initially have all of the source files when opening the IDE the first time, even before trying to build the game and plugin. This means that IntelliSense is more likely to behave that way you’d expect.

As I mentioned in another thread, we’ve made improvements to how UnrealBuildTool detects that code needs to be generated for plugins and the next beta release will hopefully address your problem!

–Mike