Bug 149927 - Incremental find does not work in Eclipse
Incremental find does not work in Eclipse
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: eclipse (Show other bugs)
rawhide
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Andrew Overholt
:
: 150514 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-02-28 15:49 EST by Ziga Mahkovec
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-01-30 10:05:57 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Workaround for the lack of quoting regex constructs (1.99 KB, patch)
2005-03-07 08:00 EST, Ziga Mahkovec
no flags Details | Diff
Workaround for the lack of quoting regex constructs (3.54 KB, patch)
2005-03-13 16:28 EST, Ziga Mahkovec
no flags Details | Diff

  None (edit)
Description Ziga Mahkovec 2005-02-28 15:49:52 EST
Description of problem:
Incremental find does not work when editing files in Eclipse.

Version-Release number of selected component (if applicable):
eclipse-platform-3.1.0_fc-0.M5.6
libgcj4-4.0.0-0.27

How reproducible:
Always

Steps to Reproduce:
1.  Open a file in the editor.
2.  Select Edit/Incremental Find Next (or press Ctrl-J).
3.  Type the text to search for.
  
Actual results:
Nothing happens.

Expected results:
The mode and search string should be shown in the status bar.  Also, the text
should be incrementally searched for.

Additional info:

It the gnu.gcj.precompiled.db.path argument is removed from /usr/bin/eclipse,
the status bar does update, but Eclipse is still failing to find any text.
When using java-1.5.0-sun, it works fine.
Comment 1 Ziga Mahkovec 2005-03-05 15:58:03 EST
There seems to be a problem with text search in general.  E.g. if I bring up the
Find/Replace dialog (Ctrl-F) and try to search for a simple string (e.g.
"class"), no results are found (incorrectly).  Then I turn on the "Regular
expressions" option and it works fine.

This was with eclipse-platform-3.1.0_fc-0.M5.8.
Comment 2 Ziga Mahkovec 2005-03-07 07:58:20 EST
After further investigation, this looks like a problem with GNU Classpath's
regex implementation.  Eclipse makes use of the quoting regular expression
constructs (\Q and \E), which aren't implemented in gnu.regexp.RE.  A simple test:

    Pattern.compile("\\Q" + "boo" + "\\E").matcher("Peekaboo").find()

returns false using gcj and true using java-sun.

I'll file this in classpath's bugzilla; I'm also attaching a patch for
eclipse-3.1M5a which works around the problem.
Comment 3 Ziga Mahkovec 2005-03-07 08:00:04 EST
Created attachment 111736 [details]
Workaround for the lack of quoting regex constructs
Comment 4 Andrew Overholt 2005-03-08 12:48:53 EST
I'm trying this patch out now and if things go well, I'll rebuild with it!

Thanks!

Andrew
Comment 5 Andrew Overholt 2005-03-08 12:52:07 EST
*** Bug 150514 has been marked as a duplicate of this bug. ***
Comment 6 Andrew Overholt 2005-03-09 11:12:27 EST
Applying the patch lets things like Ctrl-F work but doesn't fix the
larger problem of the main search functionality not working.  I've put
the patch into a build that I'm doing now so hopefully that'll make test1.

Thanks again, Ziga.
Comment 7 Ziga Mahkovec 2005-03-09 17:21:21 EST
What are the other symptoms of search functionality not working?

I did find a couple of other cases where the said regex constructs
were used, but they seemed harmless (e.g.
RegExContentAssistProcessor.java).  Of course, there are other
shortcomings of there current java.util.regex implementation.  I'm
currently writing a Mauve test that should underline those.
Comment 8 Andrew Overholt 2005-03-10 09:35:09 EST
The main search function (the flashlight icon) when using the Files
tab (the left-most one) always seems to have the Search button
greyed-out.  (I'm not in front of a computer with Eclipse right now so
my from-memory bug comment may seem silly.  sorry ;)
Comment 9 Ziga Mahkovec 2005-03-13 16:26:12 EST
The disabled Search button was a native-only issue (could be worked around by
removing the gnu.gcj.precompiled.db.path argument).  However, this seems to be
fixed with the latest libgcj update (4.0.0-0.33) -- the Search button is now
enabled in both modes.

But even so, searching files only worked when regular expressions were enabled.
 This is again due to the use of quoting regex constructs (this time in
PatternConstructor).  I updated my previous patch; hopefully, this will fix all
search related problems.

Note that once the classpath bug[1] is resolved, this patch becomes obsolete.

[1] https://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=12307
Comment 10 Ziga Mahkovec 2005-03-13 16:28:00 EST
Created attachment 111954 [details]
Workaround for the lack of quoting regex constructs
Comment 11 Andrew Overholt 2005-03-16 16:53:56 EST
I've opened a new libgcj bug which is the same as your classpath bug, Ziga:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20504

I'm also trying a build right now with your updated patch.  I'll post back here
when it's done.

Thanks again for all your hard work, Ziga!
Comment 12 Andrew Overholt 2005-05-09 14:05:26 EDT
Things seem to work for me with gcc* >= 4.0.0-4 (not yet in rawhide IIRC). 
General search still seems screwy.

Still no news from the FSF, Ziga?
Comment 13 Ziga Mahkovec 2005-05-09 16:56:32 EDT
> Things seem to work for me with gcc* >= 4.0.0-4 (not yet in rawhide IIRC). 
> General search still seems screwy.

I couldn't test this with the latest version due to bug #157255 but last I
checked, searching worked fine with the patches (both incremental/editor search
and search in files).  Are you seeing the disabled button issue again?

> Still no news from the FSF, Ziga?

Unfortunately not.

Comment 14 Ziga Mahkovec 2005-05-09 17:02:20 EDT
Changing state back to NEEDINFO (Bugzilla changed it automatically)
Comment 15 Ziga Mahkovec 2005-05-16 19:57:08 EDT
I tried searching with eclipse-jdt-3.1.0_fc-0.M6.16 and libgcj-4.0.0-5.

I can confirm that there are problems with File Search again.  However, this
doesn't seem related to the regex issue we had before.  I couldn't get file
search to work properly even when using a patched gcc (the patch was committed
today, BTW).  Also, selecting "Regular expression" in the dialog box no longer
helps (previously it did).

This looks like an issue with the files included in search.  It seems that the
search results only include files that aren't opened.
Comment 16 Tony Tsui 2005-06-20 02:10:21 EDT
Hi,

I'm seeing the same behaviour with File Search that Ziga mentioned. The search
results only includes files which aren't opened.

I'm using:
- eclipse-platform-3.1.0_fc-0.RC2.2
- libgcj-4.0.0-9
Comment 17 Andrew Overholt 2006-01-17 11:45:18 EST
This works for me now.  Should we close?  Does it not work for anyone?
Comment 18 Ziga Mahkovec 2006-01-27 17:24:54 EST
(In reply to comment #17)
> This works for me now.  Should we close?  Does it not work for anyone?

Works for me as well with eclipse-platform-3.1.1-1jpp_1fc.FC4.12.  I think this
can be closed.
Comment 19 Andrew Overholt 2006-01-30 10:05:57 EST
(In reply to comment #18)
> (In reply to comment #17)
> > This works for me now.  Should we close?  Does it not work for anyone?
> 
> Works for me as well with eclipse-platform-3.1.1-1jpp_1fc.FC4.12.  I think this
> can be closed.

Great, thanks, Ziga!

Note You need to log in before you can comment on or make changes to this bug.