Skip to content

Commit 0bbcf1a

Browse files
authored
Notify User on Linux, when only Unity mono is present (#1383)
* Revert "Editor plugin net46 (#1367)" This reverts commit 7adfbda * Notify User on Linux, when only Unity mono is present #1375 * Fix compilation (part1, Unity 3.5 runtime is broken) * Update gold, update rd runtime * wording, minor refactoring
1 parent 80bd9e7 commit 0bbcf1a

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

resharper/resharper-unity/src/Rider/MonoInstallTrigger.cs

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
using JetBrains.Lifetimes;
55
using JetBrains.ProjectModel;
66
using JetBrains.ProjectModel.Tasks;
7+
using JetBrains.ReSharper.Host.Features.BackgroundTasks;
78
using JetBrains.ReSharper.Host.Features.Runtime;
9+
using JetBrains.ReSharper.Host.Features.Settings;
810
using JetBrains.ReSharper.Plugins.Unity.ProjectModel;
11+
using JetBrains.Rider.Model.Notifications;
912
using JetBrains.Util;
1013

1114
namespace JetBrains.ReSharper.Plugins.Unity.Rider
@@ -14,9 +17,10 @@ namespace JetBrains.ReSharper.Plugins.Unity.Rider
1417
public class MonoInstallTrigger
1518
{
1619
public MonoInstallTrigger(Lifetime lifetime, ILogger logger, ISolutionLoadTasksScheduler scheduler,
17-
ISolution solution, UnitySolutionTracker unitySolutionTracker, UnityHost host)
20+
ISolution solution, UnitySolutionTracker unitySolutionTracker, UnityHost host,
21+
NotificationsModel notificationsModel)
1822
{
19-
if (PlatformUtil.RuntimePlatform != PlatformUtil.Platform.MacOsX)
23+
if (PlatformUtil.RuntimePlatform == PlatformUtil.Platform.Windows)
2024
return;
2125

2226
scheduler.EnqueueTask(new SolutionLoadTask("Check mono runtime", SolutionLoadTaskKinds.AfterDone, () =>
@@ -51,10 +55,28 @@ public MonoInstallTrigger(Lifetime lifetime, ILogger logger, ISolutionLoadTasksS
5155
return false;
5256
});
5357

54-
if (!installedValidMono)
55-
{
58+
if (installedValidMono) return;
59+
60+
if (PlatformUtil.RuntimePlatform == PlatformUtil.Platform.MacOsX)
5661
solution.Locks.ExecuteOrQueue(lifetime, "Show install mono dialog",
5762
() => { host.PerformModelAction(model => model.ShowInstallMonoDialog()); });
63+
else if (PlatformUtil.RuntimePlatform == PlatformUtil.Platform.Linux)
64+
{
65+
var notification = new NotificationModel("Mono 5.16+ is required.",
66+
"<html>Project requires new Mono with MSBuild for new C# language features support.<br>" +
67+
RiderContextNotificationHelper.MakeOpenSettingsLink(
68+
WellKnownSettingPages.Environment,
69+
"Install the latest Mono")
70+
+ ".<br>" +
71+
"If a Mono runtime is available in a non-standard location, please " +
72+
RiderContextNotificationHelper.MakeOpenSettingsLink(
73+
WellKnownSettingPages.ToolsetAndBuild,
74+
"specify the custom runtime location in settings")
75+
+ ".</html>"
76+
77+
, true,
78+
RdNotificationEntryType.WARN);
79+
notificationsModel.Notification(notification);
5880
}
5981
});
6082
}));

0 commit comments

Comments
 (0)