Haehnchen / idea-php-toolbox

Collections of tools and improvements to make PhpStorm a little bit better
http://phpstorm.espend.de/php-toolbox
MIT License
158 stars 20 forks source link

Provide class/class constant completion #24

Open Koc opened 8 years ago

Koc commented 8 years ago
  1. For some cases better add constant completion instead of plain strings (in this case we should import class maybe before completion):
  2. Starting from php 5.5 we could use ::class magic constant and better use this reference in some cases like behat context classes or form types. But maybe it should be configurable
Haehnchen commented 8 years ago

some examples Request::isMethod newRequest(null, <caret>). logic already implemented in FormType / getRepository. just a custom sorter is missing

Koc commented 8 years ago

Yes, in FormType it works ok. Maybe we should add some flag to json and plugin settings that it is possible import class as class and do not use plain strings.

Koc commented 8 years ago

Also it can be contributor for class constants - grep constants by prefix, like PATHINFO_* for http://ua2.php.net/manual/en/function.pathinfo.php

Koc commented 8 years ago

@Haehnchen is it possible create contributor for class constants? For example I want add autocomplete for defined/constant native PHP functions.

Koc commented 7 years ago

Also it is better suggest FILE_* constants for the 3rd argument of file_put_contents instead of other variables. Maybe push it to the top of the suggestions list.