Author |
Topic  |
|
cpr2323
New Member

3 Posts |
Posted - Mar 09 2018 : 1:42:56 PM
|
The coding style guide I am currently working with (on a contract) requires formatting where there is a space between function names and the open paren IF there are parameters, but no space before the paren if there are not parameters.
func1 (param) and func2()
Can I configure VA to do this?
|
|
feline
Whole Tomato Software
    
United Kingdom
19136 Posts |
Posted - Mar 09 2018 : 2:45:39 PM
|
Unfortunately no, since VA does not really do code formatting. The IDE has some code formatting options, which have been expanded in VS2017. Otherwise, if you want this done automatically, you are going to need to look up a code formatting tool. |
zen is the art of being at one with the two'ness |
 |
|
cpr2323
New Member

3 Posts |
Posted - Mar 09 2018 : 8:45:57 PM
|
Hmm.. I guess I'm slightly confused, since VA gave me to option to insert a space in between function name and the paren, which is code formatting. This puts me in the reverse situation I was in without VA, ie. not having a space. So, now I'm deleting a space for the no param version, instead of inserting it for the with param version. I thought there might be some config file with some sort of pattern matching that defined all these rules. Thank for the info. |
 |
|
feline
Whole Tomato Software
    
United Kingdom
19136 Posts |
Posted - Mar 10 2018 : 05:46:26 AM
|
VA offers you some control over the formatting of the code we insert / generate for you. For example, there are VA Snippets to control the formatting of the code generated by refactoring commands and the comments inserted via Document Method. The setting you are talking about here is:
VA Options -> Editor -> Insert () and closing } ) ] ' " and put X spaces between method name and ()
but we don't attempt to offer "full" code formatting control. The problem with doing this is the number of different settings it requires, since it seems that everyone who wants code formatted has a slightly different set of requirements.
I don't ever recall coming across this formatting rule before, and no, unfortunately VA does not offer this level of control over the spaces. I don't think VS2017 does either. |
zen is the art of being at one with the two'ness |
 |
|
|
Topic  |
|