PHP autocomplete not working


Using PHPStorm 10.0.3 and my PHP code completion has stopped working.

For exmaple, if I start typing out a `foreach()` loop, nothing happens.


It will not auto complete any part of it.


Also, I have braces set to be on new lines in the PHP code style, yet I can put them on the same line and the IDe doesn't do anything about it.


Tried invalidating the cache, no luck.


Please try to setup a new project: would autocomplete work there?




The auto complete box shows up if I type "if" but then it will not complete anything else.


Could you please try to type `for`, press ctrl+space and take a screenshot of it? Then please upload this screenshot anywhere and attach to your reply: we'd like to see how it looks.


Oh, looks like I've got you wrong. Could you please attach a screenshot illustrating an issue explicitly?


Well that is the issue.

It doesn't finish autocompleting the statement.


And in my code style options, it is supposed to add in the braces, but doesn't. Braces are also set to be on a newline, but if I put them on the same line, PHPStorm doesn't fix it.


It works if I manually run "refactor code"



If you complete foreach and then press Ctrl+Space again, does it add the brackets?


Nope, it does literally nothing.


Sorry for the previous comment, I've overlooked the original post.
Please restart the IDE, reproduce the issue and attach the IDE log - maybe we'll see some exceptions there.


I have the same problem with auto-completion not working (Windows PHPStorm 2016.2.2). It doesn't seem to know how to complete any general logic statement (if, for, while, switch, etc.).

Also, I have the same IDE on Mac, and auto-complete works as expected. 


I'm dealing with this same issue but actually on Intellij.. nothing has worked so far on my Mac to get autocompletion working for PHP.


Please disable all 3rd party (not bundled by default) plugins and try again.

If still the same -- please share idea.log (Help | Show Log in XXX) -- ideally you could clear it before running IDE with such plugins disabled (to reduce log size by excluding old info)


So what code gets inserted when you choose "foreach" entry form code completion (the one highlighted on screenshot below)? Just in case -- it's PHP language in .php file.


I have this problem too. Did anyone find a solution?


Hello Jake,

Did you try any of the suggestions above?


I fixed it. For some reason a mac key command had been activated for ctrl+space. I deactivated it in the keyboard settings.


Disable -> power save mode , if  power save mode is enabled 


@Masumkhan081  (Disable -> power save mode) Awesome its works , Thank you ! 


Please sign in to leave a comment.