Skip to content

Add missing "Organize usings" .editorconfig setting for separating using groups #2310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions docs/ide/editorconfig-code-style-settings-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,7 @@ The following list shows the formatting convention rules available in Visual Stu
- .NET formatting settings
- [Organize usings](#usings)
- dotnet_sort_system_directives_first
- dotnet_separate_import_directive_groups
- C# formatting settings
- [Newline options](#newline)
- csharp_new_line_before_open_brace
Expand Down Expand Up @@ -1426,6 +1427,7 @@ The following table shows the rule name, applicable languages, default value, an
| Rule name | Applicable languages | Visual Studio default | Visual Studio 2017 version |
| ----------- | -------------------- | ----------------------| ---------------- |
| dotnet_sort_system_directives_first | C# and Visual Basic | true | 15.3 |
| dotnet_separate_import_directive_groups | C# and Visual Basic | true | 15.5 |

**dotnet\_sort\_system\_directives_first**

Expand Down Expand Up @@ -1454,6 +1456,34 @@ Example *.editorconfig* file:
dotnet_sort_system_directives_first = true
```

**dotnet\_separate\_import\_directive\_groups**

- When this rule is set to **true**, place a blank line between using directive groups.
- When this rule is set to **false**, do not place a blank line between using directive groups.

Code examples:

```csharp
// dotnet_separate_import_directive_groups = true
using System.Collections.Generic;
using System.Threading.Tasks;

using Octokit;

// dotnet_separate_import_directive_groups = false
using System.Collections.Generic;
using System.Threading.Tasks;
using Octokit;
```

Example *.editorconfig* file:

```EditorConfig
# .NET formatting settings:
[*.{cs,vb}]
dotnet_separate_import_directive_groups = true
```

### C# formatting settings

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

# this. preferences
dotnet_style_qualification_for_field = false:none
Expand Down