From 3dc8962f3c91f06551d71cd72618b42661a13543 Mon Sep 17 00:00:00 2001 From: Andrii Rublov Date: Mon, 13 Jan 2025 15:30:19 +0100 Subject: [PATCH] [efcore]: RIDER-121838: Remove old workaround for checking package installation GitOrigin-RevId: 6389adb38a43a16b17ebf71730a9151c26689ef3 --- .../SupportedStartupProjectsProvider.cs | 4 ++-- .../Tracking/NuGetPackageReferenceTrackerEx.cs | 17 ----------------- 2 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 src/dotnet/Rider.Plugins.EfCore/Tracking/NuGetPackageReferenceTrackerEx.cs diff --git a/src/dotnet/Rider.Plugins.EfCore/Compatibility/SupportedStartupProjectsProvider.cs b/src/dotnet/Rider.Plugins.EfCore/Compatibility/SupportedStartupProjectsProvider.cs index 864f2c58..9a22d81d 100644 --- a/src/dotnet/Rider.Plugins.EfCore/Compatibility/SupportedStartupProjectsProvider.cs +++ b/src/dotnet/Rider.Plugins.EfCore/Compatibility/SupportedStartupProjectsProvider.cs @@ -45,8 +45,8 @@ public IEnumerable GetSupportedStartupProjects() } private bool StartupProjectPackagesInstalled(IProject project) => - _nugetTracker.HasPackage(project, EfCoreRequiredPackages.EfCoreToolsNugetId) - || _nugetTracker.HasPackage(project, EfCoreRequiredPackages.EfCoreDesignNugetId); + _nugetTracker.HasInstalledPackage(project, EfCoreRequiredPackages.EfCoreToolsNugetId) + || _nugetTracker.HasInstalledPackage(project, EfCoreRequiredPackages.EfCoreDesignNugetId); private IEnumerable GetReferencingProjects(IProject project) => project.TargetFrameworkIds diff --git a/src/dotnet/Rider.Plugins.EfCore/Tracking/NuGetPackageReferenceTrackerEx.cs b/src/dotnet/Rider.Plugins.EfCore/Tracking/NuGetPackageReferenceTrackerEx.cs deleted file mode 100644 index c245bec5..00000000 --- a/src/dotnet/Rider.Plugins.EfCore/Tracking/NuGetPackageReferenceTrackerEx.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Linq; -using JetBrains.ProjectModel; -using JetBrains.ProjectModel.NuGet.Packaging; - -namespace Rider.Plugins.EfCore.Tracking -{ - public static class NuGetPackageReferenceTrackerEx - { - /// - /// TODO: This is a temporary method that is used as a replacement of that works incorrectly. - /// - public static bool HasPackage(this NuGetPackageReferenceTracker tracker, IProject project, string packageId) => - tracker.GetInstalledPackages(project) - .Any(x => string.Equals(x.PackageIdentity.Id, packageId, StringComparison.OrdinalIgnoreCase)); - } -}