You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ide/code-styles-and-code-cleanup.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ You can define code style settings per-project by using an [EditorConfig file](#
30
30
::: zone pivot="programming-language-dotnet,programming-language-cpp,programming-language-dotnetf"
31
31
## Code styles in EditorConfig files
32
32
33
-
Code style settings can be specified by adding an [EditorConfig](../ide/create-portable-custom-editor-options.md) file to your project. EditorConfig files are associated with a codebase rather than a Visual Studio personalization account. Settings in an EditorConfig file take precedence over code styles that are specified in the **Options** dialog box. Use an EditorConfig file when you want to enforce coding styles for all contributors to your repo or project. They are especially useful to ensure consistency for in a teams programming environment.
33
+
Code style settings can be specified by adding an [EditorConfig](../ide/create-portable-custom-editor-options.md) file to your project. EditorConfig files are associated with a codebase rather than a Visual Studio personalization account. Settings in an EditorConfig file take precedence over code styles that are specified in the **Options** dialog box. Use an EditorConfig file when you want to enforce coding styles for all contributors to your repo or project. They are especially useful to ensure consistency in a teams programming environment.
34
34
35
35
To add an EditorConfig file, see [Ways to add an EditorConfig file](../ide/create-portable-custom-editor-options.md#ways-to-add-an-editorconfig-file).
36
36
::: zone-end
@@ -119,7 +119,7 @@ When you change a code style in the Options page or add an EditorConfig file to
119
119
120
120
::: moniker range=">=vs-2022"
121
121
122
-
Visual Studio has a **Code Cleanup** button at the bottom of the editor (keyboard: **Ctrl**+**K**, **Ctrl**+**E**) to apply code styles from an EditorConfig file or from the **Code Style** options page. If an *.editorconfig* file exists for the project, those are the settings that take precedence.
122
+
To apply code styles from an EditorConfig file or from the **Code Style** options page, use the **Code Cleanup** button at the bottom of the editor (keyboard: **Ctrl**+**K**, **Ctrl**+**E**). If an *.editorconfig* file exists for the project, those are the settings that take precedence.
123
123
124
124
::: zone pivot="programming-language-dotnet,programming-language-dotnetf"
125
125
> [!TIP]
@@ -132,17 +132,21 @@ To apply code styles:
132
132
133
133

134
134
135
+
::: zone pivot="programming-language-cpp"
136
+
C/C++ options include C++ in the name of the fixer.
137
+
::: zone-end
138
+
135
139
1. After you've configured code cleanup, use one of the following methods to run code cleanup:
136
140
137
141
- Click on the broom icon or press **Ctrl**+**K**, **Ctrl**+**E**.
138
142
139
143

140
144
141
-
- To run code cleanup across your entire project or solution, right-click on the project or solution name in **Solution Explorer**, select **Analyze and Code Cleanup**, and then select **Run Code Cleanup**.
145
+
- To run code cleanup across your entire project or solution, right-click the project or solution name in **Solution Explorer**, select **Analyze and Code Cleanup**, and then select **Run Code Cleanup**.
142
146
143
147

144
148
145
-
If you want your code style settings to be applied every time you save a file, go to **Options** > **Text Editor** > **Code Cleanup** and select **Run Code Cleanup profile on save**.
149
+
1. (Optional) If you want your code style settings to be applied every time you save a file, go to **Options** > **Text Editor** > **Code Cleanup** and select **Run Code Cleanup profile on save**.
0 commit comments