microsoft / vscode-arduino

Visual Studio Code extension for Arduino
Other
1.16k stars 215 forks source link

unable to find header files or recognize paths to header files #1721

Open dss010101 opened 6 months ago

dss010101 commented 6 months ago

I have the following files at the at

C:\Users\myusername\AppData\Local\Arduino15\libraries\ESP32Servo\src\ESP32_Servo.h C:\Users\myusername\AppData\Local\Arduino15\libraries\ESP32Servo\src\ESP32_Servo.cpp

In code i have the following which the vscode extension is not finding:

// include files
#include <ESP32_Servo.h>

I have added the path of the header file in c_cpp_properties.json as

            "forcedInclude": [
                "C:\\Users\\myusername\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.11\\cores\\esp32\\Arduino.h",
                "C:\\Users\\myusername\\AppData\\Local\\Arduino15\\libraries\\ESP32Servo\\src\\ESP32_Servo.h"
            ],

I have also tried adding the folder to "includePath"...but to no avail. Furthermore, each time i do a verify or an upload, this file is overwritten by the extension it seems, so i loose any chances. As such it doesn't seem to be the correct place for these configurations.

Any assistance in solving this would be appreciated.