Skip to content

Commit 9ed4061

Browse files
Learn Build Service GitHub AppLearn Build Service GitHub App
authored andcommitted
Merging changes synced from https://github.com/MicrosoftDocs/visualstudio-docs-pr (branch live)
2 parents fd8a886 + d2969bb commit 9ed4061

File tree

8 files changed

+167
-179
lines changed

8 files changed

+167
-179
lines changed

docs/get-started/visual-studio-ide.md

Lines changed: 37 additions & 39 deletions
Large diffs are not rendered by default.

docs/ide/outlining.md

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: Collapse and expand regions of code
2+
title: Collapse and Expand Regions of Code
33
description: Use the expand and collapse commands in the Visual Studio integrated development environment (IDE) to work in outline mode.
4-
ms.date: 9/13/2024
5-
ms.topic: conceptual
4+
ms.date: 08/25/2025
5+
ms.topic: concept-article
66
helpviewer_keywords:
77
- outlining
88
- Visual Studio, expand/collapse code
@@ -15,45 +15,43 @@ author: anandmeg
1515
ms.author: meghaanand
1616
manager: mijacobs
1717
ms.subservice: general-ide
18-
#customer intent: As a developer, I want to understand how to work in outline mode in Visual Studio to improve the ease of writing and maintaining code.
18+
#customer intent: As a developer, I want to learn how to collapse and expand code in Visual Studio to make it easier to write and maintain code.
1919
---
20+
2021
# Outlining
2122

22-
To hide a region of code from view, you can collapse it so that it appears under a caret sign (`>`) in the text editor. Then, to expand a collapsed region, select the caret sign (`>`).
23+
This article describes the outlining feature in Visual Studio. To hide a region of code from view, you can collapse it so that it appears under a caret sign (`>`) in the code editor. Then, to expand a collapsed region, select the caret sign.
2324

24-
> [!TIP]
25-
> If you are a keyboard user, you can choose **Ctrl**+**M**+**M** to collapse and expand.
25+
You can also select **Ctrl**+**M**+**M** to collapse and expand code.
2626

2727
To collapse an outlining region, double-click any line in the region on the outlining margin, which appears just to the left of the code. You can see the contents of a collapsed region as a tooltip when you hover over the collapsed region.
2828

29-
:::image type="content" source="media/outlining-example-2022.png" alt-text="Screenshot of an example of collapsed code that shows the outlining margin and an example of the expanded code visible from a tooltip.":::
29+
:::image type="content" source="media/outlining-example-2022.png" alt-text="Screenshot of an example of collapsed code that shows the outlining margin and the expanded code visible in a tooltip.":::
3030

31-
Regions in the outlining margin are also highlighted when you hover over the margin with the mouse. The default highlighting color might seem rather faint in some color configurations. You can change it in **Tools** > **Options** > **Environment** > **Fonts and Colors** > **Display items** > **Collapsible Region**.
31+
Regions in the outlining margin are also highlighted when you hover over the margin with the mouse. The default highlighting color might be hard to see in some color configurations. You can change it in **Tools** > **Options** > **Environment** > **Fonts and Colors** > **Display items** > **Collapsible Region**.
3232

33-
When you work in outlined code, you can expand the sections you want to work on, collapse them when you're done, and then move to other sections. When you don't want to have outlining displayed, you can use the **Stop Outlining** command to remove the outline information without disturbing your underlying code.
33+
When you work in outlined code, you can expand the sections you want to work on, collapse them when you're done, and then move to other sections. When you don't want to use outlining, you can use the **Stop Outlining** command to remove the outline information without disturbing your underlying code.
3434

3535
The **Undo** and **Redo** commands on the **Edit** menu affect these actions. The **Copy**, **Cut**, **Paste**, and drag-and-drop operations retain outlining information, but not the state of the collapsible region. For example, when you copy a collapsed region, the **Paste** operation pastes the copied text as an expanded region.
3636

3737
> [!CAUTION]
38-
> When you change an outlined region, the outlining might be lost. For example, deletions or **Find and Replace** operations can erase the end of the region.
38+
> When you change an outlined region, the outlining might be lost. For example, deletions or **Find and Replace** operations can erase the end of a region.
3939
40-
The following commands can be found on the **Edit** > **Outlining** submenu.
40+
You can use these commands from the **Edit** > **Outlining** menu:
4141

