Skip to content

Commit d38c0d7

Browse files
authored
Merge pull request #907 from MicrosoftDocs/gewarren-ec-formatting
Cleaned up formatting in one topic
2 parents 6928ba9 + 3e56072 commit d38c0d7

File tree

1 file changed

+30
-18
lines changed

1 file changed

+30
-18
lines changed

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

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Create portable, custom editor settings with EditorConfig | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "02/17/2017"
4+
ms.date: "10/18/2017"
55
ms.reviewer: ""
66
ms.suite: ""
77
ms.tgt_pltfrm: ""
@@ -29,36 +29,38 @@ Because the settings are contained in a file in the codebase, they travel along
2929
## Override EditorConfig settings
3030
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.
3131

32-
![EditorConfig hiearchy](../ide/media/vside_editorconfig_hierarchy.png)
32+
![EditorConfig hierarchy](../ide/media/vside_editorconfig_hierarchy.png)
3333

3434
The new .editorconfig file settings will apply to the level in which it is located and all its subfiles.
3535

3636
## Supported settings
37-
The editor in Visual Studio supports the following values of the core set of EditorConfig options.
37+
The editor in Visual Studio supports the following from the core set of [EditorConfig properties](http://editorconfig.org/#supported-properties):
38+
3839
- indent_style
3940
- indent_size
4041
- tab_width
4142
- end_of_line
4243
- charset
4344
- root
44-
- [code style conventions](../ide/editorconfig-code-style-settings-reference.md)
45+
46+
In addition, it supports the [.NET code style conventions](../ide/editorconfig-code-style-settings-reference.md).
4547

4648
EditorConfig settings are supported in all Visual Studio-supported languages except for XML.
4749

4850
## 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.
5052

5153
![Text Editor tab setting](../ide/media/vside_editorconfig_tabsetting.png)
5254

53-
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.
5456

5557
![Code before using EditorConfig](../ide/media/vside_editorconfig_before.png)
5658

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.
5860

5961
![Added .editorconfig file to project](../ide/media/vside_editorconfig_addconfig.png)
6062

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.
6264

6365
![TAB adds Tab character](../ide/media/vside_editorconfig_tab.png)
6466

@@ -69,35 +71,45 @@ Now, when you press the TAB key, you get Tab characters instead of spaces.
6971

7072
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.
7173

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:
7375

76+
### Indent style
7477
Replace:
7578

76-
Microsoft.VisualStudio.TextManager.Interop.LANGPREFERENCES.fInsertTabs or Microsoft.VisualStudio.Package.LanguagePreferences.InsertTabs
79+
Microsoft.VisualStudio.TextManager.Interop.LANGPREFERENCES.fInsertTabs
80+
_or_
81+
Microsoft.VisualStudio.Package.LanguagePreferences.InsertTabs
7782

7883
With:
7984

80-
!textBufferOptions.GetOptionValue(DefaultOptions.ConvertTabsToSpacesOptionId) or
85+
!textBufferOptions.GetOptionValue(DefaultOptions.ConvertTabsToSpacesOptionId)
86+
_or_
8187
!textView.Options.GetOptionValue(DefaultOptions.ConvertTabsToSpacesOptionId)
8288

83-
*****
89+
### Indent size
8490
Replace:
8591

86-
Microsoft.VisualStudio.TextManager.Interop.LANGPREFERENCES.uIndentSize or Microsoft.VisualStudio.Package.LanguagePreferences.InsertTabs.IndentSize
92+
Microsoft.VisualStudio.TextManager.Interop.LANGPREFERENCES.uIndentSize
93+
_or_
94+
Microsoft.VisualStudio.Package.LanguagePreferences.InsertTabs.IndentSize
8795

8896
With:
8997

90-
textBufferOptions.GetOptionValue(DefaultOptions. IndentSizeOptionId) or
91-
textView.Options.GetOptionValue(DefaultOptions. IndentSizeOptionId)
98+
textBufferOptions.GetOptionValue(DefaultOptions.IndentSizeOptionId)
99+
_or_
100+
textView.Options.GetOptionValue(DefaultOptions.IndentSizeOptionId)
92101

93-
*****
102+
### Tab size
94103
Replace:
95104

96-
Microsoft.VisualStudio.TextManager.Interop.LANGPREFERENCES.uTabSize or Microsoft.VisualStudio.Package.LanguagePreferences.InsertTabs.TabSize
105+
Microsoft.VisualStudio.TextManager.Interop.LANGPREFERENCES.uTabSize
106+
_or_
107+
Microsoft.VisualStudio.Package.LanguagePreferences.InsertTabs.TabSize
97108

98109
With:
99110

100-
textBufferOptions.GetOptionValue(DefaultOptions.TabSizeOptionId) or
111+
textBufferOptions.GetOptionValue(DefaultOptions.TabSizeOptionId)
112+
_or_
101113
textView.Options.GetOptionValue(DefaultOptions.TabSizeOptionId)
102114

103115
# See Also

0 commit comments

Comments
 (0)