Unable to get rid of Intellisense C++ errors

I moved to a new system with my VSCode/Platformio development (Ubuntu) and still am not quite at the state I had before on the older one.

One thing annoying me is C++ errors signalled by Intellisense etc. that obviously stem from disregarded include paths, like these:

As you can see from a screenshot of the file tree, the missing include is part of the libdeps folder that is found without issues when compiling the code:

The final error line from clang-tidy is a nuisance as well, as it refers to some issues inside the arduinoesp32 platform core code I never will deal with.

I cannot remember to have these messages ever before, so I need to know where to better configure the stuff…

Any help is appreciated!

Small addendum: of course the errors will vanish if I manually will add ${workspaceFolder}/.pio/libdeps/** to the Intellisense include paths list, but I never had to do that in the past.

It is getting worse… :cry:

Now a call of an assignment operator of a base class inside the assignment operator code for a derived class is marked as error, because “no known conversion for the derived parameter exists” (paraphrasing the message).
The code compiles fine, though, without gcc complaining at all. Calling the base class operators within a derived class is common practice, so again there must be some settings misleading the C++ checks.

Did you try a (temporary) clean installation?

  • close VS Code
  • rename $HOME/.vscode to $HOME/.vscode_old to keep the original files as backup
  • rename $HOME/.platformio to $HOME/.platformio_old to keep the original files as backup
  • start VS Code (should be “clean” now, without any extensions)
  • install PlatformIO extension and it’s dependencies
  • try again

Thank you, better, sort of. At least the last strange messages now are gone. Remain the nagging references to the core code I cannot influence:

If only I could prevent the check to dive into the platform code.

Give PIO and VS Code a little time to setup everything correctly (after the “reinstall”).
Then restart VS Code again.

Did so, but still… These errors will pop up for any single source file I will open.

Can you share the project, so I can download and test it?

I think it is regardless of the project. I will try to set up a small example project tomorrow that will be easier to port. Thanks for now!


Do you have multiple projects / folders in your workspace?
If so, please remove all other projects and folders from your workspace, restart vscode.

C/C++ for VS Code was updated.
The update contains a lot of bug fixes for IntelliSense.

No, just one folder is open at all tines.

Thanks, I will give that a try later today.

No change, unfortunately.

I was able to reproduce it with some very basic steps:

  • open VSC with no folder open at all
  • create a new project:
platform = espressif32
board = az-delivery-devkit-v4
framework = arduino
  • click on src/main.cpp to open it

et voilá:

I believe Intellisense is right about these issues, but I do not want to repair the core but just use it as is as I did before…

I followed the steps, but was unable to reproduce the error:

Hell! I almost was afraid that would happen.

Which Extensions do you have installed? I have the C/C++ pack that seems to be required for Platformio anyway.

You should have 0 other plugins than PlatformIO and it’s dependencies due to “temporary reinstall” (as mentioned in post #4)

But here are my installed plugins:

Yeah, I got the first two in your list, plus Vim and Platformio (neither I would expect to be the culprit). I in fact tried to get rid of the C/C++ ones as well but was stopped by a pop-up reminding me these were needed by Platformio.

I am at a loss here. I only very reluctantly would consider trashing my complete VSC and Platformio installation again…

C/C++ and C/C++ Extension pack are the mentioned dependencies of PlatformIO.
These are the extensions which contains Intellisense.

Since you still have problems after the “temporary reinstallation”, I suspect that the cause must lie elsewhere.

A “real” reinstallation (by deleting the folders completely) is therefore not expected to change anything.

Which VS Code Version do you use?
Mine is

Mine is

Version: 1.89.0
Commit: b58957e67ee1e712cebf466b995adf4c5307b2bd
Date: 2024-05-01T02:08:25.066Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
OS: Linux x64 6.5.0-28-generic

Not much different from yours, but another OS. Platformio version is 6.1.15.