Skip to content

Commit

Permalink
Remove concept of snapshot filters
Browse files Browse the repository at this point in the history
Over time we've worked towards removing the concept of filters. A recent change leaves only one such filter, meaning we can inline that instance, simplify it (as we don't need a general pattern), and remove the interface and supporting types needed for filters.
  • Loading branch information
drewnoakes committed Mar 23, 2022
1 parent 9243b38 commit 1530050
Show file tree
Hide file tree
Showing 9 changed files with 209 additions and 805 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Collections.Immutable;
using Microsoft.VisualStudio.ProjectSystem.Properties;
using Microsoft.VisualStudio.ProjectSystem.Tree.Dependencies.Models;
using Microsoft.VisualStudio.ProjectSystem.Tree.Dependencies.Snapshot.Filters;
using Microsoft.VisualStudio.ProjectSystem.VS.Tree.Dependencies;

namespace Microsoft.VisualStudio.ProjectSystem.Tree.Dependencies.Snapshot
Expand All @@ -27,23 +26,17 @@ internal sealed class DependenciesSnapshot
/// <item>the immutable <paramref name="previousSnapshot"/> if no changes were made.</item>
/// </list>
/// </summary>
/// <remarks>
/// As part of the update, each <see cref="IDependenciesSnapshotFilter"/> in <paramref name="snapshotFilters"/>
/// is given a chance to influence the addition and removal of dependency data in the returned snapshot.
/// </remarks>
/// <returns>An updated snapshot, or <paramref name="previousSnapshot"/> if no changes occurred.</returns>
public static DependenciesSnapshot FromChanges(
DependenciesSnapshot previousSnapshot,
TargetFramework changedTargetFramework,
IDependenciesChanges? changes,
IProjectCatalogSnapshot? catalogs,
ImmutableArray<TargetFramework> targetFrameworks,
TargetFramework? activeTargetFramework,
ImmutableArray<IDependenciesSnapshotFilter> snapshotFilters)
TargetFramework? activeTargetFramework)
{
Requires.NotNull(previousSnapshot, nameof(previousSnapshot));
Requires.NotNull(changedTargetFramework, nameof(changedTargetFramework));
Requires.Argument(!snapshotFilters.IsDefault, nameof(snapshotFilters), "Cannot be default.");

var builder = previousSnapshot.DependenciesByTargetFramework.ToBuilder();

Expand All @@ -57,8 +50,7 @@ public static DependenciesSnapshot FromChanges(
var newTargetedSnapshot = TargetedDependenciesSnapshot.FromChanges(
previousTargetedSnapshot,
changes,
catalogs,
snapshotFilters);
catalogs);

if (!ReferenceEquals(previousTargetedSnapshot, newTargetedSnapshot))
{
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 1530050

Please sign in to comment.