1

In Netbeans PHP if you control + mouse1 click on an object or variable it will go to the initial declaration, if it's in the same script.

But is there any way to make it go to the initial declaration if it was made inside a previously included script?

1 Answer 1

0

There may be a better way to do this, but this is my work around:

  1. Select or highlight the variable.
  2. Right click > Refactor > Rename...
  3. Change the name.
  4. Click the Preview button

Netbeans will then list all the occurrences of the variable within your project. From this list, you should be able to find where you initialized it.

Be sure to click the Cancel button, if you do not mean to rename the variable.

For the same results without refactoring, you can also use Edit > Find Usages.

3
  • hi thanks for your reply. Your method is a bit like the 'find usages' option, and would probably work in most instances but I have an enormous framework here with a number of global variables being used hundreds of times across numerous scripts, and working out where each had been instantiated is proving to be problematic.
    – Spoonface
    Jan 17, 2012 at 18:29
  • Ah. The Edit > Find Usages option is much simpler than what I suggested, although the result is effectively the same.
    – iglvzx
    Jan 17, 2012 at 18:32
  • hmm looks like it's not possible, so I might consider changing IDE's as this is a pretty big issue for me at the moment
    – Spoonface
    Jan 19, 2012 at 11:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .