Bug 268797 - Option to have search automatically refresh
Summary: Option to have search automatically refresh
Status: CLOSED DUPLICATE of bug 303517
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Search (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-Search-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 290820 300419 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-03-16 10:29 EDT by Christopher Barber CLA
Modified: 2011-11-09 05:03 EST (History)
7 users (show)

See Also:


Attachments
patch 1 (3.81 KB, patch)
2011-02-17 10:04 EST, James Blackburn CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Barber CLA 2009-03-16 10:29:15 EDT
I would like an option to cause search to automatically refresh files that it discovers are out-of-date. Currently, I just get an error at the end of the search, which requires me to do a refresh and start the search over again. This can be tedious when searching large projects. If search can detect that a file is out of date, then surely it could refresh the file before searching its contents.

BTW, I do have the workspace set to refresh automatically and that does not eliminate my problem.
Comment 1 astifter Mising name CLA 2009-03-30 13:46:40 EDT
I also would _really_ like to see this kind of functionality. An alternative would be an option to just ignore files that are out of sync. 

AFAIR these messages were not part of earlier Eclipse versions and the really bug me because I want to retain the freedom to have external tools (builds, editors) change files and _not_ have me buged about it when doing a simple file grep.

This would make eclipse so much more usable (again...)

Andi
Comment 2 Dani Megert CLA 2009-03-31 02:38:47 EDT
AFAIK the message was always there. Note that you can enable to automatically refresh the resource (Window > Preferences > General > Workspace).
Comment 3 astifter Mising name CLA 2009-03-31 02:59:36 EDT
(In reply to comment #2)
> AFAIK the message was always there. Note that you can enable to automatically
> refresh the resource (Window > Preferences > General > Workspace).
> 

I haven't changed my style of working lately and after working on some small project (where I use vim) and upgrading to eclipse 3.4 this message bugs me totally so I guess it was not there in previous version like 3.2. 

The automatic refresh is not an alternative to disabling this message since I have a 400 MB C++ source tree and a make in that tree touches an awful lot of files and this files are not interesting to the search. So there is no need that my disk grinds away, reading or updating files, when all I want is to search the sources that haven't changed. 

So it would be great to have a option to turn this message of.

Thanks, Andi
Comment 4 Dani Megert CLA 2009-03-31 03:02:03 EDT
>So there is no need
>that my disk grinds away, reading or updating files, when all I want is to
>search the sources that haven't changed. 
So, you are saying that you know which files are out-of-sync and you are not interested in results in these files?
Comment 5 astifter Mising name CLA 2009-03-31 04:08:04 EDT
(In reply to comment #4)
> >So there is no need
> >that my disk grinds away, reading or updating files, when all I want is to
> >search the sources that haven't changed. 
> So, you are saying that you know which files are out-of-sync and you are not
> interested in results in these files?
> 
Yes. :-) The out-of-sync files are make-generated and usually (besides a few map-files) not human readable anyway. 

(In reply to comment #3)
> > AFAIK the message was always there. Note that you can enable to automatically
> > refresh the resource (Window > Preferences > General > Workspace).
> 
> I haven't changed my style of working lately and after working on some small
> project (where I use vim) and upgrading to eclipse 3.4 this message bugs me
> totally so I guess it was not there in previous version like 3.2. 

I have just checked. Eclipse 3.2 does not give this message.

I created a hello world java project (one java file) in Eclipse 3.2 and searched for "Hello". 1 Item found. Then I touched the file and searched again, nothing found and there is no error message. Eclipse 3.2 just skips this file.
After I refresh the "Hello" is again found once. 

I guess the new behaviour (giving a error message when files are out of sync and thus not searched) is good for most people because they want accurate search results. But for some people there is the need to be able to turn of this message since they have changed files in their workspace all the time. 

Another option would be to have the number of skipped (because they were out of sync) files in the status message of the search dialog. Now it reads "'Hello' - 0 matches in workspace (*.java)" and displays the error message. It would be better to skip the error message and have the status says something like "'Hello' - 0 matches in workspace, 1 skipped because out of sync (*.java)".

I so sorry that my laking java skills prevent me from doing this myself....

Andi
Comment 6 Dani Megert CLA 2009-03-31 04:20:53 EDT
>Yes. :-) The out-of-sync files are make-generated and usually (besides a few
>map-files) not human readable anyway. 
Then, simply create a working set where those files aren't present. This not only solves your problem but makes the search faster. Another option to mark the folder where the generated files are as derived. Search can exclude such folders.

>I have just checked. Eclipse 3.2 does not give this message.
Right, we always detected and logged it but since 3.4 we also report it to the user because ignoring such files can lead to problems, e.g. a user might think the can delete something because the string was not found.
Comment 7 astifter Mising name CLA 2009-03-31 04:43:43 EDT
(In reply to comment #6)
> >Yes. :-) The out-of-sync files are make-generated and usually (besides a few
> >map-files) not human readable anyway. 
> Then, simply create a working set where those files aren't present. This not
> only solves your problem but makes the search faster. Another option to mark
> the folder where the generated files are as derived. Search can exclude such
> folders.
Problem is: I don't want to exclude this files from search completely because sometimes its necessary to search them (map-files again...). Working sets are also no workaround for me because I search fast (Ctrl-H) and often and usually I don't use the mouse for that. So selecting between workspace and working-set search is just to slow for me. (Also, in my opinion are working sets a little to cumbersome to manage.)

> >I have just checked. Eclipse 3.2 does not give this message.
> Right, we always detected and logged it but since 3.4 we also report it to the
> user because ignoring such files can lead to problems, e.g. a user might think
> the can delete something because the string was not found.
> 
I'm not arguing to hide this fact from the user again. I just want to have this information in a more usable an unobtrusive way. The fact that Eclipse does it without error messages poping up is one of the great things about it. 

I just would like to have this information somewhere else where its present but not annoying (like for examle in the search status line in the Search view.

Comment 8 Dani Megert CLA 2009-10-05 05:51:22 EDT
>The automatic refresh is not an alternative to disabling this message since I
>have a 400 MB C++ source tree and a make in that tree touches an awful lot of
>files and this files are not interesting to the search.
Well, if you search a string in the workspace, then the new desired option to automatically refresh out-of-date files would exactly do this ;-)

Search should simply honor the preference from Window > Preferences > General > Workspace.
Comment 9 Dani Megert CLA 2009-10-05 06:07:08 EDT
*** Bug 290820 has been marked as a duplicate of this bug. ***
Comment 10 Dani Megert CLA 2010-01-22 02:21:05 EST
*** Bug 300419 has been marked as a duplicate of this bug. ***
Comment 11 Dani Megert CLA 2011-02-17 09:54:48 EST
*** Bug 337446 has been marked as a duplicate of this bug. ***
Comment 12 James Blackburn CLA 2011-02-17 10:04:17 EST
Created attachment 189192 [details]
patch 1

Bug 337446 comment 1

> > This attached patch lets Text Search handle out-of-sync resources gracefully.
> Sorry, but that's not what we want.

Umm can you go into more depth on what's wrong with my patch Dani? 
The workspace will bring the files back into sync very quickly, and the text search for out-of-sync resources is just as valid as for in-sync resources, isn't it?

Granted newly added files would be missed. But the attached patch fixes the case users hit 99% of the time.
Comment 13 Dani Megert CLA 2011-02-17 10:08:15 EST
>Umm can you go into more depth on what's wrong with my patch Dani? 
The client code should never force the refresh. However, an option could be to honor the refresh setting (see comment 8).
Comment 14 James Blackburn CLA 2011-02-17 10:12:13 EST
(In reply to comment #13)
> >Umm can you go into more depth on what's wrong with my patch Dani? 
> The client code should never force the refresh. However, an option could be to
> honor the refresh setting (see comment 8).

Agreed.  That's not what bug 337446 is about. It's just about handling out-of-sync files gracefully and will improve the experience mentioned in comment 0, comment 1 and comment 3.
Comment 15 Dani Megert CLA 2011-02-17 10:14:58 EST
*** Bug 337446 has been marked as a duplicate of this bug. ***
Comment 16 Dani Megert CLA 2011-02-17 10:32:01 EST
*** Bug 337446 has been marked as a duplicate of this bug. ***
Comment 17 Dani Megert CLA 2011-11-09 05:03:11 EST

*** This bug has been marked as a duplicate of bug 303517 ***