protected override async Task <IReadOnlyObservableSet> GetIncludedItemsAsync(IEnumerable <IVsHierarchyItem> rootItems) { if (this.branchDiffValidator.ValidateBranch(this.package)) { // Create new tag tables everytime the filter is applied BranchDiffFilterProvider.TagManager.CreateTagTables(); IVsHierarchyItem root = HierarchyUtilities.FindCommonAncestor(rootItems); if (this.branchDiffValidator.ValidateSolution(this.solutionDirectory)) { try { this.changeSet = this.branchDiffWorker.GenerateDiff(this.solutionDirectory, this.package.BranchToDiffAgainst); } catch (GitOperationException e) { this.errorPresenter.ShowError(e.Message); return(null); } IReadOnlyObservableSet <IVsHierarchyItem> sourceItems = await this.vsHierarchyItemCollectionProvider.GetDescendantsAsync( root.HierarchyIdentity.NestedHierarchy, CancellationToken); IFilteredHierarchyItemSet includedItems = await this.vsHierarchyItemCollectionProvider.GetFilteredHierarchyItemsAsync( sourceItems, ShouldIncludeInFilter, CancellationToken); return(includedItems); } } return(null); }
protected override async Task <IReadOnlyObservableSet> GetIncludedItemsAsync(IEnumerable <IVsHierarchyItem> rootItems) { IVsHierarchy solutionHierarchy = (IVsHierarchy)_serviceProvider.GetService(typeof(IVsSolution)); IReadOnlyObservableSet <IVsHierarchyItem> sourceItems = await _hierarchyCollectionProvider.GetDescendantsAsync(solutionHierarchy, CancellationToken); return(await _hierarchyCollectionProvider.GetFilteredHierarchyItemsAsync(sourceItems, ShouldIncludeInFilter, CancellationToken)); }
public FilesWithBookmarksFilteredHierarchyItemSet(IReadOnlyObservableSet <IVsHierarchyItem> allItems, IFilteredHierarchyItemSet filteredItems) { this.allItems = allItems; this.filteredItems = filteredItems; filteredItems.CollectionChanged += (sender, args) => CollectionChanged?.Invoke(sender, args); changedItem.Add(null); //must always have exactly 1 item }
protected override async Task <IReadOnlyObservableSet> GetIncludedItemsAsync(IEnumerable <IVsHierarchyItem> rootItems) { if (BranchDiffFilterValidator.ValidateBranch(this.package)) { // Create new tag tables everytime the filter is applied BranchDiffFilterProvider.TagManager.CreateTagTables(); IVsHierarchyItem root = HierarchyUtilities.FindCommonAncestor(rootItems); if (BranchDiffFilterValidator.ValidateSolution(this.solutionDirectory, this.solutionFile)) { try { // TODO: The solution directory path may not always be the Git repo path! // Git repo could be setup higher up. Write a service to find the Git repo upwards in the heirarchy and pass that here. this.changeSet = this.branchDiffWorker.GenerateDiff(this.solutionDirectory, this.package.BranchToDiffAgainst); } catch (GitOperationException e) { ErrorPresenter.ShowError(e.Message); return(null); } IReadOnlyObservableSet <IVsHierarchyItem> sourceItems = await this.vsHierarchyItemCollectionProvider.GetDescendantsAsync( root.HierarchyIdentity.NestedHierarchy, CancellationToken); IFilteredHierarchyItemSet includedItems = await this.vsHierarchyItemCollectionProvider.GetFilteredHierarchyItemsAsync( sourceItems, ShouldIncludeInFilter, CancellationToken); return(includedItems); } } return(null); }