I want to develop Arduino code in VS Code. Therefore, I installed the Arduino IDE and the Arduino extension vor VS Code.
Upon opening an Arduino project in VS Code the extension created the following c_cpp_properties.json file for IntelliSense (excerpt):
"includePath": [
"/Applications/Arduino.app/Contents/Java/tools/**",
"/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/**"
],
"forcedInclude": [
"/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h"
],
The forced include Arduino.h has the following relative include:
// Some includes
#include <avr/pgmspace.h>
// Even more includes
The problem is that, although pgmspace.h does exist it is not located in the path relative to Arduino.h (it is not located in one of the two include paths either). Adding the path of pgmspace.h to the include paths does not help as IntelliSense seems to be looking for the given relative path.
My question is if there is any possibility to tell IntelliSense via the c_cpp_properties.json file to ignore relative paths and just look for the file? Or if you can think of another way to resolve this problem?