A phpstorm plugin for associative array key typing and completion.
Autocomplete keys of associative arrays defined in other functions.
Jetbrains Repository: 9927-deep-assoc-completion
Steps to compile plugin into a
- Start creating a new project in Intelliji Idea.
Intelliji Platform Plugin.
- Select a phpstorm installation directory as
Project SDK(java version is 8).
- Select phpstorm-deep-keys project folder as
Project Structure -> Librariesadd
Project Structure -> Modules -> Dependenciesset
To build a jar use
Build -> Prepare Plugin ... For Deployment. To debug use
Run -> Debug. Since phpstorm project takes about a minute to start, you must find
Run -> Reload Changed Classes very useful for micro changes.
To use compiled
.jar in your phpstorm go to
Settings -> Plugins -> Install plugin from disk and select the
.jar we compiled earlier.
(a bit more detailed usage guide can be found here)
Completion from expression
When you are going to type an associative key of a variable, like in
$user[''], put caret between quotes and press
space. The plugin will analyze your code, determine what keys does
$user have and suggest completion.
Go To Definition
To go to the key definition, hover on it and press
click or put carret on it and press