Skip to content

Commit

Permalink
Merge pull request #7992 from drewnoakes/remove-dependency-snapshot-f…
Browse files Browse the repository at this point in the history
…ilters

Remove concept of snapshot filters from dependency tree data handling
  • Loading branch information
drewnoakes authored Mar 24, 2022
2 parents d6a909b + 9d10a17 commit 4d57375
Show file tree
Hide file tree
Showing 11 changed files with 210 additions and 829 deletions.
12 changes: 5 additions & 7 deletions docs/repo/dependencies-node-roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,8 @@ Additionally, third parties may provide extensions (see [Extensibily model](#ext
This diagram gives an insight into the flow of data through the dependencies tree subsystem for top-level dependencies obtained via MSBuild.

```mermaid
%% TODO add click handlers:
%% click A "https://github.com/dotnet/project-system/..." "Click to view source"
flowchart LR
subgraph UnconfiguredProject Scope
filters[IDependenciesSnapshotFilter]
handlers[IDependenciesRuleHandler]
subgraph ConfiguredProject Scope
direction TB
Expand All @@ -55,12 +51,16 @@ flowchart LR
evaluation == "snapshot + delta" ==> DependencyRulesSubscriber
design-time-build == "snapshot + delta" ==> DependencyRulesSubscriber
handlers -- "import many" -.-> DependencyRulesSubscriber
filters -- "import many" -.-> DependencyRulesSubscriber
DependencyRulesSubscriber -- "IDependenciesChanges (delta)" --> DependenciesSnapshotProvider
IDependenciesTreeViewProvider["IDependenciesTreeViewProvider.BuildTreeAsync"]
DependenciesSnapshotProvider == DependenciesSnapshot ==> IDependenciesTreeViewProvider
IDependenciesTreeViewProvider -- IProjectTree --> ProjectTreeProviderBase.SubmitTreeUpdateAsync
end
click handlers "https://github.com/dotnet/project-system/blob/main/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Tree/Dependencies/CrossTarget/IDependenciesRuleHandler.cs" "Click to view source"
click DependencyRulesSubscriber "https://github.com/dotnet/project-system/blob/main/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Tree/Dependencies/Subscriptions/DependencyRulesSubscriber.cs" "Click to view source"
click IDependenciesTreeViewProvider "https://github.com/dotnet/project-system/blob/main/src/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Tree/Dependencies/IDependenciesTreeViewProvider.cs" "Click to view source"
click DependenciesSnapshotProvider "https://github.com/dotnet/project-system/blob/main/src/src/src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Tree/Dependencies/Subscriptions/DependenciesSnapshotProvider.cs" "Click to view source"
```

Bold lines indicate Dataflow subscriptions.
Expand Down Expand Up @@ -217,8 +217,6 @@ The _Web Tools Extensions_ project is a good example of a project flavor that do
[IProjectDependenciesSubTreeProvider]: /src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Tree/Dependencies/IProjectDependenciesSubTreeProvider.cs "IProjectDependenciesSubTreeProvider.cs"
[IDependencyViewModel]: /src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Tree/Dependencies/Models/IDependencyViewModel.cs "IDependencyViewModel.cs"
[DependenciesSnapshot]: /src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Tree/Dependencies/Snapshot/DependenciesSnapshot.cs "DependenciesSnapshot.cs"
[IDependenciesSnapshotFilter]: /src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Tree/Dependencies/Snapshot/Filters/IDependenciesSnapshotFilter.cs "IDependenciesSnapshotFilter.cs"
[DependenciesSnapshot]: /src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Tree/Dependencies/Snapshot/DependenciesSnapshot.cs "DependenciesSnapshot.cs"
[IDependency]: /src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Tree/Dependencies/Snapshot/IDependency.cs "IDependency.cs"
[TargetedDependenciesSnapshot]: /src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Tree/Dependencies/Snapshot/TargetedDependenciesSnapshot.cs "TargetedDependenciesSnapshot.cs"
[DependenciesRuleHandlerBase]: /src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Tree/Dependencies/Subscriptions/RuleHandlers/DependenciesRuleHandlerBase.cs "DependenciesRuleHandlerBase.cs"
Expand Down
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.

This file was deleted.

Loading

0 comments on commit 4d57375

Please sign in to comment.