Back to Devexpress

How to: Add/Remove Line Breaks to/from Code

coderushforroslyn-120102-getting-started-examples-formatting-how-to-add-remove-line-breaks-to-from-code.md

latest1.1 KB
Original Source

How to: Add/Remove Line Breaks to/from Code

  • Apr 13, 2022
  • 2 minutes to read

Follow the steps below to configure the code style for blank lines and apply this style to all code in your project:

  1. Open the CodeRush menu in the Visual Studio menu bar and select the Options… item to access the CodeRush configuration options.

  2. Open the Editor | C# | Formatting | Blank Lines options page and expand the Excessive Blank Lines group to configure the maximum number of blank lines in your code. For example, set the Max blank lines to keep in code option to 1:

  3. Configure the number of blank lines between regions. Expand the Region group and set Blank lines around to 2, and Blank lines within to 1.

  4. Click Apply to save code style changes.

  5. Configure the Format document code cleanup rule:

  6. Click OK to save the configuration.

  7. Open a source code file.

  8. Run the Code Cleanup :

CodeRush applies the Format document rule in code cleanup.