visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°

Code style preferences

You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

This topic applies to Visual Studio on Windows. For Visual Studio for Mac, see Editor behavior in Visual Studio for Mac.

Code styles in EditorConfig files

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. generate editorconfig file small. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-generate editorconfig file small. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° generate editorconfig file small. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

Code styles in the Options dialog box

Code style preferences can be set for all of your C# and Visual Basic projects by opening the Options dialog box from the Tools menu. In the Options dialog box, select Text Editor > [C# or Basic] > Code Style > General.

Each item in the list shows a preview of the preference when selected:

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. code style quick actions dialog. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-code style quick actions dialog. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° code style quick actions dialog. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. code style quick actions dialog. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-code style quick actions dialog. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° code style quick actions dialog. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

Preference and severity

For each code style setting on this page, you can set the Preference and Severity values using the drop-downs on each line. Severity can be set to Refactoring Only, Suggestion, Warning, or Error. If you want to enable Quick Actions for a code style, ensure that the Severity setting is set to something other than Refactoring Only. The Quick Actions light bulb visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. light bulb dropdown. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-light bulb dropdown. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° light bulb dropdown. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands., error light bulb visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. error bulb. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-error bulb. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° error bulb. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands., or screwdriver visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. screwdriver. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-screwdriver. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° screwdriver. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.icon appears when a non-preferred style is used, and you can choose an option on the Quick Actions list to automatically rewrite code to the preferred style.

Enforce code styles on build

Apply code styles

You can configure the Format Document command (Edit > Advanced > Format Document) to apply your code style settings (from an EditorConfig file or Code Style options) along with the regular formatting that it does (such as indentation). If an .editorconfig file exists for the project, those settings take precedence.

Applying code styles by using the Format Document command is only available for C# code files. This is an experimental feature.

Configure which settings you want Format Document to apply on the Formatting options page.

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. format document settings. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-format document settings. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° format document settings. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

Rules configured with a severity of None don’t participate in code cleanup but can be individually applied via the Quick Actions and Refactorings menu.

The first time you trigger the Format Document command, a yellow info bar prompts you to configure your code cleanup settings.

For C# code files, Visual Studio 2019 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.

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. execute code cleanup. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-execute code cleanup. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° execute code cleanup. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

Rules configured with a severity of None don’t participate in code cleanup but can be individually applied via the Quick Actions and Refactorings menu.

First, configure which code styles you want to apply (in one of two profiles) in the Configure Code Cleanup dialog box. To open this dialog box, click the expander arrow next to the code cleanup broom icon and then choose Configure Code Cleanup.

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. configure code cleanup. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-configure code cleanup. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° configure code cleanup. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

After you’ve configured code cleanup, you can either click on the broom icon or press Ctrl+K, Ctrl+E to run code cleanup. You can also 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.

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. run code cleanup project solution. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-run code cleanup project solution. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° run code cleanup project solution. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

If you want your code style settings to be applied every time you save a file, you may like the Code Cleanup on Save extension.

Π˜ΡΡ‚ΠΎΡ‡Π½ΠΈΠΊ

Color Themes

Color themes let you modify the colors in Visual Studio Code’s user interface to suit your preferences and work environment.

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. themes hero. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-themes hero. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° themes hero. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

Selecting the Color Theme

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. colorthemes. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-colorthemes. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° colorthemes. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

The active color theme is stored in your user settings (keyboard shortcut ⌘, (Windows, Linux Ctrl+, ) ).

Tip: By default, the theme is stored in your user settings and applies globally to all workspaces. You can also configure a workspace specific theme. To do so, set a theme in the Workspace settings.

Color Themes from the Marketplace

There are several out-of-the-box color themes in VS Code for you to try.

Many more themes have been uploaded to the VS Code Extension Marketplace by the community. If you find one you want to use, install it and restart VS Code and the new theme will be available.

You can search for themes in the Extensions view ( β‡§βŒ˜X (Windows, Linux Ctrl+Shift+X ) ) search box using the @category:»themes» filter.

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. category themes. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-category themes. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° category themes. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

Customizing a Color Theme

Workbench colors

You can customize your active color theme with the workbench.colorCustomizations and editor.tokenColorCustomizations user settings.

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. theme activitybar. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-theme activitybar. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° theme activitybar. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

You can use IntelliSense while setting workbench.colorCustomizations values or, for a list of all customizable colors, see the Theme Color Reference.

To customize a specific theme only, use the following syntax:

Editor syntax highlighting

To tune the editor’s syntax highlighting colors, use editor.tokenColorCustomizations in your user settings settings.json file:

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. token color customization. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-token color customization. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° token color customization. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. token color customization advanced. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-token color customization advanced. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° token color customization advanced. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

Note: Directly configuring TextMate rules is an advanced skill as you need to understand on how TextMate grammars work. Go to the Color Theme guide for more information.

Again, to customize a specific theme only, use the following syntax:

Editor semantic highlighting

Some languages (currently: TypeScript, JavaScript, Java) provide semantic tokens. Semantic tokens are based on the language service’s symbol understanding and are more accurate than the syntax tokens coming from the TextMate grammars that are driven by regular expressions. The semantic highlighting that is computed from the semantic tokens goes on top of syntax highlighting and can correct and enrich the highlighting as seen in the following example:

The «Tomorrow Night Blue» color theme without semantic highlighting:

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. no semantic highlighting. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-no semantic highlighting. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° no semantic highlighting. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

The «Tomorrow Night Blue» color theme with semantic highlighting:

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. with semantic highlighting. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-with semantic highlighting. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° with semantic highlighting. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

Notice the color differences based on language service symbol understanding:

Users can override the theme setting by:

When semantic highlighting is enabled and available for a language, it is up to the theme to configure whether and how semantic tokens are colored. Some semantic tokens are standardized and map to well-established TextMate scopes. If the theme has a coloring rule for these TextMate scopes, the semantic token will be rendered with that color, without the need for any additional coloring rules.

Additional styling rules can be configured by the user in editor.semanticTokenColorCustomizations» :

To see what semantic tokens are computed and how they are styled, users can use the scope inspector (Developer: Inspect Editor Tokens and Scopes), which displays information for the text at the current cursor position.

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. semantic highlighting scope inspector. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-semantic highlighting scope inspector. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° semantic highlighting scope inspector. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

More information on semantic tokens and styling rule syntax can be found in the Semantic Highlighting Guide.

Creating your own Color Theme

Creating and publishing a theme extension is easy. Customize your colors in your user settings then generate a theme definition file with the Developer: Generate Color Theme From Current Settings command.

VS Code’s Yeoman extension generator will help you generate the rest of the extension.

See the Create a new Color Theme topic in our Extension API section to learn more.

Remove default Color Themes

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. built in themes. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-built in themes. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° built in themes. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

You can disable a built-in theme extension as you would any other VS Code extension with the Disable command on the gear context menu.

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. disable theme. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-disable theme. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° disable theme. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

File Icon Themes

File icon themes can be contributed by extensions and selected by users as their favorite set of file icons. File icons are shown in the File Explorer and tabbed headings.

Selecting the File Icon Theme

