Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to jump to initialization of an variable in Intellij

How to navigate to the initialization of a variable NOT its declaration?

I see people using the text search and try to find each assignment and I tend to find the usages of that variable and filter by hand the assignments to it. Both ways are not practical.

Is there any shortcut or usage search way of doing this faster?

like image 314
Zarathustra Avatar asked Oct 16 '25 09:10

Zarathustra


1 Answers

Hold ctrl and mouse click the instance of the variable. This will bring you to where the variable is created. If you initialized it later in the code, hold ctrl and mouse click the variable again (where it is created) and it will show you options of all places in the code where the variable is used - just click on the top one, which is likely the initialization.

like image 165
Shane Monks O'Byrne Avatar answered Oct 18 '25 22:10

Shane Monks O'Byrne