Skip to content

Fix git push error for protected CLA branch #3128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Apr 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/code-quality/C26453.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dev_langs: ["C++"]
manager: jillfra
---

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

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

Expand Down
13 changes: 2 additions & 11 deletions docs/ide/code-snippets-schema-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,7 @@ A text value is required. This text specifies the unique identifier for the obje

## Import element

Specifies the imported namespaces used by an IntelliSense Code Snippet.

> [!NOTE]
> The `Import` element is only supported for Visual Basic projects.
Specifies the imported namespaces used by an IntelliSense code snippet.

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

Groups individual `Import` elements.

> [!NOTE]
> The `Imports` element is only supported for Visual Basic projects.

```xml
<Imports>
<Import>... </Import>
Expand Down Expand Up @@ -419,10 +413,7 @@ Literals and objects cannot contain an **ID** element with a value of selected o

## Namespace element

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.

> [!NOTE]
> The `Namespace` element is only supported for Visual Basic projects.
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.

```xml
<Namespace>
Expand Down
12 changes: 6 additions & 6 deletions docs/ide/create-portable-custom-editor-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ When you add an EditorConfig file to your project in Visual Studio, the formatti
> [!NOTE]
> This topic applies to Visual Studio on Windows. For Visual Studio for Mac, see [EditorConfig in Visual Studio for Mac](/visualstudio/mac/editorconfig).

## Coding consistency
## Code consistency

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.

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

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.

## Adding and removing EditorConfig files
## Add and remove EditorConfig files

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.

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

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

## Override EditorConfig settings
## File hierarchy and precedence

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.

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

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

## Editing EditorConfig files
## Edit EditorConfig files

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

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

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

## Troubleshooting EditorConfig settings
## Troubleshoot EditorConfig settings

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:

Expand Down
8 changes: 5 additions & 3 deletions docs/ide/csharp-developer-productivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,12 @@ Download the [IntelliCode extension](https://marketplace.visualstudio.com/items?
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.

- **Test Explorer** test discovery is fast.

- Organize your tests in **Test Explorer** with *hierarchical sorting*.
- [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.

![Hierarchy view for Text Explorer in Visual Studio](../ide/media/VSGuide_Testing.png)
![Hierarchy view for Text Explorer in Visual Studio](../ide/media/VSGuide_Testing.png)

- [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.)

## Debugging

Expand Down Expand Up @@ -205,5 +207,5 @@ Here is a list of editor and productivity features to make writing code more eff
| Enable full solution analysis | See all errors in your solution in the **Error List** | **Tools** > **Options** > **Text Editor** > **C#** > **Advanced** > **Enable full solution analysis** |
| 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** |
| 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** |
| [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** |
| [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** |
| [Code snippets](../ide/visual-csharp-code-snippets.md) | Help stub out common boilerplate code | Type a snippet name and press **Tab** twice. |
5 changes: 3 additions & 2 deletions docs/ide/editorconfig-code-style-settings-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,14 @@ The following table shows the rule names, rule IDs, applicable programming langu

**dotnet\_style\_require\_accessibility_modifiers**

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

| Value | Description |
| ----- |:----------- |
| always | Prefer accessibility modifiers to be specified |
| 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. |
| 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.) |
| never | Do not prefer accessibility modifiers to be specified |
| omit_if_default | Prefer accessibility modifiers to be specified except if they are the default modifier |

Code examples:

Expand Down
4 changes: 2 additions & 2 deletions docs/ide/editorconfig-naming-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ ms.workload:
---
# .NET naming conventions for EditorConfig

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

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

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.

Expand Down
Binary file modified docs/ide/media/vxoperator_icon.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/ide/media/vxstruct_icon.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 14 additions & 14 deletions docs/ide/reference/convert-foreach-linq.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Convert foreach loop to LINQ
title: Convert a foreach loop to LINQ
ms.date: 02/20/2019
ms.topic: reference
author: kendrahavens
Expand All @@ -10,38 +10,38 @@ dev_langs:
ms.workload:
- "dotnet"
---
# Convert foreach loop to LINQ
# Convert a foreach loop to LINQ

This refactoring applies to:

- C#

**What:** Lets you easily convert your foreach loops using IEnumerables to LINQ query or LINQ call form (also known as LINQ method).
**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).

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

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

> [!NOTE]
> 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.
> 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.

## Convert foreach loop to LINQ refactoring
## Convert a foreach loop to LINQ refactoring

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

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

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

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

3. Select **Convert to LINQ** or **Convert to Linq (call form)**
3. Select **Convert to LINQ** or **Convert to Linq (call form)**.

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

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

### Sample Code
### Sample code

```csharp
using System.Collections.Generic;
Expand Down Expand Up @@ -72,5 +72,5 @@ public class Class1
## See also

- [Refactoring](../refactoring-in-visual-studio.md)
- [Preview Changes](../../ide/preview-changes.md)
- [Preview Changes window](../../ide/preview-changes.md)
- [Tips for .NET Developers](../../ide/visual-studio-2017-for-dotnet-developers.md)
20 changes: 10 additions & 10 deletions docs/ide/reference/convert-local-function-method.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Convert local function to method
title: Convert a local function to a method
ms.date: 02/19/2019
ms.topic: reference
author: kendrahavens
Expand All @@ -11,32 +11,32 @@ dev_langs:
ms.workload:
- "dotnet"
---
# Convert local function to method
# Convert a local function to a method

This refactoring applies to:

- C#
- Visual Basic

**What:** Convert a local function to a method
**What:** Convert a local function to a method.

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

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

## Convert local function to method refactoring

1. Place your cursor in a local function.
1. Place your cursor in the local function.

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

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

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

2. Press **Enter** to accept the refactoring.
2. Press Enter to accept the refactoring.

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

## See also

Expand Down
6 changes: 3 additions & 3 deletions docs/ide/template-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ The following table lists the reserved template parameters that can be used by a
|clrversion|Current version of the common language runtime (CLR).|
|ext_*|Add the `ext_` prefix to any parameter to refer to the variables of the parent template. For example, `ext_safeprojectname`.|
|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`).|
|itemname|The name provided by the user in the **Add New Item** dialog box.|
|itemname|The name of the file in which the parameter is being used.|
|machinename|The current computer name (for example, Computer01).|
|projectname|The name provided by the user when the project was created.|
|registeredorganization|The registry key value from HKLM\Software\Microsoft\Windows NT\CurrentVersion\RegisteredOrganization.|
|rootnamespace|The root namespace of the current project. This parameter applies only to item templates.|
|safeitemname|The name provided by the user in the **Add New Item** dialog box, with all unsafe characters and spaces removed.|
|safeprojectname|The name provided by the user when the project was created, but with all unsafe characters and spaces removed.|
|safeitemname|Same as `itemname` but with all unsafe characters and spaces removed.|
|safeprojectname|The name provided by the user when the project was created but with all unsafe characters and spaces removed.|
|time|The current time in the format DD/MM/YYYY 00:00:00.|
|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.|
|userdomain|The current user domain.|
Expand Down
3 changes: 3 additions & 0 deletions docs/ide/using-the-task-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ To create a custom token:

5. Choose **Add**.

> [!TIP]
> The **Add** button becomes enabled after you enter a name. You must enter a name before clicking **Add**.

### C++ TODO comments

By default, C++ TODO comments are displayed in **Task List**.
Expand Down
Loading