Magic Function Intellisense Support

Project:VS.Php for Visual Studio .Net
Component:Editor
Category:feature request
Priority:normal
Assigned:webmaster
Status:active
Description

PHPDoc has allowed comments to describe methods and properties available only through magic functions for some time now.

See http://greg.chiaraquartet.net/archives/140-phpDocumentor-and-__get__set_... and http://manual.phpdoc.org/HTMLframesConverter/default/phpDocumentor/tutor...

There should be support for these tags in VS.PHP, both in allowing the tag itself to be auto-completed, but also in recognizing the entries as if they were full-fledged methods and properties for the purposes of intellisense and other features.

Updates

#1 submitted by webmaster on Thu, 2007-05-31 06:00

Please take a look at this tutorial. PhpDoc is already supported:

PhpDoc tutorial

#2 submitted by ICOM on Mon, 2007-06-04 16:08

Sorry, re-adding my comment as a follow-up.

That documentation does not show magic functions, or the @property tags. Neither do these appear to work in my copy of VS.PHP.

Even typing:
/**
* @p

doesn't bring up @property as a valid option.

If I'm missing something, please let me know.

#3 submitted by webmaster on Fri, 2007-07-06 04:50
Assigned to:» webmaster
Status:active» fixed

Version 2.3.4.3924 has the magic entries. You can download

http://www.jcxsoftware.com/jcx/vsphp/beta

#4 submitted by ICOM on Mon, 2007-07-09 09:02
Status:fixed» active

I see the @property support when adding comments, but still don't see any intellisense support of these. Is there an option I need to enable somewhere?

#5 submitted by webmaster on Mon, 2007-07-09 20:28

Tell me more about the behavior in intellisense you would like to see.

#6 submitted by ICOM on Tue, 2007-07-10 09:07

@property is designed to describe the equivalent of public class properties, where the actual implementation of the member is via __get and __set. Likewise, @method corresponds to function calls defined via __call.

So it would be ideal if intellisense worked with things defined in @property and @method just as if they were defined as public properties and members.

eg:

given:

<?php
/**
* show off @property, @property-read, @property-write, @method
*
* @property mixed $regular regular read/write property
* @property-read int $foo
* @property-write string $bar
* @method int borp(int $int1, int $int2) multiply two integers
*/
class blah
{
    private
$_thingy;
    private
$_bar;

    function __get($var)
    {
        switch (
$var) {
            case
'foo' :
                return
45;
            case
'regular' :
                return
$this->_thingy;
        }
    }

    function __set($var, $val)
    {
        switch (
$var) {
            case
'bar' :
               
$this->_bar = $val;
                break;
            case
'regular' :
                if (
is_string($val)) {
                   
$this->_thingy = $val;
                }
        }
    }

    function __call($method, $params)
    {
        if (
$method == 'borp') {
            if (
count($params) == 2) {
                return
$params[0] * $params[1];
            }
        }
    }
}
?>

typing:
$objBlah = new blah();
$objBlah->b
should cause intellisense to come up with bar and borp() as valid options.

I hope that clarifies things.

#7 submitted by ICOM on Tue, 2007-07-10 09:10

Not sure why that code was munged. It was taken from a page where you can see it in full color at:
http://greg.chiaraquartet.net/archives/140-phpDocumentor-and-__get__set__call-give-us-your-ideas-RFC.html

#8 submitted by webmaster on Thu, 2007-09-06 06:32
Status:active» fixed

Functionality added in version 2.3.6.4059

http://www.jcxsoftware.com/jcx/vsphp-dev?build=2.3.6.4059

#9 submitted by ICOM on Fri, 2007-09-07 09:48
Status:fixed» active

@method is not bold or intellisensed while typing
Nor does intellisense suggest borp() as an auto-complete for a blah object.
foo, bar, and regular do show up now though. :)

So the @property support seems to be working, but @method support is still completely missing.

Comments

    Additionally... It would be

    Additionally...

    It would be handy to be able to provide inline phpdoc hints for variables to help with intellisense.

    Something along the lines of:

    /**
    * @var thisClass
    */
    $thisInstance->

    That documentation does not

    That documentation does not show magic functions, or the @property tags. Neither do these appear to work in my copy of VS.PHP.

    Even typing:
    /**
    * @p

    doesn't bring up @property as a valid option.

    If I'm missing something, please let me know.

    Bump

    So, is there any possibility of this being supported in the near future?

    Done, check the latest

    Done, check the latest build

    http://www.jcxsoftware.com/jcx/vsphp/beta

    Thank you. Is there a way to

    Thank you. Is there a way to tell what improvements have been made in these daily builds, or do you wait until full releases to compile release notes?

    This url includes changelog

    This url includes changelog info:

    http://www.jcxsoftware.com/jcx/vsphp-dev

    Thanks

    Another bump

    I'm not sure how your bugs are prioritized, so if comment activity matters, here's me trying to get this higher up in the queue. :)

    Bump

    I haven't noticed any progress listed on the daily build's notes, so this is just a reminder about how much this feature would be appreciated. :)

    I haven't forgotten about

    I haven't forgotten about it. But it does not hurt to keep reminding me :)

    YAB

    Yet Another Bump. :)

    I haven't forgot :)

    I haven't forgot :)