Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make completion works at first time in PhpStorm 2016.2

I'm using PhpStorm 2016.2 and my code completion does not seem to work properly. When typing $this->assertCo

Too short list

it suggest only function names that are up to third level ancestors of my class. But when I use Ctrl+Space it suggest correct items.

enter image description here

This is my class diagram:

enter image description here

and missing suggestions are in PHPUnit_Framework_Assert class.

How can I make it work without using Ctrl+Space every time?

PhpStorm and OpenJDK info:

PhpStorm 2016.2
Build #PS-162.1121.38, built on July 12, 2016
JRE: 1.8.0_76-release-b216 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
like image 1000
piotrekkr Avatar asked Oct 19 '22 04:10

piotrekkr


1 Answers

Reason for current behaviour: it was asked by users (WI-9403) to hide static methods when completing methods using this->.

PHPUnit apparently has all assertXXX methods done as static although recommends accessing them via $this-> (same way how it's done in JUnit -- the original tool where PHPUnit devs took inspiration from).

How can I make it work without using Ctrl+Space every time?

Right at the moment -- no way.

But in 2016.2.1 it will work as before for PHPUnit methods/inside PHPUnit test files (WI-32530 -- already implemented).


You may also consider voting for https://youtrack.jetbrains.com/issue/WI-32713 -- to have such behaviour completely optional (additional setting) even outside of PHPUnit tests.

like image 81
LazyOne Avatar answered Nov 01 '22 13:11

LazyOne