IDE compiles wrong Project File

Hi together,

I use PIO for comiling ESP8266 Projects.
I have the following issue, often when I have multiple Projects in the Explorer (working path) and I have opend the main.cpp of e.g. Prj1 the IDE compiles the file of e.g. Prj2.
I have only opend the main.cpp of Prj1.

I have the issue sometimes and I don’t know if its a problem of the IDE?

I’m guessing you are trying to switch to a different project and build that rather than the current one - I think PlatformIO used to build whatever was the current project you had opened in the editor. If you have several projects open in your workspace and you’re copying code around this makes the building a little hap-hazard.

I found this hard to find and I couldn’t easily find it in the documentation but I think what you need to do is click on the alien head in the left hand tool bar - then hover over the “Project Tasks” header bar and you’ll see some icons (they don’t display until you hover over the bar and this is why its hard to know what to do).

Anyway, the one with the folder and a circle and a dot inside it (like a little target) will allow you to set the default build (or a sub-build) if you have several platforms you are building for.

The relevant project should be highlighted with a orange-ish dot when you look at the files via the folders menu menu. At least that’s what it looks like on my system.

Chris

Hi Chris,

thank you for your reply! :slight_smile:
I tried to follow your instructions but cannot follow you.
I opened the Projects in PIO but haven’t see anything you mentioned when hover over the header bar.
There is also no dot, you mentioned, in my projects view.
Would you mind to make a short screen shot?

Thank you very much!

1 Like

Are you sure you’re selecting the right project using the project and environment selector? This is new since extension version 2.3.0.

2 Likes

Hi I think I got it now :slight_smile:

1 Like

Great! Issues Having to separately select a default to compile and upload since v2.3.0 · Issue #2410 · platformio/platformio-vscode-ide · GitHub, Add a "Changelog" page on extension updates · Issue #2412 · platformio/platformio-vscode-ide · GitHub and Automatically switch to newly created project's environment · Issue #2414 · platformio/platformio-vscode-ide · GitHub are opened to hopefully improve that behavior or make it more user-visible and friendly btw.

1 Like