最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin1浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论