Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 UE4 : Overriding VS indent after UPROPERTY()
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Hugh
New Member

9 Posts

Posted - Nov 15 2019 :  06:50:41 AM  Show Profile  Reply with Quote
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

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Nov 15 2019 :  09:07:35 AM  Show Profile  Reply with Quote
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

zen is the art of being at one with the two'ness
Go to Top of Page

Hugh
New Member

9 Posts

Posted - Nov 15 2019 :  10:32:10 AM  Show Profile  Reply with Quote
Ah - fantastic - glad to hear it's on the radar. And thanks for the pointer to the regex - I'll give that a go.
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Dec 20 2019 :  2:37:34 PM  Show Profile  Reply with Quote
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
Go to Top of Page

Zeblote
Tomato Guru

183 Posts

Posted - Jan 01 2020 :  12:28:20 AM  Show Profile  Reply with Quote
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?
Go to Top of Page

Hugh
New Member

9 Posts

Posted - Jan 01 2020 :  09:11:43 AM  Show Profile  Reply with Quote
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.
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Jan 01 2020 :  09:39:11 AM  Show Profile  Reply with Quote
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.
Go to Top of Page

ChrisG
Whole Tomato Software

USA
299 Posts

Posted - Jan 01 2020 :  09:52:22 AM  Show Profile  Reply with Quote
Also, what Unreal macro are you seeing the indention after? (ex. UFUNCTION)
Go to Top of Page

Hugh
New Member

9 Posts

Posted - Jan 01 2020 :  2:12:32 PM  Show Profile  Reply with Quote
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
Go to Top of Page

Zeblote
Tomato Guru

183 Posts

Posted - Jan 01 2020 :  2:27:11 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

ChrisG
Whole Tomato Software

USA
299 Posts

Posted - Jan 01 2020 :  4:32:40 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

Zeblote
Tomato Guru

183 Posts

Posted - Jan 01 2020 :  9:48:26 PM  Show Profile  Reply with Quote
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.

Edited by - Zeblote on Jan 01 2020 9:49:53 PM
Go to Top of Page

ChrisG
Whole Tomato Software

USA
299 Posts

Posted - Jan 01 2020 :  10:33:42 PM  Show Profile  Reply with Quote
Got it, and it's perfect. I'll investigate the issue tomorrow (It's late here) and get back to you.
Go to Top of Page

ChrisG
Whole Tomato Software

USA
299 Posts

Posted - Jan 02 2020 :  3:36:36 PM  Show Profile  Reply with Quote
Zeblote, I have identified the issue thanks to the log.
Go to Top of Page

Zeblote
Tomato Guru

183 Posts

Posted - Jan 02 2020 :  9:00:20 PM  Show Profile  Reply with Quote
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()

Edited by - Zeblote on Jan 02 2020 9:11:56 PM
Go to Top of Page

ChrisG
Whole Tomato Software

USA
299 Posts

Posted - Jan 05 2020 :  08:39:10 AM  Show Profile  Reply with Quote
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()

Edited by - ChrisG on Jan 06 2020 10:02:25 AM
Go to Top of Page

Zeblote
Tomato Guru

183 Posts

Posted - Jan 05 2020 :  09:05:05 AM  Show Profile  Reply with Quote
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:

Go to Top of Page

ChrisG
Whole Tomato Software

USA
299 Posts

Posted - Jan 06 2020 :  10:26:25 AM  Show Profile  Reply with Quote
Got it. I created a case to watch for the RIGVM_METHOD and GENERATED_BODY u*macros as well.

Thanks for the feedback.
Go to Top of Page

Hugh
New Member

9 Posts

Posted - Jan 13 2020 :  10:25:17 AM  Show Profile  Reply with Quote
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.
Go to Top of Page

ChrisG
Whole Tomato Software

USA
299 Posts

Posted - Jan 13 2020 :  10:26:59 AM  Show Profile  Reply with Quote
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!
Go to Top of Page

Hugh
New Member

9 Posts

Posted - Jan 13 2020 :  10:31:06 AM  Show Profile  Reply with Quote
Thanks - it's definitely nice to not have the annoyance any more!
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Feb 20 2020 :  11:08:04 PM  Show Profile  Reply with Quote
case=141693 is fixed in build 2366.
https://support.wholetomato.com/default.asp?W404#2366
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Feb 20 2020 :  11:12:56 PM  Show Profile  Reply with Quote
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000