#How to Install PlatformIO on VSCodium on Linux
#Introduction
(If you just want the steps, here they are).
Yesterday, I had to install PlatformIO for a class at Purdue. It turned out that the extension was only available for VSCode. I thought I’d be fine, because I usually use VSCodium in situations like this. Unfortunately, installing platformIO in VSCodium proved harder than I thought, so this is a guide to help others in my situation.
#The Extension Marketplace
VSCodium doesn’t use the same extension marketplace as VSCode ie. when you search for extensions on VSCodium, it pulls from a different list of extensions. Specifically, VSCodium uses Open VSX. On this website, searching for platformio yields this deprecated extension. I was hesitant to use it, though.
#Installing the VSIX file
Every VSCode/VSCodium extension is essentially a single file, that can also be installed manually. This files are called VSIX packages, and they have the .vsix extension. Thankfully, platformIO has a Github repository for their extension, which publishes releases containing the VSIX package. I downloaded the VSIX package, and installed it manually in VSCodium. However, I got an error about a missing cpptools extension.
It turns out that the cpptools extension (this one), which provides syntax highlighting and LSP features for C and C++ and is required by PlatformIO, doesn’t exist on Open VSX.
There are alternative C/C++ extensions on Open VSX, most notably clangd. I found this GitHub issue which discusses a way to allow users to use clangd as their language server. Specifically, these are the steps:
#Steps
Install the platformio-core package. Instructions can be found here. This will install the pio command.
In VSCodium, install the PlatformIO extension from the VSIX file above, as well as the clangd extension.
Run the following command in your project directory to generate a file called compile_commands.json, which contains the commands required to compile each unit of source code. This will allow you to use clangd as your language server.
pio run -t compiledbYou should be good to go! The language server should be working now; try including a header file from your embedded platform’s SDK and ctrl-clicking on it. Note that you will have to run the command above for each PlatformIO project directory.
