This may be a VS Code issue and not be related to PIO but perhaps someone here can provide some insight.
On my M1 MacBook Pro running Monterey 12.5 I have a VS Code workspace for ESP32 projects that continuously fails to start intellisense apparently due to the C/C++ Extension not successfully starting a language server. Various notifications appear like:
Connection to server got closed. Server will not be restarted.
Pending response rejected since connection got disposed Code: -32097
cpptools client: couldn’t create connection to server.
The language server crashed 5 times in the last 3 minutes. It will not be restarted.
I’ve disabled all other extensions, tried different C/C++ extension versions, reinstalled VS Code, reset intellisense database, rebuild PIO intellisense index and tried to find something unique in the workspace but all without satisfaction.
The ESP32 projects build and run okay.
Curiously a different workspace for STM32 projects does not have any problems.
Any thoughts are appreciated.