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/create-portable-custom-editor-options.md
+30-18Lines changed: 30 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: "Create portable, custom editor settings with EditorConfig | Microsoft Docs"
3
3
ms.custom: ""
4
-
ms.date: "02/17/2017"
4
+
ms.date: "10/18/2017"
5
5
ms.reviewer: ""
6
6
ms.suite: ""
7
7
ms.tgt_pltfrm: ""
@@ -29,36 +29,38 @@ Because the settings are contained in a file in the codebase, they travel along
29
29
## Override EditorConfig settings
30
30
When you add a .editorconfig file to a folder in your file hierarchy, its settings apply to all applicable files at that level and below. To override EditorConfig settings for a particular project or codebase and use different or overriding values than the top-level .editorconfig file, just add a .editorconfig file to the level you want to change.
In addition, it supports the [.NET code style conventions](../ide/editorconfig-code-style-settings-reference.md).
45
47
46
48
EditorConfig settings are supported in all Visual Studio-supported languages except for XML.
47
49
48
50
## Example
49
-
Here is an example that shows the indent state of a C# code snippet before and after adding a .editorconfig file to the project. The **Tabs** setting in the **Options** dialog box for the Visual Studio text editor is set to produce space characters when you press the TAB key in your code.
51
+
Here is an example that shows the indent state of a C# code snippet before and after adding a .editorconfig file to the project. The **Tabs** setting in the **Options** dialog box for the Visual Studio text editor is set to produce space characters when you press the **Tab** key in your code.
As expected, pressing the TAB key on the next line indents the line by adding four additional white space characters.
55
+
As expected, pressing the **Tab** key on the next line indents the line by adding four additional white space characters.
54
56
55
57

56
58
57
-
We'll add the following to a new file called .editorconfig to the project. (The `[*.cs]` setting means that this change will apply only to .cs files in this project.)
59
+
We'll add a new file called .editorconfig to the project, with the following contents. The `[*.cs]` setting means that this change will apply only to .cs files in this project.
58
60
59
61

60
62
61
-
Now, when you press the TAB key, you get Tab characters instead of spaces.
63
+
Now, when you press the **Tab** key, you get tab characters instead of spaces.
@@ -69,35 +71,45 @@ Now, when you press the TAB key, you get Tab characters instead of spaces.
69
71
70
72
In most cases when you implement a Visual Studio language service, no additional work is needed to support EditorConfig universal properties. The core editor automatically discovers and reads the .editorconfig file when users open files, and it sets the appropriate text buffer and view options. However, some language services opt to use an appropriate contextual text view option rather than using global settings for items such as tabs and spaces when a user edits or formats text. In these cases, the language service must be updated to support EditorConfig files.
71
73
72
-
Following are the changes needed to update a language service to support EditorConfig files, by replacing a global language-specific option with a contextual option:
74
+
Following are the changes needed to update a language service to support EditorConfig files, by replacing a global _language-specific_ option with a _contextual_ option:
73
75
76
+
### Indent style
74
77
Replace:
75
78
76
-
Microsoft.VisualStudio.TextManager.Interop.LANGPREFERENCES.fInsertTabs or Microsoft.VisualStudio.Package.LanguagePreferences.InsertTabs
0 commit comments