microsoft / vscode-arduino

Visual Studio Code extension for Arduino
Other
1.14k stars 195 forks source link

non-fatal error on Adafruit Feather M0: cannot open source file "sam.h" #749

Closed pomplesiegel closed 5 years ago

pomplesiegel commented 5 years ago

When attempting to compile example code or other code for the Adafruit Feather M0, the code successfully compiles. However, this is shown as a "problem" at the top of my project:

{ "resource": "/Users/michael/Desktop/tempDev/eepromTest/eepromTest.ino", "owner": "_generated_diagnostic_collectionname#0", "severity": 8, "message": "cannot open source file \"sam.h\" (dependency of \"/Users/michael/Library/Arduino15/packages/adafruit/hardware/samd/1.2.9/cores/arduino/Arduino.h\")", "startLineNumber": 4, "startColumn": 1, "endLineNumber": 4, "endColumn": 54 }

I am using the full intellisense feature and have disabled the fallback, as that is the only way I could get syntax highlighting to work.

Any thoughts? Thank you!

LYWalker commented 5 years ago

I have the same problem with the Adafruit Metro M0 Express

LYWalker commented 5 years ago

Fixed by adding:

"C:\\Users\\------\\AppData\\Local\\Arduino15\\packages\\**"

Into the includePath in my c_cpp_properties.json file

stale[bot] commented 5 years ago

This issue has been automatically marked as stale and closed because it has not had recent activity. Please feel free to open a new issue if you would like further discussion. Thank you for your contributions.

rickoman commented 4 years ago

I had the same problem fresh install. Adding the path recommended by LYWalker fixed the problem