NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Two requests related to auto completion


Joined: 13 Oct 2007
Posts: 9
Reply with quote
Two items ...

1. Is it possible to keep the auto complete drop down window the same size as what I define ?

In some cases I have long class names, and the variables to the methods are showing after scrolling, resizing the window helps only as long as the drop down window is open, but once it is closed, and reopened, it changes back.

if not (or as another option) maybe being able to specify what shows in the dropdown ? all I am really looking for is the name of the property / method, and the params.

2. Will be really helpful to be able to specify a type of a variable without needing to specify it just above the variable (for type hinting for auto complete):

Code:
foreach($item as $key=>$object){

  /** @var $object myclass */

  if ($foo){
    echo($var->method);
  }

}

And if this can work .... then you are the king !!!!

/** @var $arr['key'] myclass */

$arr['key']->method;
View user's profileFind all posts by asabiSend private message


Joined: 13 Oct 2007
Posts: 9
Reply with quote
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
View user's profileFind all posts by asabiSend private message
Veteran

Joined: 26 Dec 2006
Posts: 253
Location: Phoenix, AZ
Reply with quote
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.
View user's profileFind all posts by bobwilliamsSend private messageVisit poster's website


Joined: 13 Oct 2007
Posts: 9
Reply with quote
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
View user's profileFind all posts by asabiSend private message
Veteran

Joined: 26 Dec 2006
Posts: 253
Location: Phoenix, AZ
Reply with quote
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!
View user's profileFind all posts by bobwilliamsSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
I think that the proposed way sould also be discussed with Gregory Beaver, phpdoc author.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Two requests related to auto completion
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic