From 13805e95bab9afb0f016d3f428d86f439fa9682b Mon Sep 17 00:00:00 2001 From: ttstanley <62913657+ttstanley@users.noreply.github.com> Date: Tue, 7 Nov 2023 10:34:01 -0800 Subject: [PATCH 1/2] Updated documentation for multiple folder support. --- ...al-studio-without-projects-or-solutions.md | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/docs/ide/develop-code-in-visual-studio-without-projects-or-solutions.md b/docs/ide/develop-code-in-visual-studio-without-projects-or-solutions.md index 364a0f2c1a1..f64eab519bf 100644 --- a/docs/ide/develop-code-in-visual-studio-without-projects-or-solutions.md +++ b/docs/ide/develop-code-in-visual-studio-without-projects-or-solutions.md @@ -1,7 +1,7 @@ --- title: Develop code without projects or solutions description: Learn how to develop code directly in Visual Studio without a need for projects or solutions. -ms.date: 04/29/2022 +ms.date: 11/7/2023 ms.topic: how-to helpviewer_keywords: - open folder [Visual Studio] @@ -40,6 +40,33 @@ You can open code into Visual Studio in the following ways: - Open code from a cloned GitHub repo. +### To open multiple folders +Opening multiple folders is especially useful in code repos with lots of unrelated code, and a developer only needs a subset to do some work. +- On the Visual Studio menu bar, choose **File** > **Open** > **Workspace**, and then browse to the `.code-workspace` file location. +- The `.code-workspace` file itself is expected to be a .JSON schema, which looks like the following: + +```json +{ + "folders" : [ + { + "path" : "some\\child\\foo", + "name" : "The Foo" + }, + { + "path" : "..\\..\\some\\unrelated\\bar" + }, + { + "path" : "C:\\a\\full\\path\\baz" + }, + { + "path" : "${env.ANY_ENV_VARIABLE}\\foobar" + } + ] +} +``` + +Each `"path"` value can be any relative path or rooted path. Rooted paths must be on the same drive letter. Environment variables can be used with the syntax `${env.ANY_ENV_VARIABLE}`. The `"name"` property can be used to create a visual alias for the folder in the Solution Explorer. + ### To open code from a cloned GitHub repo The following example shows how to clone a GitHub repo and then open its code in Visual Studio. To follow this procedure, you must have a GitHub account and Git for Windows installed on your system. See [Create a GitHub account to use with Visual Studio](../version-control/git-create-github-account.md) and [Git for Windows](https://git-for-windows.github.io/) for more information. From 2496a8ba4c5cb9172ecb0b7f78b642b4ff6c947e Mon Sep 17 00:00:00 2001 From: Mike Jones Date: Tue, 21 Nov 2023 16:46:16 -0800 Subject: [PATCH 2/2] Update docs/ide/develop-code-in-visual-studio-without-projects-or-solutions.md --- ...velop-code-in-visual-studio-without-projects-or-solutions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ide/develop-code-in-visual-studio-without-projects-or-solutions.md b/docs/ide/develop-code-in-visual-studio-without-projects-or-solutions.md index f64eab519bf..e13d5ddb136 100644 --- a/docs/ide/develop-code-in-visual-studio-without-projects-or-solutions.md +++ b/docs/ide/develop-code-in-visual-studio-without-projects-or-solutions.md @@ -41,7 +41,7 @@ You can open code into Visual Studio in the following ways: - Open code from a cloned GitHub repo. ### To open multiple folders -Opening multiple folders is especially useful in code repos with lots of unrelated code, and a developer only needs a subset to do some work. +Starting in Visual Studio 2022 version 17.9 Preview 1, you can specify multiple folders to open in Visual Studio. Opening multiple folders is especially useful in code repos with lots of unrelated code, and a developer only needs a subset to do some work. - On the Visual Studio menu bar, choose **File** > **Open** > **Workspace**, and then browse to the `.code-workspace` file location. - The `.code-workspace` file itself is expected to be a .JSON schema, which looks like the following: