Skip to content

Commit

Permalink
update csharp_space_between_parentheses with default value
Browse files Browse the repository at this point in the history
  • Loading branch information
gewarren committed Jan 30, 2025
1 parent 233bbc8 commit d38b964
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: C# formatting options
description: Learn about the code style options for formatting C# code files.
ms.date: 12/13/2022
ms.date: 01/30/2025
dev_langs:
- CSharp
---
Expand Down Expand Up @@ -593,10 +593,10 @@ for(int i;i<x;i++) { ... }
| **Option values** | `control_flow_statements` | Place space between parentheses of control flow statements |
| | `expressions` | Place space between parentheses of expressions |
| | `type_casts` | Place space between parentheses in type casts |
| | `false` (or any other value) | Ignore spaces between parentheses |
| **Default option value** | `` | |
| | `false` (or any other value) | Prefer no spaces between parentheses |
| **Default option value** | `false` | |

If you omit this rule or use a value other than `control_flow_statements`, `expressions`, or `type_casts`, spaces between parentheses are ignored, meaning new spaces aren't added and existing spaces aren't removed.
If you omit this rule or use any value other than `control_flow_statements`, `expressions`, or `type_casts`, spaces between parentheses of control flow statements, expressions, and type casts are removed.

Code examples:

Expand All @@ -611,6 +611,8 @@ var z = ( x * y ) - ( ( y - x ) * 3 );
int y = ( int )x;

// csharp_space_between_parentheses = false
for (int i = 0; i < 10; i++) { }
var z = (x * y) - ((y - x) * 3);
int y = (int)x;
```

Expand Down

0 comments on commit d38b964

Please sign in to comment.