By default, the Seti file icon set is used and those are the icons you see in the File Explorer. Once a file icon theme is selected, the selected theme will be remembered and appear again whenever VS Code is restarted. You can disable file icons by selecting None.

VS code ships with two file icon themes; Minimal and Seti. To install more file icon themes, select the Install Additional File Icon Themes item in the file icon theme picker and you’ll see a query for file icon themes (tag:icon-theme) in the Extensions view.

You can also browse the VS Code Marketplace site directly to find available themes.

The active File Icon theme is persisted in your user settings (keyboard shortcut ⌘, (Windows, Linux Ctrl+, ) ).

Creating your own File Icon Theme

You can create your own File Icon Theme from icons (preferably SVG), see the File Icon Theme topic in our Extension API section for details.

Next steps

Themes are just one way to customize VS Code. If you’d like to learn more about VS Code customization and extensibility, try these topics:

Π˜ΡΡ‚ΠΎΡ‡Π½ΠΈΠΊ

ΠŸΡ€Π°ΠΊΡ‚ΠΈΡ‡Π΅ΡΠΊΠΎΠ΅ руководство. ΠŸΠ΅Ρ€ΡΠΎΠ½Π°Π»ΠΈΠ·Π°Ρ†ΠΈΡ ΠΈΠ½Ρ‚Π΅Π³Ρ€ΠΈΡ€ΠΎΠ²Π°Π½Π½ΠΎΠΉ срСды Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠΈ ΠΈ Ρ€Π΅Π΄Π°ΠΊΡ‚ΠΎΡ€Π° Visual Studio

Из этой ΡΡ‚Π°Ρ‚ΡŒΠΈ Π²Ρ‹ ΡƒΠ·Π½Π°Π΅Ρ‚Π΅, ΠΊΠ°ΠΊ ΠΏΠ΅Ρ€Π΅ΠΊΠ»ΡŽΡ‡ΠΈΡ‚ΡŒ Ρ†Π²Π΅Ρ‚ΠΎΠ²ΡƒΡŽ Ρ‚Π΅ΠΌΡƒ Visual Studio ΠΏΠΎ ΡƒΠΌΠΎΠ»Ρ‡Π°Π½ΠΈΡŽ Π½Π° Ρ‚Π΅ΠΌΠ½Ρ‹ΠΉ Ρ€Π΅ΠΆΠΈΠΌ. ΠœΡ‹ Ρ‚Π°ΠΊΠΆΠ΅ настроим Ρ†Π²Π΅Ρ‚Π° для Π΄Π²ΡƒΡ… Ρ€Π°Π·Π»ΠΈΡ‡Π½Ρ‹Ρ… Ρ‚ΠΈΠΏΠΎΠ² тСкста Π² Ρ€Π΅Π΄Π°ΠΊΡ‚ΠΎΡ€Π΅ ΠΊΠΎΠ΄Π°.

Π’ Visual Studio 2022 Preview ΠΌΡ‹ ΠΎΠ±Π½ΠΎΠ²ΠΈΠ»ΠΈ Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΎΠ½Π°Π»ΡŒΠ½ΠΎΡΡ‚ΡŒ Ρ†Π²Π΅Ρ‚ΠΎΠ²Ρ‹Ρ… Ρ‚Π΅ΠΌ, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΠΎΠ½ΠΈ соотвСтствовали вашим настройкам Windows. Π”ΠΎΠΏΠΎΠ»Π½ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹Π΅ свСдСния см. Π² записи Π±Π»ΠΎΠ³Π° Π“ΠΈΠ±ΠΊΠΈΠ΅ возмоТности Ρ‚Π΅ΠΌΠ°Ρ‚ΠΈΠΊΠΈ для Visual Studio.

УстановитС Visual Studio бСсплатно со страницы скачиваСмых ΠΌΠ°Ρ‚Π΅Ρ€ΠΈΠ°Π»ΠΎΠ² Visual Studio, Ссли Π΅Ρ‰Π΅ Π½Π΅ сдСлали этого.

УстановитС Visual Studio бСсплатно со страницы скачиваСмых ΠΌΠ°Ρ‚Π΅Ρ€ΠΈΠ°Π»ΠΎΠ² Visual Studio, Ссли Π΅Ρ‰Π΅ Π½Π΅ сдСлали этого.

Настройка Ρ†Π²Π΅Ρ‚ΠΎΠ²ΠΎΠΉ Ρ‚Π΅ΠΌΡ‹ для ΠΈΠ½Ρ‚Π΅Π³Ρ€ΠΈΡ€ΠΎΠ²Π°Π½Π½ΠΎΠΉ срСды Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠΈ

По ΡƒΠΌΠΎΠ»Ρ‡Π°Π½ΠΈΡŽ Π² ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»ΡŒΡΠΊΠΎΠΌ интСрфСйсС Visual Studio установлСна Ρ‚Π΅ΠΌΠ° Биняя. Π”Π°Π²Π°ΠΉΡ‚Π΅ ΠΈΠ·ΠΌΠ΅Π½ΠΈΠΌ Π΅Π΅ Π½Π° Ρ‚Π΅ΠΌΡƒ ВСмная.

Π’ строкС мСню, Π³Π΄Π΅ располоТСны Ρ€Π°Π·Π΄Π΅Π»Ρ‹ Π€Π°ΠΉΠ» ΠΈ Π˜Π·ΠΌΠ΅Π½ΠΈΡ‚ΡŒ, Π²Ρ‹Π±Π΅Ρ€ΠΈΡ‚Π΅ БрСдства > ΠŸΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹.

ΠžΡ‚ΠΊΡ€ΠΎΠΉΡ‚Π΅ страницу ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€ΠΎΠ² ΠžΠΊΡ€ΡƒΠΆΠ΅Π½ΠΈΠ΅ > ΠžΠ±Ρ‰ΠΈΠ΅, ΠΈΠ·ΠΌΠ΅Π½ΠΈΡ‚Π΅ Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅ ЦвСтовая Ρ‚Π΅ΠΌΠ° Π½Π° ВСмная ΠΈ Ρ‰Π΅Π»ΠΊΠ½ΠΈΡ‚Π΅ ОК.

ЦвСтовая Ρ‚Π΅ΠΌΠ° для всСй срСды Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠΈ (IDE) Visual Studio измСняСтся Π½Π° ВСмная.

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. quickstart personalize dark theme. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-quickstart personalize dark theme. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° quickstart personalize dark theme. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. dark theme. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-dark theme. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° dark theme. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

Π’Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ Π²Ρ‹Π±Ρ€Π°Ρ‚ΡŒ Π΄ΠΎΠΏΠΎΠ»Π½ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹Π΅ ΠΏΡ€Π΅Π΄ΠΎΠΏΡ€Π΅Π΄Π΅Π»Π΅Π½Π½Ρ‹Π΅ Ρ‚Π΅ΠΌΡ‹, установив Ρ€Π΅Π΄Π°ΠΊΡ‚ΠΎΡ€ Ρ†Π²Π΅Ρ‚ΠΎΠ²Ρ‹Ρ… Ρ‚Π΅ΠΌ Visual Studio ΠΈΠ· Visual Studio Marketplace. Когда Π²Ρ‹ установитС это срСдство, Π² Ρ€Π°ΡΠΊΡ€Ρ‹Π²Π°ΡŽΡ‰Π΅ΠΌΡΡ спискС ЦвСтовая Ρ‚Π΅ΠΌΠ° появятся Π΄ΠΎΠΏΠΎΠ»Π½ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹Π΅ Ρ‚Π΅ΠΌΡ‹.

