Download

Fix in C++ Macros for UFUNCTION, UPROPERTY, etc... to make visual studio stop autoindenting?

This has been really bugging me for a long time.

Visual Studio seems to want to autoindent the next line after using UFUNCTION and UPROPERTY macros in C++ for some reason.

I always have to manually unindent the next line where I declare the actual function or variable.

My guess is something in the macros makes visual studio think the next line needs to indent. Is it possible to fix this or maybe some setting in Visual Studio I can disable?

Those macros are empty, they just markers for UHT and they are bypassed by compiler. The reason of it is lack of “;” in them, but if you place “;” at the end of them you get UHT error, so either Epic need to add “;” in macros (if this won’t make compiler issues) or make UHT ignore ; so you can add it yourself.

Has anyone found a solution for this? It gets obnoxious when you have autoformat on save enabled… Which means I can’t use that ultra useful feature of VS

This has nothing to do with UE4 and is due to how indenting is set up in Visual Studio, to change it do; Tools - Options - Text Editor - C++ - Tabs - Indenting and set it to Block, instead of Smart, this should fix the issue hopefully for you. Cheers,

New Visual Assist fixed it.

https://support.wholetomato.com/default.asp?W404

Look for ‘indent’. If that does not work for you, there is also this extension: https://forums.unrealengine.com/comm…und-ue4-macros

Wow, it took them 6 years. Just when I switched to Resharper++ :smiley: