PlatformIO IDE and IntelliSense problems

Hallo!

I am using the PlatformIO IDE (Visual Studio Code) under Linux (both, Ubuntu and Manjaro) currently with ESP32 and Arduino framework projects.

Compilation works, but there are some problems with annoying warnings and Code lookup by Intellisense as provided by the C++ extension:

  • There seems to be a problem with the Warning line in c_cpp_properties.json
  • Althought the correct paths can be found in c_cpp_properties.json (in includePath and browse items), e.g. the declarations and definitions cannot be looked up (not found errors).

Especially annoying is also the ‘cannot open source file “Arduino.h”’. Is someone aware of some specific setting or corruption although the paths are set. Rebuild the index does not change the situation.

Regards,
Ralf.

Copied errors (Paths shorten):
{
“resource”: “…/test1/.vscode/c_cpp_properties.json”,
“owner”: “generated_diagnostic_collection_name#2”,
“severity”: 4,
“message”: “Property !!! WARNING !!! is not allowed.”,
“startLineNumber”: 2,
“startColumn”: 5,
“endLineNumber”: 2,
“endColumn”: 22
}
{
“resource”: “…/test1/src/main.cpp”,
“owner”: “generated_diagnostic_collection_name#0”,
“severity”: 2,
“message”: “#include errors detected. Please update your includePath. IntelliSense features for this translation unit (…/test1/src/main.cpp) will be provided by the Tag Parser.”,
“startLineNumber”: 4,
“startColumn”: 1,
“endLineNumber”: 4,
“endColumn”: 21
}
and a 2. message: “cannot open source file “Arduino.h” (dependency of “…/test1/src/main.cpp”)”

The “!!! WARNINGS!!!” warning/error is due to a recent change in the Microsoft C/C++ extension, and will be rectified in an update that’ll probably be coming next week. It can be safely ignored for now.

As far as the path/not found errors, I’m not sure what’s going on there. I’m not having any issues with esp32 compiling or intellisense on my linux OS… (Ubuntu also)… I think I did have an issue with Arduino.h not being found at one point, but probably just killed the .platformio folder off and made platformio reinstall itself anew.

Thanks for your hint to the upcoming release with the fix for WARNING error.

Reinstall of platformio and extensions does not help me for “Arduino.h not found” problem.

Ralf.

The problem I have with IntelliSense for “Arduino.h” seems to be related to chosen workspace setup.

What works for me now:

  • Use a single project e.g. by “open folder” and saved workspace file in same folder
  • Use an extra folder for the workspace file, and include projects outside of this folder.

What does not work:

  • direct sub-folders of a workspace folder, i.e. workspace file inside this folder, as project folders
3 Likes