Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Inserting spaces inside method brackets

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
klakier Posted - Jan 16 2013 : 04:26:14 AM
There is a fine feature in VAX >>Insert () and closing } ) ] ' " and put xxx spaces between method name and ()<<.

Would it be possible to add feature to enable automatic inserting of spaces inside these autocompleted method brackets? Typing "method(" would autocomplete it as "method( | )" with | being a cursor position. Also typing ")" in front of " )" (space and closing bracket) would just skip inserting a closing bracket and move the cursor to the right of the brackets.

Thanks
-?W
7   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jan 21 2013 : 11:58:48 AM
Unfortunately there is no option to change this yet, but I noted the same problem myself, and it is on our list of things to fix:

case=64684
klakier Posted - Jan 21 2013 : 04:11:12 AM
Thanks for the tip. It does almost what I need, but places the cursor just in front of the last character instead of in the middle (e.g. "( |)" ). Is there and option to change that? This would be exactly what I need :)
feline Posted - Jan 18 2013 : 5:28:45 PM
It turns out there is already a registry key setting to do this, I have added a FAQ entry for it:

http://docs.wholetomato.com?W335

This should help For the more detailed code formatting, a specific code formatting tool will probably help more.
klakier Posted - Jan 18 2013 : 11:24:32 AM
As I said any complications could be simply ommited as inserting spaces within brackets is the most important part of my suggestion and anything more than that is just my personal quirk, which I understand that is not very common ;)

Thanks for the link, from what I see I really must check it out!
feline Posted - Jan 18 2013 : 11:19:36 AM
Unfortunately you are now moving away from a simple "always do this" rule, and this is turning into code formatting, according to your personal style. We don't have any current plans to try and do code formatting, since everyone who wants this wants something different. You might want to look at this tool, which sounds interesting:

http://www.profactor.co.uk/stylemanager.php

Alternatively VS2010 offers some code formatting settings for C#, in

IDE tools menu -> Options -> Text Editor -> C# -> Formatting -> Spacing
klakier Posted - Jan 17 2013 : 06:58:29 AM
Thanks for pointing out the refactoring snippets, I will surely take a look at what can I do with them.

In the case of methods / method calls with no arguments I tend to skip the spaces and just type the brackets alone. I can see how this can be a complication to my idea but the spaces could be simply removed if ")" was pressed with no arguments between brackets. I also usually compress closing brackets in nested calls to something like this:

ret = method( arg1, arg2, anotherMethod( arg31, arg32 ));

just to make it more readable, conserve horizontal space and ease counting closing brackets in case something got messed up. But this may not be that easy to implement so it can be used intuitively, so it could be just omitted.

I should add I usually apply the same rules to <> and [] brackets, but in these cases it may not always be so obvious, because readability of constructions using these brackets may vary greatly, especially with nested use.
feline Posted - Jan 16 2013 : 7:01:26 PM
You can get a bit closer, by making sure the spaces are present in the VA Refactoring snippets:

Refactor Create Implementation
Refactor Extract Method
Refactor Encapsulate Field

so that when VA generates code via its refactoring commands, it will already be formatted how you like.

What about methods calls that don't take any parameters? Do you still want the two spaces inside the brackets then?

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