The Run Configuration dialog looks for the <workspace_root>/.vscode/launch.json
file, but it will not traverse into any subfolders so it will not find any configurations inside launch.json
files that reside in nested folders. You can merge configurations from multiplelaunch.json
files by using workspaces. Here is a sample that shows different development environment setups.
Assuming the following file system structure:
The launch.json
files contain the configuration noted next to them: Config One, Config Two, andConfig Subfolder. Iepending on which folder you choose, you will get different results.
When opening Folder_One, Config One is shown in Run and Debug view.
If you open Folder Two, the Run and Debug view shows Config Two.
The config from Subfolder is not shown because the
launch.json
configuration file cannot be found in the<workspace_root>/.vscode
file.
When you open Subfolder in your development environment, only Config Subfolder is shown.
In addition, you can create a workspace, by opening one of the folders and selecting Add Folder to Workspace in your development environment. The workspace can be configured in many ways. Here are some examples:
-
workspace root: Folder_One
Only Config One is displayed, same as shown above in Open Folder_One.
-
workspace roots: Folder_One, Folder_Two
In this case, Config One and Config Two are displayed, because these two configurations can be found in
Folder_One/.vscode/launch.json
andFolder_Two/.vscode/launch.json
-
workspace roots: Folder_One, Folder_Two, Subfolder
In this case configurations from all three
launch.json
files are displayed:
As seen in the last example, you can add a subfolder of an existing workspace root folder as a standalone workspace root.
For more information on run configurations, seeLaunch configurations
Related Information
Create a New Run Configuration in Visual Studio Code
Create a New Run Configuration in SAP Business Application Studio