Π’Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΡΠΎΠ·Π΄Π°Ρ‚ΡŒ собствСнныС Ρ‚Π΅ΠΌΡ‹, установив конструктор Ρ†Π²Π΅Ρ‚ΠΎΠ²Ρ‹Ρ… Ρ‚Π΅ΠΌ Visual Studio ΠΈΠ· Visual Studio Marketplace.

ИзмСнСниС Ρ†Π²Π΅Ρ‚ΠΎΠ² тСкста Π² Ρ€Π΅Π΄Π°ΠΊΡ‚ΠΎΡ€Π΅

Π’Π΅ΠΏΠ΅Ρ€ΡŒ настроим нСсколько Ρ†Π²Π΅Ρ‚ΠΎΠ² тСкста для Ρ€Π΅Π΄Π°ΠΊΡ‚ΠΎΡ€Π°. Π‘Π½Π°Ρ‡Π°Π»Π° создадим XML-Ρ„Π°ΠΉΠ», Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΠΏΡ€ΠΎΡΠΌΠΎΡ‚Ρ€Π΅Ρ‚ΡŒ Ρ†Π²Π΅Ρ‚Π° ΠΏΠΎ ΡƒΠΌΠΎΠ»Ρ‡Π°Π½ΠΈΡŽ.

Π’ строкС мСню Π²Ρ‹Π±Π΅Ρ€ΠΈΡ‚Π΅ Π€Π°ΠΉΠ» > Π‘ΠΎΠ·Π΄Π°Ρ‚ΡŒ > Π€Π°ΠΉΠ».

Π’ Π΄ΠΈΠ°Π»ΠΎΠ³ΠΎΠ²ΠΎΠΌ ΠΎΠΊΠ½Π΅ Новый Ρ„Π°ΠΉΠ» Π² Ρ€Π°Π·Π΄Π΅Π»Π΅ ΠžΠ±Ρ‰ΠΈΠ΅ Π²Ρ‹Π±Π΅Ρ€ΠΈΡ‚Π΅ XML-Ρ„Π°ΠΉΠ» ΠΈ Π½Π°ΠΆΠΌΠΈΡ‚Π΅ ΠΊΠ½ΠΎΠΏΠΊΡƒ ΠžΡ‚ΠΊΡ€Ρ‹Ρ‚ΡŒ.

ΠžΠ±Ρ€Π°Ρ‚ΠΈΡ‚Π΅ Π²Π½ΠΈΠΌΠ°Π½ΠΈΠ΅, Ρ‡Ρ‚ΠΎ Ρ†Π²Π΅Ρ‚ Π½ΠΎΠΌΠ΅Ρ€ΠΎΠ² строк Π±ΠΈΡ€ΡŽΠ·ΠΎΠ²Ρ‹ΠΉ, Π° Π°Ρ‚Ρ€ΠΈΠ±ΡƒΡ‚ΠΎΠ² XML (Π½Π°ΠΏΡ€ΠΈΠΌΠ΅Ρ€ id=»bk101″ ) β€” Π³ΠΎΠ»ΡƒΠ±ΠΎΠΉ. Π”Π°Π²Π°ΠΉΡ‚Π΅ ΠΈΠ·ΠΌΠ΅Π½ΠΈΠΌ Ρ†Π²Π΅Ρ‚ этих элСмСнтов.

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. quickstart personalize xml file. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-quickstart personalize xml file. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° quickstart personalize xml file. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

Π§Ρ‚ΠΎΠ±Ρ‹ ΠΎΡ‚ΠΊΡ€Ρ‹Ρ‚ΡŒ Π΄ΠΈΠ°Π»ΠΎΠ³ΠΎΠ²ΠΎΠ΅ ΠΎΠΊΠ½ΠΎ ΠŸΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹, Π² строкС мСню Π²Ρ‹Π±Π΅Ρ€ΠΈΡ‚Π΅ БСрвис > ΠŸΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹.

Π’ Ρ€Π°Π·Π΄Π΅Π»Π΅ Π‘Ρ€Π΅Π΄Π° Π²Ρ‹Π±Π΅Ρ€ΠΈΡ‚Π΅ ΠΊΠ°Ρ‚Π΅Π³ΠΎΡ€ΠΈΡŽ Π¨Ρ€ΠΈΡ„Ρ‚Ρ‹ ΠΈ Ρ†Π²Π΅Ρ‚Π°.

ΠžΠ±Ρ€Π°Ρ‚ΠΈΡ‚Π΅ Π²Π½ΠΈΠΌΠ°Π½ΠΈΠ΅, Ρ‡Ρ‚ΠΎ Π² ΠΏΠΎΠ»Π΅ ΠŸΠΎΠΊΠ°Π·Π°Ρ‚ΡŒ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹ для ΡƒΠΊΠ°Π·Π°Π½ΠΎ Π·Π½Π°Ρ‡Π΅Π½ΠΈΠ΅ ВСкстовый Ρ€Π΅Π΄Π°ΠΊΡ‚ΠΎΡ€,β€”ΠΈΠΌΠ΅Π½Π½ΠΎ это Π½Π°ΠΌ ΠΈ Π½ΡƒΠΆΠ½ΠΎ. РаскройтС список, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΡƒΠ·Π½Π°Ρ‚ΡŒ, для ΠΊΠ°ΠΊΠΈΡ… Π΅Ρ‰Π΅ элСмСнтов ΠΌΠΎΠΆΠ½ΠΎ Π½Π°ΡΡ‚Ρ€ΠΎΠΈΡ‚ΡŒ ΡˆΡ€ΠΈΡ„Ρ‚Ρ‹ ΠΈ Ρ†Π²Π΅Ρ‚ тСкста.

Π§Ρ‚ΠΎΠ±Ρ‹ ΠΈΠ·ΠΌΠ΅Π½ΠΈΡ‚ΡŒ Ρ†Π²Π΅Ρ‚ Π½ΠΎΠΌΠ΅Ρ€Π° строки, Π² спискС ΠžΡ‚ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ элСмСнтов Π²Ρ‹Π±Π΅Ρ€ΠΈΡ‚Π΅ НомСр строки. Π’ ΠΏΠΎΠ»Π΅ Основной Ρ†Π²Π΅Ρ‚ элСмСнта Π²Ρ‹Π±Π΅Ρ€ΠΈΡ‚Π΅ ΠžΠ»ΠΈΠ²ΠΊΠΎΠ²Ρ‹ΠΉ.

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. quickstart personalize line number color. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-quickstart personalize line number color. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° quickstart personalize line number color. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

НСкоторыС языки ΠΈΠΌΠ΅ΡŽΡ‚ собствСнныС ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹ ΡˆΡ€ΠΈΡ„Ρ‚ΠΎΠ² ΠΈ Ρ†Π²Π΅Ρ‚ΠΎΠ². Если Π²Ρ‹ ΡΠ²Π»ΡΠ΅Ρ‚Π΅ΡΡŒ Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊΠΎΠΌ Π½Π° C++ ΠΈ Ρ…ΠΎΡ‚ΠΈΡ‚Π΅ ΠΈΠ·ΠΌΠ΅Π½ΠΈΡ‚ΡŒ Ρ†Π²Π΅Ρ‚, ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΠ΅ΠΌΡ‹ΠΉ для выдСлСния Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΉ, Π½Π°ΠΉΠ΄ΠΈΡ‚Π΅ элСмСнт Π€ΡƒΠ½ΠΊΡ†ΠΈΠΈ C++ Π² спискС ΠžΡ‚ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ элСмСнтов.

ΠŸΡ€Π΅ΠΆΠ΄Π΅ Ρ‡Π΅ΠΌ Π·Π°ΠΊΡ€Ρ‹Ρ‚ΡŒ Π΄ΠΈΠ°Π»ΠΎΠ³ΠΎΠ²ΠΎΠ΅ ΠΎΠΊΠ½ΠΎ, Π΄Π°Π²Π°ΠΉΡ‚Π΅ Ρ‚Π°ΠΊΠΆΠ΅ ΠΈΠ·ΠΌΠ΅Π½ΠΈΠΌ Ρ†Π²Π΅Ρ‚ Π°Ρ‚Ρ€ΠΈΠ±ΡƒΡ‚ΠΎΠ² XML. Π’ спискС ΠžΡ‚ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ элСмСнтов ΠΏΡ€ΠΎΠΊΡ€ΡƒΡ‚ΠΈΡ‚Π΅ Π²Π½ΠΈΠ· Π΄ΠΎ элСмСнта Атрибут XML ΠΈ Π²Ρ‹Π±Π΅Ρ€ΠΈΡ‚Π΅ Π΅Π³ΠΎ. Π’ ΠΏΠΎΠ»Π΅ Основной Ρ†Π²Π΅Ρ‚ элСмСнта Π²Ρ‹Π±Π΅Ρ€ΠΈΡ‚Π΅ Вравяной. НаТмитС ОК, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΡΠΎΡ…Ρ€Π°Π½ΠΈΡ‚ΡŒ измСнСния ΠΈ Π·Π°ΠΊΡ€Ρ‹Ρ‚ΡŒ Π΄ΠΈΠ°Π»ΠΎΠ³ΠΎΠ²ΠΎΠ΅ ΠΎΠΊΠ½ΠΎ.

Π’Π΅ΠΏΠ΅Ρ€ΡŒ Ρ†Π²Π΅Ρ‚ Π½ΠΎΠΌΠ΅Ρ€ΠΎΠ² строк станСт ΠΎΠ»ΠΈΠ²ΠΊΠΎΠ²Ρ‹ΠΌ, Π° Ρ†Π²Π΅Ρ‚ XML-Π°Ρ‚Ρ€ΠΈΠ±ΡƒΡ‚ΠΎΠ² β€” ярко-травяным. Если ΠΎΡ‚ΠΊΡ€Ρ‹Ρ‚ΡŒ Ρ„Π°ΠΉΠ» Π΄Ρ€ΡƒΠ³ΠΎΠ³ΠΎ Ρ‚ΠΈΠΏΠ°, Π½Π°ΠΏΡ€ΠΈΠΌΠ΅Ρ€ Ρ„Π°ΠΉΠ» с ΠΊΠΎΠ΄ΠΎΠΌ C++ ΠΈ C#, Ρ†Π²Π΅Ρ‚ Π½ΠΎΠΌΠ΅Ρ€ΠΎΠ² строк Ρ‚Π°ΠΊΠΆΠ΅ станСт ΠΎΠ»ΠΈΠ²ΠΊΠΎΠ²Ρ‹ΠΌ.

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. quickstart personalize xml file new colors. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-quickstart personalize xml file new colors. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° quickstart personalize xml file new colors. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

ΠœΡ‹ ΠΈΠ·ΡƒΡ‡ΠΈΠ»ΠΈ Ρ‚ΠΎΠ»ΡŒΠΊΠΎ Π½Π΅ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ способы Π½Π°ΡΡ‚Ρ€Π°ΠΈΠ²Π°Ρ‚ΡŒ Ρ†Π²Π΅Ρ‚Π° Π² Visual Studio. ΠžΠ·Π½Π°ΠΊΠΎΠΌΡŒΡ‚Π΅ΡΡŒ с Π΄Ρ€ΡƒΠ³ΠΈΠΌΠΈ возмоТностями Π² Π΄ΠΈΠ°Π»ΠΎΠ³ΠΎΠ²ΠΎΠΌ ΠΎΠΊΠ½Π΅ ΠŸΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹, Ρ‡Ρ‚ΠΎΠ±Ρ‹ Π½Π°ΡΡ‚Ρ€ΠΎΠΈΡ‚ΡŒ Visual Studio Π² соотвСтствии со своими прСдпочтСниями.

Π˜ΡΡ‚ΠΎΡ‡Π½ΠΈΠΊ

Π‘ΠΎΠ·Π΄Π°Π½ΠΈΠ΅ Ρ„Π°ΠΉΠ»Π° EditorConfig

ΠŸΡ€ΠΈΠΌΠ΅Π½Π΅Π½ΠΈΠ΅ Ρ„Π°ΠΉΠ»ΠΎΠ² EditorConfig позволяСт ΠΎΠ±Π΅ΡΠΏΠ΅Ρ‡ΠΈΡ‚ΡŒ ΡΠΎΠ³Π»Π°ΡΠΎΠ²Π°Π½Π½ΠΎΡΡ‚ΡŒ ΠΊΠΎΠ΄Π° Π·Π° счСт опрСдСлСния Ρ„ΠΎΡ€ΠΌΠ°Ρ‚ΠΎΠ² ΠΈ стилСй ΠΊΠΎΠ΄Π°. Π­Ρ‚ΠΈ соглашСния ΠΏΠΎΠΌΠΎΠ³Π°ΡŽΡ‚ Visual Studio автоматичСски ΠΈΡΠΏΡ€Π°Π²Π»ΡΡ‚ΡŒ ΡΡ‚ΠΈΠ»ΡŒ ΠΈ Ρ„ΠΎΡ€ΠΌΠ°Ρ‚ для очистки Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚Π°. Для Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊΠΎΠ², ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΡŽΡ‰ΠΈΡ… язык C#, IntelliCode ΠΌΠΎΠΆΠ΅Ρ‚ ΠΎΠΏΡ€Π΅Π΄Π΅Π»ΡΡ‚ΡŒ ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° ΠΈ соглашСния ΠΏΠΎ Ρ„ΠΎΡ€ΠΌΠ°Ρ‚ΠΈΡ€ΠΎΠ²Π°Π½ΠΈΡŽ, обСспСчивая динамичСскоС созданиС Ρ„Π°ΠΉΠ»Π° EditorConfig.

