Skip to content

Commit 16938c6

Browse files
committed
Merge branch 'mikejo-br5' of https://github.com/MicrosoftDocs/visualstudio-docs-pr into mikejo-br5
2 parents ab27896 + b63ae08 commit 16938c6

6 files changed

+476
-394
lines changed

docs/debugger/source-server-security-alert.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ When using Source Server, only use symbol files that are from a known and truste
2727
This warning appears when you enable Source Server support. Source Server commands are embedded in debug symbol files (***.pdb** files). Make sure you know where your PDB files come from.
2828

2929
> [!IMPORTANT]
30-
> The following potential security threats must be taken into account when using Source Server: Arbitrary commands can be embedded in the application's PDB file, so make sure you put only the ones you want to execute in the srcsrv.ini file. Any attempt to execute a command not in the srcsvr.ini file will cause a confirmation dialog box to appear. For more information, see [Security Warning: Debugger Must Execute Untrusted Command](../debugger/security-warning-debugger-must-execute-untrusted-command.md).No validation is done on command parameters, so be careful with trusted commands. For example, if you trusted cmd.exe, a malicious user might specify parameters that would make the command dangerous.
30+
> The following potential security threats must be taken into account when using Source Server: Arbitrary commands can be embedded in the application's PDB file, so make sure you put only the ones you want to execute in the srcsrv.ini file. Any attempt to execute a command not in the srcsvr.ini file will cause a confirmation dialog box to appear. For more information, see [Security Warning: Debugger Must Execute Untrusted Command](../debugger/security-warning-debugger-must-execute-untrusted-command.md). No validation is done on command parameters, so be careful with trusted commands. For example, if you trusted cmd.exe, a malicious user might specify parameters that would make the command dangerous.
3131
3232
## See Also
3333
[Specify Symbol (.pdb) and Source Files](../debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md)
3434
[Debugger Security](../debugger/debugger-security.md)
35-
[Source Server](http://msdn.microsoft.com/library/windows/desktop/ms680641.aspx)
35+
[Source Server](http://msdn.microsoft.com/library/windows/desktop/ms680641.aspx)

docs/extensibility/how-to-provide-a-service.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ A VSPackage can provide services that other VSPackages can use. To provide a ser
106106

107107
2. Implement the callback method, which should create and return the service, or null if it cannot be created.
108108

109-
```
109+
```csharp
110110
private object CreateService(IServiceContainer container, Type serviceType)
111111
{
112112
if (typeof(SMyService) == serviceType)
@@ -140,4 +140,4 @@ A VSPackage can provide services that other VSPackages can use. To provide a ser
140140
## See Also
141141
[How to: Get a Service](../extensibility/how-to-get-a-service.md)
142142
[Using and Providing Services](../extensibility/using-and-providing-services.md)
143-
[Service Essentials](../extensibility/internals/service-essentials.md)
143+
[Service Essentials](../extensibility/internals/service-essentials.md)

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: "Using EditorConfig settings in VisualStudio | Microsoft Docs"
2+
title: "Using EditorConfig settings in Visual Studio | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "10/27/2017"
4+
ms.date: "12/13/2017"
55
ms.reviewer: ""
66
ms.suite: ""
77
ms.tgt_pltfrm: ""
@@ -15,7 +15,9 @@ ms.technology: vs-ide-general
1515
---
1616
# Create portable, custom editor settings with EditorConfig
1717

18-
Text editor settings in Visual Studio apply to all projects of a given type. So, for example, if you change a C# text editor setting, that setting applies to *all* C# projects in Visual Studio. However, in some cases, you may need to use conventions that differ from your own personal editor preferences. [EditorConfig](http://editorconfig.org/) files enable you to do this by describing common text editor options, such as indent size, on a per-project basis. EditorConfig settings, which are contained in an .editorconfig file that lives alongside the code and project files, take precedence over global Visual Studio text editor settings. This means that you can tailor each codebase to use text editor settings that are specific to that project. No plug-in is required to use this functionality in Visual Studio.
18+
In Visual Studio 2017, you can add an [EditorConfig](http://editorconfig.org/) file to your project or codebase to enforce consistent coding styles for everyone that works in the codebase. EditorConfig settings take precedence over global Visual Studio text editor settings. This means that you can tailor each codebase to use text editor settings that are specific to that project. You can still set your own personal editor preferences in the Visual Studio **Options** dialog box. Those settings apply whenever you're working in a codebase without an .editorconfig file, or when the .editorconfig file doesn't override a particular setting. An example of such a preference is indent style—tabs or spaces.
19+
20+
EditorConfig settings are supported by numerous code editors and IDEs, including Visual Studio. It's a portable component that travels with your code, and can enforce coding styles even outside of Visual Studio.
1921

2022
## Coding consistency
2123

@@ -27,7 +29,7 @@ Because the settings are contained in a file in the codebase, they travel along
2729

2830
## Override EditorConfig settings
2931

30-
When you add an .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 such that it uses different conventions than the top-level EditorConfig file, just add an .editorconfig file to the root of your codebase's repo or project directory. Make sure to put the ```root=true``` property in the file so Visual Studio doesn't look any further up the directory structure for .editorconfig files. The new EditorConfig file settings will apply to files in the same level and any subdirectories.
32+
When you add an .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 such that it uses different conventions than the top-level EditorConfig file, just add an .editorconfig file to the root of your codebase's repo or project directory. Make sure to put the ```root=true``` property in the file so Visual Studio doesn't look any further up the directory structure for .editorconfig files. The new EditorConfig file settings apply to files in the same level and any subdirectories.
3133

3234
```
3335
# top-most EditorConfig file
@@ -53,27 +55,27 @@ EditorConfig editor settings are supported in all Visual Studio-supported langua
5355

5456
## Editing EditorConfig files
5557

56-
Visual Studio provides some IntelliSense for editing .editorconfig files. If you edit a lot of .editorconfig files, you may find the [EditorConfig Language Service](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.EditorConfig) extension helpful.
58+
Visual Studio provides some IntelliSense for editing .editorconfig files. If you edit numerous .editorconfig files, you may find the [EditorConfig Language Service](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.EditorConfig) extension helpful.
5759

5860
After you've edited your EditorConfig file, you must reload your code files for the new settings to take effect.
5961

6062
## Adding and removing EditorConfig files
6163

62-
Adding an EditorConfig file to your project or codebase will not convert existing styles to the new ones. For example, if you have indents in your file that are formatted with tabs, and you add an EditorConfig file that indents with spaces, the indent characters will not get converted to spaces. However, any new lines of code will be formatted according to the EditorConfig file.
64+
Adding an EditorConfig file to your project or codebase does not convert existing styles to the new ones. For example, if you have indents in your file that are formatted with tabs, and you add an EditorConfig file that indents with spaces, the indent characters are not converted to spaces. However, any new lines of code will be formatted according to the EditorConfig file.
6365

6466
If you remove an EditorConfig file from your project or codebase, you must close and reopen any open code files to revert to the global editor settings for new lines of code.
6567

6668
## Example
6769

68-
The following is an example that shows the indent state of a C# code snippet before and after adding an .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.
70+
The following example shows the indent state of a C# code snippet before and after adding an .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.
6971

7072
![Text Editor tab setting](../ide/media/vside_editorconfig_tabsetting.png)
7173

7274
As expected, pressing the **Tab** key on the next line indents the line by adding four additional white space characters.
7375

7476
![Code before using EditorConfig](../ide/media/vside_editorconfig_before.png)
7577

76-
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 C# code files in this project.
78+
We'll add a new file called .editorconfig to the project, with the following contents. The `[*.cs]` setting means that this change applies only to C# code files in the project.
7779

7880
```
7981
# Top-most EditorConfig file
@@ -90,11 +92,11 @@ Now, when you press the **Tab** key, you get tab characters instead of spaces.
9092

9193
## Troubleshooting EditorConfig settings
9294

93-
If there is an EditorConfig file anywhere in the directory structure at or above your project's location, Visual Studio will apply the editor settings in that file to your editor. In this case, you may see the following message in the status bar:
95+
If there is an EditorConfig file anywhere in the directory structure at or above your project's location, Visual Studio applies the editor settings in that file to your editor. In this case, you may see the following message in the status bar:
9496

9597
**"User preferences for this file type are overridden by this project's coding conventions."**
9698

97-
This means that if any editor settings in **Tools**, **Options**, **Text Editor** (such as indent size and style, tab size, or coding conventions) are specified in an EditorConfig file at or above the project in the directory structure, the conventions in the EditorConfig file will override the settings in Options. You can control this behavior by toggling the **Follow project coding conventions** option in **Tools**, **Options**, **Text Editor**. Unchecking the option will turn off EditorConfig support for Visual Studio.
99+
This means that if any editor settings in **Tools**, **Options**, **Text Editor** (such as indent size and style, tab size, or coding conventions) are specified in an EditorConfig file at or above the project in the directory structure, the conventions in the EditorConfig file override the settings in Options. You can control this behavior by toggling the **Follow project coding conventions** option in **Tools**, **Options**, **Text Editor**. Unchecking the option turns off EditorConfig support for Visual Studio.
98100

99101
![Tools Options - follow project coding conventions](media/coding_conventions_option.png)
100102

@@ -104,7 +106,7 @@ You can find any .editorconfig files in parent directories by opening a command
104106
dir .editorconfig /s
105107
```
106108

107-
You can control the scope of your EditorConfig conventions by setting the ```root=true``` property in the .editorconfig file at the root of your repo or in the directory that your project resides. Visual Studio looks for a file named .editorconfig in the directory of the opened file and in every parent directory. Visual Studio stops searching if the root filepath is reached, or if an .editorconfig file with ```root=true``` is found.
109+
You can control the scope of your EditorConfig conventions by setting the ```root=true``` property in the .editorconfig file at the root of your repo or in the directory that your project resides. Visual Studio looks for a file named .editorconfig in the directory of the opened file and in every parent directory. The search ends when it reaches the root filepath, or if an .editorconfig file with ```root=true``` is found.
108110

109111
## See also
110112

0 commit comments

Comments
 (0)