PHP autocomplete not working

Answered

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.

17 comments
Comment actions Permalink

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

4
Comment actions Permalink

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

2
Comment actions Permalink

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

0
Comment actions Permalink

Nope.

 

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

0
Comment actions Permalink

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.

0
Comment actions Permalink

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

0
Comment actions Permalink

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"

0
Comment actions Permalink

Hello,

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

0
Comment actions Permalink

Nope, it does literally nothing.

0
Comment actions Permalink

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.

0
Comment actions Permalink

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. 

0
Comment actions Permalink

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.

0
Comment actions Permalink

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)

P.S.

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.

0
Comment actions Permalink

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

0
Comment actions Permalink

Hello Jake,

Did you try any of the suggestions above?

0
Comment actions Permalink

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

0

Please sign in to leave a comment.