Folder and Workspace in VS Code

In the "File" menu of VS Code , "Open Folder" refers to the root directory of the open project folder. A project folder (Project Folder) contains one or more folders related to the project, and the VS Code configuration related to the project (placed in the .vscode folder).
Insert picture description here

In the "File" menu, there is another option: "Open Workspace" .

What is the difference between this option and "Open Folder"?
When should I use folders?
When should I use a workspace?

In VS Code, workspace refers to the file with the suffix *.code-workspace, which is a file in JSON with Comments format, which contains all the folders associated with the workspace and related VS Code configuration information is as follows.

*.code-workspace file

Double-click the *.code-workspace file to start VSCode to open the workspace. The difference between opening the project folder with "Open Folder" after starting VSCode is that there is a workspace suffix after the former folder name

“Open Folder” vs "Open Workspace"

[When to use the work area? ] There is and only when you need to work on multiple projects at the same time, you need to create a workspace. At this time, there are the root directories of multiple project folders in the workspace, namely: Multi-root Workspaces

[When to use folders? ] Working on a project, using folders, is enough. After setting up VS Code for the project, VS Code will automatically create a .vscode folder in the root directory of the project folder to store the VS Code configuration (settings.json file)

In addition, the function of inserting picture description of CSDN's Markdown has not yet been realized. .

Guess you like

Origin blog.csdn.net/qq_43229056/article/details/109544933