Intellisense giving false error squiggles


#1

I’ve only been using PlatformIO for about a week now, so I’m sorry if I’m doing something dumb, but following an update to the C/C++ Extension on VSCode, I’m now getting error squiggles show in the IDE which wern’t there before.

These appear at various points in the codebase, but I don’t think there are any actual errors with my code, as it builds and uploads just fine.

If it helps, my entire codebase is here, but I don’t think it’s an issue with my code itself.

I think it’s related to the C/C++ extension, as I remember opening the extensions tab of the IDE, seeing an update install, and immediately seeing the squiggles after restarting the IDE. I think a second update to the C/C++ extension has been released since, which also auto installed, but as you can see, didn’t solve the issue.

I hope someone can help. Thanks.


#2

Please try the next:

  1. Run `Left Sidebar > PlatformIO > Rebuild Project C/C++ Index
  2. Uninstall/Install again Microsoft C/C++ extension
  3. Remove .vscode folder from a project
  4. Restart VSCode.

#3

I’ve just tried all of that, it didn’t make any difference.


#4

Is this issue similar with?


#5

I started to make the changes as suggested on the link, but it didn’t make any difference.

I decided, instead, to copy the AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS); line from the config.h file into the main.ino file, and that seemed to fix it…

(…other than the fact it’s now complaining that IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS are all undefined.)

This is making me think that the editor is ignoring the code inside the config.h file (which is being included right at the top via #include "config.h"), something it wasn’t doing before.

This is my main.ino file as it exists right this second, along with my config.h file.

Thanks.


#6

It seems like a bug of VSCode C++ extension. I’ve just seen the same errors. How did I resolve them?

  1. Remove .vscode folder from a project
  2. Restart VSCode

It works now :slight_smile:


#7

I tried that, but it didn’t work. Oh well. Thanks anyway :slight_smile: