Bug with Unreal Code and "Change function signature"

I have a fairly large Unreal C++ project. I am doing some extensive rewriting at the moment mainly based on changing a variable type from int32 to int64.

 

When using the "change Function signature" feature of Resharper C++ I oftentimes find the RS adds invalid includes at the top of either the H or the Cpp file with references to the Unreal engine.

 

for instance I have a medium sized h/cpp file here with the following function

UFUNCTION(BlueprintCallable, category = "Mikaboshi|Objects", Meta = (ExpandEnumAsExecs = "Branches"))

void
UObjectManager::GetCharacterSubobjectSkills(
int64 CharacterID,
TArray<int32>& SubobjectValues,
TArray<int32>& AvailableDanceMoves,
TEnumAsByte<FE_ITEM_FOUND_TYPE>& Branches)

with the header in the h and the body in the Cpp file. When I use the RS "Change signature" function from the cpp file, RS includes the marked include lines regarding Android in the H file:

#include "UE_Client.h"

#include "SharedStructureLibrary.h"
#include "Account.h"
>#include "Android/AndroidPlatformMath.h"
>#include "Android/AndroidPlatformMath.h"
>#include "Android/AndroidPlatformMath.h"
>#include "Android/AndroidPlatformMath.h"

#include "ObjectManager.generated.h"

Note that I don't even have the Android support of UE installed. When I use the same functionality from the H file by clicking on the declaration, RS adds those lines at the top of the CPP file instead.

 

It doesn't seem to happen all the time because I used it extensively and it happened only with some cpp/h files. I can not determine what triggers it but it must be something with Unreal because I did the same kind of changes in a related project that is a pure windows project without Unreal and the "Change Signature" function worked without problem for hundreds of files.

 

 

 

 

 

2 comments
Comment actions Permalink

Hello,

This seems similar to https://youtrack.jetbrains.com/issue/RSCPP-30507. If you have a specific scenario that we can repeat to better understand the problem, please share it with us. Are you perhaps performing these changes in newly added files? At the moment with UE 4.25 you have to run "Refresh VS project" from Unreal Editor after adding a new source file for R++ to pick up the correct compilation properties.

Thanks!

0
Comment actions Permalink

I added a comment here https://youtrack.jetbrains.com/issue/RSCPP-30507  for reference.

Im using UE 4.24 and the files are old files, not new ones

 

0

Please sign in to leave a comment.