Any way to do PHP function summary/comment?

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

Any way to do PHP function summary/comment?

Postby RicardoPaulinski » August 17th, 2012, 3:22 pm

Hey. Was wondering if there was any way to add summarys to PHP functions so that intellisense could make use of them. I've tried the usual:

///<summary>
///This is a description of my function.
///</summary>

but no luck :(

Maybe it's not supported in PHP Tools for Visual Studio yet?
RicardoPaulinski
 
Posts: 2
Joined: August 17th, 2012, 3:19 pm

Re: Any way to do PHP function summary/comment?

Postby Jakub Misek » August 17th, 2012, 3:28 pm

Hi!

In PHP there is different syntax of documentary comments - called PHPDoc.

It looks like this
Code: Select all
/**
 * Short summary.
 *
 * Long summary.
 * @return array Returns an array of items.
 */
function foo(){}


More info at http://en.wikipedia.org/wiki/PHPDoc

PHP Tools supports this syntax, reads type hints from comments and helps you while typing comments by showing possible keywords after @ and making smart indentation inside PHPDoc text.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Any way to do PHP function summary/comment?

Postby Miloslav Beno » August 17th, 2012, 3:50 pm

Hi Ricardo,

Jakub's right, PHPDoc is standard comment type. Is this some kind of PHP comment type you've seen in other PHP IDE?

Thanks
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: Any way to do PHP function summary/comment?

Postby AndyM84 » August 17th, 2012, 5:46 pm

Ricardo seems to be referencing the XMLDoc stuff you use with C# in Visual Studio.

One note, would it be possible to take the Zend Studio approach to phpDoc comments and sort of pre-fill them based on the arguments it finds for a function? If you're not familiar with it, I can make a short video of what it does...
User avatar
AndyM84
 
Posts: 69
Joined: August 6th, 2012, 3:24 pm
Location: Boston, MA, USA

Re: Any way to do PHP function summary/comment?

Postby Jakub Misek » August 17th, 2012, 5:53 pm

AndyM84 wrote:pre-fill them based on the arguments it finds for a function?

Yes, we are planning this feature. Once you type /** before a function declaration, it would complete the whole PHPDoc skeleton, with parameters name.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Any way to do PHP function summary/comment?

Postby AndyM84 » August 17th, 2012, 6:01 pm

That's why I love you guys.
User avatar
AndyM84
 
Posts: 69
Joined: August 6th, 2012, 3:24 pm
Location: Boston, MA, USA

Re: Any way to do PHP function summary/comment?

Postby RicardoPaulinski » August 28th, 2012, 10:57 am

Thanks so much guys, this is perfect.
RicardoPaulinski
 
Posts: 2
Joined: August 17th, 2012, 3:19 pm

Re: Any way to do PHP function summary/comment?

Postby Jakub Misek » August 28th, 2012, 1:58 pm

This feature has been implemented, and will be available in the next update.

Thanks for Your ideas!
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 12 guests

User Control Panel

Login

Who is online

In total there are 12 users online :: 0 registered, 0 hidden and 12 guests (based on users active over the past 5 minutes)
Most users ever online was 787 on May 12th, 2024, 11:50 am

Users browsing this forum: No registered users and 12 guests