Skip to content

Commit 280d092

Browse files
authored
Merge pull request #2310 from tiesmaster/master
Add missing "Organize usings" .editorconfig setting for separating using groups
2 parents 69059e3 + 723d6ac commit 280d092

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

docs/ide/editorconfig-code-style-settings-reference.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,7 @@ The following list shows the formatting convention rules available in Visual Stu
13841384
- .NET formatting settings
13851385
- [Organize usings](#usings)
13861386
- dotnet_sort_system_directives_first
1387+
- dotnet_separate_import_directive_groups
13871388
- C# formatting settings
13881389
- [Newline options](#newline)
13891390
- csharp_new_line_before_open_brace
@@ -1426,6 +1427,7 @@ The following table shows the rule name, applicable languages, default value, an
14261427
| Rule name | Applicable languages | Visual Studio default | Visual Studio 2017 version |
14271428
| ----------- | -------------------- | ----------------------| ---------------- |
14281429
| dotnet_sort_system_directives_first | C# and Visual Basic | true | 15.3 |
1430+
| dotnet_separate_import_directive_groups | C# and Visual Basic | true | 15.5 |
14291431

14301432
**dotnet\_sort\_system\_directives_first**
14311433

@@ -1454,6 +1456,34 @@ Example *.editorconfig* file:
14541456
dotnet_sort_system_directives_first = true
14551457
```
14561458

1459+
**dotnet\_separate\_import\_directive\_groups**
1460+
1461+
- When this rule is set to **true**, place a blank line between using directive groups.
1462+
- When this rule is set to **false**, do not place a blank line between using directive groups.
1463+
1464+
Code examples:
1465+
1466+
```csharp
1467+
// dotnet_separate_import_directive_groups = true
1468+
using System.Collections.Generic;
1469+
using System.Threading.Tasks;
1470+
1471+
using Octokit;
1472+
1473+
// dotnet_separate_import_directive_groups = false
1474+
using System.Collections.Generic;
1475+
using System.Threading.Tasks;
1476+
using Octokit;
1477+
```
1478+
1479+
Example *.editorconfig* file:
1480+
1481+
```EditorConfig
1482+
# .NET formatting settings:
1483+
[*.{cs,vb}]
1484+
dotnet_separate_import_directive_groups = true
1485+
```
1486+
14571487
### C# formatting settings
14581488

14591489
The formatting rules in this section apply only to C# code.
@@ -2187,6 +2217,7 @@ charset = utf-8-bom
21872217
[*.{cs,vb}]
21882218
# Organize usings
21892219
dotnet_sort_system_directives_first = true
2220+
dotnet_separate_import_directive_groups = false
21902221

21912222
# this. preferences
21922223
dotnet_style_qualification_for_field = false:none

0 commit comments

Comments
 (0)