Automatically expand all in Eclipse Search results
Asked Answered
A

3

34

I usually want to have all the search results (from ctrl-H) fully expanded, but only the first leaf node is expanded by default.

What I end up doing is clicking the "Expand All" button in the Search view but this is tedious.

Is there a way to automatically have results fully expanded?

Aitken answered 11/5, 2012 at 14:36 Comment(2)
Possible duplicate of #3160291Lilalilac
Mark Search/ViewMenu/ShowAsList, and also SortBy/ParentName. The tree mode is very annoying indeed.Callender
Z
19

No but you can use the keyboard shortcuts of your OS. On Linux, use Nk* (* on the numpad) to expand the current node and all children.

Windows user can use Shift+Nk*

On the Mac, select all nodes with Command+A and then expand them with Command+Right Arrow

Zolnay answered 11/5, 2012 at 15:26 Comment(8)
Do you know the windows shortcut?Aitken
Any shortcut for Mac OS X? Cmd+Shift+Numpad_* is only working in the Editors and not in the Search Results. All I found is Alt+Right_Arrow, but you have to be on the root node, which is as tedious as using the (+) button.Thirlage
Do you know what the term for this function in Preferences -> Keys is? I would like to remap it, but can't find it.Psalter
@hheimbuerger: It's not in the preferences since it's the OS widgets default behavior (i.e. Java never notices this).Zolnay
@AaronDigulla I see. I was just hoping that as there's a toolbar button to trigger this, one could also bind it to a key.Psalter
Sometimes, there is a toolbar button but most of the time, it's only a "-" button (collapse all).Zolnay
On Mac it is Alt+Right Arrow or Alt+Left ArrowLibido
This only fully opens the current tree if you have clicked on any line in the search window. And you have to click on something because by default nothing is selected in the search window and the keypress will do nothing.Sequestration
H
3

On a Mac without the numpad, to avoid moving the mouse:

  • do the search

  • the focus moves in the search view

    (make sure to close the Find/Replace dialog before searching, otherwise it would take the focus)

  • do this sequence quickly:

    • Alt ⎇ + ▲ Up Arrow (select the root node)
    • Alt ⎇ + ◀ Left Arrow (collapse the root node)
    • Alt ⎇ + ► Right Arrow (expand the root node)

      (For some reason + doesn't expand all of the root children, first you have to collapse it.)

This is faster than clicking on the small + icon.

Homeroom answered 11/5, 2012 at 14:36 Comment(1)
This works for Spring Tool Suite as well, since it is built on top of Eclipse.Ordovician
E
3

On a Windows without a numpad, the following can help to expand the search result fast without click the mouse.

This method does not expand result instantly, but i found it to be more convenient and faster than using mouse to click the + button on Eclipse.

  1. After search, hold onto ► Right Arrow to expand one search result to its end root

  2. Once reached the end root, press ▼ Down Arrow to move on to the next search result, hold onto ► Right Arrow to expand one search result to its end root

  3. Repeat step 1 and step 2 until all results are expanded.
Endless answered 11/10, 2017 at 8:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.