Closed 1234ru closed 2 years ago
Hi. The plugin already has a similar format supported:
/**
* @param $u = Declarations::$user
*/
P.S. Русскоязычные приветствуют в ответ!
That is just great! Your plugin is very helpful.
One little thing: IDE doesn't suggest autocompletion after =
sign:
It also does not suggest property names:
So, I guess, one way here is to go to property's definition, press Ctrl+Alt+C to get a reference to it:
then paste the reference where it should be:
Sadly, IDE doesn't treat that as references, and if the class or variable is renamed, it won't affect the definition:
Also it does not support nested references like ClassName::property::subproperty
:
<?php
class Declarations {
/**
* @var = [
* 'name' => string,
* 'email' => string,
* 'phone' => string
* ]
*/
public $user;
}
class Another {
/** @var Declarations */
public $D;
/**
* @param $arg = self::$D::$user
*/
function foo($arg) {
$arg['']; // Doesn't suggest here
}
}
/**
* @param $u = Another::$D::user
*/
function do_someting($u) {
$u['']; // Doesn't suggest here as well
}
I apologize for putting comments in such chaotic way. I didn't expect to find all this out. But I want those observations to be kept somewhere.
no problem, github will handle it =D
PhpDoc has @see tag, which allows to reference methods and properties of the class.
In it's current implementation it doesn't affect autocompletion.
But it would be great if we could do something like that:
This would make PHP much more convenient language, allowing to describe data structures in one particular place and reference to it anywhere we want — the feature native PHP lacks to this day.
P.S. Привет русскоязычным!