Skip to content

Commit 04f8f67

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 28fcda7 commit 04f8f67

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
@@ -539,16 +539,7 @@ private void RunTopLevelExecutionLoop()
539539
// Signal that we are ready for outside services to use
540540
_started.TrySetResult(true);
541541

542-
if (_hostInfo.ConsoleReplEnabled)
543-
{
544-
RunExecutionLoop();
545-
}
546-
else
547-
{
548-
// TODO: Is this really necessary? The other 'RunExecutionLoop' already handles
549-
// the case where the console REPL isn't enabled.
550-
RunNoPromptExecutionLoop();
551-
}
542+
RunExecutionLoop();
552543
}
553544
catch (Exception e)
554545
{
@@ -561,30 +552,6 @@ private void RunTopLevelExecutionLoop()
561552
_stopped.SetResult(true);
562553
}
563554

564-
private void RunNoPromptExecutionLoop()
565-
{
566-
while (!ShouldExitExecutionLoop)
567-
{
568-
using (CancellationScope cancellationScope = _cancellationContext.EnterScope(isIdleScope: false))
569-
{
570-
string taskRepresentation = null;
571-
try
572-
{
573-
ISynchronousTask task = _taskQueue.Take(cancellationScope.CancellationToken);
574-
taskRepresentation = task.ToString();
575-
task.ExecuteSynchronously(cancellationScope.CancellationToken);
576-
}
577-
catch (OperationCanceledException)
578-
{
579-
// Just continue
580-
}
581-
catch (Exception e)
582-
{
583-
_logger.LogError(e, $"Fatal exception occurred with task '{taskRepresentation ?? "<null task>"}'");
584-
}
585-
}
586-
}
587-
}
588555

589556
private void RunDebugExecutionLoop()
590557
{

0 commit comments

Comments
 (0)