Community
Participate
Working Groups
Created attachment 166598 [details] Fix testing both Follow-up to bug 292924 (and bug 299151 and bug 310687) In 3.5, the score for file extensions always won. Now, an ISearchPageScoreComputer is always tested first, but even if it returns UNKNOWN, the whole computeScore(..) method returns UNKNOWN, without further testing whether there is a score for file extensions. We should at least fall back to the file extension if the ISearchPageScoreComputer returned UNKNOWN. I would even do both tests and return the higher of the scores. The patch implements this strategy.
Makes sense.
The extension point doc says: Note: This only applies if there is no org.eclipse.search.ui.ISearchPageScoreComputer adapter for the selected element. Hence we should not try both but fall back in case of unknown and mention this case in the extension point doc. Markus, do you agree?
(In reply to comment #2) That note has only been added during 3.6 (with bug 292924). Before, the ISearchPageScoreComputer was not even mentioned, and clients could assume that the "extensions" list was the only weight that was used. I think trying both mechanism offers the maximum flexibility and does not cause more problems than always letting the ISearchPageScoreComputer win if it has a score.
Oh, yes, you are right. The note was added in 3.6. Then I agree. I take your patch plus adjust the extension point doc. I guess it's now time for you to get commit rights here ;-)
Fixed in HEAD with attached patch plus updated doc. Available in build > N20100501-2000.
Verified in N20100516-2000.