Haehnchen / idea-php-symfony2-plugin

IntelliJ IDEA / PhpStorm Symfony Plugin
https://plugins.jetbrains.com/plugin/7219
MIT License
910 stars 137 forks source link

Phpstorm freezes when need to search namespace for "use" of an unknown class (Again ^) #32

Closed leiha closed 11 years ago

leiha commented 11 years ago

Hi i come back to you because in fact i have always a freeze when i use auto completion for a class : new Foo -> auto completion crashes (memory overloaded) when i choose the namespace in the list :(

cf old issue : https://github.com/adrienbrault/idea-php-symfony2-plugin/issues/27

lunetics commented 11 years ago

same here. Want to do a Autocomplete use statement for Request, (or generally at autcomplete classnames) hangs at "Re" (with every other autcomplete class also)

error in log is: #com.jetbrains.php.PhpIndex - Wrong element Re from file:///path/to/controller.php index: php.class.shortName

adrienbrault commented 11 years ago

Can you paste the full stacktrace ?

lunetics commented 11 years ago

i packed the log from .WebIde60/system/log here: https://www.dropbox.com/s/5wx0kh7z5s1o7zq/log.tar.gz

tPl0ch commented 11 years ago

@adrienbrault I can confirm this for 129.291. Had to disable the plugin for now.

lunetics commented 11 years ago

@tPl0ch what are you using? I'm on Ubuntu 12.10 in a vm and java:

java version "1.7.0_07" Java(TM) SE Runtime Environment (build 1.7.0_07-b10) Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

Haehnchen commented 11 years ago

i isolated it. try a use on this snippet breaks the ide

namespace [..];
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class xxxxController extends Controller {
    public function notNice() {
        return $this->getDoctrine();
    }
}

error is in Symfony2InterfacesUtil. check for NullPointerException?

PsiElement resolvedReference = methodRef.getReference().resolve();

com.jetbrains.php.PhpIndex - Wrong element xxx from file://xxxx.php in index: php.class.shortName

apfelbox commented 11 years ago

I also experienced this issue: http://youtrack.jetbrains.com/issue/WI-18102

My code:

<?php

namespace My\Bundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
// <- here is the cursor

class AppController extends Controller
{
    public function indexAction($name)
    {
        return $this->render('MyBundle:Default:index.html.twig', array('name' => $name));
    }
}

As soon as I type use Tem the IDE hangs completely.

Haehnchen commented 11 years ago

this one also breaks the ide, but i think it shouldnt. so it is a bug of phpstorm?

public PhpType getType(PsiElement e) {
  PlatformPatterns.psiElement(MethodReference.class).referencing(PlatformPatterns.psiElement(Method.class)).accepts(e);
Haehnchen commented 11 years ago

i replaced getReference and it works now!

adrienbrault commented 11 years ago

Closing as this should be fixed. If you still have issues, please report here!

apfelbox commented 11 years ago

Is this already included in 0.7.0? Or will I have to wait for 0.7.1?