Closed tntodorov closed 3 years ago
It might be helpful to note:
As per comment https://github.com/platformio/platformio-vscode-ide/issues/2252#issuecomment-739948535 the IDE seems to re-sync, if a new platformio.ini file is opened and it contains a different environment. However, if both projects have the same environment as in my case (e.g. env:tinypico), then the behavior is still as described in this issue.
Sorry, I can't reproduce this issue. Could you reproduce it multiple times after VSCode restart?
Same problem here
Visual Studio Code
Version: 1.52.1
Commit: ea3859d4ba2f3e577a159bc91e3074c5d85c0523
Date: 2020-12-16T16:30:02.420Z (1 mo ago)
Electron: 9.3.5
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Darwin x64 19.6.0
PlatformIO
Core 5.1.0
Home 3.3.3
How did you add projects to a workspace? Using PlatformIO Home or VSCode -> File > Add Folder?
I have actually used both methods.
I created the projects one after another with PIO > New Project (from the home page)
Another time I just open the folder from the Explorer context menu "Open with Code" and then add the other project with File > Add Folder.
It doesn't matter if I create the projects and try using them immediately or restart VSCode in between. It doesn't matter if I just reload the window, or fully close the application and open again. Behavior is same on both Windows and Linux.
The attached zip file contains 3 fresh projects, which are opened in the same workspace. Even when I select the active project to be different from tinypico1, when I hit the build button it's always tinypico1 which gets built. All 3 projects were created with the PIO New Project wizard.
You need to open any file from a project and make it active in editor.
Then why do I have the "active project" selection in the PIO toolbar? This should take precedence on what editor is active. I might even have an active editor with a file which does not belong to any of the projects in the workspace, but I need to copy some code from.... What would the build button do in that case, build the world?
Yet, even if I follow your instructions:
Update: I also tried to have only the file from the tinypico2 project open and all else closed, yet still the tinypico1 project is the one built.
@ivankravets
Just tested the beta version. Thanks for all the hard work you do and honestly, this is an amazing piece of software!
Now I see 2 selectors (drop-down menus) in the PIO toolbar: "Switch Platform IO Project Environment" and the old one "Click to select the active folder".
Are you sure you installed the beta version?
I got the same issue, but what as causing it is that I had the same env name for the different projects in the .pio file. By having different name it start to work without issues.
@siul72, could you file a new issue at https://github.com/platformio/platformio-vscode-ide/issues?
@siul72, could you file a new issue at https://github.com/platformio/platformio-vscode-ide/issues?
Not sure if it should be considered an issue. For me is just a limitation that by have unique env names is fixed.
In one window I have multiple folders open, which contain PlatformIO projects. When I press the 'Build' icon on the PlatformIO toolbar, it always builds the top project in the workspace list, even when a different folder is selected as active in the toolbar. Please see attached screenshot.
On the other hand, when I issue
pio run
from a PIO terminal inside the desired project folder, then the correct project is built.OS: Windows 10 x64 VSCode: 1.52.1 PlatformIO: Core 5.0.4