[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Collapse]CodeRush
  System Requirements
  Improve Performance
 [Expand]Features by Language
 [Expand]Getting Started
 [Expand]How To
 [Expand]Coding Assistance
 [Expand]Navigation and Search Tools
 [Expand]Static Code Analysis
 [Expand]Visualization Tools
 [Collapse]Code Style Assistance
  [Expand]Code Formatters
   Programming Style Rules
   Naming Conventions
  [Expand]Code Cleanup
   Remove Unused Assembly References
  [Collapse]Document Formatting (C#)
    General
    Blank Lines
    Braces
    Spacing
    Wrapping
    Other
   Document Formatting (XAML)
   Organize Members
   Move Member to Region
  Building Assistance
  Debugging Assistance
 [Expand]Refactoring Assistance
 [Expand]Unit Testing Assistance
 [Expand]Decompiling Tools
 [Expand]Configuration Options
 [Expand]Extensibility
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Wrapping

The Wrapping options page provides settings for the following code elements' wrapping rules:

  • LINQ Expression
  • Arithmetic Expression
  • Relational Expression
  • Bitwise Expression
  • Logical Expression
  • Ternary Expression
  • Assignment Expression
  • Arguments
  • Parameters
  • Array Initializer
  • Collection Initializer
  • Object Initializer
  • Chained Method Calls
  • Lambda Expression
  • Expression Body
  • Type Parameters
  • Null Coalescing Expression
  • Base List
  • Constructor Initializer

Each element of these expressions has configuration options. You can set the following wrapping options:

  • How CodeRush should wrap expression elements:

    • No wrap - does not add extra line breaks. This option removes existing line breaks if the Keep existing line breaks checkbox is checked in the Editor | C# | Formatting | General options page.
    • Wrap if Long or Multiline - adds line breaks to wrap lines that exceed the margin.
    • Simple Wrap - adds line breaks to wrap those expression elements that exceed the margin.
    • Wrap - wraps all code elements regardless of the right margin.
  • The line break's position before or after the code element.

  • Align by - allows CodeRush to align wrapped lines by an element at the first line.
  • Indent - allows you to specify wrapped lines indentation.
  • Tolerance - you can specify the minimum parameter count for which the formatting rule is applied. This option is available for arguments, parameters, array initializers, collection initializers, and object initializers.
  • Wrap first - you can define whether to wrap the first element in an assignment expression.

The image below shows the wrapping settings for the Arguments item.

Is this topic helpful?​​​​​​​