c# - How can you apply auto format to method calls in variable declarations in Visual Studio? - Stack Overflow

My auto format rules are set to add a space before and after parens in method calls, but they do not ap

My auto format rules are set to add a space before and after parens in method calls, but they do not apply if the method call is in the same line as a declaration.

I've gone through the formatting settings for my language and turned on spacing options.

This auto formats the spacing in the method call:

bool example = true;
string myString;
myString = GetMyString( example );

But this does not:

bool example = true;
string myString = GetMyString( example);

My auto format rules are set to add a space before and after parens in method calls, but they do not apply if the method call is in the same line as a declaration.

I've gone through the formatting settings for my language and turned on spacing options.

This auto formats the spacing in the method call:

bool example = true;
string myString;
myString = GetMyString( example );

But this does not:

bool example = true;
string myString = GetMyString( example);
Share Improve this question asked 16 hours ago Christie LittleChristie Little 1 New contributor Christie Little is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
Add a comment  | 

1 Answer 1

Reset to default 0

Please try the following options to add a space before and after parens in method calls.

Tools->Options->C#->Code Style->Formatting-Spacing

Checked Insert space within argument list parentheses

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743758154a4502133.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信