diff --git a/CHANGELOG.md b/CHANGELOG.md index 95f2fa25..f61493ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [223.1.0] - 2022-10-20 +### Added +- Support for F# migrations projects + ## [223.0.0] - 2022-09-30 ### Added - Enable support for Rider 2022.3 EAP diff --git a/build.gradle b/build.gradle index 233c0bf9..f684ada3 100644 --- a/build.gradle +++ b/build.gradle @@ -56,6 +56,7 @@ task setBuildTool { ext.args << "/p:Configuration=${BuildConfiguration}" ext.args << "/p:HostFullIdentifier=" ext.args << "/p:SdkVersion=${RiderSdkVersion}" + ext.args << "/p:RiderVersion=${ProductVersion}" } } @@ -99,13 +100,7 @@ intellij { downloadSources = false instrumentCode = false // TODO: add plugins - // HACK: -- Load F# plugin from custom repository (our local disk) - plugins = ["com.jetbrains.rider.fsharp"] - pluginsRepositories { - marketplace() - custom(new File("${buildDir}/dependencies").toURI().toURL().toString()) - } - // /-- + plugins = ["rider-fsharp"] patchPluginXml { changeNotes = changelog.get(PluginVersion).toHTML() diff --git a/protocol/src/main/kotlin/model/rider/RiderEfCoreModel.kt b/protocol/src/main/kotlin/model/rider/RiderEfCoreModel.kt index 2434f851..2cff5e35 100644 --- a/protocol/src/main/kotlin/model/rider/RiderEfCoreModel.kt +++ b/protocol/src/main/kotlin/model/rider/RiderEfCoreModel.kt @@ -33,16 +33,13 @@ object RiderEfCoreModel : Ext(SolutionModel.Solution) { field("migrationShortName", string) field("migrationLongName", string) field("migrationFolderAbsolutePath", string) - field("language", enum { - +"Unknown" - +"CSharp" - +"FSharp" - }) + field("language", language) } private val DbContextInfo = structdef { field("name", string) field("fullName", string) + field("language", language) } private val EfToolDefinition = structdef { @@ -54,6 +51,12 @@ object RiderEfCoreModel : Ext(SolutionModel.Solution) { }) } + private val language = enum { + +"Unknown" + +"CSharp" + +"FSharp" + } + init { setting(CSharp50Generator.Namespace, "Rider.Plugins.EfCore.Rd") setting(Kotlin11Generator.Namespace, "me.seclerp.rider.plugins.efcore.rd") diff --git a/src/dotnet/Plugin.props b/src/dotnet/Plugin.props index a50a7ef7..503392bb 100644 --- a/src/dotnet/Plugin.props +++ b/src/dotnet/Plugin.props @@ -2,6 +2,7 @@ 2022.3.0-eap01 + 2022.3-EAP1-SNAPSHOT Entity Framework Core JetBrains Rider plugin for Entity Framework Core diff --git a/src/dotnet/Rider.Plugins.EfCore/Compatibility/SolutionExtensions.cs b/src/dotnet/Rider.Plugins.EfCore/Compatibility/SolutionExtensions.cs deleted file mode 100644 index e69de29b..00000000 diff --git a/src/dotnet/Rider.Plugins.EfCore/Compatibility/SupportedMigrationsProjectsProvider.cs b/src/dotnet/Rider.Plugins.EfCore/Compatibility/SupportedMigrationsProjectsProvider.cs index 3083f01f..217ee227 100644 --- a/src/dotnet/Rider.Plugins.EfCore/Compatibility/SupportedMigrationsProjectsProvider.cs +++ b/src/dotnet/Rider.Plugins.EfCore/Compatibility/SupportedMigrationsProjectsProvider.cs @@ -18,13 +18,17 @@ public SupportedMigrationsProjectsProvider(ISolution solution) public IEnumerable GetSupportedMigrationProjects() { var supportedMigrationProjects = _solution.GetAllProjects() - .Where(project => project.TargetFrameworkIds.Any(IsSupportedInMigrationsProject)) - .Where(project => project.ProjectFileLocation.ExtensionNoDot == "csproj"); + .Where(project => project.TargetFrameworkIds.Any(IsSupportedTargetFramework)) + .Where(project => IsSupportedProjectExtension(project.ProjectFileLocation.ExtensionNoDot)); return supportedMigrationProjects; } - private static bool IsSupportedInMigrationsProject(TargetFrameworkId targetFrameworkId) => + private static bool IsSupportedProjectExtension(string extensionNoDot) => + extensionNoDot == "csproj" + || extensionNoDot == "fsproj"; + + private static bool IsSupportedTargetFramework(TargetFrameworkId targetFrameworkId) => targetFrameworkId.UniqueString.StartsWith(SupportedTargetFrameworks.Net5) || targetFrameworkId.UniqueString.StartsWith(SupportedTargetFrameworks.Net6) || targetFrameworkId.UniqueString.StartsWith(SupportedTargetFrameworks.Net7) diff --git a/src/dotnet/Rider.Plugins.EfCore/Compatibility/SupportedStartupProjectsProvider.cs b/src/dotnet/Rider.Plugins.EfCore/Compatibility/SupportedStartupProjectsProvider.cs index 56b0d4a1..ddd4dbb3 100644 --- a/src/dotnet/Rider.Plugins.EfCore/Compatibility/SupportedStartupProjectsProvider.cs +++ b/src/dotnet/Rider.Plugins.EfCore/Compatibility/SupportedStartupProjectsProvider.cs @@ -37,15 +37,15 @@ public IEnumerable GetSupportedStartupProjects() var result = projectsWithNugetPacks .Concat(referencingProjects) - .Where(project => project.TargetFrameworkIds.Any(IsSupportedInStartupProject)) + .Where(project => project.TargetFrameworkIds.Any(IsSupportedTargetFramework)) .Distinct(); return result; } private bool StartupProjectPackagesInstalled(IProject project) => - _nugetTracker.HasPackage(project, EfCoreRequiredPackages.EfCoreToolsNugetId) - || _nugetTracker.HasPackage(project, EfCoreRequiredPackages.EfCoreDesignNugetId); + _nugetTracker.HasPackage(project, KnownNuGetPackages.EfCoreToolsNugetId) + || _nugetTracker.HasPackage(project, KnownNuGetPackages.EfCoreDesignNugetId); private IEnumerable GetReferencingProjects(IProject project) => project.TargetFrameworkIds @@ -53,7 +53,7 @@ private IEnumerable GetReferencingProjects(IProject project) => .Select(x => x.Value) .ToList(); - private static bool IsSupportedInStartupProject(TargetFrameworkId targetFrameworkId) => + private static bool IsSupportedTargetFramework(TargetFrameworkId targetFrameworkId) => targetFrameworkId.UniqueString.StartsWith(SupportedTargetFrameworks.Net5) || targetFrameworkId.UniqueString.StartsWith(SupportedTargetFrameworks.Net6) || targetFrameworkId.UniqueString.StartsWith(SupportedTargetFrameworks.Net7) diff --git a/src/dotnet/Rider.Plugins.EfCore/DbContext/DbContextProvider.cs b/src/dotnet/Rider.Plugins.EfCore/DbContext/DbContextProvider.cs index 7c374098..6412d7f4 100644 --- a/src/dotnet/Rider.Plugins.EfCore/DbContext/DbContextProvider.cs +++ b/src/dotnet/Rider.Plugins.EfCore/DbContext/DbContextProvider.cs @@ -1,7 +1,9 @@ using System.Collections.Generic; using System.Linq; using JetBrains.ProjectModel; +using JetBrains.ReSharper.Plugins.FSharp.Psi; using JetBrains.ReSharper.Psi; +using JetBrains.ReSharper.Psi.CSharp; using JetBrains.ReSharper.Psi.Modules; using JetBrains.RiderTutorials.Utils; using Rider.Plugins.EfCore.Extensions; @@ -38,7 +40,14 @@ private static bool TryGetDbContextInfo(IClass @class, out DbContextInfo dbConte return false; } - dbContextInfo = new DbContextInfo(@class.ShortName, @class.GetFullClrName()); + var language = @class.PresentationLanguage switch + { + CSharpLanguage _ => Language.CSharp, + FSharpLanguage _ => Language.FSharp, + _ => Language.Unknown + }; + + dbContextInfo = new DbContextInfo(@class.ShortName, @class.GetFullClrName(), language); return true; } diff --git a/src/dotnet/Rider.Plugins.EfCore/Extensions/PsiExtensions.cs b/src/dotnet/Rider.Plugins.EfCore/Extensions/PsiExtensions.cs index 179607dd..15e8b586 100644 --- a/src/dotnet/Rider.Plugins.EfCore/Extensions/PsiExtensions.cs +++ b/src/dotnet/Rider.Plugins.EfCore/Extensions/PsiExtensions.cs @@ -2,6 +2,7 @@ using System.Linq; using JetBrains.Application.Progress; using JetBrains.Metadata.Reader.API; +using JetBrains.Metadata.Reader.Impl; using JetBrains.ProjectModel; using JetBrains.ReSharper.Feature.Services.Navigation.Requests; using JetBrains.ReSharper.Feature.Services.Occurrences; @@ -12,10 +13,10 @@ namespace Rider.Plugins.EfCore.Extensions { public static class PsiExtensions { - public static IAttributeInstance GetAttributeInstance(this IAttributesSet @class, string attributeShortName) => + public static IAttributeInstance GetAttributeInstance(this IAttributesSet @class, string attributeLongName) => @class - .GetAttributeInstances(AttributesSource.All) - .SingleOrDefault(attribute => attribute.GetAttributeShortName() == attributeShortName); + .GetAttributeInstances(new ClrTypeName(attributeLongName), AttributesSource.All) + .SingleOrDefault(); public static IEnumerable FindInheritorsOf(this IPsiModule module, IProject project, IClrTypeName clrTypeName) diff --git a/src/dotnet/Rider.Plugins.EfCore/IRiderEfCoreZone.cs b/src/dotnet/Rider.Plugins.EfCore/IRiderEfCoreZone.cs index ac3561c4..29c01c06 100644 --- a/src/dotnet/Rider.Plugins.EfCore/IRiderEfCoreZone.cs +++ b/src/dotnet/Rider.Plugins.EfCore/IRiderEfCoreZone.cs @@ -2,6 +2,7 @@ using JetBrains.Platform.RdFramework.Actions.Backend; using JetBrains.ProjectModel.NuGet; using JetBrains.ReSharper.Feature.Services.Daemon; +using JetBrains.ReSharper.Plugins.FSharp; using JetBrains.ReSharper.Psi; using JetBrains.ReSharper.Psi.CSharp; @@ -13,7 +14,9 @@ public interface IRiderEfCoreZone : IPsiLanguageZone, IRequire, IRequire, IRequire, - IRequire + IRequire, + IRequire, + IRequire { } } diff --git a/src/dotnet/Rider.Plugins.EfCore/KnownAttributes.cs b/src/dotnet/Rider.Plugins.EfCore/KnownAttributes.cs new file mode 100644 index 00000000..8759cd9f --- /dev/null +++ b/src/dotnet/Rider.Plugins.EfCore/KnownAttributes.cs @@ -0,0 +1,8 @@ +namespace Rider.Plugins.EfCore +{ + public static class KnownAttributes + { + public const string MigrationAttribute = "Microsoft.EntityFrameworkCore.Migrations.MigrationAttribute"; + public const string DbContextAttribute = "Microsoft.EntityFrameworkCore.Infrastructure.DbContextAttribute"; + } +} diff --git a/src/dotnet/Rider.Plugins.EfCore/EfCoreRequiredPackages.cs b/src/dotnet/Rider.Plugins.EfCore/KnownNuGetPackages.cs similarity index 82% rename from src/dotnet/Rider.Plugins.EfCore/EfCoreRequiredPackages.cs rename to src/dotnet/Rider.Plugins.EfCore/KnownNuGetPackages.cs index 9538af62..6d067d3a 100644 --- a/src/dotnet/Rider.Plugins.EfCore/EfCoreRequiredPackages.cs +++ b/src/dotnet/Rider.Plugins.EfCore/KnownNuGetPackages.cs @@ -1,6 +1,6 @@ namespace Rider.Plugins.EfCore { - public static class EfCoreRequiredPackages + public static class KnownNuGetPackages { public const string EfCoreDesignNugetId = "Microsoft.EntityFrameworkCore.Design"; public const string EfCoreToolsNugetId = "Microsoft.EntityFrameworkCore.Tools"; diff --git a/src/dotnet/Rider.Plugins.EfCore/Migrations/MigrationsProvider.cs b/src/dotnet/Rider.Plugins.EfCore/Migrations/MigrationsProvider.cs index ea05bcc8..82397de6 100644 --- a/src/dotnet/Rider.Plugins.EfCore/Migrations/MigrationsProvider.cs +++ b/src/dotnet/Rider.Plugins.EfCore/Migrations/MigrationsProvider.cs @@ -1,7 +1,13 @@ using System.Collections.Generic; using System.Linq; +using FSharp.Compiler.Symbols; +using JetBrains.Metadata.Reader.API; using JetBrains.ProjectModel; +using JetBrains.ReSharper.Plugins.FSharp.Psi; +using JetBrains.ReSharper.Plugins.FSharp.Psi.Impl; +using JetBrains.ReSharper.Plugins.FSharp.Psi.Util; using JetBrains.ReSharper.Psi; +using JetBrains.ReSharper.Psi.CSharp; using JetBrains.ReSharper.Psi.Modules; using JetBrains.RiderTutorials.Utils; using Rider.Plugins.EfCore.Extensions; @@ -48,8 +54,8 @@ private static bool TryGetMigrationInfo(IClass @class, out MigrationInfo migrati migrationInfo = null; var migrationShortName = @class.ShortName; - var migrationAttribute = @class.GetAttributeInstance("MigrationAttribute"); - var dbContextAttribute = @class.GetAttributeInstance("DbContextAttribute"); + var migrationAttribute = @class.GetAttributeInstance(KnownAttributes.MigrationAttribute); + var dbContextAttribute = @class.GetAttributeInstance(KnownAttributes.DbContextAttribute); if (dbContextAttribute is null || migrationAttribute is null) { @@ -61,11 +67,7 @@ private static bool TryGetMigrationInfo(IClass @class, out MigrationInfo migrati .ConstantValue .StringValue; - var dbContextClass = dbContextAttribute - .PositionParameter(0) - .TypeValue - ?.GetScalarType() - ?.GetClrName(); + var dbContextClass = ExtractDbContextClrName(dbContextAttribute); if (migrationLongName is null || dbContextClass is null) { @@ -76,13 +78,39 @@ private static bool TryGetMigrationInfo(IClass @class, out MigrationInfo migrati .FirstOrDefault() .GetLocation().Directory.FileAccessPath; + var language = @class.PresentationLanguage switch + { + CSharpLanguage _ => Language.CSharp, + FSharpLanguage _ => Language.FSharp, + _ => Language.Unknown + }; + migrationInfo = new MigrationInfo( dbContextClass.FullName, migrationShortName, migrationLongName, - migrationFolderAbsolutePath); + migrationFolderAbsolutePath, + language); return true; } + + private static IClrTypeName ExtractDbContextClrName(IAttributeInstance attributeInstance) => + attributeInstance switch + { + FSharpAttributeInstance fsharpAttribute => + (fsharpAttribute + .AttrConstructorArgs + .First() + .Item2 as FSharpType)? + .TypeDefinition + .GetClrName(), + + _ => attributeInstance + .PositionParameter(0) + .TypeValue + ?.GetScalarType() + ?.GetClrName() + }; } } diff --git a/src/dotnet/Rider.Plugins.EfCore/Rider.Plugins.EfCore.csproj b/src/dotnet/Rider.Plugins.EfCore/Rider.Plugins.EfCore.csproj index 3fe076e5..a42426f2 100644 --- a/src/dotnet/Rider.Plugins.EfCore/Rider.Plugins.EfCore.csproj +++ b/src/dotnet/Rider.Plugins.EfCore/Rider.Plugins.EfCore.csproj @@ -18,6 +18,24 @@ + + + + ..\..\..\build\riderRD-$(RiderVersion)\plugins\rider-fsharp\dotnet\FSharp.Compiler.Service.dll + + + ..\..\..\build\riderRD-$(RiderVersion)\plugins\rider-fsharp\dotnet\JetBrains.ReSharper.Plugins.FSharp.Common.dll + + + ..\..\..\build\riderRD-$(RiderVersion)\plugins\rider-fsharp\dotnet\JetBrains.ReSharper.Plugins.FSharp.ProjectModelBase.dll + + + ..\..\..\build\riderRD-$(RiderVersion)\plugins\rider-fsharp\dotnet\JetBrains.ReSharper.Plugins.FSharp.Psi.dll + + + ..\..\..\build\riderRD-$(RiderVersion)\plugins\rider-fsharp\dotnet\JetBrains.ReSharper.Plugins.FSharp.Psi.Features.dll + + diff --git a/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/features/migrations/script/GenerateScriptDataContext.kt b/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/features/migrations/script/GenerateScriptDataContext.kt index 0de68fc6..ea84d79f 100644 --- a/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/features/migrations/script/GenerateScriptDataContext.kt +++ b/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/features/migrations/script/GenerateScriptDataContext.kt @@ -4,25 +4,27 @@ import com.intellij.openapi.project.Project import me.seclerp.observables.* import me.seclerp.rider.plugins.efcore.features.shared.ObservableMigrations import me.seclerp.rider.plugins.efcore.features.shared.dialog.CommonDataContext +import me.seclerp.rider.plugins.efcore.rd.Language +import me.seclerp.rider.plugins.efcore.rd.MigrationInfo class GenerateScriptDataContext( intellijProject: Project ): CommonDataContext(intellijProject, true) { - val availableFromMigrationNames = observableList() - val availableToMigrationNames = observableList() + val availableFromMigrations = observableList() + val availableToMigrations = observableList() - val fromMigration = observable(null) - val toMigration = observable(null) + val fromMigration = observable(null) + val toMigration = observable(null) val outputFilePath = observable("script.sql") val idempotent = observable(false) val noTransactions = observable(false) private val observableMigrations = ObservableMigrations(intellijProject, migrationsProject, dbContext) - private val availableMigrationNames = observableList() + private val availableMigrations = observableList() .apply { bind(observableMigrations) { migrations -> migrations - .map { it.migrationLongName } - .sortedByDescending { it } + .map { it } + .sortedByDescending { it.migrationLongName } } } @@ -31,14 +33,14 @@ class GenerateScriptDataContext( observableMigrations.initBinding() - availableFromMigrationNames.bind(availableMigrationNames) { + availableFromMigrations.bind(availableMigrations) { buildList { addAll(it) - add("0") + add(MigrationInfo("", "0", "0", "", it.lastOrNull()?.language ?: Language.Unknown)) } } - availableToMigrationNames.bind(availableMigrationNames) { + availableToMigrations.bind(availableMigrations) { buildList { addAll(it) } diff --git a/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/features/migrations/script/GenerateScriptDialogWrapper.kt b/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/features/migrations/script/GenerateScriptDialogWrapper.kt index 64bbbc1d..7115d9fc 100644 --- a/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/features/migrations/script/GenerateScriptDialogWrapper.kt +++ b/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/features/migrations/script/GenerateScriptDialogWrapper.kt @@ -14,6 +14,7 @@ import me.seclerp.rider.plugins.efcore.cli.api.MigrationsCommandFactory import me.seclerp.rider.plugins.efcore.cli.api.models.DotnetEfVersion import me.seclerp.rider.plugins.efcore.cli.execution.CliCommand import me.seclerp.rider.plugins.efcore.features.shared.dialog.CommonDialogWrapper +import me.seclerp.rider.plugins.efcore.rd.MigrationInfo import me.seclerp.rider.plugins.efcore.ui.items.MigrationItem class GenerateScriptDialogWrapper( @@ -51,11 +52,11 @@ class GenerateScriptDialogWrapper( override fun initBindings() { super.initBindings() - fromMigrationsView.bind(dataCtx.availableFromMigrationNames) { + fromMigrationsView.bind(dataCtx.availableFromMigrations) { it.map(mappings.migration.toItem) } - toMigrationsView.bind(dataCtx.availableToMigrationNames) { + toMigrationsView.bind(dataCtx.availableToMigrations) { it.map(mappings.migration.toItem) } @@ -73,8 +74,8 @@ class GenerateScriptDialogWrapper( override fun generateCommand(): CliCommand { val commonOptions = getCommonOptions() - val fromMigration = dataCtx.fromMigration.value!!.trim() - val toMigration = dataCtx.toMigration.value?.trim() + val fromMigration = dataCtx.fromMigration.value!!.migrationLongName.trim() + val toMigration = dataCtx.toMigration.value?.migrationLongName?.trim() val outputFile = dataCtx.outputFilePath.value val idempotent = dataCtx.idempotent.value val noTransactions = dataCtx.noTransactions.value @@ -130,12 +131,12 @@ class GenerateScriptDialogWrapper( companion object { private object mappings { object migration { - val toItem: (String?) -> MigrationItem? + val toItem: (MigrationInfo?) -> MigrationItem? get() = { - if (it == null) null else MigrationItem(it) + if (it == null) null else MigrationItem(it.migrationLongName, it) } - val fromItem: (MigrationItem?) -> String? + val fromItem: (MigrationItem?) -> MigrationInfo? get() = { it?.data } } } diff --git a/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/ui/DotnetIconResolver.kt b/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/ui/DotnetIconResolver.kt index 1c312c2c..52dc2e15 100644 --- a/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/ui/DotnetIconResolver.kt +++ b/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/ui/DotnetIconResolver.kt @@ -1,9 +1,11 @@ package me.seclerp.rider.plugins.efcore.ui import com.intellij.icons.AllIcons +import com.intellij.ide.plugins.cl.PluginClassLoader import com.intellij.openapi.util.IconLoader import icons.ReSharperIcons import icons.RiderIcons +import me.seclerp.rider.plugins.efcore.rd.Language import javax.swing.Icon object DotnetIconResolver { @@ -14,12 +16,11 @@ object DotnetIconResolver { else -> null } ?: return null - ReSharperIcons.ProjectModel.Fsharp return icon } - fun resolveForType(type: DotnetIconType): Icon { - val icon = when (type) { + fun resolveForType(type: DotnetIconType) = + when (type) { DotnetIconType.BUILD_CONFIGURATION -> ReSharperIcons.ProjectModel.ProjectProperties DotnetIconType.TARGET_FRAMEWORK -> RiderIcons.RunConfigurations.Application DotnetIconType.CSHARP_CLASS -> ReSharperIcons.PsiCSharp.Csharp @@ -27,8 +28,13 @@ object DotnetIconResolver { DotnetIconType.FSHARP_CLASS -> IconLoader.findIcon("/icons/Fsharp.png", javaClass) ?: AllIcons.FileTypes.Text } - return icon - } + fun resolveForLanguage(language: Language) = + when (language) { + Language.CSharp -> ReSharperIcons.PsiCSharp.Csharp + // Fallback to plain text if F# file icon was not found + Language.FSharp -> IconLoader.findIcon("/icons/Fsharp.png", javaClass) ?: AllIcons.FileTypes.Text + Language.Unknown -> AllIcons.FileTypes.Text + } } enum class DotnetIconType { diff --git a/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/ui/items/DbContextItem.kt b/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/ui/items/DbContextItem.kt index b42a0d8c..5d5ff6ca 100644 --- a/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/ui/items/DbContextItem.kt +++ b/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/ui/items/DbContextItem.kt @@ -5,4 +5,4 @@ import me.seclerp.rider.plugins.efcore.ui.DotnetIconResolver import me.seclerp.rider.plugins.efcore.ui.DotnetIconType class DbContextItem(displayName: String, data: DbContextInfo) - : IconItem(displayName, DotnetIconResolver.resolveForType(DotnetIconType.CSHARP_CLASS), data) \ No newline at end of file + : IconItem(displayName, DotnetIconResolver.resolveForLanguage(data.language), data) \ No newline at end of file diff --git a/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/ui/items/MigrationItem.kt b/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/ui/items/MigrationItem.kt index c1916882..bf422209 100644 --- a/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/ui/items/MigrationItem.kt +++ b/src/rider/main/kotlin/me/seclerp/rider/plugins/efcore/ui/items/MigrationItem.kt @@ -4,5 +4,5 @@ import me.seclerp.rider.plugins.efcore.rd.MigrationInfo import me.seclerp.rider.plugins.efcore.ui.DotnetIconResolver import me.seclerp.rider.plugins.efcore.ui.DotnetIconType -class MigrationItem(name: String) - : IconItem(name, DotnetIconResolver.resolveForType(DotnetIconType.CSHARP_CLASS), name) \ No newline at end of file +class MigrationItem(displayName: String, data: MigrationInfo) + : IconItem(displayName, DotnetIconResolver.resolveForLanguage(data.language), data) \ No newline at end of file