klesun / deep-assoc-completion

A phpstorm plugin for associative array key typing and completion
Other
267 stars 17 forks source link

Include upcoming usages in the current scope for autocompletion #168

Closed pretzlaw closed 3 years ago

pretzlaw commented 3 years ago

An array is filled to be used in an function:

        $data = $this->createCommentData();
        $data[' ...

        wp_update_comment( $data );

When adding another field I use autocomplete to get all the possible fields.

grafik

Unfortunately only the fields that are defined in $this->createCommentData() can be seen. The fields that wp_update_comment allows are not shown (e.g. "comment_ID").

But when using the variable in some future context it would be great if the autocomplete shows those accepted fields too.

Notes:

klesun commented 3 years ago

Hi. While not exactly the way you asked, but in current implementation you can achieve same completion this way:

image

upd.: oh, though += does not overwrite existing keys... I think same completion should have been working with array_merge and array_replace, but it seems it does not anymore.

klesun commented 3 years ago

I want to implement this, but dunno when I'll get the time...

klesun commented 3 years ago

Released in 2020.12.21.001 image

klesun commented 3 years ago

I did not implement few features that could go nicely with this:

If anyone is positive that some of them are worth implementig, ping me please, I'll spend some more time on this then.