The Extension should automagically fill the c_cpp_properties.json, so intellisense works out of the box #438
Description
EDIT: 07/03/2018: My understanding of the issue has improved since I opened it. I think that the extension should fill the intellisense config file on the fly based on the board being selected by the user.
To my knowledge, the Arduino IDE checks for libraries in 4 places: the main Arduino installation path (in windows c:\program files....), any board-specific version of the libraries for this board ("...\appdata\local..."), your sketchbook location and a "libraries" folder for that particular sketch. Ideally, you would install your libraries in your sketchbook location, so they are available for all your projects.
I've just installed VS Code and the Arduino plugin, and it seems to be able to know that my sketchbook location is not the default, as I can see the examples of the libraries that I've installed there, and I can compile my sketch. In any case, I get tens of intellisense errors, as intellisense seems incapable to follow the paths for the includes. I can add the sketchbook location libraries to the c_cpp_properties.json, and either add all the libraries used there (painfull) or add the base "libraries" folder and then tweak the includes to have partial paths (less painfull), but even in these cases, intellisense will complain that it can't find any of the libraries this files might use. And I would have to do it for all my projects, one by one.
What am I doing wrong? why doesn't this plugin pick the usual library locations? Is it normal to have 100s of intellisense errors? is that really the way it's meant to be?
Sorry, I'm new to Visual Studio and Visual Studio Code, and I'm quite sure that the problem it's me not being able to find out the logic behind them, but I can't find any info on the internet either.
I'm using windows 10 64 bits, and my arduino Ide is at the latest version. The relevant part of my c_cpp_settings.json of this project is:
"name": "Win32",
"includePath": [
"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/include/*",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/um",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/ucrt",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/shared",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/winrt",
"${workspaceRoot}",
"C:\\Users\\Joel\\AppData\\Local\\Arduino15\\packages\\SODAQ\\hardware\\samd\\1.6.14\\cores\\arduino"
],
"defines": [
"_DEBUG",
"UNICODE"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/include/*",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/um",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/ucrt",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/shared",
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.16299.0/winrt",
"${workspaceRoot}",
"C:\\Users\\Joel\\AppData\\Local\\Arduino15\\packages\\SODAQ\\hardware\\samd\\1.6.14\\cores\\arduino"
],
"limitSymbolsToIncludedHeaders": false,
"databaseFilename": ""
}
}
This is a screenshot of my project