Skip to content

Commit

Permalink
Merge pull request #9049 from drewnoakes/dep-tree-capabilities
Browse files Browse the repository at this point in the history
Tighten AppliesTo filtering in dependencies tree
  • Loading branch information
drewnoakes authored Oct 12, 2023
2 parents d0efb44 + 4c42a12 commit 7318cf3
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
namespace Microsoft.VisualStudio.ProjectSystem.Tree.Dependencies.Subscriptions.MSBuildDependencies;

[Export(typeof(IMSBuildDependencyFactory))]
[AppliesTo(ProjectCapability.DependenciesTree)]
// There's no "AnalyzerReferences" capability, and F# doesn't have analyzers
[AppliesTo(ProjectCapability.DependenciesTree + " & (" + ProjectCapability.CSharp + " | " + ProjectCapability.VisualBasic + ")")]
internal sealed class AnalyzerDependencyFactory : MSBuildDependencyFactoryBase
{
// NOTE we include ProjectTreeFlags.FileSystemEntity here so that Roslyn can correctly identify the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Microsoft.VisualStudio.ProjectSystem.Tree.Dependencies.Subscriptions.MSBuildDependencies;

[Export(typeof(IMSBuildDependencyFactory))]
[AppliesTo(ProjectCapability.DependenciesTree)]
[AppliesTo(ProjectCapability.DependenciesTree + " & (" + ProjectCapabilities.AssemblyReferences + " | " + ProjectCapabilities.WinRTReferences + ")")]
internal sealed class AssemblyDependencyFactory : MSBuildDependencyFactoryBase
{
private static readonly DependencyFlagCache s_flagCache = new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Microsoft.VisualStudio.ProjectSystem.Tree.Dependencies.Subscriptions.MSBuildDependencies;

[Export(typeof(IMSBuildDependencyFactory))]
[AppliesTo(ProjectCapability.DependenciesTree)]
[AppliesTo(ProjectCapability.DependenciesTree + " & " + ProjectCapabilities.ComReferences)]
internal sealed class ComDependencyFactory : MSBuildDependencyFactoryBase
{
private static readonly DependencyFlagCache s_flagCache = new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Microsoft.VisualStudio.ProjectSystem.Tree.Dependencies.Subscriptions.MSBuildDependencies;

[Export(typeof(IMSBuildDependencyFactory))]
[AppliesTo(ProjectCapability.DependenciesTree)]
[AppliesTo(ProjectCapability.DependenciesTree + " & " + ProjectCapability.DotNet)] // There's no "FrameworkReferences" capability
internal sealed class FrameworkDependencyFactory : MSBuildDependencyFactoryBase
{
// Framework references were introduced in .NET Core 2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Microsoft.VisualStudio.ProjectSystem.Tree.Dependencies.Subscriptions.MSBuildDependencies
{
[Export(typeof(IMSBuildDependencyFactory))]
[AppliesTo(ProjectCapability.DependenciesTree)]
[AppliesTo(ProjectCapability.DependenciesTree + " & " + ProjectCapabilities.PackageReferences)]
internal sealed class PackageDependencyFactory : MSBuildDependencyFactoryBase
{
private static readonly DependencyFlagCache s_flagCache = new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Microsoft.VisualStudio.ProjectSystem.Tree.Dependencies.Subscriptions.M
// TODO also filter AppliesTo to ProjectCapabilities.ProjectReferences? same for other dependency types

[Export(typeof(IMSBuildDependencyFactory))]
[AppliesTo(ProjectCapability.DependenciesTree)]
[AppliesTo(ProjectCapability.DependenciesTree + " & " + ProjectCapabilities.ProjectReferences)]
internal sealed class ProjectDependencyFactory : MSBuildDependencyFactoryBase
{
private static readonly DependencyFlagCache s_flagCache = new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Microsoft.VisualStudio.ProjectSystem.Tree.Dependencies.Subscriptions.MSBuildDependencies;

[Export(typeof(IMSBuildDependencyFactory))]
[AppliesTo(ProjectCapability.DependenciesTree)]
[AppliesTo(ProjectCapability.DependenciesTree + " & " + ProjectCapabilities.SdkReferences)]
internal class SdkDependencyFactory : MSBuildDependencyFactoryBase
{
private static readonly DependencyFlagCache s_flagCache = new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace Microsoft.VisualStudio.ProjectSystem.Tree.Dependencies.Subscriptions;
/// for slices upon request.
/// </remarks>
[Export(typeof(IDependencySliceSubscriber))]
[AppliesTo(ProjectCapability.DependenciesTree)]
[AppliesTo(ProjectCapability.DependenciesTree + " & " + ProjectCapabilities.SharedProjectReferences)]
internal sealed class SharedProjectDependencySubscriber : IDependencySliceSubscriber
{
private readonly UnconfiguredProject _unconfiguredProject;
Expand Down

0 comments on commit 7318cf3

Please sign in to comment.