public void PresentRoot(CallHierarchyItem root) { var callHierarchy = _serviceProvider.GetService(typeof(SCallHierarchy)) as ICallHierarchy; callHierarchy.ShowToolWindow(); callHierarchy.AddRootItem((ICallHierarchyMemberItem)root); }
internal void VerifyResult(CallHierarchyItem root, string searchCategory, string[] expectedCallers, CallHierarchySearchScope scope = CallHierarchySearchScope.EntireSolution, IImmutableSet <Document> documents = null) { this.SearchRoot(root, searchCategory, (CallHierarchyItem c) => { Assert.Contains(ConvertToName(c), expectedCallers); }, scope, documents); }
internal void VerifyRoot(CallHierarchyItem root, string name = "", string[] expectedCategories = null) { Assert.Equal(name, ConvertToName(root)); if (expectedCategories != null) { var categories = root.SupportedSearchCategories.Select(s => s.DisplayName); foreach (var category in expectedCategories) { Assert.Contains(category, categories); } } }
internal void SearchRoot(CallHierarchyItem root, string displayName, Action<ICallHierarchyNameItem> verify, CallHierarchySearchScope scope, IImmutableSet<Document> documents = null) { var callback = new MockSearchCallback(verify); var category = root.SupportedSearchCategories.First(c => c.DisplayName == displayName).Name; if (documents != null) { root.StartSearchWithDocuments(category, scope, callback, documents); } else { root.StartSearch(category, scope, callback); } callback.WaitForCompletion(); }
internal void SearchRoot(CallHierarchyItem root, string displayName, Action <ICallHierarchyNameItem> verify, CallHierarchySearchScope scope, IImmutableSet <Document> documents = null) { var callback = new MockSearchCallback(verify); // Assert we have the category before we try to find it to give better diagnosing Assert.Contains(displayName, root.SupportedSearchCategories.Select(c => c.DisplayName)); var category = root.SupportedSearchCategories.First(c => c.DisplayName == displayName).Name; if (documents != null) { root.StartSearchWithDocuments(category, scope, callback, documents); } else { root.StartSearch(category, scope, callback); } callback.WaitForCompletion(); }
internal void Navigate(CallHierarchyItem root, string searchCategory, string callSite, CallHierarchySearchScope scope = CallHierarchySearchScope.EntireSolution, IImmutableSet<Document> documents = null) { CallHierarchyItem item = null; this.SearchRoot(root, searchCategory, (CallHierarchyItem c) => item = c, scope, documents); if (callSite == ConvertToName(item)) { var detail = item.Details.FirstOrDefault(); if (detail != null) { detail.NavigateTo(); } else { item.NavigateTo(); } } }
public void PresentRoot(CallHierarchyItem root) { this.PresentedRoot = root; }