Autocompletion for yii2?
How do I get PS to do autocompletion for yii2?
For example the `yii\web\BadRequestHttpException` class in my controller?
请先登录再写评论。
How do I get PS to do autocompletion for yii2?
For example the `yii\web\BadRequestHttpException` class in my controller?
请先登录再写评论。
Hi there,
I do not understand the issue here -- class name should be completed in the same way as any other namespaced class -- you just start typing and IDE shows you all possible variants that it knows about.
1) Maybe it does not know about your Yii2 code (in other words -- check if such file is part of your project or referenced somehow) ?
2) Try "File | Invalidate Caches..." and restart IDE in case if file is there but IDE doe snot see it.
I don't understand it either. I've tried invalidating the cache and restarting. Same issue.


It finds some classes, but quite a few are not found for some reasons.
See the screenshot below:
Here's the file directory:
Not sure what's going on.
Where do you try to complete it?
If it's the place shown on screenshot .. then IDE is correct here -- that class has no static methods/constants so it makes no sense to use it there in such way.
If I do "throw new \yii\web\b" then it completes just fine
P.S.
The only case where IDE should list all possible cases is to support completion of "::class" -- https://youtrack.jetbrains.com/issue/WI-20711 which is currently "In Progress"
Tried in a Controller class within the `controllers/` directory.
I just tried with the `throw new \yii\web\B` thing and it works now.
It wasn't working before. Maybe the `Invalidate Cache/Restart` fixed it.
Thanks.