Π’Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ Π΄ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ созданный IntelliCode Ρ„Π°ΠΉΠ» EditorConfig Π² Visual Studio Π½Π° ΡƒΡ€ΠΎΠ²Π½Π΅ ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π° ΠΈΠ»ΠΈ Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ (Π»ΠΈΠ±ΠΎ Π² ΠΏΠ°ΠΏΠΊΡƒ Ρ€Π΅ΡˆΠ΅Π½ΠΈΡ). Π§Ρ‚ΠΎΠ±Ρ‹ Π΄ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ ΠΏΡ€Π΅Π΄Π²Π°Ρ€ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎ Π·Π°ΠΏΠΎΠ»Π½Π΅Π½Π½Ρ‹ΠΉ Ρ„Π°ΠΉΠ» EditorConfig, Ρ‰Π΅Π»ΠΊΠ½ΠΈΡ‚Π΅ ΠΏΡ€Π°Π²ΠΎΠΉ ΠΊΠ½ΠΎΠΏΠΊΠΎΠΉ ΠΌΡ‹ΡˆΠΈ Π² Π½ΡƒΠΆΠ½ΠΎΠΌ мСстС Π² ΠΎΠ±ΠΎΠ·Ρ€Π΅Π²Π°Ρ‚Π΅Π»Π΅ Ρ€Π΅ΡˆΠ΅Π½ΠΈΠΉ ΠΈ Π²Ρ‹Π±Π΅Ρ€ΠΈΡ‚Π΅ Π”ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ > Новая конфигурация Ρ€Π΅Π΄Π°ΠΊΡ‚ΠΎΡ€Π° (IntelliCode).

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. intellicode editorconfig. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-intellicode editorconfig. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° intellicode editorconfig. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

ПослС добавлСния Ρ„Π°ΠΉΠ»Π° Π² соотвСтствии с этими инструкциями IntelliCode автоматичСски заполняСт Π΅Π³ΠΎ с использованиСм соглашСний ΠΎ стилС ΠΊΠΎΠ΄Π°, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ Π±Ρ‹Π»ΠΈ ΠΎΠΏΡ€Π΅Π΄Π΅Π»Π΅Π½Ρ‹ Π½Π° основании вашСй Π±Π°Π·Ρ‹ ΠΊΠΎΠ΄Π°.

Π’ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎΡΡ‚ΡŒ опрСдСлСния стиля ΠΊΠΎΠ΄Π° Π½Π° Π΄Π°Π½Π½Ρ‹ΠΉ ΠΌΠΎΠΌΠ΅Π½Ρ‚ Ρ€Π΅Π°Π»ΠΈΠ·ΠΎΠ²Π°Π½Π° Π² Π²ΠΈΠ΄Π΅ ΠΏΡ€Π΅Π΄Π²Π°Ρ€ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎΠΉ вСрсии ΠΈ ΠΏΠΎ ΡƒΠΌΠΎΠ»Ρ‡Π°Π½ΠΈΡŽ ΠΎΡ‚ΠΊΠ»ΡŽΡ‡Π΅Π½Π°. Π•Π΅ ΠΌΠΎΠΆΠ½ΠΎ Π²ΠΊΠ»ΡŽΡ‡ΠΈΡ‚ΡŒ Π² Ρ€Π°Π·Π΄Π΅Π»Π΅ БрСдства > ΠŸΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹ > IntelliCode. На Π΄Π°Π½Π½Ρ‹ΠΉ ΠΌΠΎΠΌΠ΅Π½Ρ‚ ΠΎΠ½Π° доступна Ρ‚ΠΎΠ»ΡŒΠΊΠΎ для ΠΊΠΎΠ΄Π° C#. Для доступа ΠΊ этой Ρ„ΡƒΠ½ΠΊΡ†ΠΈΠΈ ΠΎΠ±ΡΠ·Π°Ρ‚Π΅Π»ΡŒΠ½ΠΎ ΠΎΠ±Π½ΠΎΠ²ΠΈΡ‚Π΅ ΠΏΡ€Π΅Π΄Π²Π°Ρ€ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹ΠΉ выпуск Visual Studio 2019.

Π”ΠΎΠΏΠΎΠ»Π½ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹Π΅ свСдСния ΠΎ создании Ρ„Π°ΠΉΠ»Π° EditorConfig Π½Π° основС стилСй ΠΊΠΎΠ΄Π° ΠΈΠ· вашСй Π±Π°Π·Ρ‹ ΠΊΠΎΠ΄Π° см. Π² этой ΡΡ‚Π°Ρ‚ΡŒΠ΅ Π±Π»ΠΎΠ³Π°.

ΠŸΡ€ΠΈΠΌΠ΅Π½Π΅Π½ΠΈΠ΅ соглашСний ΠΈΠ· Ρ„Π°ΠΉΠ»Π° EditorConfig

ΠΠ°Ρ€ΡƒΡˆΠ΅Π½ΠΈΡ соглашСния ΠΎ стилС ΠΊΠΎΠ΄Π° ΠΈΠ· Ρ„Π°ΠΉΠ»Π° EditorConfig Π½Π΅ ΠΎΡ‚ΠΎΠ±Ρ€Π°ΠΆΠ°ΡŽΡ‚ΡΡ Π² спискС ошибок ΠΈ Π½Π΅ ΠΏΠΎΠ΄Ρ‡Π΅Ρ€ΠΊΠΈΠ²Π°ΡŽΡ‚ΡΡ Π² ΠΊΠΎΠ΄Π΅. Π’Π΅ΠΌ Π½Π΅ ΠΌΠ΅Π½Π΅Π΅ ΠΈΡ… ΠΌΠΎΠΆΠ½ΠΎ ΠΏΡ€ΠΈΠΌΠ΅Π½ΠΈΡ‚ΡŒ с ΠΏΠΎΠΌΠΎΡ‰ΡŒΡŽ ΠΊΠΎΠΌΠ°Π½Π΄Ρ‹ ΠžΡ‡ΠΈΡΡ‚ΠΊΠ° ΠΊΠΎΠ΄Π° (Visual Studio 2019) ΠΈΠ»ΠΈ Π€ΠΎΡ€ΠΌΠ°Ρ‚ Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚Π° (Visual Studio 2017).

Π‘ΠΏΡ€Π°Π²ΠΎΡ‡Π½ΠΈΠΊ ΠΏΠΎ опрСдСляСмым соглашСниям

IntelliCode Π½Π° Π΄Π°Π½Π½Ρ‹ΠΉ ΠΌΠΎΠΌΠ΅Π½Ρ‚ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΈΠ²Π°Π΅Ρ‚ Π½Π΅ вСсь Π½Π°Π±ΠΎΡ€ соглашСний, Π·Π°Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚ΠΈΡ€ΠΎΠ²Π°Π½Π½Ρ‹Ρ… Π² справочникС ΠΏΠΎ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Π°ΠΌ стиля ΠΊΠΎΠ΄Π°. Π’ Ρ‚Π΅ΠΊΡƒΡ‰Π΅ΠΉ вСрсии IntelliCode ΠΌΠΎΠΆΠ΅Ρ‚ ΠΎΠΏΡ€Π΅Π΄Π΅Π»ΡΡ‚ΡŒ ΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΠΈΠ΅ соглашСния ΠΎ Ρ„ΠΎΡ€ΠΌΠ°Ρ‚ΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠΈ ΠΈ стилС:

