Skip to content

Commit 632c598

Browse files
authored
Merge pull request #3128 from MicrosoftDocs/master636915515396721042
For protected CLA branch, push strategy should use PR and merge to target branch method to work around git push error
2 parents fd9d9e5 + 94b3a05 commit 632c598

16 files changed

+71
-67
lines changed

docs/code-quality/C26453.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dev_langs: ["C++"]
1313
manager: jillfra
1414
---
1515

16-
# Warning C26253: Arithmetic overflow: Left shift of a negative signed number is undefined behavior
16+
# Warning C26453: Arithmetic overflow: Left shift of a negative signed number is undefined behavior
1717

1818
This warning indicates we are left shifting a negative signed integral value, which is a bad idea and triggers implementation defined behavior.
1919

docs/ide/code-snippets-schema-reference.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,7 @@ A text value is required. This text specifies the unique identifier for the obje
312312

313313
## Import element
314314

315-
Specifies the imported namespaces used by an IntelliSense Code Snippet.
316-
317-
> [!NOTE]
318-
> The `Import` element is only supported for Visual Basic projects.
315+
Specifies the imported namespaces used by an IntelliSense code snippet.
319316

320317
```xml
321318
<Import>
@@ -335,9 +332,6 @@ Specifies the imported namespaces used by an IntelliSense Code Snippet.
335332

336333
Groups individual `Import` elements.
337334

338-
> [!NOTE]
339-
> The `Imports` element is only supported for Visual Basic projects.
340-
341335
```xml
342336
<Imports>
343337
<Import>... </Import>
@@ -419,10 +413,7 @@ Literals and objects cannot contain an **ID** element with a value of selected o
419413

420414
## Namespace element
421415

422-
Specifies the namespace that must be imported for the code snippet to compile and run. The namespace specified in the `Namespace` element is automatically added to an `Imports` statement at the beginning of the code, if it does not already exist.
423-
424-
> [!NOTE]
425-
> The `Namespace` element is only supported for Visual Basic projects.
416+
Specifies the namespace that must be imported for the code snippet to compile and run. The namespace specified in the `Namespace` element is automatically added to a `using` directive or `Imports` statement at the beginning of the code if it doesn't already exist.
426417

427418
```xml
428419
<Namespace>

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ When you add an EditorConfig file to your project in Visual Studio, the formatti
1919
> [!NOTE]
2020
> This topic applies to Visual Studio on Windows. For Visual Studio for Mac, see [EditorConfig in Visual Studio for Mac](/visualstudio/mac/editorconfig).
2121
22-
## Coding consistency
22+
## Code consistency
2323

2424
Settings in EditorConfig files enable you to maintain consistent coding styles and settings in a codebase, such as indent style, tab width, end of line characters, encoding, and more, regardless of the editor or IDE you use. For example, when coding in C#, if your codebase has a convention to prefer that indents always consist of five space characters, documents use UTF-8 encoding, and each line always ends with a CR/LF, you can configure an *.editorconfig* file to do that.
2525

@@ -45,7 +45,7 @@ The editor in Visual Studio supports the core set of [EditorConfig properties](h
4545

4646
EditorConfig editor settings are supported in all Visual Studio-supported languages except for XML. In addition, EditorConfig supports [code style](../ide/editorconfig-code-style-settings-reference.md) and [naming](../ide/editorconfig-naming-conventions.md) conventions for C# and Visual Basic.
4747

48-
## Adding and removing EditorConfig files
48+
## Add and remove EditorConfig files
4949

5050
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 automatically converted to spaces. However, any new lines of code are formatted according to the EditorConfig file. Additionally, if you format the document (**Edit** > **Advanced** > **Format Document** or **Ctrl**+**K**, **Ctrl**+**D**), the settings in the EditorConfig file are applied to existing lines of code.
5151

@@ -88,7 +88,7 @@ There are a couple other ways you can add an EditorConfig file to your project:
8888

8989
- Try out the [IntelliCode extension](/visualstudio/intellicode/intellicode-visual-studio). This experimental extension infers your code styles from existing code, and then creates a non-empty *.editorconfig* file with your code style preferences already defined.
9090

91-
## Override EditorConfig settings
91+
## File hierarchy and precedence
9292

9393
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. You can also override EditorConfig settings for a particular project, codebase, or part of a codebase, such that it uses different conventions than other parts of the codebase. This can be useful when you incorporate code from somewhere else, and don’t want to change its conventions.
9494

@@ -103,9 +103,9 @@ If you want to override some but not all of the settings, specify just those set
103103
root = true
104104
```
105105

