Go To > Declaration question

From memory the older PhpStorm 1 had a slightly different Go To > Declaration functionality. It seemed to be more leanient.


$foo = new my_class();
$bar -> my_unique_method_name();
class my_class{
  public function my_unique_method_name(){

when clicking Go To > Declaration (Ctrl+B or Ctrl+click) it would take me to "my_unique_method_name" even though it couldn't directly resolve it.

since there is only one declaration of "my_unique_method_name" in the entire project.

Currently it seems in PhpStorm 2 if the IDE cannot directly resolve the declaration of the method it will not take you there.
eg: if the $bar object is defined through some weird "global" or "eval" situation.

I was wondering if there is an option to turn on this more generaic "go to declaration" that I can remember from older phpstorm versions?

(sorry if I'm mistaken)


Comment actions Permalink

(deleted this post)

Comment actions Permalink

What version are you using?

in 2.0.1 and the new EAP version just released on the 11th if you right click or highlight and right click the variable or function or css declaration and choose "go to" you are presented with 4 options that allow you to either be shown or go directly to the declaration.  The keyboard keys are shown also.

I am using WIndows XP I do not know what the shortcut keys are for other op sys.

CTRL+B  == Go to Declaration

CTRL+SHIFT+B == Go to Type Declaration

Type Declaration for CSS tags opens up the CSS file and places the cursor or carret at the beginning of the line the of the declaration.

You can also view all usages of that CSS tag or variable or function etc etc... throughout your entire project.   I love this because it shows where I am writing to and taking out from the php variable.  Totally AWESOME!
I had a lot of questions and suggestions about how to make the IDE better too, but 99% of my suggestions are already included in the product it just takes time to figure out where all the settings are and what it is called in the IDE.

I am really interested in the new features they added in the new EAP, I am waiting on the blog posts that describe how to use them because I can't find any info anywhere about them, like the new htaccess feature.  I see the plugin in the plugin menu but no docs on it yet at least none I can find.  Anyway, it is great this forum is here because most of the things I was looking for and how to use I figured out with help from the forum.

Comment actions Permalink

yep EAP PS-106.444

screenshot showing a very simplified version of my issue:

welcome to try yourself.

Comment actions Permalink

Nope. This "heurisric" was dliberately removed in 2.0 due to huge amount of false positives.

You need to provide proper type annotations, i.e.

/** @var $something_tricky my_class */


Please sign in to leave a comment.