Bug 62177 - search for extension point references fails
Summary: search for extension point references fails
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 RC4   Edit
Assignee: PDE-UI-Inbox CLA Friend
QA Contact:
URL:
Whiteboard:
Keywords:
: 68119 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-05-13 16:35 EDT by Rafael Chaves CLA Friend
Modified: 2004-06-21 23:45 EDT (History)
3 users (show)

See Also:


Attachments
Patch for pde-ui (1.17 KB, patch)
2004-06-21 18:40 EDT, Wassim Melhem CLA Friend
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Chaves CLA Friend 2004-05-13 16:35:55 EDT
i200405130010

This is probably known, but... for new-style plug-in manifests (like
core.runtime's), that do not contain a plug-in identifier, searching for
references to any of its extension points fails to find any results.
Comment 1 Wassim Melhem CLA Friend 2004-05-29 23:52:25 EDT
Using RC1, I searched for extension points/extensions starting with 
org.eclipse.core.runtime.* and I got all the correct hits including the ones 
in the plugin.xml of org.eclipse.core.runtime.
Comment 2 Wassim Melhem CLA Friend 2004-06-21 17:20:09 EDT
Actually, there is certainly a problem.  Whe I closed the defect as 
worksforme, I had verified that searching for references to an extension point 
such as "org.eclipse.core.runtime.applications" is fine through the Search 
page and it was.

The problem here is when you do it in the plugin manifest editor, you will get 
0 references.

This is because when we do a search for a reference to an extension point, we 
implicitly prepend the id of the plugin.  So in this case, when 
selecting "applications", we ask its model for its id, which should 
return "org.eclipse.core.runtime".

When the editor is open however, the extension point comes from the plugin.xml 
that contains no plugin id, so when we ask the model for the plugin.xml for 
its id, it returns null, and hence no search hits are found.

Need to investigate the value/risk ratio.
I can't believe this one fell through the cracks.
Comment 3 Wassim Melhem CLA Friend 2004-06-21 17:20:47 EDT
Reopening...
Comment 4 Rafael Chaves CLA Friend 2004-06-21 17:37:19 EDT
That makes bug 68119 a duplicate of this one, doesn't it?
Comment 5 Jeff McAffer CLA Friend 2004-06-21 17:43:05 EDT
looks like a readme bug
Comment 6 Wassim Melhem CLA Friend 2004-06-21 17:46:11 EDT
*** Bug 68119 has been marked as a duplicate of this bug. ***
Comment 7 Wassim Melhem CLA Friend 2004-06-21 17:51:22 EDT
To do a proper fix is too risky and too elaborate.  It becomes an extremely 
difficult problem to solve properly when opening the plugin.xml on an external 
file using the Plugins view.

There are workarounds as described in bug 68119.

One workaround that PDE could do and would require a one-character change in 
our code is to prepend '*' to the search string if a plugin id is null.

So the search string would be '*.applications', which would pick up all the 
hits.  This, of course, would be error-prone if more than one extension point 
had the same id, and yet they were declared by different plugins.

So it's either a README or the '*' change.  

Dejan, thoughts?
Comment 8 Dejan Glozic CLA Friend 2004-06-21 17:55:35 EDT
When I perform a Java search for a method, sometimes I get lots of hits - 
method with the same name in unrelated classes. In other words, I have seen 
Java search give me more results than I need i.e. not very precise. 

I would rather have that than 0 hits. I vote for '*'. Can you try it out and 
give it a test using real-world extension point. We need to find out how 
frequently will the users get the 'false' hits. 
Comment 9 Wassim Melhem CLA Friend 2004-06-21 17:57:14 EDT
In the Eclipse SDK as it is today, you would get 0 false hits.
Comment 10 Dejan Glozic CLA Friend 2004-06-21 18:01:50 EDT
I know :-).

Please use the '*' workaround in your workspace and try some searches.
Comment 11 Wassim Melhem CLA Friend 2004-06-21 18:26:37 EDT
comment #9 was not a conjecture/prediction.  It was based on me testing 
the '*' change.

So the sensible thing to do is to do this minor change and add a README entry, 
that there is a theoretical possibility the search might return a false hit if 
two plug-ins that both use a manifest.mf happen to declare an extension point 
by the same id.
Comment 12 Wassim Melhem CLA Friend 2004-06-21 18:27:33 EDT
I will attach the patch very shortly.  

We're soliciting for two votes for RC4.
Dejan? Jeff?
Comment 13 Dejan Glozic CLA Friend 2004-06-21 18:28:33 EDT
+1
Comment 14 Wassim Melhem CLA Friend 2004-06-21 18:40:35 EDT
Created attachment 12619 [details]
Patch for pde-ui

Dejan and Cherie, please review patch.
Comment 15 Cherie Wong CLA Friend 2004-06-21 19:01:44 EDT
Verified.

+1
Comment 16 Dejan Glozic CLA Friend 2004-06-21 19:16:05 EDT
Patch looks good - +1.
Comment 17 Jeff McAffer CLA Friend 2004-06-21 23:31:00 EDT
+1 
Comment 18 Wassim Melhem CLA Friend 2004-06-21 23:45:35 EDT
Marking as fixed.