NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Displaying Optional @param in code completion


Joined: 13 Feb 2008
Posts: 32
Reply with quote
I do not know if I am doing this correctly, but I checked with PHPDOC and it seems so.


Example Code

Code:

class a
{
   /**
   *@desc Blah Blah Blah
   *@param string $data Some sweet stuff
   *@param string Optional Arguments
   */
    function test($data)
    {
    //nothing here
    }
}



Basically, I would like to see code completion display this as I am typing, imagining below is the type completion box popping up.

a::test(string $data, Option Arguments)

As it is now Code completion will on show

a::test(string $data)

So there is no way to know that optional arguments are possible. Once you started typing in the first paramater and hit the ",' then info will show up for the optional parameters..

Thanks in advance.
View user's profileFind all posts by linchatSend private message
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
why not specify the parameter and give it a default value?

Code:
function test ( $data, $optional = FALSE )
{
}
View user's profileFind all posts by BlizzSend private messageVisit poster's website


Joined: 21 Jan 2008
Posts: 19
Reply with quote
Blizz,

I guess there are optional argumentS not one.
View user's profileFind all posts by wenihalSend private message


Joined: 13 Feb 2008
Posts: 32
Reply with quote
Smile Right, many optional arguments. I would just like code completion to show that optional arguments can be used.
View user's profileFind all posts by linchatSend private message
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
I seem to have missed that, my apologies. If there's a reasoning behind which arguments they have to be (for example depending on the first argument), you might describe them in the first @param or something? Don't think there's another way to do it atm.
View user's profileFind all posts by BlizzSend private messageVisit poster's website


Joined: 13 Feb 2008
Posts: 32
Reply with quote
Sounds like that might be a good option. Thanks.
View user's profileFind all posts by linchatSend private message
Displaying Optional @param in code 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