Automatic indentation of arguments list on multiple lines in Visual Studio

前端 未结 2 1972
一个人的身影
一个人的身影 2021-02-20 02:16

When the list of arguments to a method grows to the point where they do not fit comfortably on one line, I like to format code such that each argument is on a separate line (fol

相关标签:
2条回答
  • 2021-02-20 02:57

    You may want to look at Resharper from JetBrains. It has all sorts of rules that can be applied to formatting code that is much better that the built-in VS stuff.

    http://www.jetbrains.com/resharper/

    This particular option is located at:

    Update

    Resharper > Options > C# >Formatting Style > Line Breaks and Wrapping > Wrap long lines

    I don't know if it does exactly what you want, but it does wrap long lines

    0 讨论(0)
  • 2021-02-20 03:15

    For anyone searching this problem for later versions, in visual studio 2017 I found an option to do this. (not sure if it is available in other versions) Under tools->options->Text editor->C/C++->Formatting->Indentation->"Within parentheses, align new lines when I type them"
    Choose the option "Align contents to opening parentheses.

    0 讨论(0)
提交回复
热议问题