Author |
Topic  |
|
Hugh
New Member

9 Posts |
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 |
|
feline
Whole Tomato Software
    
United Kingdom
19136 Posts |
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 |
zen is the art of being at one with the two'ness |
 |
|
Hugh
New Member

9 Posts |
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. |
 |
|
sean
Whole Tomato Software
    
USA
2817 Posts |
|
Zeblote
Tomato Guru
    
183 Posts |
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? |
 |
|
Hugh
New Member

9 Posts |
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. |
 |
|
sean
Whole Tomato Software
    
USA
2817 Posts |
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. |
 |
|
ChrisG
Whole Tomato Software
    
USA
299 Posts |
Posted - Jan 01 2020 : 09:52:22 AM
|
Also, what Unreal macro are you seeing the indention after? (ex. UFUNCTION) |
 |
|
Hugh
New Member

9 Posts |
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 |
 |
|
Zeblote
Tomato Guru
    
183 Posts |
|
ChrisG
Whole Tomato Software
    
USA
299 Posts |
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
Tomato Guru
    
183 Posts |
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. |
Edited by - Zeblote on Jan 01 2020 9:49:53 PM |
 |
|
ChrisG
Whole Tomato Software
    
USA
299 Posts |
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. |
 |
|
ChrisG
Whole Tomato Software
    
USA
299 Posts |
Posted - Jan 02 2020 : 3:36:36 PM
|
Zeblote, I have identified the issue thanks to the log. |
 |
|
Zeblote
Tomato Guru
    
183 Posts |
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() |
Edited by - Zeblote on Jan 02 2020 9:11:56 PM |
 |
|
ChrisG
Whole Tomato Software
    
USA
299 Posts |
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() |
Edited by - ChrisG on Jan 06 2020 10:02:25 AM |
 |
|
Zeblote
Tomato Guru
    
183 Posts |
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
Whole Tomato Software
    
USA
299 Posts |
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. |
 |
|
Hugh
New Member

9 Posts |
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
Whole Tomato Software
    
USA
299 Posts |
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
New Member

9 Posts |
Posted - Jan 13 2020 : 10:31:06 AM
|
Thanks - it's definitely nice to not have the annoyance any more! |
 |
|
sean
Whole Tomato Software
    
USA
2817 Posts |
|
sean
Whole Tomato Software
    
USA
2817 Posts |
|
|
Topic  |
|