コード例 #1
0
        public void PresentRoot(CallHierarchyItem root)
        {
            var callHierarchy = _serviceProvider.GetService(typeof(SCallHierarchy)) as ICallHierarchy;

            callHierarchy.ShowToolWindow();
            callHierarchy.AddRootItem((ICallHierarchyMemberItem)root);
        }
コード例 #2
0
 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);
 }
コード例 #3
0
        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);
                }
            }
        }
コード例 #4
0
        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();
        }
コード例 #5
0
        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();
        }
コード例 #6
0
        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();
                }
            }
        }
コード例 #7
0
 public void PresentRoot(CallHierarchyItem root)
 {
     this.PresentedRoot = root;
 }