Autocomplete not working after #include <ESP8266WiFi.h>

  1. Please don’t use Arduino IDE libraries. Use PlatformIO Library manager instead. Remove this line lib_dir=~\Documents\Arduino\libraries. If you need some lib, add to platformio.ini lib_deps =.... See PlatformIO Registry

  2. Try Menu: PlatformIO > Rebuild C/C++ Index

P.S: If you have broken permission for PLATFORMIO_HOME_DIR, try to remove totally %USERPROFILE%/.platformio folder. Start building again and check code completion.