Same PIO Project Accessible by Two Different Computers Causes Error

I created a PIO project on computer A and saved it in a Google Drive folder where other computers can access it. When I use computer B to open up the same PIO project through Google Drive, I get path errors in the c_cpp_properties.json file. A screenshot of the path error is attached. Now the fix was simple as I just replaced the “kuan3” from Computer A with the username of the Computer B and the project compiles again.

However this is a very manual way of doing things and I don’t want to do it every time I use a different computer to edit or view the project. What’s the proper way to do this?

Share the project without the .vscode folder. PlatformIO will recreate it (with the intellisense index) once the project is loaded in VSCode.

Alternatively, use Ctrl+Shift+P → Rebuild Intellisense to trigger a rebuild of the files within .vscode.

How do you exactly share the project without the .vscode folder since it’s inside the project folder itself?

It’s not the project folder. The PlatformIO project is platformio.ini + src/ + include/ + lib/ + test/.

I see. When I first created the project, I generated it in the Google Drive and it created the .vscode & .pio folder inside what I assume is the project folder. Do I delete the .vscode folder or something to “share the project without the .vscode folder”?

The way I opened the project in VSCode on computer B is by “Add Folder to Workspace” and selecting the project folder containing the ini, src, etc. Is this the correct way to do it?

Yes.

If you were something like git, the .vscode folder should be added to the .gitignore.

That is one correct way, next to going over PIO Home → Open Project.

Okay. Thanks for the info Max! I really appreciate it and will look into using that method.