Workspace organization

I have a lot of project folders. I’ve uncluttered my working workspace with the right-click-remove. But I want to open another folder and add it to the workspace.

When I open a new folder, PIO asks me if I want to save the workspace, and then it goes away.

How can I put a set of projects into the working workspace? Can I create a new workspace and add folders?

1 Like

Lets gets some basics out of the way. PlatformIO is in two parts - the PIO Core/CLI, which is the heart of PIO, and does all the toolchain, dependency, compile & library management, etc. Then you have the PlatformIO VSCode extension, which adds the integration between PlatformIO and VSCode, so you don’t have to use the command line to interact with PlatformIO.

Everything else is in the domain of the editor you are using - in this case, VSCode. Workspaces, IntelliSense, syntax highlighting, etc are all VSCode related.

Put simply, to create a workspace, do File -> New Window. You now have an empty workspace. You can now repeatedly go File -> Add Folder to Workspace... to well… add folders to the workspace. Once you’ve added your folders (one or more), you can then go File -> Save Workspace As... to save the workspace layout to a file. Doing so will allow you to group a bunch of projects together in different workspaces, which you can open via File -> Open Workspace... or the File -> Open Recent menu.

Workspaces will remember the order you have the folders, the tabs you had open, and can be changed at any point in the future. Have a look at the VSCode documentation as well, as that walks you through using them.


Thank you. I’ll try it again.

1 Like

Aha! Those workspaces are part of VSCode, and nithing to do with PlatformIO. I don’t use them.

My projects live in /home/norman/SourceCode/PROJECT-NAME and when I’m using VSCodium, I just do a File->Open Folder.

I have projects for Arduino in my /home/norman/Arduino/PROJECT-NAME also, the default for the IDE, and again, I just “open folder” on those too.

I have Arduino, AVR, and most recently, STM32 projects – so I only install libraries locally to each project – installing globally can, with mixed environments, lead to problems with the wrong libraries being used for the wrong envonment. Like you seem to be seeing.


1 Like

Does the compiler ignore everything but src and lib?

I was concerned a while ago about cluttering up the library folders with excess files and directories (examples, for example), because I kinda suspected the conflicts you talk about, which I did see when the compiler found an incompatible library in my bulk folder.

Sort of! It looks in the include folder for any #include "filename_in_quotes" statements.

When I install a library, I let it install to wherever it needs to go by default for local libraries.

If I’ve created a new class, which I can use in other projects, I drop the header and source files into the lib folder for the project. They do live in a separate folder for each library.

Each folder within the lib folder is a separate library. If you have lots of folders, you must be using lots of libraries; or, you have files in the “wrong” place.


1 Like