Skip to content

Commit dc2f5ab

Browse files
committed
edits
1 parent 0ae34f8 commit dc2f5ab

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

docs/ide/create-portable-custom-editor-options.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ You can manually populate an EditorConfig file, or automatically generate it bas
2121

2222
When you add an EditorConfig file to your project in Visual Studio, only new lines of code are formatted based on the EditorConfig settings. The formatting of existing code isn't changed unless you run the **Code Cleanup** or **Format Document** commands. For more information, see [Apply code styles](../ide/code-styles-and-code-cleanup.md).
2323

24+
For .NET, Visual Studio provides a formatted version of the `.editorconfig` file.
25+
2426
::: moniker range=">= vs-2022"
2527
:::image type="content" source="media/vs-2022/editorconfig-dotnet.png" alt-text="Screenshot that shows the .editorconfig file.":::
2628
::: moniker-end
@@ -33,7 +35,7 @@ When you use an EditorConfig file, you can still continue to set your own person
3335

3436
## Code consistency
3537

36-
EditorConfig file settings let you maintain consistent coding styles and conventions in a codebase, regardless of the editor or IDE you use. Some coding styles you can control are indent style, tab width, end-of-line characters, and encoding. For example, if your C# codebase has a convention that indents use five space characters, documents use UTF-8 encoding, and lines ends with CR/LF, you can configure an EditorConfig file to use this convention.
38+
EditorConfig file settings let you maintain consistent coding styles and conventions in a codebase, regardless of the editor or IDE you use. Some coding styles you can control are indent style, tab width, end-of-line characters, and encoding. For example, if your C# codebase has a convention that indents use five space characters, documents use UTF-8 encoding, and lines ends with CR/LF, you can configure an EditorConfig file to use this convention. For information on supported conventions, see [Supported settings](#supported-settings).
3739

3840
EditorConfig files are useful when coding conventions you use on your personal projects differ from those conventions used on your team's projects. For example, you might prefer that an indent adds a tab character in your code. However, your team might prefer that an indent adds four spaces instead. EditorConfig files resolve this problem by letting you have a configuration for each scenario.
3941

@@ -46,7 +48,9 @@ Because an `.editorconfig` file in the codebase contains the EditorConfig settin
4648

4749
## Supported settings
4850

49-
The editor in Visual Studio supports the core set of [EditorConfig properties](https://editorconfig.org/#supported-properties):
51+
EditorConfig supports all Visual Studio-supported languages except XML.
52+
53+
For each language, the editor in Visual Studio supports the core set of [EditorConfig properties](https://editorconfig.org/#supported-properties):
5054

5155
- indent_style
5256
- indent_size
@@ -57,8 +61,6 @@ The editor in Visual Studio supports the core set of [EditorConfig properties](h
5761
- insert_final_newline
5862
- root
5963

60-
EditorConfig supports all Visual Studio-supported languages except XML.
61-
6264
For C# and Visual Basic, EditorConfig also supports [code-style rules](/dotnet/fundamentals/code-analysis/code-style-rule-options) including [language](/dotnet/fundamentals/code-analysis/style-rules/language-rules), [formatting](/dotnet/fundamentals/code-analysis/style-rules/formatting-rules), and [naming](/dotnet/fundamentals/code-analysis/style-rules/naming-rules). For example, you can specify a C# language rule regarding the use of var when defining variables. Or, you can specify a naming rule that async method names must include an "Async" suffix.
6365

6466
## Add and remove EditorConfig files
@@ -75,7 +77,7 @@ If there is no EditorConfig file, you can add one to the project using one of th
7577

7678
- [Manually add the EditorConfig file](#add-an-editorconfig-file-to-a-project).
7779

78-
- Use [IntelliCode for Visual Studio](/visualstudio/ide/intellicode-visual-studio) to generate an `.editorconfig` file in your solution. Right-click in Solution Explorer and choosing **Add** > **New EditorConfig (IntelliCode)** from the context menu. IntelliCode for Visual Studio infers your code styles from existing code, and then creates an EditorConfig file with your code-style preferences predefined.
80+
- Use [IntelliCode for Visual Studio](/visualstudio/ide/intellicode-visual-studio) to generate an `.editorconfig` file in your solution. Right-click in Solution Explorer and choose **Add** > **New EditorConfig (IntelliCode)** from the context menu. IntelliCode for Visual Studio infers your code styles from existing code, and then creates an EditorConfig file with your code-style preferences predefined.
7981

8082
### Generate an EditorConfig from code-style settings
8183

@@ -111,9 +113,13 @@ To add an EditorConfig file to your project or solution, follow these steps:
111113

112114
:::image type="content" source="media/vs-2022/editorconfig-item-templates-new.png" alt-text="Screenshot that shows EditorConfig file item templates in Visual Studio.":::
113115

116+
If you don't see the item template, you need to add the file manually or you can add the Intellicode version of `.editorconfig`, and then modify it for your language.
117+
114118
1. Select the **editorconfig File (empty)** template to add an EditorConfig file prefilled with default EditorConfig options for whitespace, code style, and naming conventions. Or, select the **editorconfig File (.NET)** template to add an EditorConfig file prefilled with default [.NET whitespace, code style, and naming conventions](/dotnet/fundamentals/code-analysis/code-style-rule-options).
115119

116120
A new `.editorconfig` file appears in Solution Explorer, and opens in the editor as a new tab.
121+
122+
For .NET, Visual Studio provides a formatted version of the file, as follows.
117123

118124
::: moniker range=">= vs-2022"
119125
:::image type="content" source="media/vs-2022/editorconfig-dotnet-new.png" alt-text="Screenshot that shows the .editorconfig file in Solution Explorer and editor.":::

0 commit comments

Comments
 (0)