How to properly delete projects in PlatformIO?

Viewed 3399

I use PlatformIO with Visual Studio Code on Windows 10.

Now whenever I:

  1. create a Project with a name X
  2. close Visual Studio Code
  3. delete the Project folder X
  4. open Visual Studio Code
  5. create a new Project with the same name X

I get an empty project with a main.cpp file as expected, but the IDE shows an error for the line:

#include <Arduino.h>

The Error says: "Include Error recognised. Update your includePath." (Translated)

However, if I try to build, it compiles just fine. Even uploading and running works.

This include error appears not only with Arduino.h but with all includes, even if the file is in the exact same location. And it appears in other files than just main.cpp as well.

Can you tell me why this happens? How can I reuse the project names of deleted projects? Or If I should not delete projects like this (delete the project folder), how else would I delete a project?

I tried this with multiple project names and different boards, always with the same result.

Things I tried so far:

I found a Folder .cache in the PIO directory. But unfortunately renaming it (after step 3) did not help: after restarting PIO it recreated the folder as expected but the error message is still here.

In the same location there is a file homestate.json that among other things contains the path to recently opened projects. I removed those entries without luck.

1 Answers

I am just starting out with VSCoode and PlatformIO so i can't tell you why all of what you are seeing is happening is happening.

I use VSCode v1.63.0 on Windows 10.

If you want to delete the old project name, reuse it or not, you can bring up the Command Palette under the View menu (Shift-Control-P for me) and search for Workspace: Remove Folder from Workspace...., it will only be listed if you have projects in the workspace. A list of projects will be displayed, selected which one to delete and click on it. There will not be a confirmation prompt.

Related