UCLASS() not being interpreted by intellisense

I have a specific question related to UCLASS() not being interpreted by intellisense in specific situations.

UCLASS() fails to be interpreted when it is placed anywhere other than line 9 due to which I have to place the forward declarators inside the class. Not that it should matter, but it is quite odd…

Edit: I certainly have to write forward declarations outside. Otherwise, it doesn’t compile

This is typical for IntelliSense and UE4, when you put new includes, IntelliSense goes nuts cause of Unreal macros. Build project, close VS2017 and reopen it again. The best case solution is to download Visual Assist, which is way better than VS’ IntelliSense. Your code is actually working fine, it’s just that IntelliSense is not that smart

Thank you for your answer! I will try building it next time. I have been eyeing Visual Assist for quite some time now. I hope it goes on sale on black Friday… Hehe

You can get away with it if you let the UCLASS() code in line 12 (assuming you still got the 3 comment lines that Unreal makes by default when creating a class). Other than that you have to build again which takes some time, so before you do that and you know you will include more classes, just give make a bigger empty comment.

Hmm…! Do you mean like this?. Doesn’t work for me though. But yes, building project and restarting VS definitely helps! Thanks you guys! BTW, I noticed your names on the high karma list on the livestream yesterday. That’s pretty awesome!

It looks like you deleted the 3 lines at some point or Unreal didn’t make them when creating a class, hence you are getting no red underlines when putting the UCLASS in line 9. Don’t ask me why, but Intellisense is saving this line when Building your class and if it’s not on this line anymore, you get your red underlines. So you can think ahead and Build with UCLASS in line x, so you don’t need to Build again when adding something.

thats a good idea… thanks!