Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 477471

Summary: Search view: Remove 'Search Again' and 'Expand All' from context menu
Product: [Eclipse Project] Platform Reporter: Nobody - feel free to take it <nobody>
Component: SearchAssignee: Robert Roth <robert.roth.off>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: ben, daniel_megert, Lars.Vogel, robert.roth.off, sit1way, sxenos
Version: 4.5   
Target Milestone: 4.6 M7   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/70802
https://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=a122b64792a58d840d5963a7701ac9f5fff43b3b
https://git.eclipse.org/r/71098
https://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/?id=ea839f9a068fd3af39bd29b99960c0422dcac373
Whiteboard:
Bug Depends on:    
Bug Blocks: 515983    

Description Nobody - feel free to take it CLA 2015-09-15 11:42:31 EDT
When I refactor a project, I search for a string in all files. If Eclipse finds matches in several files and each file has several matches, I may adjust each file one by one.

After finishing one file, I wanted to be sure I hadn't forgotten to treat a match, so rather than deleting the file's match, I right-clicked the file in the Search view and selected "Search Again". To my surprise, rather than searching again in that file only, Eclipse searched all files (as if I had clicked the "Run the Current Search Again" icon at the top).

Beyond performance, this is bad because it can restore matches which I want to ignore. When I perform a search, I often start by deleting the matches which I do not want to treat. Deleting those again can take some time.

Using "Search Again" on a given file is probably not that useful to me if I had not tried it before, but if it's not going to be fixed to behave properly, at least it should be removed from the contextual menus.
Comment 1 Dani Megert CLA 2015-12-18 04:11:42 EST
The hover tells you that it performs the current search again.
Comment 2 Dani Megert CLA 2015-12-18 04:13:34 EST
I agree that it can be misleading when executing the action via context menu. We should remove it from there.

Hint: if you want to search again only on the files that you already worked on, you can select them in the Search view, press Ctrl+H and then choose to only search the selected resources.
Comment 3 Nobody - feel free to take it CLA 2015-12-18 07:52:12 EST
Thanks Dani.

I notice that this also happens with "Remove All Matches". Arguably, the actual effect is less surprising with this label.
There is also a "Replace all..."
Comment 4 Nobody - feel free to take it CLA 2015-12-29 09:05:12 EST
"Expand All" on a directory could also expand more than the user expects.
Comment 5 Robert Roth CLA 2016-04-15 12:45:28 EDT
So based on the description and comments the "Search Again" menu item from the search result context menu should be removed. The other topics (comment 3 and 4) seem like other issues, which should be treated separately, is that right?
Comment 6 Nobody - feel free to take it CLA 2016-04-15 12:56:18 EDT
(In reply to Robert Roth from comment #5)
> So based on the description and comments the "Search Again" menu item from
> the search result context menu should be removed.

Indeed, unless someone prefers to fix it, but it seems that will not happen soon.

> The other topics (comment
> 3 and 4) seem like other issues, which should be treated separately, is that
> right?

Since the fix must be similar, I will not say they *should* be treated separately. But they certainly *can*.
Comment 7 Eclipse Genie CLA 2016-04-16 05:15:49 EDT
New Gerrit change created: https://git.eclipse.org/r/70802
Comment 9 Lars Vogel CLA 2016-04-20 12:28:42 EDT
Thanks Robert. 

Note: I think on the same line we could also remove the "Expand all" entry from the context menu. This entry also ignores the selections and it feels weird that it does not only expand the selected tree element.
Comment 10 Eclipse Genie CLA 2016-04-20 17:09:49 EDT
New Gerrit change created: https://git.eclipse.org/r/71098
Comment 11 Robert Roth CLA 2016-04-20 17:15:01 EDT
Based on Filipus' (comment 4) and Lars' (comment 9) request I have proposed another commit for review, one removing the Expand All from the context menu.
Comment 13 Nobody - feel free to take it CLA 2016-06-23 17:43:54 EDT
I confirm that this is fixed, although the options were also removed from the menu which appears when clicking nowhere (in an empty part), which was not requested.

I have filed follow-up ticket #496692 regarding remaining actions which could be removed.
Comment 14 James Lang CLA 2016-07-15 09:02:17 EDT
Thumbs down to removing "Expand All" from context menu :\

Now one has to click tiny + icon instead of right-clicking *anywhere* in search results and down arrow key to "Expand All".

I find the old behavior more ergonomic as having to focus one's attention on the tiny + icon and then moving the pointer to that exact position is a hassle vs. right-click/down arrow key motion.
Comment 15 Stefan Xenos CLA 2016-10-03 16:55:11 EDT
I've filed bug 503155 to track comment 14. (I don't think we should put the action back on the context menu for reasons Lars has already described, but I *do* think we should make the action easier to discover and more efficient to activate for those that use it heavily.)
Comment 16 Dani Megert CLA 2017-02-14 12:39:40 EST
*** Bug 512192 has been marked as a duplicate of this bug. ***