Just started working with PlatformIO and I love it. But now, when starting a new arduino project with no code at all except for the automatically generated #include <arduino.h> , I get 2 errors:
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (…workspacefoldername…)
Cannot open source file <arduino.h>
Tried to add my default workspace to IncludePath like suggested on the forum, but no result.
Any suggestions or solutions?
Does it go away after you run a build? If not, try rebuilding the IntelliSense index, because all the code sense stuff is done by the Microsoft C++ IntelliSense engine… and it probably needs a kick in the backside to get it to liven up and do it’s job.
Ok… doing a new project means I don’t need to get you to try something else… so have you tried building that code yet? If you’re wondering ‘what does that have to do with these errors’… platformio downloads platform cores and libraries when you do a build… so if those files are actually not present yet (meaning the errors aren’t IntelliSense being confused, but are real)… they will get downloaded, and the errors should go away by the end of the build.
Otherwise, I’d be suggesting at you try temporarily disabling your antivirus software, and doing the rebuild intellisense again, just to rule that out (meaning if that was the cause, you’ll need to white-list stuff so it behaves itself).
Drats… Now this really is annoying. You could try deleting the .vscode folder and letting vscode rebuild it, but creating a new project rules out that sort of problem. I’m of to bed, so hopefully someone else can help out…
Yeah, the Microsoft Arduino extension causes conflicts itself, and is a known issue… there is a issue open on the VSCode github… but it’s :tumbleweed: there as far as them doing anything about it. And generally any extension that provides intellisense other than the microsoft one should be treated with caution…
The few times I’ve had issues like this, I’ve either just deleted the .piolibs folder / .vscode folder and/or triggered intellisense to be rebuilt, and one time deleted the whole $HOMEDIR/.platformio folder, and let the PlatformIO extension reinstall everything… haven’t had any problems since… even when trying to cause them with some non-standard configurations
Not sure… it I would think it would be fine with Dropbox since the files are stored locally on your PC - they don’t have this ‘until accessed’ feature like onedrive AFAIK… not that this shoud matter as the issue seems to stem from not being able to access core files. It could be something to do with the workspace, as it seems like there something strange with the folders that have been added? Note that it’s the double up that’s red… not the NodeMCU - RFID one (which was ealier)…
Might be worth saving that workspace for now, and opening a new empty one and adding just the Proef trial to it, to see if the error is related to something else in that workspace.
Not sure what fixed it, but I deleted .vscode and started a new workspace, got some sleep. restarted the computer the next day, entered some new code and … it worked. I’m still puzzled. Although I really like the platformIO I’m wondering how reliable it is. Making mistakes in the code is one thing, but also having to question if may be the mistake is in PlatformIO.