42-
| Name | Keyboard | Description |
42+
| Name | Keyboard shortcut | Description |
4343
|:-----|:---------|:------------|
44-
| Hide Selection | **Ctrl**+**M**, **Ctrl**+**H** | Collapses a selected block of code that wouldn't normally be available for outlining. Example: an `if` block. To remove the custom region, use **Stop Hiding Current** or **Ctrl**+**M**, **Ctrl**+**U**. Not available in Visual Basic. |
45-
| Toggle Outlining Expansion | **Ctrl**+**M**, **Ctrl**+**M** | Reverses the current hidden or expanded state of the innermost outlining section when the cursor lies in a nested collapsed section. |
44+
| Hide Selection | **Ctrl**+**M**, **Ctrl**+**H** | Collapses a selected block of code that wouldn't normally be available for outlining. Example: an `if` block. To remove the custom region, use **Stop Hiding Current** or **Ctrl**+**M**, **Ctrl**+**U**. |
45+
| Toggle Outlining Expansion | **Ctrl**+**M**, **Ctrl**+**M** | Reverses the current hidden or expanded state of the innermost outlining section when the cursor is in a nested collapsed section. |
4646
| Toggle All Outlining | **Ctrl**+**M**, **Ctrl**+**L** | Sets all regions to the same collapsed or expanded state. If some regions are expanded and some collapsed, the collapsed regions are expanded.|
47-
| Stop Outlining | **Ctrl**+**M**, **Ctrl**+**P** | Removes all outlining information for the entire document. To turn it back on, go to **Edit** > **Outlining** and select **Start Automatic Outlining**. |
48-
| Stop Hiding Current | **Ctrl**+**M**, **Ctrl**+**U** | Removes the outlining information for the currently selected user-defined region. Not available in Visual Basic. |
47+
| Stop Outlining | **Ctrl**+**M**, **Ctrl**+**P** | Removes all outlining information for the entire document. To turn outlining back on, go to **Edit** > **Outlining** and select **Start Automatic Outlining**. |
48+
| Stop Hiding Current | **Ctrl**+**M**, **Ctrl**+**U** | Removes the outlining information for the currently selected user-defined region. |
4949
| Collapse to Definitions | **Ctrl**+**M**, **Ctrl**+**O** | Collapses the members of all types. |
50-
| Collapse Block:\<logical boundary> | | (C++) Collapses a region in the function containing the insertion point. For example, if the insertion point lies inside a loop, the loop is hidden.|
51-
| Collapse All in: \<logical structures> | | (C++) Collapses all the structures inside the function.|
5250

5351
> [!TIP]
54-
> For more information on how to use the keyboard exclusively, see [Keyboard shortcuts in Visual Studio](default-keyboard-shortcuts-in-visual-studio.md).
52+
> For more information on how to use the keyboard, see [Keyboard shortcuts in Visual Studio](default-keyboard-shortcuts-in-visual-studio.md).
5553
56-
You can also use the Visual Studio SDK to define the text regions you want to expand or collapse. See [Walkthrough: Outlining](../extensibility/walkthrough-outlining.md).
54+
You can also use the Visual Studio SDK to define the text regions that you want to expand or collapse. For more information, see [Walkthrough: Outlining](../extensibility/walkthrough-outlining.md).
5755

5856
## Related content
5957

docs/ide/solutions-and-projects-in-visual-studio.md

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: 'What are Visual Studio solutions & projects?'
3-
description: Learn about Visual Studio projects and solutions, how to create new projects from a template, and how to view & manage projects in Solution Explorer.
4-
ms.date: 08/19/2024
2+
title: What Are Visual Studio Solutions and Projects?
3+
description: Learn about Visual Studio projects and solutions, how to create new projects from a template, and how to view and manage projects in Solution Explorer.
4+
ms.date: 08/25/2025
55
ms.topic: concept-article
66
f1_keywords:
77
- vs.openproject
@@ -26,38 +26,38 @@ This article describes the difference between a *project* and a *solution* in Vi
2626

2727
## Projects
2828

29-
When you create an app or website in Visual Studio, you start with a *project*. In a logical sense, a project contains all files that are compiled into an executable project, library, or website. Those files can include source code, icons, images, data files, and more. A project also contains compiler settings and other configuration files that your program might need to communicate with various services or components.
29+
When you create an app or website in Visual Studio, you start with a *project*. A project contains all files that are compiled into an executable project, library, or website. Those files can include source code, icons, images, data files, and more. A project also contains compiler settings and other configuration files that your program might need to communicate with various services or components.
3030

