Two requests related to auto completion |
|
There is no easy way to specify what '$companyType' is at the moment, so the auto complete becomes completely useless in the following example ...
$companyTypes = new db_company_types(); $counter = 1; foreach ($companyTypes as $companyType){?> <div> <?php echo ($counter.') '.$companyType->name); $counter++; ?> </div> <?php } ?> The example I suggested before will allow to specify: /** * @var $companyType db_company_type */ Which will allow the auto complete to work once implemented in the IDE. Will someone comment about it ? Is that such a bad idea? Cheers |
||||||||||||
|
Veteran
|
I agree it would be great to do what you say. The problem is that those comments aren't just a random solution that NuSphere came up with to help their code insight engine; it's a repurposing of an existing--and extremely useful--tool, PhpDoc. To do as you suggest would mean potentially running afoul of proper PhpDoc syntax, which would break the purpose of the comments outside of PhpEd.
That said, the functionality *is* very desirable. We just need to come up with a good solution to provide it without breaking the tool chain. Ideal would be if PHP itself incorporated a complete system of type hinting, but organizers have thus far been very resistant to that idea. |
||||||||||||
|
|
I suggested this method, because another largely used IDE for PHP uses that exact syntax, and they support phpdoc generation too. I never noticed any issues using it in conjunction of generating a PHPdoc help.
Now I have to do weird coding to get around it like: $companyTypes = new db_company_types(); $counter = 1; foreach ($companyTypes as $companyType){ /** * @var db_company_type */ $companyType; ?> <div> <?php echo ($counter.') '.$companyType->name); $counter++; ?> </div> <?php } ?> Can you think of a better way ?, or maybe, if the developers of PHPdoc are willing to do it, it is the right place for people, and themselves to suggest ideas which will not break other functionality ? Cheers |
||||||||||||
|
Veteran
|
Hmm, interesting. Well, based on the phpDocumentor docs for the var tag:
http://manual.phpdoc.org/HTMLframesConverter/phpdoc.de/phpDocumentor/tutorial_tags.var.pkg.html that syntax isn't valid. However, I've not found the docs to be particular accurate nor helpful (quite surprisingly), so I wouldn't be surprised to learn that this is a new extension. If that's the case, then please, bring it on! |
||||||||||||
|
Site Admin
|
I think that the proposed way sould also be discussed with Gregory Beaver, phpdoc author.
|
||||||||||||
_________________ The PHP IDE team |
Two requests related to auto completion |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by