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

Bug 68157

Summary: Search for file occurences keybinding doesn't work
Product: [Eclipse Project] JDT Reporter: Jean-Michel Lemieux <jean-michel_lemieux>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: grant_gayed, jerome_lanneluc
Version: 3.0   
Target Milestone: 3.0 RC4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch for CompilationUnitDocumentProvider none

Description Jean-Michel Lemieux CLA 2004-06-22 09:38:33 EDT
RC3 - 20040622:00:10

I opened org.eclipse.ui.examples.jobs.views.JobsView added a field to the
classes saved the file (note at this point there are no errors or warnings in
the file) then clicked on another existing field and pressed CTRl+SHIFT+U. All I
got was a beep. I get this a lot and it is really annoying because I rely on
this search function, I love it! 

The message in the status line when this happens is "element is not a java
element". 

So here are the exact steps to reproduce 100% of the time (note that I have
analyse annotations while typing turned off):
1. open JobsViews (org.eclipse.ui.examples.jobs plugin)
2. click on userField attribute and ctrl+shirt+u works.
3. add an attribute to the end of the Button fields. Don't save yet.
4. Click on another attribute and ctrl+shirt+u. Beep. Nothing happens.
4. save and the file compiles without errors.
5. click on userField again and then ctrl+shirt+u. It no longer works and the
above error message is shown in the status line. 

Closing and then opening the editor will get you out of this state. but this is
happening all the time and at first I thought it was a  keybinding problem, but
it actually looks like a java search issue.
Comment 1 Jean-Michel Lemieux CLA 2004-06-22 09:40:36 EDT
I'm marking as critical because this is a regression. This had always worked and
now I have to close/re-open editors all the time.
Comment 2 Dirk Baeumer CLA 2004-06-22 11:13:44 EDT
Disucssed it with Kai, and the problem is that as soon as analyse annotations 
while typing is turned off the editor doesn't refresh the AST anymore. The 
find occurrences action takes tha AST from the editor.
Comment 3 Kai-Uwe Maetzel CLA 2004-06-22 15:28:46 EDT
The problem is that an AST is constructed by core but this AST does not 
contain the full information. We set the problem requestor of the compilation 
unit to inactive when we are not interested in problems. The side effect it 
seems is that an empty AST is constructed.
Comment 4 Kai-Uwe Maetzel CLA 2004-06-22 15:40:24 EDT
The simplest fix at this point in time is that the compilation unit annotation 
model that implements the problem requestor interface distinguishes between 
internal and external activation state. The external activation state would 
then only be used by JCore and always return true. The internal state would 
depend on the preference setting.
Comment 5 Kai-Uwe Maetzel CLA 2004-06-22 15:42:55 EDT
Created attachment 12689 [details]
patch for CompilationUnitDocumentProvider
Comment 6 Jerome Lanneluc CLA 2004-06-23 06:23:38 EDT
With the proposed solution, users won't be able to disable code resolution 
(which is CPU intensive). This means that editing a very large compilation 
unit can become tedious as the code resolution can take several seconds.
Comment 7 Kai-Uwe Maetzel CLA 2004-06-23 06:29:25 EDT
No, in this scenario editing is not impacted at all.
Comment 8 Kai-Uwe Maetzel CLA 2004-06-23 13:04:44 EDT
Build I200406231600.
Comment 9 Andre Weinand CLA 2004-06-25 08:46:39 EDT
Verified for I20040625.

both problems are fixed:
- after adding another field to the Button fields (step3), and then clicking on another field and
  pressing ctrl+shirt+u (setp 4), no beep occurs and Occurrences in File works correctly.
- adter saving ctrl+shirt+u works too, and there is no error message in the status line.
Comment 10 Dani Megert CLA 2004-09-14 07:07:51 EDT
*** Bug 65178 has been marked as a duplicate of this bug. ***
Comment 11 Dani Megert CLA 2004-10-21 07:54:41 EDT
For a follow-up see bug 76738.