I implement IVsSimpleLibrary2 and IVsSimpleObjectList2 for "find all reference".. and I could query result from list.. While, whenever code run into method doSearch()..GetList2 of IVsSimpleLibrary seems to be called twice and return double information of results..How did it happened?
Code's below:
IVsObjectSearch search = GetService(typeof (SVsObjectSearch)) as IVsObjectSearch; IVsFindSymbol find = search as IVsFindSymbol; criteria = new VSOBSEARCHCRITERIA2[1]; criteria[0].eSrchType = VSOBSEARCHTYPE.SO_ENTIREWORD; criteria[0].grfOptions = (uint)(_VSOBSEARCHOPTIONS.VSOBSO_CASESENSITIVE | _VSOBSEARCHOPTIONS.VSOBSO_LOOKINREFS); criteria[0].szName = strText; Guid g = new Guid("0925166e-a743-49e2-9224-bbe206545104"); ObjectLib = new SearchLibrary(g, strText); uint SearchCookie; IVsObjectManager2 objManager = GetService(typeof(SVsObjectManager)) as IVsObjectManager2; objManager.RegisterSimpleLibrary(ObjectLib, out SearchCookie); int returnValue = find.DoSearch(ref g, criteria);