*newbie* How do I use Find Word at Caret for member variables?

Find Word at Caret is a great feature but I can't figure out how to use it to find instances of a member variable inside a class.

For example: At the top of a class I have a variable e.g. private $vVar; If I position the caret on the vVar and press cntl+F3 I get '$vVar not found...'. The problem is that the 'select word' has included the $ of $vVar and, of course, all the other occurances if vVar in the class are referrenced as $this->vVar (without the $). Is there a better way to do this? Or can I change something (e.g. is there a regex for 'Select Word at Caret' that I could alter to not use the $ as par tof a word?)


Comment actions Permalink

Hi there,

Do not use "Find Word at Caret" for variables and similar stuff (methods/fields/classes/constants/etc).

Better use more appropriate actions (all under "Edit | Find" menu):

  • Find Usages... -- search across project (or selected scope) and all results will be listed in separate window
  • Show Usages... -- same as above but search results will be shown in overlay popup window
  • Find Usages in File -- searches for usages in local file only -- similar behaviour to "Find Word at Caret"
Comment actions Permalink

Thank you, that was very helpful.


Please sign in to leave a comment.