microsoft / vscode-arduino

Visual Studio Code extension for Arduino

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Intellisense always fails with ArduinoJson library

raffaeler opened this issue · comments

The ArduinoJson library is extremely popular, therefore I believe it is important to validate it is correctly managed by the Intellisense.
A sample snippet:

#include <ArduinoJson.h>
// ...
DynamicJsonDocument doc(1024);
doc["address"] = address;
doc["previous"] = address;
doc["message"] = "ok";

The DynamicJsonDocument is squiggled as unrecognized:
image

The relevant lines in the includePath section of c_cpp_properties.json file are:

"C:\\username\\raffaeler\\Documents\\Arduino\\libraries\\ArduinoJson\\src",
"C:\\username\\raffaeler\\Documents\\Arduino\\libraries\\ArduinoJson\\src/**",

A possible reason is that the files in the ArduinoJson library have the .hpp extension.

BTW, is there any way to disable the squiggles only for specific lines (maybe with some preprocessor command)?
Alternatively, providing a list of types/words not to be checked/squiggled.
TIA

One more info.
I go to the definition of #include <ArduinoJson.h>. I can also navigate to the inner includes.
But when I reach the JsonSerializer.cpp I see this:
image

  • The first JsonSerializer is NOT squiggled and can be navigated to its definition
  • The second JsonSerializer is squiggled and unavailable.
    It doesn't make sense to me.

Ironically, I moved my dev installation and projects on Ubuntu and it all works like a charm.
I hope this helps in the issue identification.