【发布时间】:2020-09-09 06:17:41
【问题描述】:
我想在 VS Code 中开发 Arduino 代码。因此,我安装了 Arduino IDE 和 Arduino 扩展 vor VS Code。
在 VS Code 中打开 Arduino 项目后,扩展程序为 IntelliSense 创建了以下 c_cpp_properties.json 文件(摘录):
"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"
],
强制包含Arduino.h具有以下相对包含:
// Some includes
#include <avr/pgmspace.h>
// Even more includes
问题在于,尽管pgmspace.h 确实存在,但它并不位于相对于Arduino.h 的路径中(它也不位于两个包含路径之一中)。将 pgmspace.h 的路径添加到包含路径并没有帮助,因为 IntelliSense 似乎正在寻找给定的相对路径。
我的问题是,是否有可能通过 c_cpp_properties.json 文件告诉 IntelliSense 忽略相对路径并只查找文件?或者您能想出另一种方法来解决这个问题吗?
【问题讨论】:
标签: c++ visual-studio-code arduino include intellisense