Skip to content

Repo sync for protected branch #10479

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 19 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
50 changes: 30 additions & 20 deletions docs/ide/code-styles-and-code-cleanup.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Code style options and code cleanup
description: Learn how to configure Visual Studio to apply code style preferences using the Code Cleanup (Visual Studio 2019) and Format Document (Visual Studio 2017) commands.
ms.date: 10/03/2024
ms.date: 11/11/2024
ms.topic: conceptual
author: mikejo5000
ms.author: mikejo
Expand Down Expand Up @@ -79,37 +79,54 @@ Starting in Visual Studio 2019 version 16.8, which includes the .NET 5.0 RC2 SDK

For C# code files, Visual Studio has a **Code Cleanup** button at the bottom of the editor (keyboard: **Ctrl**+**K**, **Ctrl**+**E**) to apply code styles from an EditorConfig file or from the **Code Style** options page. If an *.editorconfig* file exists for the project, those are the settings that take precedence.

![Screenshot of Execute code cleanup.](media/vs-2019/execute-code-cleanup.png)

> [!TIP]
> Rules configured with a severity of **None** don't participate in code cleanup but can be individually applied via the **Quick Actions and Refactorings** menu.

First, configure which code styles you want to apply (in one of two profiles) in the **Configure Code Cleanup** dialog box. To open this dialog box, click the expander arrow next to the code cleanup broom icon and then choose **Configure Code Cleanup**.
To apply code styles:

1. First, configure which code styles you want to apply (in one of two profiles) in the **Configure Code Cleanup** dialog box. To open this dialog box, click the expander arrow next to the code cleanup broom icon and then choose **Configure Code Cleanup**.

![Screenshot of Configure Code Cleanup.](media/vs-2019/configure-code-cleanup.png)

1. After you've configured code cleanup, use one of the following methods to run code cleanup:

- Click on the broom icon or press **Ctrl**+**K**, **Ctrl**+**E** to run code cleanup.

![Screenshot of Configure Code Cleanup.](media/vs-2019/configure-code-cleanup.png)
![Screenshot of Execute code cleanup.](media/vs-2019/execute-code-cleanup.png)

After you've configured code cleanup, you can either click on the broom icon or press **Ctrl**+**K**, **Ctrl**+**E** to run code cleanup. You can also run code cleanup across your entire project or solution. Right-click on the project or solution name in **Solution Explorer**, select **Analyze and Code Cleanup**, and then select **Run Code Cleanup**.
- To run code cleanup across your entire project or solution, right-click on the project or solution name in **Solution Explorer**, select **Analyze and Code Cleanup**, and then select **Run Code Cleanup**.

![Screenshot of Run Code Cleanup across entire project or solution.](media/vs-2019/run-code-cleanup-project-solution.png)
![Screenshot of Run Code Cleanup across entire project or solution.](media/vs-2019/run-code-cleanup-project-solution.png)

If you want your code style settings to be applied every time you save a file, you may like the [Code Cleanup on Save](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.CodeCleanupOnSave) extension.
::: moniker-end

::: moniker range=">=vs-2022"

For C# code files, Visual Studio has a **Code Cleanup** button at the bottom of the editor (keyboard: **Ctrl**+**K**, **Ctrl**+**E**) to apply code styles from an EditorConfig file or from the **Code Style** options page. If an *.editorconfig* file exists for the project, those are the settings that take precedence.

![Screenshot of Execute code cleanup.](media/vs-2022/execute-code-cleanup.png)

> [!TIP]
> Rules configured with a severity of **None** don't participate in code cleanup but can be individually applied via the **Quick Actions and Refactorings** menu.

First, configure which code styles you want to apply (in one of two profiles) in the **Configure Code Cleanup** dialog box. To open this dialog box, click the expander arrow next to the code cleanup broom icon and then choose **Configure Code Cleanup**.
To apply code styles:

1. First, configure which code styles you want to apply (in one of two profiles) in the **Configure Code Cleanup** dialog box. To open this dialog box, click the expander arrow next to the code cleanup broom icon and then choose **Configure Code Cleanup**.

![Screenshot of Configure Code Cleanup.](media/vs-2022/configure-code-cleanup.png)

1. After you've configured code cleanup, use one of the following methods to run code cleanup:

![Screenshot of Configure Code Cleanup.](media/vs-2022/configure-code-cleanup.png)
- Click on the broom icon or press **Ctrl**+**K**, **Ctrl**+**E**.

After you've configured code cleanup, you can either click on the broom icon or press **Ctrl**+**K**, **Ctrl**+**E** to run code cleanup. You can also run code cleanup across your entire project or solution. Right-click on the project or solution name in **Solution Explorer**, select **Analyze and Code Cleanup**, and then select **Run Code Cleanup**.
![Screenshot of Execute code cleanup.](media/vs-2022/execute-code-cleanup.png)

