Community
Participate
Working Groups
Created attachment 83359 [details] patch file Build ID: 200711200801 Steps To Reproduce: 1.Create a Hello World C++ Project. 2.Ctrl-H => C/C++ Search tab => fill in "main" for Search String => Hit Search. 3.Search view does not select the first match and expand like File and Java Search does. More information: User would like to see C/C++ tab as default upon Ctrl-H, should the last C/C++ search returns any matches. Following changes enable selecting the first match to guide Eclipse toward search tab of appropriate context: -PDOMSearchTreeContentProvider changes mimic what JDT does for setting up search tree, including converting some functions to synchronized. -Added PDOMSearchElementAdapterFactory, PDOMSearchElement now extends PlatformObject. These allow computeSource() in org.eclipse.search.internal.ui.SearchPageDescriptor to evaluate a score.
Created attachment 83914 [details] patch file A newer patch fixed some issues when search results are header files
Thanks Stanley, to fix the problem it is sufficient to remove the 'asyncExec' blocks, which is safe because the search-API guarantees to call the methods in the UI-thread. For the same reason it is not necessary to add synchronized sections. To make the score-evaluation work, I have implemented IAdaptable for the PDOMSearchElement directly and used the full-path there, because it is more efficient. Fixed in 5.0 > 20071210.