Autocomplete not working after #include <ESP8266WiFi.h>

Hello,

Today I discovered PlatformIO for Atom, it works great so far! Much better than the Arduino IDE. After getting all set up I noticed that intelligent code completion didn’t work as expected. The project I was using was converted from an Arduino .ino sketch.

When I created a new project I noticed that the autocomplete did work correctly. After typing “Serial.be” a autocomplete list pops up with function signatures and overloads.

Back to the previous project, autocomplete still doesn’t work. It only autocompletes certain keywords such as “begin” but it will never show a list of function signatures.

Only when I comment out the line “#include <ESP8266WiFi.h>” autocomplete starts working. As soon as I uncomment it, it breaks again.

Here’s the platformio.ini file:

[platformio]
src_dir=EspOledRfServerBoss
lib_dir=~\Documents\Arduino\libraries
[env:esp12e]
platform = espressif8266
board = esp12e
framework = arduino

Thanks for the help

Additionally:

I’ve opened up

  • PlatformIO > Project Examples
  • Espressif\ESP8266-wifiscan

And I have the same problem. When I uncomment "#include “ESP8266WiFi.h” autocomplete works.

  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.

Thank you for your answer. I have removed the line from the ini file as you have suggested. The project still compiles and the issue remains. In my second post I was able to reproduce this with the Project Example file for the ESP8266. This project example doesn’t have the lib_dir and yet the problem persists.

Do you have another solution?

How about this? Did you try it?

Yes, I have tried that just now. After rebooting Atom it took a little longer to load. It did eventually and I went to Project Examples > ESP8266-wifiscan again. This time it had to redownload the xtensa toolchain upon build and afterwards it basically has the same symptom.

Can anybody reproduce this problem?

Am I truly the only one to experience this problem?