Back to Devexpress

How to: Wrap All Long Lines in Code

coderushforroslyn-120103-getting-started-examples-formatting-how-to-wrap-all-long-lines-in-code.md

latest1.2 KB
Original Source

How to: Wrap All Long Lines in Code

  • Apr 13, 2022
  • 2 minutes to read

Follow the steps below to configure code line wrapping and apply this format 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. Configure the Right margin column size. This option allows you to specify the minimum line length for which a formatting rule is applied:

  3. Show the right margin line in the code editor (optional):

  4. Configure wrapping style for chained method calls and lambda expression in the Editor | C# | Formatting | Wrapping options page:

  5. Click Apply to save the code style changes.

  6. Configure the Format document code cleanup rule:

  7. Click OK to save the configuration.

  8. Open a source code file.

  9. Run Code Cleanup :

CodeRush applies the Format document rule in code cleanup.