NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Autocomplete in docblocs


Joined: 30 Jun 2009
Posts: 79
Reply with quote
Hi,

I would like to be able to bring up autocomplete/class lookup dialog when writing docblocks:

Code:

/**
 * User account.
 *
 * @var My\App\U
 */



Code:

/**
 * @return My\App\U
 */


When typing docblocs above, it would be highly convenient to use autocomplete. As you can see above, having typed last letter "U", I'd like to press CTRL+Space and see what are the matching classes.

How about that?

Thanks,
Temuri
View user's profileFind all posts by temuriSend private message


Joined: 07 Jul 2013
Posts: 2
Reply with quote
This is what I was looking for myself!
It could also be namespace/lookup dialog which pops up when you start typing "use " on top of the php class file.
View user's profileFind all posts by chirillSend private message


Joined: 26 Sep 2007
Posts: 25
Reply with quote
I would also love some scoped type hinting as well. I often do something like:

Code:
foreach ($Users as $User) {
   echo $User->getName() . "\n";
}


Where a simple docblock with a @var injected into the scope could tell PhpED what $User is:

Code:
foreach ($Users as $User) {
   /**
    * @var User $User
    */
   echo $User->getName() . "\n";
}
View user's profileFind all posts by PureFormSend private message


Joined: 30 Jun 2009
Posts: 79
Reply with quote
Agreed. +1
View user's profileFind all posts by temuriSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
@PureForm

Does the @var need to come before the first usage (declaration) of the variable?

Code:
/**
 * @var User $User
 */
foreach ($Users as $User) {
   echo $User->getName() . "\n";
}


I agree with Temuri that it would be good to get some sort of completion in PhpDoc.
View user's profileFind all posts by plugnplaySend private message


Joined: 07 May 2014
Posts: 64
Reply with quote
@dmitri

What's your position on this?
View user's profileFind all posts by temuri416Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8351
Reply with quote
it already worked back in 2014

what you need is to add square brackets :


as of completion in phpdoc block itself, only phpdoc tags are supported at the moment.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 07 May 2014
Posts: 64
Reply with quote
dmitri,

Please read my original post again. I was asking for autocomplete INSIDE docblocks. How about that?
View user's profileFind all posts by temuri416Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8351
Reply with quote
What's about reading my post again too? Wink
I replied about completion inside phpdoc blocks too

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 07 May 2014
Posts: 64
Reply with quote
ok, but that's the feature request. It would be great to have class names autocomplete in docblocks. any chance?
View user's profileFind all posts by temuri416Send private message
Autocomplete in docblocs
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