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
 Inserting spaces inside method brackets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

klakier
New Member

Poland
4 Posts

Posted - Jan 16 2013 :  04:26:14 AM  Show Profile  Reply with Quote
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

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Jan 16 2013 :  7:01:26 PM  Show Profile  Reply with Quote
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?

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

klakier
New Member

Poland
4 Posts

Posted - Jan 17 2013 :  06:58:29 AM  Show Profile  Reply with Quote
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.

Edited by - klakier on Jan 17 2013 06:59:18 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Jan 18 2013 :  11:19:36 AM  Show Profile  Reply with Quote
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

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

klakier
New Member

Poland
4 Posts

Posted - Jan 18 2013 :  11:24:32 AM  Show Profile  Reply with Quote
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!

Edited by - klakier on Jan 18 2013 11:29:50 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Jan 18 2013 :  5:28:45 PM  Show Profile  Reply with Quote
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.

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

klakier
New Member

Poland
4 Posts

Posted - Jan 21 2013 :  04:11:12 AM  Show Profile  Reply with Quote
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 :)
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19014 Posts

Posted - Jan 21 2013 :  11:58:48 AM  Show Profile  Reply with Quote
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

zen is the art of being at one with the two'ness
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