Π˜ΡΡ‚ΠΎΡ‡Π½ΠΈΠΊ

ΠšΠΎΠ½Ρ„ΠΈΠ³ΡƒΡ€ΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠ΅ стиля ΠΊΠΎΠ΄Π° Π² Visual Studio 2017

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. 41bdba49618542d1a9a29c2fd2e0dd19. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-41bdba49618542d1a9a29c2fd2e0dd19. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° 41bdba49618542d1a9a29c2fd2e0dd19. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.
ΠŸΡ€Π΅Π΄Π»Π°Π³Π°ΡŽ Π²Π°ΡˆΠ΅ΠΌΡƒ вниманию ΠΏΠ΅Ρ€Π΅Π²ΠΎΠ΄ ΠΏΠΎΠ»Π΅Π·Π½ΠΎΠΉ ΡΡ‚Π°Ρ‚ΡŒΠΈ ΠΎ Ρ‚ΠΎΠΌ, ΠΊΠ°ΠΊ Π½Π°ΡΡ‚Ρ€Π°ΠΈΠ²Π°Ρ‚ΡŒ ΠΈ ΠΏΡ€ΠΈΠΌΠ΅Π½ΡΡ‚ΡŒ ΠΏΡ€Π°Π²ΠΈΠ»Π° написания ΠΊΠΎΠ΄Π° Π² вашСй ΠΊΠΎΠΌΠ°Π½Π΄Π΅.

Visual Studio 2017 обСспСчиваСт соблюдСниС стиля написания ΠΊΠΎΠ΄Π° ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΡƒ EditorConfig. Новая вСрсия Π²ΠΊΠ»ΡŽΡ‡Π°Π΅Ρ‚ Π² сСбя большС ΠΏΡ€Π°Π²ΠΈΠ» для code style ΠΈ позволяСт Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊΠ°ΠΌ Π½Π°ΡΡ‚Ρ€Π°ΠΈΠ²Π°Ρ‚ΡŒ ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ‡Π΅Ρ€Π΅Π· EditorConfig.

Π§Ρ‚ΠΎ Ρ‚Π°ΠΊΠΎΠ΅ EditorConfig?

EditorConfig β€” это Ρ„ΠΎΡ€ΠΌΠ°Ρ‚ Ρ„Π°ΠΉΠ»Π° с ΠΎΡ‚ΠΊΡ€Ρ‹Ρ‚Ρ‹ΠΌ исходным ΠΊΠΎΠ΄ΠΎΠΌ, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹ΠΉ ΠΏΠΎΠΌΠΎΠ³Π°Π΅Ρ‚ Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊΠ°ΠΌ Π½Π°ΡΡ‚Ρ€Π°ΠΈΠ²Π°Ρ‚ΡŒ ΠΈ ΠΏΡ€ΠΈΠΌΠ΅Π½ΡΡ‚ΡŒ ΠΏΡ€Π°Π²ΠΈΠ»Π° форматирования ΠΈ соглашСния ΠΎ стилС написания ΠΊΠΎΠ΄Π° для получСния Π±ΠΎΠ»Π΅Π΅ Ρ‡ΠΈΡ‚Π°Π΅ΠΌΡ‹Ρ… ΠΊΠΎΠ΄ΠΎΠ²Ρ‹Ρ… Π±Π°Π· (codebases). Π€Π°ΠΉΠ»Ρ‹ EditorConfig Π»Π΅Π³ΠΊΠΎ Π²ΠΊΠ»ΡŽΡ‡Π°ΡŽΡ‚ΡΡ Π² систСму управлСния вСрсиями ΠΈ ΠΏΡ€ΠΈΠΌΠ΅Π½ΡΡŽΡ‚ΡΡ Π½Π° ΡƒΡ€ΠΎΠ²Π½Π΅ рСпозитория ΠΈ ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π°. БоглашСния EditorConfig ΠΏΠ΅Ρ€Π΅ΠΎΠΏΡ€Π΅Π΄Π΅Π»ΡΡŽΡ‚ ΠΈΡ… эквивалСнты Π² Π²Π°ΡˆΠΈΡ… Π»ΠΈΡ‡Π½Ρ‹Ρ… настройках, Ρ‚Π°ΠΊ Ρ‡Ρ‚ΠΎ соглашСния ΠΈΠ· ΠΊΠΎΠ΄ΠΎΠ²ΠΎΠΉ Π±Π°Π·Ρ‹ ΠΈΠΌΠ΅ΡŽΡ‚ ΠΏΡ€ΠΈΠΎΡ€ΠΈΡ‚Π΅Ρ‚ Π½Π°Π΄ ΠΈΠ½Π΄ΠΈΠ²ΠΈΠ΄ΡƒΠ°Π»ΡŒΠ½Ρ‹ΠΌ Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚Ρ‡ΠΈΠΊΠΎΠΌ.

Начало Ρ€Π°Π±ΠΎΡ‚Ρ‹

Π§Ρ‚ΠΎΠ±Ρ‹ ΠΎΠΏΡ€Π΅Π΄Π΅Π»ΠΈΡ‚ΡŒ ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° ΠΈ ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹ форматирования для всСго рСпозитория, просто Π΄ΠΎΠ±Π°Π²ΡŒΡ‚Π΅ Ρ„Π°ΠΉΠ» .editorconfig Π² ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³ Π²Π΅Ρ€Ρ…Π½Π΅Π³ΠΎ уровня. Π§Ρ‚ΠΎΠ±Ρ‹ ΡƒΡΡ‚Π°Π½ΠΎΠ²ΠΈΡ‚ΡŒ эти ΠΏΡ€Π°Π²ΠΈΠ»Π° Π² качСствС Β«ΠΊΠΎΡ€Π½Π΅Π²Ρ‹Ρ…Β» ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€ΠΎΠ², Π΄ΠΎΠ±Π°Π²ΡŒΡ‚Π΅ ΡΠ»Π΅Π΄ΡƒΡŽΡ‰Π΅Π΅ Π² .editorconfig (Π²Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΡΠ΄Π΅Π»Π°Ρ‚ΡŒ это Π² своСм Ρ€Π΅Π΄Π°ΠΊΡ‚ΠΎΡ€Π΅ / IDE ΠΏΠΎ Π²Ρ‹Π±ΠΎΡ€Ρƒ):

# top-most EditorConfig file
root = true

ΠŸΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Ρ‹ EditorConfig ΠΏΡ€ΠΈΠΌΠ΅Π½ΡΡŽΡ‚ΡΡ свСрху Π²Π½ΠΈΠ· с пСрСопрСдСлСниями, Ρ‚ΠΎ Π΅ΡΡ‚ΡŒ Π²Ρ‹ описываСтС ΠΎΠ±Ρ‰ΠΈΠ΅ ΠΏΡ€Π°Π²ΠΈΠ»Π° Π½Π°Π²Π΅Ρ€Ρ…Ρƒ ΠΈ пСрСопрСдСляСтС ΠΈΡ… дальшС Π²Π½ΠΈΠ· Π² своСм Π΄Π΅Ρ€Π΅Π²Π΅ ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³ΠΎΠ² ΠΏΠΎ ΠΌΠ΅Ρ€Π΅ нСобходимости. Π’ Ρ€Π΅ΠΏΠΎΠ·ΠΈΡ‚ΠΎΡ€ΠΈΠΈ Roslyn Ρ„Π°ΠΉΠ»Ρ‹ Π² ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³Π΅ Compilers Π½Π΅ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΡŽΡ‚ var, поэтому ΠΌΡ‹ ΠΌΠΎΠΆΠ΅ΠΌ просто ΡΠΎΠ·Π΄Π°Ρ‚ΡŒ Π΄Ρ€ΡƒΠ³ΠΎΠΉ Ρ„Π°ΠΉΠ» .editorconfig, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹ΠΉ содСрТит Ρ€Π°Π·Π»ΠΈΡ‡Π½Ρ‹Π΅ настройки для ΠΏΡ€Π΅Π΄ΠΏΠΎΡ‡Ρ‚Π΅Π½ΠΈΠΉ var, ΠΈ эти ΠΏΡ€Π°Π²ΠΈΠ»Π° Π±ΡƒΠ΄ΡƒΡ‚ ΠΏΡ€ΠΈΠΌΠ΅Π½ΡΡ‚ΡŒΡΡ Ρ‚ΠΎΠ»ΡŒΠΊΠΎ ΠΊ Ρ„Π°ΠΉΠ»Π°ΠΌ Π² этом ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³Π΅. ΠžΠ±Ρ€Π°Ρ‚ΠΈΡ‚Π΅ Π²Π½ΠΈΠΌΠ°Π½ΠΈΠ΅, Ρ‡Ρ‚ΠΎ ΠΊΠΎΠ³Π΄Π° ΠΌΡ‹ создаСм этот EditorConfig Ρ„Π°ΠΉΠ» Π² ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³Π΅ Compilers, Ρ‚ΠΎ Π½Π°ΠΌ Π½Π΅ Π½ΡƒΠΆΠ½ΠΎ Π΄ΠΎΠ±Π°Π²Π»ΡΡ‚ΡŒ root = true (это ΠΏΠΎΠ·Π²ΠΎΠ»ΠΈΡ‚ Π½Π°ΡΠ»Π΅Π΄ΠΎΠ²Π°Ρ‚ΡŒ ΠΏΡ€Π°Π²ΠΈΠ»Π° ΠΈΠ· Ρ€ΠΎΠ΄ΠΈΡ‚Π΅Π»ΡŒΡΠΊΠΎΠ³ΠΎ ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³Π° ΠΈΠ»ΠΈ, Π² Π΄Π°Π½Π½ΠΎΠΌ случаС, ΠΈΠ· ΠΊΠ°Ρ‚Π°Π»ΠΎΠ³Π° Roslyn Π²Π΅Ρ€Ρ…Π½Π΅Π³ΠΎ уровня).

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. image loader. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-image loader. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° image loader. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

ΠŸΡ€Π°Π²ΠΈΠ»Π° форматирования ΠΊΠΎΠ΄Π°

ΠŸΡ€Π°Π²ΠΈΠ»Π° стиля ΠΊΠΎΠ΄Π°

Π”Π°Π²Π°ΠΉΡ‚Π΅ рассмотрим ΠΏΡ€ΠΈΠΌΠ΅Ρ€ Ρ‚ΠΎΠ³ΠΎ, ΠΊΠ°ΠΊ ΠΌΠΎΠ³ΡƒΡ‚ Π±Ρ‹Ρ‚ΡŒ ΠΎΠΏΡ€Π΅Π΄Π΅Π»Π΅Π½Ρ‹ соглашСния ΠΎ ΠΊΠΎΠ΄ΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠΈ:

Если Π²Π°ΠΌ Π½ΡƒΠΆΠ½ΠΎ ΠΏΠ΅Ρ€Π΅ΠΎΡΠΌΡ‹ΡΠ»ΠΈΡ‚ΡŒ Ρ€Π°Π·Π»ΠΈΡ‡Π½Ρ‹Π΅ ΡƒΡ€ΠΎΠ²Π½ΠΈ ΡΠ΅Ρ€ΡŒΠ΅Π·Π½ΠΎΡΡ‚ΠΈ ΠΈ Ρ‚ΠΎ, Ρ‡Ρ‚ΠΎ ΠΎΠ½ΠΈ Π΄Π΅Π»Π°ΡŽΡ‚:

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. image loader. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-image loader. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° image loader. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

Π‘ΠΎΠ²Π΅Ρ‚: сСрыС Ρ‚ΠΎΡ‡ΠΊΠΈ, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ ΡƒΠΊΠ°Π·Ρ‹Π²Π°ΡŽΡ‚ Π½Π° ΠΏΡ€Π΅Π΄Π»ΠΎΠΆΠ΅Π½ΠΈΠ΅, довольно сСрыС. Π§Ρ‚ΠΎΠ±Ρ‹ Ρ€Π°Π·Π½ΠΎΠΎΠ±Ρ€Π°Π·ΠΈΡ‚ΡŒ Π²Π°ΡˆΡƒ Тизнь, ΠΏΠΎΠΏΡ€ΠΎΠ±ΡƒΠΉΡ‚Π΅ ΠΈΠ·ΠΌΠ΅Π½ΠΈΡ‚ΡŒ ΠΈΡ… Π½Π° приятный Ρ€ΠΎΠ·ΠΎΠ²Ρ‹ΠΉ. Для этого ΠΏΠ΅Ρ€Π΅ΠΉΠ΄ΠΈΡ‚Π΅ Π² мСню Tools > Options > Environment > Fonts and Colors > Suggestion ellipses (…) ΠΈ Π·Π°Π΄Π°ΠΉΡ‚Π΅ для ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Π° ΡΠ»Π΅Π΄ΡƒΡŽΡ‰ΠΈΠΉ настраиваСмый Ρ†Π²Π΅Ρ‚ (R: 255, G: 136, B: 196):

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. image loader. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-image loader. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° image loader. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

ΠžΠΏΡ‹Ρ‚ Ρ€Π°Π±ΠΎΡ‚Ρ‹ Π² Visual Studio

