Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 UE4 : Overriding VS indent after UPROPERTY()

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Hugh Posted - Nov 15 2019 : 06:50:41 AM
Hi,

I'm not sure how doable this is for Visual Assist, but one thing that I find irritating when developing for UE4 in Visual Studio is the fact that, after a UPROPERTY() or UFUNCTION() line, VS wants to indent. And even if I delete the indentation initially, when I add the semicolon at the end of the property or function line, it re-indents it.

I've considered turning off auto-indent, but is this anything that could be overridden by Visual Assist specifically for UE4?

Thanks
22   L A T E S T    R E P L I E S    (Newest First)
sean Posted - Feb 20 2020 : 11:12:56 PM
case=141706 was created for RIGVM_METHOD() and GENERATED_BODY().
case=141706 is implemented in build 2366.
https://support.wholetomato.com/default.asp?W404#2366
sean Posted - Feb 20 2020 : 11:08:04 PM
case=141693 is fixed in build 2366.
https://support.wholetomato.com/default.asp?W404#2366
Hugh Posted - Jan 13 2020 : 10:31:06 AM
Thanks - it's definitely nice to not have the annoyance any more!
ChrisG Posted - Jan 13 2020 : 10:26:59 AM
We are working on expanding the fix to copy and paste as well. Right now the fix only works when typing in the editor.

Glad to see it's been helpful!
Hugh Posted - Jan 13 2020 : 10:25:17 AM
I'm definitely liking the changes that you guys made - it makes life much more pleasant!

I did discover one scenario where it does still indent - when pasting something that changes the first character on the line.

If you have:


    UFUNCTION( BlueprintCallable )
    void Initialise();


And then you copy something like "bool" then select "void" and press CTRL-V, it'll indent that line.

It only seems to happen if the paste affects the first character on the line. If you paste it anywhere else, there is no indent.
ChrisG Posted - Jan 06 2020 : 10:26:25 AM
Got it. I created a case to watch for the RIGVM_METHOD and GENERATED_BODY u*macros as well.

Thanks for the feedback.
Zeblote Posted - Jan 05 2020 : 09:05:05 AM
Oh you are right, those first 4 actually work properly.

RIGVM_METHOD seems to be something new related to Control Rig system, I saw it with the other macros. It is used like this:

ChrisG Posted - Jan 05 2020 : 08:39:10 AM
It has been on our TODO list for a while. Glad we could finally get around to it as well.

Can you give me an example of when VS inserts unwanted indention after using the following macros? My experience is that macros used in the global scope do not have the unnecessary indent problem.
USTRUCT(...)
UCLASS(...)
UINTERFACE(...)
UENUM(...)

We do watch for the following macros.
UFUNCTION(...)
UPROPERTY(...)
GENERATED_USTRUCT_BODY()
GENERATED_UCLASS_BODY()
GENERATED_UINTERFACE_BODY()
GENERATED_IINTERFACE_BODY()

I have never seen the RIGVM_METHOD(...) macro, and google isn't pulling up results either. Can you give me an example of how it is used?

It seems the following macro I missed, and we should start watching for it as well in the next release.
GENERATED_BODY()
Zeblote Posted - Jan 02 2020 : 9:00:20 PM
Nice! Fixing this stupid auto-indent will make so many people happy.

Btw, just in case you aren't aware, there are more than UPROPERTY() and UFUNCTION(). Auto-indent should be stopped after all of these macros:
UPROPERTY(...)
UFUNCTION(...)
USTRUCT(...)
UCLASS(...)
UINTERFACE(...)
UENUM(...)
RIGVM_METHOD(...)
GENERATED_BODY()
GENERATED_USTRUCT_BODY()
GENERATED_UCLASS_BODY()
GENERATED_UINTERFACE_BODY()
GENERATED_IINTERFACE_BODY()
ChrisG Posted - Jan 02 2020 : 3:36:36 PM
Zeblote, I have identified the issue thanks to the log.
ChrisG Posted - Jan 01 2020 : 10:33:42 PM
Got it, and it's perfect. I'll investigate the issue tomorrow (It's late here) and get back to you.
Zeblote Posted - Jan 01 2020 : 9:48:26 PM
I enabled the log file, typed the same thing as in the video, then turned the log back off. The result is ginormous, so I'm not sure if it worked correctly, but I sent it to that email anyway. Auto-reply has assigned it case 141687.
ChrisG Posted - Jan 01 2020 : 4:32:40 PM
Thanks for the video Zeblote. Visual Assist should be preventing the indentation after semicolon. I can't reproduce the issue so far on my end, but Visual Assist may be missing the semicolon key.

Could you please enable logging (Performance tab of Visual Assist Options dialog), reproduce the issue, and send the log you capture to [email protected]? It should show what keypresses Visual Assist is seeing. If that doesn't solve it, I may add more logging to see where things are going wrong.
Zeblote Posted - Jan 01 2020 : 2:27:11 PM
Here's a video to clarify the issue:
https://dl.dropboxusercontent.com/s/f99u02xj3fk3xrt/2020-01-01_20-24-36.mp4

Using VA 2358 and VS 16.4.2.
Hugh Posted - Jan 01 2020 : 2:12:32 PM
I haven�t tried it myself yet, but I�ll give it a go in the next day or so and will let you know.

Thanks
ChrisG Posted - Jan 01 2020 : 09:52:22 AM
Also, what Unreal macro are you seeing the indention after? (ex. UFUNCTION)
sean Posted - Jan 01 2020 : 09:39:11 AM
The semicolon case was specifically supposed to be addressed. There may be some additional settings at play that we did not find/mitigate. What version of Visual Studio are you using? The dev that worked on the fix will followup in this thread.
Hugh Posted - Jan 01 2020 : 09:11:43 AM
That�s a shame. I was excited when I saw the release notes but if it still changes it on typing a semicolon then it�s not all that different than before in practice.
Zeblote Posted - Jan 01 2020 : 12:28:20 AM
That's honestly not that useful considering it's immediately indenting it anyway as soon as I type the ; at the end of the declaration. Could that be overridden too?
sean Posted - Dec 20 2019 : 2:37:34 PM
Build 2358 has improvements in this area when typing but not for the format selection command.
https://support.wholetomato.com/default.asp?W404
http://builds.wholetomato.com/binaries/VA_X_Setup2358_0.exe
Hugh Posted - Nov 15 2019 : 10:32:10 AM
Ah - fantastic - glad to hear it's on the radar. And thanks for the pointer to the regex - I'll give that a go.
feline Posted - Nov 15 2019 : 09:07:35 AM
We are looking to add a feature to VA to stop the IDE formatting doing this all of the time:

case=109205

For now though, if it helps, I have worked out a regular expression search and replace that you can run across your code files to remove this extra indent. It is explained in this thread:

https://forums.wholetomato.com/forum/topic.asp?TOPIC_ID=16718

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000