106-
EditorConfig files are read top to bottom, and the closest EditorConfig files are read last. Conventions from matching EditorConfig sections are applied in the order they were read, so conventions in closer files take precedence.
106+
EditorConfig files are read top to bottom. If there are multiple properties with the same name, the most recently found property with that name takes precedence.
107107

108-
## Editing EditorConfig files
108+
## Edit EditorConfig files
109109

110110
Visual Studio helps you edit *.editorconfig* files by providing IntelliSense completion lists.
111111

@@ -142,7 +142,7 @@ Now, when you press the **Tab** key, you get tab characters instead of spaces.
142142

143143
![Tab key adds Tab character](../ide/media/vside_editorconfig_tab.png)
144144

145-
## Troubleshooting EditorConfig settings
145+
## Troubleshoot EditorConfig settings
146146

147147
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:
148148

docs/ide/csharp-developer-productivity.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,12 @@ Download the [IntelliCode extension](https://marketplace.visualstudio.com/items?
148148
Starting in Visual Studio 2017, there are numerous improvements to the testing experience. You can test with the MSTest v1, MSTest v2, NUnit, or XUnit test frameworks.
149149

150150
- **Test Explorer** test discovery is fast.
151+
151152
- Organize your tests in **Test Explorer** with *hierarchical sorting*.
152-
- [Live unit testing](../test/live-unit-testing.md) continuously runs tests impacted by your code changes and updates inline editor icons to let you know the status of your tests. Include or exclude specific tests or test projects from your live test set.
153153

154-
![Hierarchy view for Text Explorer in Visual Studio](../ide/media/VSGuide_Testing.png)
154+
![Hierarchy view for Text Explorer in Visual Studio](../ide/media/VSGuide_Testing.png)
155+
156+
- [Live unit testing](../test/live-unit-testing.md) continuously runs tests impacted by your code changes and updates inline editor icons to let you know the status of your tests. Include or exclude specific tests or test projects from your live test set. (Visual Studio Enterprise edition only.)
155157

156158
## Debugging
157159

@@ -205,5 +207,5 @@ Here is a list of editor and productivity features to make writing code more eff
205207
| Enable full solution analysis | See all errors in your solution in the **Error List** | **Tools** > **Options** > **Text Editor** > **C#** > **Advanced** > **Enable full solution analysis** |
206208
| Enable navigation to decompiled sources | Allow Go To Definition on types/members from external sources and use the ILSpy decompiler to show method bodies | **Tools** > **Options** > **Text Editor** > **C#** > **Advanced** > **Enable navigation to decompiled sources** |
207209
| Completion/Suggestion Mode | Changes the completion behavior in IntelliSense. Developers with IntelliJ backgrounds tend to use a non-default setting here. | **Menu** > **Edit** > **IntelliSense** > **Toggle Completion Mode** |
208-
| [CodeLens](../ide/find-code-changes-and-other-history-with-codelens.md) | Displays code reference information and change history in the editor | **Tools** > **Options** > **Text Editor** > **All Languages** > **CodeLens** |
210+
| [CodeLens](../ide/find-code-changes-and-other-history-with-codelens.md) | Displays code reference information and change history in the editor. (Source control CodeLens indicators aren't available in Visual Studio Community edition.) | **Tools** > **Options** > **Text Editor** > **All Languages** > **CodeLens** |
209211
| [Code snippets](../ide/visual-csharp-code-snippets.md) | Help stub out common boilerplate code | Type a snippet name and press **Tab** twice. |

docs/ide/editorconfig-code-style-settings-reference.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,13 +323,14 @@ The following table shows the rule names, rule IDs, applicable programming langu
323323

324324
**dotnet\_style\_require\_accessibility_modifiers**
325325

326-
This rule does not accept a **true** or **false** value; instead it accepts a value from the following table:
326+
This rule accepts a value from the following table:
327327

328328
| Value | Description |
329329
| ----- |:----------- |
330330
| always | Prefer accessibility modifiers to be specified |
331-
| for\_non\_interface_members | Prefer accessibility modifiers to be declared except for public interface members. This is the same as **always** and has been added for future proofing if C# adds default interface methods. |
331+
| for\_non\_interface_members | Prefer accessibility modifiers to be declared except for public interface members. (This is the same as **always** and has been added for future-proofing if C# adds default interface methods.) |
332332
| never | Do not prefer accessibility modifiers to be specified |
333+
| omit_if_default | Prefer accessibility modifiers to be specified except if they are the default modifier |
333334

334335
Code examples:
335336

docs/ide/editorconfig-naming-conventions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ ms.workload:
1313
---
1414
# .NET naming conventions for EditorConfig
1515

16-
Naming conventions concern the naming of code elements such as classes, properties, and methods. For example, you can specify that public members must be capitalized, or that asynchronous methods must end in "Async". You can enforce these rules by specifying them in an [.editorconfig file](../ide/create-portable-custom-editor-options.md). Naming rule violations appear either in the **Error List** or as a suggestion under the name, depending on the severity you choose for your rule. There is no need to build the project in order to see violations.
16+
Naming conventions concern the naming of code elements such as classes, properties, and methods. For example, you can specify that public members must be capitalized or that asynchronous methods must end in "Async". You can enforce these rules by specifying them in an [.editorconfig file](../ide/create-portable-custom-editor-options.md). Naming rule violations appear either in the **Error List** or as a suggestion under the name, depending on the severity you choose for your rule. There is no need to build the project in order to see violations.
1717

18-
Naming conventions should be ordered from most-specific to least-specific in the *.editorconfig* file. The first rule encountered that can be applied is the only rule that is applied.
18+
Naming conventions should be ordered from most-specific to least-specific in the EditorConfig file. The first rule encountered that can be applied is the only rule that is applied. However, if there are multiple rule *properties* with the same name, the most recently found property with that name takes precedence. For more information, see [File hierarchy and precedence](create-portable-custom-editor-options.md#file-hierarchy-and-precedence).
1919

2020
For each naming convention, you must specify the symbols it applies to, a naming style, and a severity for enforcing the convention, using the properties described below. The order of the properties is not important.
2121

docs/ide/media/vxoperator_icon.gif

831 Bytes
Loading

docs/ide/media/vxstruct_icon.gif

702 Bytes
Loading

docs/ide/reference/convert-foreach-linq.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Convert foreach loop to LINQ
2+
title: Convert a foreach loop to LINQ
33
ms.date: 02/20/2019
44
ms.topic: reference
55
author: kendrahavens
@@ -10,38 +10,38 @@ dev_langs:
1010
ms.workload:
1111
- "dotnet"
1212
---
13-
# Convert foreach loop to LINQ
13+
# Convert a foreach loop to LINQ
1414

1515
This refactoring applies to:
1616

1717
- C#
1818

19-
**What:** Lets you easily convert your foreach loops using IEnumerables to LINQ query or LINQ call form (also known as LINQ method).
19+
**What:** Lets you easily convert your *foreach* loop that uses an IEnumerable to a LINQ query or a LINQ call form (also known as a LINQ method).
2020

21-
**When:** When you have a foreach loop that uses an IEnumerable that you prefer to read as a LINQ query.
21+
**When:** You have a foreach loop that uses an IEnumerable, and you want that loop to read as a LINQ query.
2222

23-
**Why:** Sometimes users may prefer using LINQ syntax rather that a foreach loop. [LINQ](/dotnet/csharp/programming-guide/concepts/linq/introduction-to-linq) makes a query a first-class language construct in C#. LINQ can reduce the amount of code in a file, make it easier to read, and allow different data sources to have similar query expression patterns.
23+
**Why:** You prefer to use LINQ syntax rather than a foreach loop. [LINQ](/dotnet/csharp/programming-guide/concepts/linq/introduction-to-linq) makes a query into a first-class language construct in C#. LINQ can reduce the amount of code in a file, make the code easier to read, and allow different data sources to have similar query expression patterns.
2424

2525
> [!NOTE]
26-
> LINQ syntax is typically less performant than foreach loops. It's good to be aware of any performace trade off you may cause when improving the readability of your code with LINQ.
26+
> LINQ syntax is typically less efficient than a foreach loop. It's good to be aware of any performance tradeoff that might occur when you use LINQ to improve the readability of your code.
2727
28-
## Convert foreach loop to LINQ refactoring
28+
## Convert a foreach loop to LINQ refactoring
2929

3030
1. Place your cursor in the `foreach` keyword.
3131

32-
![Foreach using IEnumerable](media/convert-foreach-to-LINQ.png)
32+
![Foreach using IEnumerable sample](media/convert-foreach-to-LINQ.png)
3333

3434
2. Press **Ctrl**+**.** to trigger the **Quick Actions and Refactorings** menu.
3535

36-
![Convert to LINQ menu](media/convert-foreach-to-LINQ-codefix.png)
36+
![Convert to LINQ menu sample](media/convert-foreach-to-LINQ-codefix.png)
3737

38-
3. Select **Convert to LINQ** or **Convert to Linq (call form)**
38+
3. Select **Convert to LINQ** or **Convert to Linq (call form)**.
3939

40-
![LINQ query result](media/convert-foreach-to-LINQ-result.png)
40+
![LINQ query result sample](media/convert-foreach-to-LINQ-result.png)
4141

42-
![LINQ call form result](media/convert-foreach-to-LINQ-callform-result.png)
42+
![LINQ call form result sample](media/convert-foreach-to-LINQ-callform-result.png)
4343

44-
### Sample Code
44+
### Sample code
4545

4646
```csharp
4747
using System.Collections.Generic;
@@ -72,5 +72,5 @@ public class Class1
7272
## See also
7373

7474
- [Refactoring](../refactoring-in-visual-studio.md)
75-
- [Preview Changes](../../ide/preview-changes.md)
75+
- [Preview Changes window](../../ide/preview-changes.md)
7676
- [Tips for .NET Developers](../../ide/visual-studio-2017-for-dotnet-developers.md)

docs/ide/reference/convert-local-function-method.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Convert local function to method
2+
title: Convert a local function to a method
33
ms.date: 02/19/2019
44
ms.topic: reference
55
author: kendrahavens
@@ -11,32 +11,32 @@ dev_langs:
1111
ms.workload:
1212
- "dotnet"
1313
---
14-
# Convert local function to method
14+
# Convert a local function to a method
1515

1616
This refactoring applies to:
1717

1818
- C#
1919
- Visual Basic
2020

21-
**What:** Convert a local function to a method
21+
**What:** Convert a local function to a method.
2222

23-
**When:** You have a local function that you want to define outside of your current local context.
23+
**When:** You have a local function that you want to define outside your current local context.
2424

25-
**Why:** You may want to convert a local function to a method so you can call it outside of your local context. You may want to convert to a method when your local function is getting too long. Defining it in a separate method makes your code easier to read.
25+
**Why:** You want to convert a local function into a method so that you can call it outside your local context. You might want to convert to a method when your local function is getting too long. When you define the function in a separate method, your code is easier to read.
2626

2727
## Convert local function to method refactoring
2828

29-
1. Place your cursor in a local function.
29+
1. Place your cursor in the local function.
3030

31-
![Convert local function to method](media/convert-local-function-to-method.png)
31+
![Convert a local function to a method code sample](media/convert-local-function-to-method.png)
3232

3333
2. Press **Ctrl**+**.** to trigger the **Quick Actions and Refactorings** menu.
3434

35-
![Convert local function to method code fix](media/convert-local-function-to-method-codefix.png)
35+
![Convert local function to method code fix sample](media/convert-local-function-to-method-codefix.png)
3636

37-
2. Press **Enter** to accept the refactoring.
37+
2. Press Enter to accept the refactoring.
3838

39-
![Convert local function to method result](media/convert-local-function-to-method-result.png)
39+
![Convert local function to method result sample](media/convert-local-function-to-method-result.png)
4040

4141
## See also
4242

docs/ide/template-parameters.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ The following table lists the reserved template parameters that can be used by a
4646
|clrversion|Current version of the common language runtime (CLR).|
4747
|ext_*|Add the `ext_` prefix to any parameter to refer to the variables of the parent template. For example, `ext_safeprojectname`.|
4848
|guid[1-10]|A GUID used to replace the project GUID in a project file. You can specify up to 10 unique GUIDs (for example, `guid1`).|
49-
|itemname|The name provided by the user in the **Add New Item** dialog box.|
49+
|itemname|The name of the file in which the parameter is being used.|
5050
|machinename|The current computer name (for example, Computer01).|
5151
|projectname|The name provided by the user when the project was created.|
5252
|registeredorganization|The registry key value from HKLM\Software\Microsoft\Windows NT\CurrentVersion\RegisteredOrganization.|
5353
|rootnamespace|The root namespace of the current project. This parameter applies only to item templates.|
54-
|safeitemname|The name provided by the user in the **Add New Item** dialog box, with all unsafe characters and spaces removed.|
55-
|safeprojectname|The name provided by the user when the project was created, but with all unsafe characters and spaces removed.|
54+
|safeitemname|Same as `itemname` but with all unsafe characters and spaces removed.|
55+
|safeprojectname|The name provided by the user when the project was created but with all unsafe characters and spaces removed.|
5656
|time|The current time in the format DD/MM/YYYY 00:00:00.|
5757
|SpecificSolutionName|The name of the solution. When "create solution directory" is checked, `SpecificSolutionName` has the solution name. When "create solution directory" is not checked, `SpecificSolutionName` is blank.|
5858
|userdomain|The current user domain.|

docs/ide/using-the-task-list.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ To create a custom token:
7878

7979
5. Choose **Add**.
8080

81+
> [!TIP]
82+
> The **Add** button becomes enabled after you enter a name. You must enter a name before clicking **Add**.
83+
8184
### C++ TODO comments
8285

8386
By default, C++ TODO comments are displayed in **Task List**.

0 commit comments

Comments
 (0)