PlatformIO Community

PIO IDE in VSCode: Please don't overwrite `extensions.json`

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: https://github.com/platformio/platformio-core/issues

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)

1 Like

Ah, so that’s where the behavior comes from. But why would it be programmed to do this? It’s a rather destructive operation…

Well I also do a project re-init when my IDE starts acting up and I’m glad it recreates it from scratch :sweat_smile:. That file of yours seems to be an exemption though.

I suppose… Issue up: https://github.com/platformio/platformio-core/issues/3374

1 Like

Fixed in

1 Like

Fixed within 27 minutes? :open_mouth:

3 Likes

Ha-ha :laughing: 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.

2 Likes

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?

2 Likes

Yes, it will be updated automatically!

2 Likes