Using PlatformIO on VS with Bitbucket and SourceTree

(if this would be better in another category, please advise)
I feel certain that there must be lots of folks using PlatformIO on Visual Studio with Atlassian’s Bitbucket and maybe also with Sourcetree, but I can’t seem to find any blogs, notes, or youtubes on this. I am failing to find a way to take an existing project created under PlatformIO and moving that code tree into source control under bitbucket. I can get it going with git but then the sync does not work. Or, I can start a repository on bitbucket, clone it down to VS, but then I can’t put PlatformIO files into that source tree without loosing the platformio “project” construct, and simply including the files does not do it… the compile, upload, and other platformio buttons go away. Anyone have a pointer to a tutorial on this or some other straightforward instructions? I’ve burned two days on this so far and gotten nowhere. :8^(

I have absolutely no experience with Bitbucket or source tree, but having “no platformio buttons” is usually a symptom of e.g. having opened the project in a wrong way. Wworkflow should be clone project → Open VSCode → PIO Home auto-opens → “Import Project” button → path to cloned project folder. The PIO VSCode extensions only displays the buttons if it has detected a platformio.ini configuration file in the currently opened workspace folder. Another possibility is a corrupted .vscode/ folder (or one of its files). That can be restored by re-initializing the project from the commandline (pio init --ide=vscode) or using the project task “Miscelleneous → Rebuild IntelliSense index”.

For furhter help we would need to see exactly how you clone the project, what the exact files and filestucture of that project is, how you open the cloned project and how VSCode looks like when you have opened it.

Thank you very much for your detailed reply. This is very helpful and will help me with new projects that I am importing from the Arduino IDE, but I am still not clear on how I can take a project which is already in PIO and getting it under Git change control and then pushing that local repository up to my repository on Bitbucket.


See screenshot above

platformio.ini is present (and displayed in the right tab)
I completed the reinitializing (pio init --ide=vscode)
(and corrected the missing ‘m’ in monitor in the platformio.ini

but still no compile, upload, etc buttons

closing VScode and restarting resulted in getting the missing buttons back.

any explanation for that? (seems pretty flaky). anything I can do to improve stability?

You may try a more aggressive setting in the PlatformIO VSCode extension setting regarding when PlatformIO is being shown –


(Disable the first option, make sure the 4th is ticked).

Another possibility is that other VSCode extensions you have installed interfere with PlatformIO. You can also se the list of 7 extensions are I have installed there… Only Microsoft C/C++, PlatformIO IDE and Python are necessary though. You should try with this minimal list of exensions.

Thanks. Those PlatformIO settings were the default in my installation.

Good thought regarding the extensions. I do so love some of the color bracket and comment extensions ;^)