![Screenshot of Run Code Cleanup across entire project or solution.](media/vs-2022/run-code-cleanup-project-solution.png)
- To run code cleanup across your entire project or solution, right-click on the project or solution name in **Solution Explorer**, select **Analyze and Code Cleanup**, and then select **Run Code Cleanup**.

![Screenshot of Run Code Cleanup across entire project or solution.](media/vs-2022/run-code-cleanup-project-solution.png)

If you want your code style settings to be applied every time you save a file, go to **Options** > **Text Editor** > **Code Cleanup** and select **Run Code Cleanup profile on save**.

::: moniker-end

## Code cleanup settings

Expand Down Expand Up @@ -163,13 +180,6 @@ Most of the code cleanup settings map to one or more .NET code styles supported

::: moniker-end

::: moniker range=">=vs-2022"
If you want your code style settings to be applied every time you save a file, go to **Options** > **Text Editor** > **Code Cleanup** and select **Run Code Cleanup profile on save**.
::: moniker-end
::: moniker range="<=vs-2019"
If you want your code style settings to be applied every time you save a file, you may like the [Code Cleanup on Save](https://marketplace.visualstudio.com/items?itemName=MadsKristensen.CodeCleanupOnSave) extension.
::: moniker-end

## Related content

- [Quick Actions](../ide/quick-actions.md)
Expand Down
10 changes: 9 additions & 1 deletion docs/ide/how-to-change-fonts-and-colors-in-visual-studio.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Change themes, fonts, text, & accessibility options in Visual Studio
description: Learn how to change Visual Studio color themes, font colors, text sizes, extra-contrast colors, and more for ease of use and accessibility concerns.
titleSuffix: ''
ms.date: 9/19/2024
ms.date: 11/12/2024
ms.topic: how-to
helpviewer_keywords:
- Visual Studio, color themes
Expand Down Expand Up @@ -135,6 +135,14 @@ You can change the font and text size for all the IDE frame and tool windows, or

1. Select the appropriate item in **Display items**, and then modify the **Item foreground** and **Item background** options.

### Preserve font settings across theme changes

With Visual Studio 2002 version 17.12, you can now preserve your font and font size preferences across theme changes. This functionality is enabled by default. When you switch themes in Visual Studio, your custom font face and size settings remain unchanged, while the font color updates with the new theme.

If you prefer to have font selections change with the theme, select **Tools** > **Manage Preview Features** and uncheck **Separate font settings from color themes selection (requires restart)**.

:::image type="content" source="media/vs-2022/preserve-font-settings-across-themes.png" alt-text="Screenshot of the setting that enables preserving font settings across themes.":::

::: moniker-end

::: moniker range="<=vs-2019"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Fonts and Colors, Environment, Options dialog box
description: Learn how to use the Fonts and Colors page in the Environment section to establish a custom font and color scheme for various user interface elements in the IDE.
ms.date: 12/02/2022
ms.date: 11/12/2024
ms.topic: reference
f1_keywords:
- VS.ToolsOptionsPages.FontsAndColors
Expand Down Expand Up @@ -92,15 +92,11 @@ Some of display items include:
|**Selected Text**|Text that is included in the current selection when the editor has focus.|
|**Inactive Selected Text**|Text that is included in the current selection when the editor has lost focus.|
|**Indicator Margin**|The margin at the left of the Code Editor where breakpoints and bookmark icons are displayed.|
|**Line Numbers**|Optional numbers that appear next to each line of code|
|**Line Number**|Optional numbers that appear next to each line of code|
|**Visible White Space**|Spaces, tabs and word wrap indicators|
|**Bookmark**|Lines that have bookmarks. **Bookmark** is only visible if the indicator margin is disabled.|
|**Brace Matching (Highlight)**|Highlighting that is typically bold formatting for matching braces.|
|**Brace Matching (Rectangle)**|Highlighting that is typically a grey rectangle in the background.|
|**Breakpoint (Disabled)**|Not used.|
|**Breakpoint (Enabled)**|Specifies the highlight color for statements or lines containing simple breakpoints. This option is applicable only if statement-level breakpoints are active or the **Highlight entire source line for breakpoints or current statement** option is selected on [General, Debugging, Options Dialog Box](../../debugger/general-debugging-options-dialog-box.md).|
|**Breakpoint (Error)**|Specifies the highlight color for statements or lines containing breakpoints that are in an error state. Applicable only if statement-level breakpoints are active or the **Highlight entire source line for breakpoints or current statement** option is selected on [General, Debugging, Options Dialog Box](../../debugger/general-debugging-options-dialog-box.md).|
|**Breakpoint (Warning)**|Specifies the highlight color for statements or lines containing breakpoints that are in a warning state. Applicable only if statement-level breakpoints are active or the **Highlight entire source line for breakpoints or current statement** option is selected on [General, Debugging, Options Dialog Box](../../debugger/general-debugging-options-dialog-box.md).|
|**Breakpoint - Advanced (Disabled)**|Specifies the highlight color for statements or lines containing disabled conditional or hit-counted breakpoints. Applicable only if statement-level breakpoints are active or the **Highlight entire source line for breakpoints or current statement** option is selected on [General, Debugging, Options Dialog Box](../../debugger/general-debugging-options-dialog-box.md).|
|**Breakpoint - Advanced (Enabled)**|Specifies the highlight color for statements or lines containing conditional or hit-counted breakpoints. Applicable only if statement-level breakpoints are active or the **Highlight entire source line for breakpoints or current statement** option is selected on [General, Debugging, Options Dialog Box](../../debugger/general-debugging-options-dialog-box.md).|
|**Breakpoint - Advanced (Error)**|Specifies the highlight color for statements or lines containing conditional or hit-counted breakpoints that are in an error state. Applicable only if statement-level breakpoints are active or the **Highlight entire source line for breakpoints or current statement** option is selected on [General, Debugging, Options Dialog Box](../../debugger/general-debugging-options-dialog-box.md).|
Expand All @@ -109,12 +105,18 @@ Some of display items include:
|**Breakpoint - Mapped (Enabled)**|Specifies the highlight color for statements or lines containing mapped breakpoints. Applicable for ASP or ASP.NET debugging if statement-level breakpoints are active or the **Highlight entire source line for breakpoints or current statement** option is selected on [General, Debugging, Options Dialog Box](../../debugger/general-debugging-options-dialog-box.md).|
|**Breakpoint - Mapped (Error)**|Specifies the highlight color for statements or lines containing mapped breakpoints in an error state. Applicable for ASP or ASP.NET debugging if statement-level breakpoints are active or the **Highlight entire source line for breakpoints or current statement** option is selected on [General, Debugging, Options Dialog Box](../../debugger/general-debugging-options-dialog-box.md).|
|**Breakpoint - Mapped (Warning)**|Specifies the highlight color for statements or lines containing mapped breakpoints in a warning state. Applicable for ASP or ASP.NET debugging if statement-level breakpoints are active or the **Highlight entire source line for breakpoints or current statement** option is selected on [General, Debugging, Options Dialog Box](../../debugger/general-debugging-options-dialog-box.md).|
|**Breakpoint (Disabled)**|Not used.|
|**Breakpoint (Enabled)**|Specifies the highlight color for statements or lines containing simple breakpoints. This option is applicable only if statement-level breakpoints are active or the **Highlight entire source line for breakpoints or current statement** option is selected on [General, Debugging, Options Dialog Box](../../debugger/general-debugging-options-dialog-box.md).|
|**Breakpoint (Error)**|Specifies the highlight color for statements or lines containing breakpoints that are in an error state. Applicable only if statement-level breakpoints are active or the **Highlight entire source line for breakpoints or current statement** option is selected on [General, Debugging, Options Dialog Box](../../debugger/general-debugging-options-dialog-box.md).|
|**Breakpoint (Warning)**|Specifies the highlight color for statements or lines containing breakpoints that are in a warning state. Applicable only if statement-level breakpoints are active or the **Highlight entire source line for breakpoints or current statement** option is selected on [General, Debugging, Options Dialog Box](../../debugger/general-debugging-options-dialog-box.md).|
|**C/C++ User Keywords**|A constant within a particular code file defined by means of the `#define` directive.|
|**Call Return**|Specifies the highlight color for source statements or lines that indicate call return points when context is switched to a non-top stack frame when debugging.|
|**Code Snippet Dependent Field**|A field that will be updated when the current editable field is modified.|
|**Code Snippet Field**|Editable field when a code snippet is active.|
|**Collapsible Text**|A block of text or code that can be toggled in and out of view within the Code Editor.|
|**Comment**|Code comments.|
|**Collapsed Text (Collapsed)**|A block of text or code that can be toggled in and out of view within the Code Editor.|
|**Collapsed Text (Expanded)**|A block of text or code that can be toggled in and out of view within the Code Editor.|
|**Collapsed Text Indicator (Collapsed)**|Sets custom or predefined colors for the collapsed indicators in the Editor.|
|**Collapsed Text Indicator (Expanded)**|Sets custom or predefined colors for the expanded indicators in the Editor.|
|**Compiler Error**|Blue squiggles in the editor indicating a compiler error.|
|**Coverage Not Touched Area**|Code that has not been covered by a unit test.|
|**Coverage Partially Touched Area**|Code that has been partially covered by a unit test.|
Expand Down
8 changes: 7 additions & 1 deletion docs/ide/visual-studio-github-copilot-chat.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: About GitHub Copilot Chat in Visual Studio
description: Learn about the fully integrated GitHub Copilot Chat in Visual Studio. Use the chat interface to ask coding-related questions from right within the IDE.
ms.date: 8/13/2024
ms.date: 11/12/2024
ms.topic: overview
author: anandmeg
ms.author: meghaanand
Expand Down Expand Up @@ -68,6 +68,8 @@ The chat window of Copilot Chat in Visual Studio enables you to ask your questio
1. In the Copilot Chat window, type a coding related question in the **Ask Copilot** text box. Press **Enter** or select **Send** to ask your question.

:::image type="content" source="media/vs-2022/visual-studio-github-copilot-chat/copilot-chat-window-ask-copilot-textbox.png" alt-text="Screenshot of Copilot Chat window.":::

Use the example starter prompts in Visual Studio 2022 version 17.12 and later to start exploring GitHub Copilot Chat.

1. If Copilot Chat offers a code suggestion you want to use, select **Copy code block** to copy the code suggestion, **Insert in new files** to insert the code suggestion in a new file, or select **Preview** to insert the code suggestion in your current code file. Using the **Preview** button lets you preview the code in the target location so you can easily see what's being updated.

Expand All @@ -82,6 +84,10 @@ The chat window of Copilot Chat in Visual Studio enables you to ask your questio
1. If you select **Insert in new file**, you'll see the code suggestions in a new file. The file is not saved by default.

:::image type="content" source="media/vs-2022/visual-studio-github-copilot-chat/copilot-chat-window-insert-in-new-file.png" alt-text="Screenshot of code suggestions in new file in the editor." lightbox="media/vs-2022/visual-studio-github-copilot-chat/copilot-chat-window-insert-in-new-file.png":::

Visual Studio 2022 version 17.12 now includes [code referencing in GitHub Copilot](https://github.blog/news-insights/product-news/introducing-code-referencing-for-github-copilot/). This feature in GitHub Copilot notifies you when suggestions match public code. You can view the matching code, its source file, and any associated licensing information directly within Visual Studio. This enables you to make more informed decisions about whether to use the suggested code.

:::image type="content" source="media/vs-2022/visual-studio-github-copilot-chat/code-referencing.png" alt-text="Screenshot of code referencing for public code.":::

### Ask questions in the inline chat view

Expand Down
22 changes: 21 additions & 1 deletion docs/ide/work-with-multi-factor-authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,27 @@ These errors may be caused by the following:
#### Support for network related issues
Network related issues are normally related to the machine or network configuration rather than Visual Studio. [Developer Community](https://developercommunity.visualstudio.com/VisualStudio) may provide some support, but it's focused on features within Visual Studio rather than machine configuration. For network-specific support, the [Microsoft Support Community](https://answers.microsoft.com/en-us) or [Technical support](https://support.serviceshub.microsoft.com/supportforbusiness/create?sapId=4fd4947b-15ea-ce01-080f-97f2ca3c76e8) can be helpful.

### Errors on first launch

You may encounter errors when launching Visual Studio for the first time. The error dialog will show the issue that prevented Visual Studio from opening.

#### Access denied
You may see one of the following errors:

:::image type="content" source="media/vs-2022/access-denied-first-launch-file.png" alt-text="Screenshot showing the error Access to the path 'C:\Users\<UserName>\AppData\Local\.IdentityService\<Some file name>' is denied.":::

:::image type="content" source="media/vs-2022/access-denied-first-launch-directory.png" alt-text="Screenshot showing the error Access to the path 'C:\Users\<UserName>\AppData\Local\.IdentityService\' is denied.":::

If you encounter these errors, close any open instances of Visual Studio and delete the file or directory mentioned in the error message to resolve the issue.

Before deleting the file, check the security permissions on the file and consider logging a [Developer Community](https://developercommunity.visualstudio.com/VisualStudio) feedback ticket. This will help us better understand why access to these files or directories is being denied.

In your feedback ticket, please include the following information to help us investigate the issue:
1. A description or screenshot of the groups and users with permissions for the file or directory mentioned in the error. To view this, right-click the file or directory, then select **Properties** > **Security**.
1. The user account you're using to run Visual Studio.
1. If the error persists when launching Visual Studio a second time.


## Related content

- [Sign in to Visual Studio](signing-in-to-visual-studio.md)
- [Sign in to Visual Studio](signing-in-to-visual-studio.md)
Loading