NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
fails to find static declarations


Joined: 30 Jun 2009
Posts: 79
Reply with quote
Hi all,

Has anyone experienced the following problem in v9.

Sometimes, PHPEd would stop finding class, method and constant declarations with CTRL+Click/Shift+F12.

It ONLY happens when method is called statically:
Code:
$a = SomeClass::someMethod();

CTRL+Click on "SomeClass" results in: "Failed to find \SomeClass::SomeClass::someMethod()" method string in status bar

And:
Code:
$a = SomeClass::SOME_CONSTANT;

In this case, CTRL+Click on "SomeClass" results in: "Failed to find SomeClass::SOME_CONSTANT" method string in status bar (N.B. - WITHOUT the forward slash in front of "SomeClass".
CTRL+Click on "SOME_CONSTANT" results in: "Failed to find \SomeClass::SomeClass::SOME_CONSTANT" method string in status bar.

In both cases, holding CTRL and hovering over "SomeClass", "SomeMethod" or "SOME_CONSTANT" does not turn it to clickable/underlined text.

At the same time, autocomplete works fine, typing SomeClass:: correctly shows available static methods and constants. The problem can be resolved by restarting PHPEd, but soon as you try CTRL+Click for the first time (when it works fine), it craps out again.

Finding method declarations in an instantiated class always works fine.

I am almost certain that it has something to do with namespaces. I have use SomeClass; at the top of the file.

Thanks,
Temuri[/b]
View user's profileFind all posts by temuriSend private message


Joined: 26 Sep 2007
Posts: 25
Reply with quote
Yes, I've experienced this issue as well. I took it directly to support, complete with a video of it happening, but I got the "we can't reproduce this" pedantry from them.

I am not using namespaces, so I don't think it's unique to that.

I also noticed that this seems to pop up immediately after invoking the Shift+F12 dialog you've mentioned.

The same action also seems to make the "Extended select" break.

I've also noticed that Ctrl+Clicking on a static method (when this is working) puts the cursor / caret a few chars before the actual method name, somewhere in the middle of "static". Maybe they're assuming we're using spaces instead of tabs? (even though this is an explicit setting).

I'd love to see this get fixed asap. I find myself restarting the IDE several times a day when it chokes up like this. It's incredibly annoying.
View user's profileFind all posts by PureFormSend private message


Joined: 30 Jun 2009
Posts: 79
Reply with quote
It actually gets even better.

Code:
class A
{
    const B;

    function C()
    {
        $d = self::B;
    }
}


CTRL+Click on "B" part of "self::B" above gives me 'Failed to find "self" class' which is completely crazy.
View user's profileFind all posts by temuriSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7887
Reply with quote
I'm not sure what pedantory in the support reply, but I can't reproduce the "issues" too.


Your code
Code:

class A
{
    const B;

    function C()
    {
        $d = self::B;
    }
}

is broken. It has syntax error -- because you can't define a constant without providing a value for it.
With correct code like below Find Declaration works fine (at least for me):

Code:

class A
{
    const B = 5;

    function C()
    {
        $d = self::B;
    }
}


With the other "issues", check with new empty project, right after restart the IDE, make sure all the settings in the project are default and php version set to "5.3 or higher"
If you can reproduce in this case (I doubt, but who knows), let me know.
If you can't reproduce, try to find what specific is in your project that causes the issue.
I think it's clear that without a way on reproducing the issues, we can't fix them

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 30 Jun 2009
Posts: 79
Reply with quote
dmitri,

obviously, that was a typo. I do have it as "const B = 5;".

can I use recorded screencast to submit a bug report?

Thx
View user's profileFind all posts by temuriSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7887
Reply with quote
Screencast is useless as I believe your report is not a fake, then what am I supposed to see new in it?
What would be a bit more helpful is following what I asked for.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 26 Sep 2007
Posts: 25
Reply with quote
I've found the PhpED team to be less than ideal when responding to issues we have (see how I left the quotes off of issues, here?).

Resetting the IDE to default settings, using a fresh project, etc is not something we feel we should have to do when new releases introduce regression like this. It should "just work" regardless of the settings we have chosen from within the IDE.

You can't keep going back to the not being able to reproduce argument when there are more than a few of us who are experiencing these problems.

The standoffish tone in your replies doesn't help either, and the only thing it leaves me with is a sinking feeling for the team behind the only PHP dev software I've used for the past 10 years.

I've given up on many of the issues I have simply because I feel like they wont be taken seriously, and that plain sucks. I hate that feeling.

Today alone I restarted PhpED roughly 20 times when the Shift+F12 dialog started returning a subset of the files in my project (not to mention the 3 or 4 times is straight up crashed when trying to use it).

We're all trying hard to give you all the data you guys need to fix these things, and at this point I would hope someone on the team would just start playing around with the code to try and see how these things could possibly break.

Every one of your customers is also a programmer, so we have a very high threshold for quality, something you guys are historically on spot on with. I'd love to see more of that Smile
View user's profileFind all posts by PureFormSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 7887
Reply with quote
Of course, you don't have any obligations on testing the software and of course we do our job very well in particular in finding problems - we find them efficiently and fix them fast -- these are the words we hear from our customers, not just my own opinion.

With this issue about static members -- it looks like you're indeed a few, otherwise we'd already got multi-1000 reports.
Certainly, it does not mean that we do not care. We take care of each single report. You are absolutely wrong thinking that way. We did our best in order to reproduce this issue and spent sufficiently long time. BTW we also run all the IDE tests before the release and before each public update. Sorry, but no problems were discovered. Now -- somebody of you can try to help us find what causes the problem. I see no other ways, except the ones we have already followed.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 30 Jun 2009
Posts: 79
Reply with quote
@PureForm:

1. I somehow have a feeling that this static lookup failures are caused by the combination of use of PHP 5.4 namespace aliases (use A\B as C; ) AND DocBlock declarations @var C. I have never had such problem with non-namespaced projects.
2. It would be nice if support team stopped treating all of us as newbies and for once assume that we know how to set up debugging or what JIT is and we know something about PHP language.
3. I found another oddity: my project uses number of external PHP libs, and among them Zend Framework v1. So, I've noticed that autolookup/autocomplete of Zend_A* classes works, however, Zend_V* classes don't appear. Looks like include parsing crashes half-way through. I have 16GB RAM, and PHPEd stays within 350Meg use.
4. Can you confirm the following:

You have:

File1.php:
Code:

namespace A;
class B
{
    const C = 1;
}


You're in the middle of debugging of File2.php which has the following on top:
Code:

use A\B as D;

AND you add a Watch as: "D::C".

I expect it to display "1" in Watch value, however I'm getting an error that class "D" not found (or smth like that).

Unfortunately, PHPEd's support of namespaces and class aliases is very unstable (@var ["use" alias] does not always work). It is a source of daily frustrations.


@dmitri:
We're software developers ourselves and we know that to fix a problem you have to reproduce it first. But we would like to see more effort or help from your team working with us, trying to resolve those issues that are hard to reproduce. You do understand that I cannot zip up my entire project and send it over to you. So you really have to try to come up with something that will help us fix those bugs. It will make your product better and us - much happier.

Thanks,
Temuri
View user's profileFind all posts by temuriSend private message
fails to find static declarations
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic