Search code examples
c++visual-studio-codearduinoarduino-ide

VS code doesn't recognize arduino specific syntax


I've installed C++ and Arduino extensions for my VS code, and most of it seem to work (it tries to connect to a board, for example), but the language recognition and IntelliSense keep marking Arduino keywords as errors and doesn't complete anything that isn't pure C++. what am I doing wrong? enter image description here

Edit: I've figured out where things go wrong. the C++ configuration is set to Win32, but the Arduino config does not exist. it isn't in the json either. seems like the arduino extension failed to modify the c_cpp_properties.json, but still I can't fix it because i don't know what is supposed to be the content of the json.


Solution

  • The solution that finally worked for me was to open an example (the arduino package comes with examples). then i chose a board and verified the code, the json file called c_cpp_properties, that up until now only had the configuration for Win32, was modified to contain the configs needed for arduino. its been e journey.