Skip to content

Commit f14163d

Browse files
committed
Remove RunNoPromptExecutionLoop()
While this wasn't necessary to get the debug service unit tests running again, it seems like an unncessary code path that causes unit tests to behave slightly differently than production code, which I don't like.
1 parent 593cd46 commit f14163d

File tree

1 file changed

+1
-34
lines changed

1 file changed

+1
-34
lines changed

src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs

+1-34
Original file line numberDiff line numberDiff line change
@@ -549,16 +549,7 @@ private void RunTopLevelExecutionLoop()
549549
// Signal that we are ready for outside services to use
550550
_started.TrySetResult(true);
551551

552-
if (_hostInfo.ConsoleReplEnabled)
553-
{
554-
RunExecutionLoop();
555-
}
556-
else
557-
{
558-
// TODO: Is this really necessary? The other 'RunExecutionLoop' already handles
559-
// the case where the console REPL isn't enabled.
560-
RunNoPromptExecutionLoop();
561-
}
552+
RunExecutionLoop();
562553
}
563554
catch (Exception e)
564555
{
@@ -571,30 +562,6 @@ private void RunTopLevelExecutionLoop()
571562
_stopped.SetResult(true);
572563
}
573564

574-
private void RunNoPromptExecutionLoop()
575-
{
576-
while (!ShouldExitExecutionLoop)
577-
{
578-
using (CancellationScope cancellationScope = _cancellationContext.EnterScope(isIdleScope: false))
579-
{
580-
string taskRepresentation = null;
581-
try
582-
{
583-
ISynchronousTask task = _taskQueue.Take(cancellationScope.CancellationToken);
584-
taskRepresentation = task.ToString();
585-
task.ExecuteSynchronously(cancellationScope.CancellationToken);
586-
}
587-
catch (OperationCanceledException)
588-
{
589-
// Just continue
590-
}
591-
catch (Exception e)
592-
{
593-
_logger.LogError(e, $"Fatal exception occurred with task '{taskRepresentation ?? "<null task>"}'");
594-
}
595-
}
596-
}
597-
}
598565

599566
private void RunDebugExecutionLoop()
600567
{

0 commit comments

Comments
 (0)