Tips & Tricks

Do you know where ‘Go To…’ can get you?

How often do you use ‘Go To Class/File/Symbol’ feature in IntelliJ IDEA? Pretty often I would guess. But do you know everything you can do with it? Let me go through a couple of often overlooked gems.

Do you know that when you search for file or class you can preview an image (Ctrl-Shift-I) or see a quick doc (Ctrl-Q)?

It is also possible to open multiple items in the editor (multiselect with Ctrl or Shift) or run multiple selected tests right from the search (Ctrl-Shift-F10).

And you can open all search results in the ‘Find’ tool-window to process them one by one later.

Did I mention your favorite feature? No? Please, share it with everyone! πŸ™‚

Comments below can no longer be edited.

9 Responses to Do you know where ‘Go To…’ can get you?

  1. Avatar

    BenP says:

    January 19, 2012

    My favourite use is simply Find Usages (Alt+F7) from a Go To Class dropdown. It means that you don’t need to open the class before looking for references.

  2. Avatar

    Eugene Toporov says:

    January 19, 2012

    @BenP: A nice one!

  3. Avatar

    Bill says:

    January 19, 2012

    I love reading these tips, but is there a manual somewhere explaining all of them? I feel like I’m getting a few intriguing tidbits from these blog posts, but how do I get the whole picture?

  4. Avatar

    Carsten Schlipf says:

    January 20, 2012

    My favorite is that you can start with the first letters of the parts of a camel case type without completing the separated words. E.g. for finding ExtractClassTest you can type ExtClTe or even just ECT.

  5. Avatar

    BenP says:

    January 20, 2012

    One enhancement to this feature would be to specify a line number. If I’m reading a stack trace from a log file, sometimes I want to go to MyClass line 90, I need to go to the class first, then Ctrl+G, type ’90’, enter. It’s a lot of keystrokes.

    I’ve often wondered why I can’t type Ctrl+N, MyClass:90, enter, which opens MyClass and positions the cursor at line 90.

  6. Avatar

    Alexander Doroshko says:

    January 20, 2012

    @BenP you can do it using Go To File action (Ctrl+Shift+N)

  7. Avatar

    Philip Herbst says:

    January 20, 2012

    I often wondered why “go to line” doesn’t work with Ctrl+N?

  8. Avatar

    BenP says:

    January 20, 2012

    @Alexander oh, you’re right.. How come it doesn’t work on Go To Class too?

  9. Avatar

    Alexander Doroshko says:

    January 20, 2012

    @BenP Files have lines. Classes have fields, methods, etc., but no lines.

Discover more