klesun / deep-assoc-completion

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

Can be used for autocomplete string variable. #166

Closed andrew-svirin closed 3 years ago

andrew-svirin commented 4 years ago

Your widget helps a lot. Thanks. I have found that widget works very good with arrays. Does it possible to autocomplete string argument? public function(string $thisArg)

klesun commented 4 years ago

Hi. Do you mean something like that https://github.com/klesun/deep-assoc-completion/issues/50 per chance?

image

klesun commented 4 years ago

There is also this PSALM syntax supported

    /** @psalm-param 'aaaa'|'bbbb' $field */
    static function rororor($field)
    {
    }

Though it does not seem to work for completion when you call the method... Guess I'll fix that in some of the upcoming releases

andrew-svirin commented 4 years ago

Yes. It is great! Can be added some comment for arguments? like on screen? image

andrew-svirin commented 4 years ago

image This way autocomplete is working. Anyway i can do like here, if comments for list is not passable.

klesun commented 4 years ago

Hm, conceptually, this format is supposed to work as well:

    /**
     * @param $field =
     *     'client-address' ?: // comment 1
     *     'client-data' // comment 2
     */

But it does not seem to work. I guess I'll fix that in context of this ticket. Not sure @ keywords won't break it still, though, so I guess your format is the way to go...

klesun commented 3 years ago

Following will be fixed in the next release: image image