How can I change the indent rules inVisual Studio?
How do you configured Visual Studio c++ indent for source code?
By default, it puts a tab indent after a macro like UPROPERTY() and in Epic code there are not indent.
I want to be as close as possible to Epic Formating.
I was just struggling with this myself. I don't believe it's possible to make Visual Studio treat this case correctly. One option is to sidestep the problem on a case-by-case basis, as NickDarnell describes, but that can get really obnoxious.
Another option is just to turn off Visual Studio's auto-formatting entirely. This is unfortunate, because when it works it can be a very nice feature. However, Unreal's heavy use of macros and it's custom pre-processor can confuse the auto-formatter.
To turn it off, go to Tools -> Options... -> Text Editor -> C/C++ -> Formatting -> General, and then uncheck all of the checkboxes there.
Note that when you hit return after the UPROPERTY line, it will still give you the initial indentation. But it will no longer insist on re-inserting that indentation all the time.
In Visual Studio Community 2013:
Go to Tools > Options > Text Editor > C/C++ > Tabs In the "Indenting" section select "Block" instead of Smart.
It will stop over-indenting after macros such as GENERATED_BODY(). However:
Alternative trick: add a semicolumn after the macro, and get some peace with that. Don't forget to remove it later, or you will have a compile error.
Follow this question
Once you sign in you will be able to subscribe for any updates here