PlatformIO Community

Intellisense issues, VSCode and Platformio

Hello!
I have a very weird issue I cannot find a solution for. Everything compiles nicely, but I frequently get intellisense errors which aren’t actual errors.
here’s a screenshot that shows the actual Problem:
01

As you can see, WIFI_STA has a red underline. The intellisense popup shows how and where it is defined, I can also ‘Go to definition’ successfully. However, and this is the weird part I assume is causing the problem, the second to last line is in my native language (Everything is set to english as far as I can tell), and it says WIFI_STA is not defined (while apparently it is).

I have deactivated every extension except platformio and C/C++, I have deleted the .vscode folder, I have tried having only one project in my workspace, I have rebuilt intellisense index, I have tried to find any option where the language is not set to english trying to find out why this even pops out but could not find any.

Hope anyone can help me pin down the problem, it indeed drives me mad a bit, despite everything actually working.

thank you!
Wolfgang

No ideas? :anguished:

The red squiggly lines originates from two sources: IntelliSense (i.e. the background compilation run while you’re typing) and from errors that Visual Studio Code detects in the build output. The latters one also appear in the PROBLEMS view.

Your example looks like case where IntelliSense is running successfully and showing the definition of the macro (upper part) but an error message was detected in the build log and is being displayed in the lower part. Could that be the case?

My experience with these two mechanisms is mixed:

  • IntelliSense seems to crash regularly, in particular when make major changes to the code.
  • IntelliSense and/or Visual Studio Code get confused easily if a project is closed but one of the source files is still open or if it manages to open a source twice because two different paths lead to the same file.
  • Error messages detected in the build log are not reliably removed if the build is run again.
1 Like

Well my observations are similar, but not the same. There are no problems in the build output, but they show up in the problems output. The symptom seems to indicate that there are two intellisense mechanisms at work. One that actually works, and one that does not. The one that does not also has localization turned on, but I cannot find a localization setting anywhere, hence I am having problems o identify the module and if possible turn it off.