Aptana Studio
  1. Aptana Studio
  2. APSTUD-1714

php @var type-hinting has no effect on code assist

    Details

      Description

      {html}<div><p>When using a @var annotation no code assist is being displayed
      on a variable not otherwise explicitly declared in current
      scope.</p>
      <pre>
      <code class="php"><?php
      class Foo {
      public function bar() {}
      }

      $foo = new Foo();
      $foo->bar(); // When typing $foo-> code assist shows bar() as option

      /* @var $definedOutsideScope Foo */
      $definedOutsideScope->bar(); // After typing $definedOutsideScope-> I would expect the same code assist

      $arrayOfFoo = array(new Foo(), new Foo(), new Foo());
      foreach ($arrayOfFoo as $oneFoo) { /* @var $oneFoo Foo */ $oneFoo->bar(); // Again, after typing $oneFoo-> I would expect the code assist the appear }
      ?></code>
      </pre></div>{html}

        Issue Links

          Activity

          Hide
          Matej Szendi added a comment -

          I like this feature in others IDE, so +1, please.

          Show
          Matej Szendi added a comment - I like this feature in others IDE, so +1, please.
          Hide
          Shalom Gibly added a comment -

          Implemented this support for 3.1.
          We actually had in place some support for that, but it was quite awkward. For example:

          /*
           * @var Foo
           */
           $myVar; // Redundant...
           $myVar -> // CA for Foo's functions
          

          The fixed implementation adds support for the PDT syntax:

          /* @var $myVar Foo */
          $myVar -> // CA for Foo's functions
          

          We now support both ways.

          Show
          Shalom Gibly added a comment - Implemented this support for 3.1. We actually had in place some support for that, but it was quite awkward. For example: /* * @var Foo */ $myVar; // Redundant... $myVar -> // CA for Foo's functions The fixed implementation adds support for the PDT syntax: /* @var $myVar Foo */ $myVar -> // CA for Foo's functions We now support both ways.
          Hide
          Joel Witt (Inactive) added a comment -

          Aptana Studio 3, build: 3.0.7.201111182245
          Windows 7

          Confirmed support of the @var annotation (please see capture at http://www.screencast.com/t/rQi28nqumaS).

          Show
          Joel Witt (Inactive) added a comment - Aptana Studio 3, build: 3.0.7.201111182245 Windows 7 Confirmed support of the @var annotation (please see capture at http://www.screencast.com/t/rQi28nqumaS ).

            People

            • Assignee:
              Shalom Gibly
              Reporter:
              Joram van den Boezem
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development