Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Indentation for method arguments in source file

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
rryk Posted - Feb 26 2012 : 05:24:57 AM
Hi,

By default VAX adds spaces around arguments to the function. This leads to an additional space after opening parenthis:
void Foo:bar( int argument1, float argument2, Foo & other )
However when breaking the arguments line into several lines (usually to keep code under 80 characters wide) it aligns second and other arguments to the first character after parenthsis:
void Foo:bar( int argument1, 
             float argument2,
             Foo & other )
In my opinion this should be consistent - either remove the space or make arguments align to the first argument.
3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Feb 29 2012 : 11:50:25 AM
Spaces around the brackets seems to be quite common, and having the spaces there helps to show that VA can do this, and this leads to the observation that the spaces can be removed.

Any default formatting or style is going to look wrong for quite a few of our users, since there are so many different styles and standards out there. So we just had to pick something and hope it was not to bad.

As for the indenting of the line when you split it, an easy check is to select the code and press CTRL-K, CTRL-F which is the default keyboard shortcut for the IDE command:

Edit menu -> Advanced -> Format Selection

this way you can see what the IDE thinks the formatting should look like, so you can tell if the formatting is coming from the IDE or not.
rryk Posted - Feb 29 2012 : 03:29:18 AM
My suggestion was to make no spaces around arguments as a default to make it consistent, though I didn't know that Visual Studio makes the indentation when the like is broken on its own. What made you choose this style as default? I think it's more common not to have spaces.
feline Posted - Feb 28 2012 : 3:05:17 PM
The formatting / indenting when you break these lines is coming from the IDE, not from VA. You may be able to control this slightly in the IDE options, depending on the IDE you are using.

For the leading and trailing spaces around the arguments, you can control these yourself. Assuming you are seeing this happening when using VA's refactoring commands, just look for and edit the spacing in the VA Snippets for the refactoring commands. The Snippets are called:

Refactor Create Implementation
Refactor Encapsulate Field
Refactor Document Method
Refactor Extract Method

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