Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For loop variable autocompletion #208

Closed
wojtas opened this issue Jan 9, 2014 · 5 comments
Closed

For loop variable autocompletion #208

wojtas opened this issue Jan 9, 2014 · 5 comments
Labels

Comments

@wojtas
Copy link

wojtas commented Jan 9, 2014

Would it be possible to support variable autocompletion in for loops?

Example (for demonstration purpose I wrote these two hypothetical classes which illustrate my use case):

class MyObject
{
    public function getName() { return 'test'; }
}

class MyService
{
    protected $myObjectList;

    /**
    * @return MyObject[]
    */
    public function getMyObjectList()
    {
        return $this->myObjectList;
    }
}

Then in Twig I have an object which is instance of MyService class, and it is autocompleted nicely:

image

but this single loop element module, even if it has a proper PHPDoc annotation, gets no autocompletion:

image

@Haehnchen
Copy link
Owner

thats already in. latest plugin version?
can you give a full screenshot? you stripped off the detected type on the compltion window

@Haehnchen
Copy link
Owner

{% for foo in foo.bar %}

"foo.bar" is not supported right now, add to todo-list

@Haehnchen Haehnchen added todo and removed question labels Feb 20, 2014
@dewos
Copy link

dewos commented Dec 26, 2014

+1 for this.

@Haehnchen
Copy link
Owner

fixed. optimization also needed for #444 later

@gharlan
Copy link

gharlan commented Mar 10, 2015

So, shouldn't autocompletion for user work here?

screenshot 2015-03-10 11 59 20

The type of user is empty, but it should be \AppBundle\Model\User..
So I don't get autocompletion for lastName etc.

I'm using PhpStorm 9 EAP and sf2 plugin 0.11.86.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants