Error: Invalid value for '--ide': 'vscode' is not one of

Hi All

Yesterday I had to reinstall VS Code/Pio IDE/Pio Core (system 1.127.0/3.3.4/6.1.19) on Windows 11. On opening an existing test project Platformio initialises then builds, uploads and monitors an ESP8266 running a very basic main.cpp under a minimal platformio.ini. However #include <Arduino.h> is squiggled, and errors are not at least not until I build.

I have only a single platformio.platformio-ide in extensions folder – -3.3.4-win32-x64. PlatformIO IDE:customPATH is empty. Platformio-ide: Use Builtin PIO Core and Platformio-ide: Use Builtin Python are checked.

C/S/P Platformio:Rebuild Intellisense Index and C/C++:Reset Intellisense Database produce a message in OUTPUT —

Error: Invalid value for ‘–ide’: ‘vscode’ is not one of ‘clion’, ‘codeblocks’, ‘eclipse’, ‘emacs’, ‘netbeans’, ‘qtcreator’, ‘sublimetext’, ‘vim’, ‘visualstudio’.

and I find this in the developer console —

at c:\Users\graha.vscode\extensions\platformio.platformio-ide-3.3.4-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:5250
at ChildProcess.i (c:\Users\graha.vscode\extensions\platformio.platformio-ide-3.3.4-win32-x64\node_modules\platformio-node-helpers\dist\index.js:1:4548)
at ChildProcess.emit (node:events:509:28)
at ChildProcess.emit (node:domain:489:12)
at maybeClose (node:internal/child_process:1124:16)
at ChildProcess._handle.onexit (node:internal/child_process:306:5)

AFAIK there should be no need for vscodeide.

.vscode is missing from the project tree.

I guess there is a problem with the integration of Intellisense.

I am now stuck for ideas. I am probably just missing a single setting, I hope I am. I have never had any problem reinstalling before.

Wut.

Can you open a PlatformIO Core CLI regardless and show the output of pio system info and pio init --help?

Thanks for the reply….

PS C:!development!!platformio!TESTS\ESP8266\test> pio system info


PlatformIO Core 6.1.19
Python 3.11.7-final.0
System Type windows_amd64
Platform Windows-10
File System Encoding utf-8
Locale Encoding cp1252
PlatformIO Core Directory C:\Users\graha.platformio
PlatformIO Core Executable C:\Users\graha.platformio\penv\Scripts\platformio.exe
Python Executable C:\Users\graha.platformio\penv\Scripts\python.exe
Global Libraries 0
Development Platforms 1
Tools & Toolchains 10


PS C:!development!!platformio!TESTS\ESP8266\test> pio init --help
Usage: pio init [OPTIONS]

Options:
-d, --project-dir DIRECTORY
-b, --board ID
–ide [clion|codeblocks|eclipse|emacs|netbeans|qtcreator|sublimetext|vim|visualstudio]
-e, --environment TEXT Update existing environment
-O, --project-option TEXT A name=value pair
–sample-code
–no-install-dependencies
–env-prefix TEXT
-s, --silent
-h, --help Show this message and exit.

which option(s)?

or maybe

Usage: python -m platformio project init [OPTIONS]

Try ‘python -m platformio project init -h’ for help.

Error: Invalid value for ‘–ide’: ‘vscode’ is not one of ‘clion’, ‘codeblocks’, ‘eclipse’, ‘emacs’, ‘netbeans’, ‘qtcreator’, ‘sublimetext’, ‘vim’, ‘visualstudio’.

from which –

PS C:!development!!platformio!TESTS\ESP8266\test> python -m platformio project init -h
C:\Users\graha.platformio\python3\python.exe: No module named platformio


Crazy. I think maybe one the generator files for vscode inside the PlatformIO core installation have been corrupted.

  1. Close VSCode
  2. Delete C:\Users\graha\.platformio
  3. Reopen VSCode
  4. wait for reinstall

Done those things. Looks like success. No spurious squiggles, error highlighting working.

Closed minimal test project and opened real one. The spurious squiggles have returned.

Closed real and opened test again. All OK.

Back to real one. Spurious squiggles.

Create a new project – test001 – copy in main.cpp from real project. Squiggles are where they should be - unsatisfied includes and such.

It will take a while to reconstruct project stage-by-stage seeing if and when it falls over, but for now I’ll take it as fixed.

Thanks for all your help.

If the platformio.ini is correct, and no global libaries are used, and the platform is correctly version fixed, there should be no build errors. It should be reproducible.