[Issue] Autocomplete messed up in 3.0

Since last update autocomplete stopped working properly, while before it was perfectly capable of presenting class methods, general library functions and constants, now it only seems to sugest completions related to words i’ve allready typed in any of the open files. I’m currently running IDE v1.6.0 and CLI v3.1.0.

Try PlatformIO IDE Menu: PlatformIO > Regenerate C/C++ Project Index.

Thanks for the fast reponse! I’ve tried it, repeatedly, and it didn’t worked. Also tried Menu: PlatformIO > Clean then closing and opening the IDE, then Menu: PlatformIO > Build and then Menu: PlatformIO > Regenerate C/C++ Project Index, just to make sure, it didn’t worked too.
I’m working with framework mBed and I noticed the source code is not linked inside the .pioenvs anymore, thought the issue may be related to that, but not sure, because locally implemented classes also don’t get autocomplete either.

Please share here your platformio.ini. maybe it is broken or invalid board ID

@ivankravets do you mean platform.json ? Which is located at .platformio/platforms/ststm32/platform.json ?

If so, here it goes:

  "name": "ststm32",
  "title": "ST STM32",
  "description": "The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M processor is designed to offer new degrees of freedom to MCU users. It offers a 32-bit product range that combines very high performance, real-time capabilities, digital signal processing, and low-power, low-voltage operation, while maintaining full integration and ease of development.",
  "url": "http://www.st.com/web/en/catalog/mmc/FM141/SC1169?sc=stm32",
  "homepage": "http://platformio.org/platforms/ststm32",
  "license": "Apache-2.0",
  "engines": {
    "platformio": "^3.0.0",
    "scons": ">=2.3.0,<2.6.0"
  "repository": {
    "type": "git",
    "url": "https://github.com/platformio/platform-ststm32.git"
  "version": "1.1.0",
  "packageRepositories": [
      "framework-arduinoststm32": [
          "url": "https://github.com/ubis/Arduino_STM32/archive/v1.0.0.tar.gz",
          "sha1": "36f26069b70ef6b7ceae2a91e3c23be74cc79337",
          "version": "1.0.0",
          "system": "*"
  "frameworks": {
    "mbed": {
      "package": "framework-mbed",
      "script": "builder/frameworks/mbed/mbed.py"
    "cmsis": {
      "package": "framework-cmsis",
      "script": "builder/frameworks/cmsis.py"
    "spl": {
      "package": "framework-spl",
      "script": "builder/frameworks/spl.py"
    "libopencm3": {
      "package": "framework-libopencm3",
      "script": "builder/frameworks/libopencm3/libopencm3.py"
    "arduino": {
      "package": "framework-arduinoststm32",
      "script": "builder/frameworks/arduino.py"
  "packages": {
    "toolchain-gccarmnoneeabi": {
      "type": "toolchain",
      "version": ">=1.40803.0,<1.40805.0"
    "framework-mbed": {
      "type": "framework",
      "optional": true,
      "version": "~3.124.0"
    "framework-cmsis": {
      "type": "framework",
      "optional": true,
      "version": "~1.40300.0"
    "framework-spl": {
      "type": "framework",
      "optional": true,
      "version": "~1.10201.0"
    "framework-libopencm3": {
      "type": "framework",
      "optional": true,
      "version": "~1.1.0"
    "framework-arduinoststm32": {
      "type": "framework",
      "optional": true,
      "version": "~1.0.0"
    "tool-stlink": {
      "type": "uploader",
      "optional": true,
      "version": "~1.10200.0"

Please sorry, PLATFORMIO.INI.


pio update

Then again, Menu, PIO > Rebuild C++ Index

Here it goes:

# Project Configuration File
# A detailed documentation with the EXAMPLES is located here:
# http://docs.platformio.org/en/latest/projectconf.html

# A sign `#` at the beginning of the line indicates a comment
# Comment lines are ignored.

# Simple and base environment
# [env:mybaseenv]
# framework =
# board =
# Automatic targets - enable auto-uploading
# targets = upload

platform = ststm32
framework = mbed
board = nucleo_f401re
upload_protocol = stlink
build_flags = -Og -g3 -DF401RE

platform = ststm32
framework = mbed
board = nucleo_l152re
upload_protocol = stlink
build_flags = -Og -g3 -DL152RE

pio update fetched a couple new packets indeed, but autocomplete is still “dead”. Altough now I get the confirmation that PlatformIO: C/C++ Project Index (for Autocomplete, Linter) has been successfully rebuilt.

Do you see autocomplete-clang package in Settings > Packages list?

@ivankravets, yes I see autocomplete-clang v0.10.0 is currently installed.

Try to uninstall Atom completely. Close Atom and:

rm -rf ~/.atom
rm -rf ~/Library/Application\ Support/Atom

Start Atom, go to Packages and install platformio-ide.

@ivankravets I’m on Windows, so I did the equivalent of that here. Also uninstalled Python and LLVM, downloaded fresh new versions of everything and reinstalled.

Unfortunatelly, it didn’t solved the problem, which leads me to think the last update caused the problem, since it worked on previous versions. Is there something else I can do to help sort this out? It’s a major headache having no autocomplete, since now I have this huge code I’m working on, and I have to keep consulting implementation files…

Update: I noticed that there are multiple autocomplete plugins listed among my installed packages, autocomplete-plus and some other autocomplete core packages which seems to be responsible for giving some very basic completion options work for now, but the more usefull clang autocompletion is not working at all. I tried disabling autocomplete-clang from the settings menu and confirmed that the autocomplete autoput haven’t changed, so it seems the issue is related to the autocomplete-clang package only.

Update #2: Toggling developer console shows me some erro messages whe I try toggling autocomplete with ctrl-space.

The command line is too long. clang-provider.cofee:45

You are right. This issue is linked with Windows line length limitation and autocomplete-clang package. Please report this issue here Issues · yasuyuky/autocomplete-clang · GitHub

Thanks @ivankravets, I’ve reported the issue here

Now I’m just wondering what changed, since it was working before. Is there perhaps some quick workaround?

Could you share your .clang_complete files on http://pastebin.com ? The file is located in a project directory.

There you go http://pastebin.com/WvT8brey . I see some repetition there, namely lib/MD5 and /lib/FreeMem, but apart from that seems ok. Is the content passed as argument at some point?

Could you try to create simple “Blink” project for Arduino Uno, not mbed. Does code completion work here?

@ivankravets created Arduino Blinky from the example projects and clang autocompletion does work in that case. As seen below:

Yep, the problem here that Windows can’t handle command line with length more than 8192 chars. It should be fixed on the GitHub - yasuyuky/autocomplete-clang side