Cannot get arduino projects building with vscode ide. Help

Actually i had included Wire.h as part of the first line #include <arduino.h>
My issues turned out to be adding the Arduino libaries folder to the lib_extra_dirs option in the platformio.ini
I had to add the base libraries folder and rebuild the intellisense
for windows: home\documents\Arduino\libraries
like this:

[env:nanoatmega328]
lib_extra_dirs = c:\users\user.name\documents\arduino\libraries

If you add a library from the library manager you need this line. Platform IO creates its own copy of the arduino core for building but does not add the external libraries from the library manager to this environment. It adds them to the arduino environment. I think its because its part of the dependent arduino extension

refer Including Arduino libraries together with private libraries [solved]