Run VSCode commands through extra_scripts

I’m using Platformio both in VSCode and CLI on Lubuntu. I have a python script which runs before building using extra_scripts.

I wonder if it is possible to run actions in the script I’d normally run using the VSCode command palette. Is the script somehow capable of interacting with the editor it is used in?

The extra scripts is being loaded as an SCons script during the execution of the pio executable / Python script. I don’t think there’s a way to directly access VSCode functionality like executing something in the command palette through it.

@ivankravets can answer this with certainty I think.

I’m thinking the same. I can always try to find python packages that do the same as my VSCode extension and add them as extra python packages. Maybe that’s even better because then it also works when using only CLI.

But yeah, if somebody could confirm it’s not possible…

https://docs.platformio.org/en/latest/projectconf/advanced_scripting.html#extra-python-packages

1 Like