Php Documentor Tag support

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

Php Documentor Tag support

Postby ikappas » March 19th, 2015, 8:41 am

It would be great if you could provide support for the phpDocumentor tags.

Especially {@inheritdoc}

Thanks

Ioannis
ikappas
 
Posts: 21
Joined: December 13th, 2014, 3:50 pm

Re: Php Documentor Tag support

Postby Jakub Misek » March 19th, 2015, 9:09 am

Hi,

Thanks for the feedback. We are planning missing support for PHPDoc tags
- @inheritdoc
- IntelliSense for tags
- code snippets for PHPDoc

Currently PHP Tools support following http://www.devsense.com/doc/phptools/ed ... c-comments
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: Php Documentor Tag support

Postby ikappas » March 19th, 2015, 9:43 am

That is great to hear Jakub. Any ETA on that?
ikappas
 
Posts: 21
Joined: December 13th, 2014, 3:50 pm

Re: Php Documentor Tag support

Postby Jakub Misek » March 19th, 2015, 10:31 am

IntelliSense and snippets are planned for the next release 1.17 or lately. Processing @inheritdoc so you'll see correct PHPDoc in tooltips will be avail. within near preview release ~week or so.
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: Php Documentor Tag support

Postby josh » March 19th, 2015, 3:10 pm

There is an issue with @property[-read] tags.

if you define a property with the same name as a private/protected member of the class, IntelliSense does not show for that property outside of the class.

In the example of the below, no IntelliSense is shown from outside of the class until the properties $foo an $bar have been accessed.

Example:

Code: Select all
/**
  * @property string $foo
  * @property-read string $bar
  */
class FooBar
{
    protected $foo;
    protected $bar;

    public function __get($name)
    {
        return $this->{$name};
    }

    public function __set($name, $value)
    {
        if($name === 'foo') $this->{$name} = $value;
    }
}
josh
 
Posts: 7
Joined: February 27th, 2015, 7:43 pm

Re: Php Documentor Tag support

Postby Jakub Misek » March 19th, 2015, 3:23 pm

josh wrote:There is an issue with @property[-read] tags.

if you define a property with the same name as a private/protected member of the class, IntelliSense does not show for that property outside of the class.
According to documentation (http://manual.phpdoc.org/HTMLSmartyConv ... y.pkg.html) @property documents "magic" properties accessed using __get/__set magic methods.

In case properties are real, you should not use @property tag. Add PHPDoc above the property declaration instead.

Edit: the sample is really nasty, I didn't see anything like this before :-)
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: Php Documentor Tag support

Postby josh » March 20th, 2015, 4:11 pm

In this sample, what I'm really interested in is the @property-read.

I want to give access to a protected/private member in a read-only manner to external classes without having to explicitly make a getFoo() method. I can change the name of either the property or the internal member and get the expected IntelliSense for @property-read. It looks like IntelliSense for the protected member is always suppressed regardless of the @property-read statement. I think this should be reversed, where the @property-read takes precedent.
josh
 
Posts: 7
Joined: February 27th, 2015, 7:43 pm

Re: Php Documentor Tag support

Postby Jakub Misek » March 20th, 2015, 5:01 pm

Technically, it is possible. Internally we would have to treat access from inside the class context, its subclasses and outside the context differently. I'll note this case, but I'm not sure it makes much sense to support it. We may compare other IDEs how they handle such sample.
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: Php Documentor Tag support

Postby josh » March 26th, 2015, 4:05 pm

I know PHPStorm for sure handles this. That is the only other IDE I a have experience with though.
josh
 
Posts: 7
Joined: February 27th, 2015, 7:43 pm

Re: Php Documentor Tag support

Postby JeanVanDender » February 10th, 2017, 1:12 pm

Hello i like PHP Tools from DevSense with Visual Studio very much. IT is the best with VS, diveinto code with F12

I use latly YII framework.

I have this issue Lots of warnings
"@inheritdoc should be {@inheritdoc}"

https://github.com/yiisoft/yii2/issues/ ... -221995372

Will this be supported or could i suppress this warning in Visual Studio/PHP Tools ?
JeanVanDender
 
Posts: 3
Joined: June 19th, 2016, 7:36 pm

Next

Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 49 guests

cron

User Control Panel

Login

Who is online

In total there are 49 users online :: 0 registered, 0 hidden and 49 guests (based on users active over the past 5 minutes)
Most users ever online was 297 on March 29th, 2024, 7:06 am

Users browsing this forum: No registered users and 49 guests