3131
### Project file
3232

3333
Visual Studio uses [MSBuild](../msbuild/msbuild.md) to build each project in a solution, and each project contains an MSBuild project file. The file extension reflects the type of project, for example, a C# project (.csproj), a Visual Basic project (.vbproj), or a database project (.dbproj). The project file is an XML document that contains all the information and instructions that MSBuild needs to build your project. Such information and instructions include the content, platform requirements, versioning information, web server or database server settings, and the tasks to perform.
3434

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

37-
Project files are based on the [MSBuild XML schema](../msbuild/msbuild-project-file-schema-reference.md). To look at the contents of newer, [SDK-style project files](../msbuild/how-to-use-project-sdk.md) in Visual Studio, right-click the [project node](use-solution-explorer.md#solution-explorer-ui) in **Solution Explorer** and select **Edit Project File**. To look at the contents of .NET projects, first unload the project (right-click the project node in **Solution Explorer** and select **Unload Project**). Then, right-click the project and select **Edit Project File**.
37+
Project files are based on the [MSBuild XML schema](../msbuild/msbuild-project-file-schema-reference.md). To look at the contents of newer, [SDK-style project files](../msbuild/how-to-use-project-sdk.md) in Visual Studio, right-click the [project node](use-solution-explorer.md#solution-explorer-ui) in Solution Explorer and select **Edit Project File**. To look at the contents of .NET projects, first unload the project. (Right-click the project node in Solution Explorer and select **Unload Project**.) Then right-click the project and select **Edit Project File**.
3838

3939
::: moniker-end
4040

4141
::: moniker range="=vs-2019"
4242

43-
Project files are based on the [MSBuild XML schema](../msbuild/msbuild-project-file-schema-reference.md). To look at the contents of newer, [SDK-style project files](../msbuild/how-to-use-project-sdk.md) in Visual Studio, right-click the [project node](use-solution-explorer.md#solution-explorer-ui) in **Solution Explorer** and select **Edit \<projectname\>**. To look at the contents of .NET projects, first unload the project (right-click the project node in **Solution Explorer** and select **Unload Project**). Then, right-click the project and choose **Edit \<projectname\>**.
43+
Project files are based on the [MSBuild XML schema](../msbuild/msbuild-project-file-schema-reference.md). To look at the contents of newer, [SDK-style project files](../msbuild/how-to-use-project-sdk.md) in Visual Studio, right-click the [project node](use-solution-explorer.md#solution-explorer-ui) in Solution Explorer and select **Edit \<projectname\>**. To look at the contents of .NET projects, first unload the project. (Right-click the project node in Solution Explorer and select **Unload Project**.) Then right-click the project and select **Edit \<projectname\>**.
4444

4545
::: moniker-end
4646

4747
> [!NOTE]
4848
> You don't have to use solutions or projects in Visual Studio to edit, build, and debug code. You can simply open the folder that contains your source files in Visual Studio and start editing. For more information, see [Develop code in Visual Studio without projects or solutions](develop-code-in-visual-studio-without-projects-or-solutions.md).
4949
50-
### Create new projects
50+
### Create projects
5151

5252
The easiest way to create a new project is to use a project template for the project type you want. A project template includes a basic set of pregenerated code files, config files, assets, and settings. Use **File** > **New** > **Project** to select a project template. For more information, see [Create a new project in Visual Studio](create-new-project.md).
5353

5454
You can also create a custom project template that you can use to create new projects from. For more information, see [Create project templates](how-to-create-project-templates.md).
5555

56-
When you create a new project, Visual Studio saves it to the default location, *%USERPROFILE%\source\repos*. To change the default location, go to **Tools** > **Options** > **Projects and Solutions** > **Locations**. For more information, see [Options dialog box: Projects and Solutions > Locations](reference/projects-solutions-locations-options.md).
56+
When you create a project, Visual Studio saves it to the default location, *%USERPROFILE%\source\repos*. To change the default location, go to **Tools** > **Options** > **Projects and Solutions** > **Locations**. For more information, see [Options dialog box: Projects and Solutions > Locations](reference/projects-solutions-locations-options.md).
5757

5858
## Solutions
5959

60-
A project is contained within a *solution*. Despite its name, a solution isn't an "answer." It's simply a container for one or more related projects, along with build information, Visual Studio window settings, and any miscellaneous files that aren't associated with a particular project.
60+
A project is contained in a *solution*. Despite its name, a solution isn't an "answer." It's simply a container for one or more related projects, along with build information, Visual Studio window settings, and any miscellaneous files that aren't associated with a particular project.
6161

6262
### Solution file
6363

@@ -68,26 +68,15 @@ Visual Studio uses two file types (*.sln* and *.suo*) to store settings for solu
6868
|.sln|Visual Studio Solution|Organizes projects, project items, and solution items in the solution.|
6969
|.suo|Solution User Options|Stores user-level settings and customizations, such as breakpoints.|
7070

71-
::: moniker range=">=vs-2022"
72-
73-
> [!IMPORTANT]
74-
> A solution is described by a text file (extension *.sln*) that has its own unique format; it's not intended to be edited by hand. Conversely, the *.suo* file is a hidden file that isn't displayed under the default File Explorer settings. To show hidden files, on the **View** menu in File Explorer, select **Show** > **Hidden items**.
75-
76-
::: moniker-end
77-
78-
::: moniker range="=vs-2019"
79-
8071
> [!IMPORTANT]
81-
> A solution is described by a text file (extension *.sln*) with its own unique format; it's not intended to be edited by hand. Conversely, the *.suo* file is a hidden file that is not displayed under the default File Explorer settings. To show hidden files, on the **View** menu in File Explorer, select the **Hidden Items** checkbox.
82-
83-
::: moniker-end
72+
> A solution is described by a text file (extension *.sln*) that has its own unique format. It's not intended to be edited manually. Conversely, the *.suo* file is a hidden file that isn't displayed under the default File Explorer settings. To show hidden files, on the **View** menu in File Explorer, select **Show** > **Hidden items**.
8473
8574
### Solution folder
8675

87-
A *solution folder* is a virtual folder that exists only in Solution Explorer, where you can use it to group projects in a solution. If you want to locate a solution file on a computer, go to **Tools** > **Options** > **Projects and Solutions** > **Locations**. For more information, see [Options dialog box: Projects and Solutions > Locations](reference/projects-solutions-locations-options.md).
76+
A *solution folder* is a virtual folder that exists only in Solution Explorer, where you can use it to group projects in a solution. If you want to find the location of solution files on a computer, go to **Tools** > **Options** > **Projects and Solutions** > **Locations**. For more information, see [Options dialog box: Projects and Solutions > Locations](reference/projects-solutions-locations-options.md).
8877

8978
> [!TIP]
90-
> To construct a project and solution as an exercise, see [Introduction to projects and solutions](../get-started/tutorial-projects-solutions.md).
79+
> If you want to construct a project and solution as an exercise, see [Introduction to projects and solutions](../get-started/tutorial-projects-solutions.md).
9180
9281
## Solution Explorer
9382

@@ -111,14 +100,14 @@ Many menu commands are available from the [right-click context menu](use-solutio
111100

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

114-
Starting with [version 17.7](/visualstudio/releases/2022/release-notes), you can also compare files in Solution Explorer by using the right-click context menu options. For more information, see [The file comparison tool](use-solution-explorer.md#the-file-comparison-tool) in [Learn about Solution Explorer](use-solution-explorer.md).
103+
Starting with [version 17.7](/visualstudio/releases/2022/release-notes-v17.7), you can also compare files in Solution Explorer by using the right-click context menu options. For more information, see [The file comparison tool](use-solution-explorer.md#the-file-comparison-tool) in [Learn about Solution Explorer](use-solution-explorer.md).
115104

116105
::: moniker-end
117106

118107
For ASP.NET Core projects, you can customize how files are nested in Solution Explorer. For more information, see [File nesting in Solution Explorer](file-nesting-solution-explorer.md).
119108

120109
> [!TIP]
121-
> If you close Solution Explorer and want to open it again, select **View** > **Solution Explorer** on the menu bar, or select **Ctrl**+**Alt**+**L**. If you close side tabs and want to restore them to their default locations, select **Window** > **Reset Window Layout** on the menu bar.
110+
> If you close Solution Explorer and want to open it again, select **View** > **Solution Explorer** in the top menu, or select **Ctrl**+**Alt**+**L**. If you close side tabs and want to restore them to their default locations, select **Window** > **Reset Window Layout** in the top menu.
122111
123112
> [!NOTE]
124113
> To view the application images and icons that appear in Visual Studio, download the [Visual Studio Image Library](https://www.microsoft.com/download/details.aspx?id=35825).

0 commit comments

Comments
 (0)