Когда Π²Ρ‹ добавляСтС Ρ„Π°ΠΉΠ» EditorConfig ΠΊ ΡΡƒΡ‰Π΅ΡΡ‚Π²ΡƒΡŽΡ‰Π΅ΠΌΡƒ Ρ€Π΅ΠΏΠΎΠ·ΠΈΡ‚ΠΎΡ€ΠΈΡŽ ΠΈΠ»ΠΈ ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Ρƒ, Ρ„Π°ΠΉΠ»Ρ‹ Π½Π΅ ΠΏΡ€ΠΎΠ²Π΅Ρ€ΡΡŽΡ‚ΡΡ автоматичСски, Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΡΠΎΠΎΡ‚Π²Π΅Ρ‚ΡΡ‚Π²ΠΎΠ²Π°Ρ‚ΡŒ вашим соглашСниям. Когда Π²Ρ‹ добавляСтС ΠΈΠ»ΠΈ Ρ€Π΅Π΄Π°ΠΊΡ‚ΠΈΡ€ΡƒΠ΅Ρ‚Π΅ EditorConfig Ρ„Π°ΠΉΠ», Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΠΏΡ€ΠΈΠΌΠ΅Π½ΠΈΡ‚ΡŒ Π½ΠΎΠ²Ρ‹Π΅ настройки, Π²Ρ‹ Π΄ΠΎΠ»ΠΆΠ½Ρ‹ Π·Π°ΠΊΡ€Ρ‹Ρ‚ΡŒ ΠΈ ΠΎΡ‚ΠΊΡ€Ρ‹Ρ‚ΡŒ всС ΠΎΡ‚ΠΊΡ€Ρ‹Ρ‚Ρ‹Π΅ Ρ„Π°ΠΉΠ»Ρ‹, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ Ρƒ вас Π΅ΡΡ‚ΡŒ. Π§Ρ‚ΠΎΠ±Ρ‹ вСсь Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚ придСрТивался ΠΏΡ€Π°Π²ΠΈΠ» форматирования ΠΊΠΎΠ΄Π°, ΠΎΠΏΡ€Π΅Π΄Π΅Π»Π΅Π½Π½Ρ‹Ρ… Π² Π²Π°ΡˆΠΈΡ… настройках, Π²Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ Format Document (Ctrl + K, D). Π­Ρ‚Π° ΠΏΡ€ΠΎΠ²Π΅Ρ€ΠΊΠ° Π½Π΅ измСняСт ΠΊΠΎΠ΄, Π½ΠΎ Π²Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ мСню быстрых дСйствий (Ctrl +.), Ρ‡Ρ‚ΠΎΠ±Ρ‹ ΠΏΡ€ΠΈΠΌΠ΅Π½ΠΈΡ‚ΡŒ исправлСниС стиля ΠΊΠΎΠ΄Π° ΠΊΠΎ всСм вхоТдСниям Π² Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚Π΅/ΠΏΡ€ΠΎΠ΅ΠΊΡ‚Π΅/Ρ€Π΅ΡˆΠ΅Π½ΠΈΠΈ.

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. image loader. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-image loader. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° image loader. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

Π‘ΠΎΠ²Π΅Ρ‚: Π§Ρ‚ΠΎΠ±Ρ‹ ΠΏΡ€ΠΎΠ²Π΅Ρ€ΠΈΡ‚ΡŒ, Ρ‡Ρ‚ΠΎ Π² вашСм Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚Π΅ ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΡƒΡŽΡ‚ΡΡ ΠΏΡ€ΠΎΠ±Π΅Π»Ρ‹ ΠΈΠ»ΠΈ табуляции, Π²ΠΊΠ»ΡŽΡ‡ΠΈΡ‚Π΅ Edit > Advanced > View White Space.

Но ΠΊΠ°ΠΊ ΡƒΠ·Π½Π°Ρ‚ΡŒ, примСняСтся Π»ΠΈ Ρ„Π°ΠΉΠ» EditorConfig ΠΊ Π²Π°ΡˆΠ΅ΠΌΡƒ Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚Ρƒ? Π’Ρ‹ ΠΌΠΎΠΆΠ΅Ρ‚Π΅ Π²Π·Π³Π»ΡΠ½ΡƒΡ‚ΡŒ Π½Π° ниТнюю строку состояния Visual Studio ΠΈ ΡƒΠ²ΠΈΠ΄Π΅Ρ‚ΡŒ это сообщСниС:

visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. image loader. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π° Ρ„ΠΎΡ‚ΠΎ. visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°-image loader. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° visual studio ΡΡ‚ΠΈΠ»ΡŒ ΠΊΠΎΠ΄Π°. ΠΊΠ°Ρ€Ρ‚ΠΈΠ½ΠΊΠ° image loader. You can define code style settings per-project by using an EditorConfig file, or for all code you edit in Visual Studio on the text editor Options page. For C# code, you can also configure Visual Studio to apply these code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.

ΠžΠ±Ρ€Π°Ρ‚ΠΈΡ‚Π΅ Π²Π½ΠΈΠΌΠ°Π½ΠΈΠ΅, Ρ‡Ρ‚ΠΎ это ΠΎΠ·Π½Π°Ρ‡Π°Π΅Ρ‚, Ρ‡Ρ‚ΠΎ EditorConfig Ρ„Π°ΠΉΠ»Ρ‹ ΠΏΠ΅Ρ€Π΅ΠΎΠΏΡ€Π΅Π΄Π΅Π»ΡΡŽΡ‚ Π»ΡŽΠ±Ρ‹Π΅ настройки стиля ΠΊΠΎΠ΄Π°, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ Π²Ρ‹ настроили Π² мСню Tools > Options.

Π§Ρ‚ΠΎΠ±Ρ‹ ΠΏΠΎΠ»ΡƒΡ‡ΠΈΡ‚ΡŒ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΡƒ языковых слуТб ΠΏΡ€ΠΈ Ρ€Π΅Π΄Π°ΠΊΡ‚ΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠΈ EditorConfig Ρ„Π°ΠΉΠ»Π° Π² VS, Π·Π°Π³Ρ€ΡƒΠ·ΠΈΡ‚Π΅ Ρ€Π°ΡΡˆΠΈΡ€Π΅Π½ΠΈΠ΅ EditorConfig Language Service.

Π’Ρ‹Π²ΠΎΠ΄

Visual Studio 2017 β€” просто ΡΡ‚ΡƒΠΏΠ΅Π½ΡŒΠΊΠ° Π² ΠΊΠΎΠ½Ρ„ΠΈΠ³ΡƒΡ€Π°Ρ†ΠΈΠΈ соглашСния ΠΎ написания ΠΊΠΎΠ΄Π°. Π§Ρ‚ΠΎΠ±Ρ‹ ΡƒΠ·Π½Π°Ρ‚ΡŒ большС ΠΎ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ΅ EditorConfig Π² Visual Studio 2017, ΠΎΠ·Π½Π°ΠΊΠΎΠΌΡŒΡ‚Π΅ΡΡŒ с Π΄ΠΎΠΊΡƒΠΌΠ΅Π½Ρ‚Π°Ρ†ΠΈΠ΅ΠΉ.

Π˜ΡΡ‚ΠΎΡ‡Π½ΠΈΠΊ

Π”ΠΎΠ±Π°Π²ΠΈΡ‚ΡŒ ΠΊΠΎΠΌΠΌΠ΅Π½Ρ‚Π°Ρ€ΠΈΠΉ

Π’Π°Ρˆ адрСс email Π½Π΅ Π±ΡƒΠ΄Π΅Ρ‚ ΠΎΠΏΡƒΠ±Π»ΠΈΠΊΠΎΠ²Π°Π½. ΠžΠ±ΡΠ·Π°Ρ‚Π΅Π»ΡŒΠ½Ρ‹Π΅ поля ΠΏΠΎΠΌΠ΅Ρ‡Π΅Π½Ρ‹ *