On a regular basis, I use the VSCode-generated .vscode/extensions.json to maintain a list of VSCode extensions relevant to the project. Every time PlatformIO updates (I think this is the trigger, I could be wrong), it overwrites the entire file with one that just recommends itself for installation. Every time I see this, I need to revert the changes in git before I make commits.
I wish this weren’t the case. I’d be perfectly happy (pleased even) if the PlatformIO IDE extension appended itself to the end of the file rather than overwriting it. Could we make this change a reality/get an explanation for why it is the way it currently is?
PlatformIO will overwrite it with the result of the template evaluation
The overwriting happens here (open with w):
So if you want a sort of “merge” of your and PIOs file, or tell it to not generate that file, I think it’s best to open a feature request in the core code: Issues · platformio/platformio-core · GitHub
Temporarily deleting C:\Users\<user>\.platformio\penv\Lib\site-packages\platformio\ide\tpls\vscode\.vscode\extensions.json.tpl will make PIO also ignore this template (since it doesn’t exist anymore)
Well I also do a project re-init when my IDE starts acting up and I’m glad it recreates it from scratch . That file of yours seems to be an exemption though.
Ha-ha We have one interesting proverb in Ukraine: “Don’t put off till tomorrow what you can do today”.
Indeed, we are so close to the final release of PIO Core 4.2. Let’s wait a few days, if there are no bug reports from users, we will release it next week.
Jesus christ that was a quick fix… Good on you @ivankravets for getting this change merged, I really appreciate the work ethic embodied in this.
So, I need to manually update PIO via the command line in order to update to a development release? Will this dev release then update cleanly to the proper PIO Core 4.2 release when it’s pushed soon?
Ok, trailing comma was part of the problem.
The second issue was that I didn’t have "ms-vscode.cpptools-extension-pack".
Here is a version that works:
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"SonarSource.sonarlint-vscode",
"gruntfuggly.todo-tree",
"jbenden.c-cpp-flylint",
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
Note, that "platformio.platformio-ide" was moved to the end automatically according to the template.