Skip to content

Commit dc8ac1b

Browse files
authored
Merge pull request #2293 from JetBrains/net221-fix-unity-start-from-run-debug
Fix start unity from run debug
2 parents af0bb21 + ac3c63a commit dc8ac1b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

resharper/resharper-unity/src/Unity.Rider/Integration/Core/Feature/UnitTesting/UnityTaskRunnerHostControllerExtension.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,16 @@ private async Task PrepareForRunInternal(Lifetime lifetime, IUnitTestRun run)
8282
var unityEditorProcessId = myUnityController.TryGetUnityProcessId();
8383
if (unityEditorProcessId.HasValue)
8484
return;
85-
85+
8686
var message = string.Format(StartUnityEditorQuestionMessage,
8787
myAvailableProviders[run.HostController.HostId],
8888
myUnityController.GetPresentableUnityVersion());
89-
if (!MessageBox.ShowYesNo(message, PluginName))
89+
// Don't show message to user if CT mode on
90+
if (!(run.Launch.Session.ContinuousTestingIsOn.Value || MessageBox.ShowYesNo(message, PluginName)))
91+
{
92+
run.Launch.Abort();
9093
throw new Exception(string.Format(NotAvailableUnityEditorMessage, myAvailableProviders[run.HostController.HostId]));
94+
}
9195

9296
var startUnityTask = StartUnity(lifetime);
9397

@@ -116,7 +120,7 @@ private void ShowProgress(Lifetime lifetime, Task task)
116120
{
117121
var innerLifeDef = lifetime.CreateNested();
118122
myBackgroundProgressIndicatorManager.CreateIndicator(innerLifeDef.Lifetime, false, false, "Start Unity Editor");
119-
task.ContinueWith(x => innerLifeDef.Terminate(), myLifetime, TaskContinuationOptions.None, myShellLocks.Tasks.Scheduler);
123+
task.ContinueWith(_ => innerLifeDef.Terminate(), myLifetime, TaskContinuationOptions.None, myShellLocks.Tasks.Scheduler);
120124
}
121125

122126
private void WrapStartUnityTask(Func<Task> run)

0 commit comments

Comments
 (0)