UE-4.25 Intellisense broken issue #UE-87619

Coming from here:

Basically intellisense is completely down due to preprocessor error in following header:
UnrealEngine\Engine\Source\Runtime\Core\Public\HAL\Platform.h

#define COMPILED_PLATFORM_HEADER(Suffix) PREPROCESSOR_TO_STRING(PREPROCESSOR_JOIN(PLATFORM_HEADER_NAME/PLATFORM_HEADER_NAME, Suffix))

Manifested in following header (same path):
PreprocessorHelpers.h

UE-87619 Effectively breaks anyone using VSCode and UE4 on Linux for development as well as anyone using a source build of the engine with VSCode from the description of the bug.

In 4.24 my c_cpp_properties.json file had 100s of entries in the defines array, and on 4.25 it is empty. Copying the info over from an old project and manually tweaking got intellisense back on track, so the project generator appears to be flawed in some way. Interestingly it appeared as if no defines were being generated for QT Crewtor either, but I do not use that product and have not verified.

Just tried, CLion w/ cmake and cmake-definitions.cmake is empty.
Appears all project generators are not populating the needed definition files in 4.25, this is a much bigger bug than what is identified above.

Can’t recommend moving to 4.25 if you want to have any kind of autocomplete / intellisense with any alternative IDE when working with a source build at this point, appears to be broken across the board.

Rev 71f5ab51b6b8fa9c15b652e86ff86256760fb734, by Ben Marsh, 2020-03-06 18:42:36 MST
Refactor UBT to use an interface (IActionGraphBuilder) to construct the action graph. Response files are also constructed through this interface, allowing them to be tracked as dependencies (will be added in subsequent change).

If you search your project directory you’ll find Definitions.ProjectName.h (replace ProjectName with your project name). It seems to have all the defines c_cpp_properties.json needs. I copied them over and did some regex find/replace to format them correctly.

Intellisense errors disappeared.

VSCode, Windows 10, VS Build Tools

I appreciate the workaround. It is worth noting that this Definitions.ProjectName.h is present in all 4.24 builds as well. Additionally, using this method every time you add a new class, plugin, or do any other action that requires project file generation you will have to manually re-apply this method each time.

If you are going to go this route you would need to do a similar workaround for each IDE you are targeting. I’ve been testing more permutations and it looks like everything except Visual Studio Intellisense is broken. Just tested on my Mac and Xcode is broken too. Project compiles, autocomplete and detecting errors all over the project.

You can try and see if this temporary workaround will work out for you or not.

ue4_25-defines-fix.patch

Just download the file and apply it with git

git apply /path/to/ue4_25-defines-fix.patch

A little late but here’s a guide:

https://gist.github.com/boocs/31e6c2e54815b7ba6246ee20315acf96#Step-9

This worked on Fedora 32/33 Thanks for the patch ! Im not too experienced with the UBT (Unreal Built Tool) code… Can you explain what this patch did ?