Skip to content

Commit 89035b2

Browse files
Add back unrelated changes
1 parent 03d8989 commit 89035b2

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

src/PowerShellEditorServices/Services/DebugAdapter/Handlers/ConfigurationDoneHandler.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ internal class ConfigurationDoneHandler : IConfigurationDoneHandler
2525
// TODO: We currently set `WriteInputToHost` as true, which writes our debugged commands'
2626
// `GetInvocationText` and that reveals some obscure implementation details we should
2727
// instead hide from the user with pretty strings (or perhaps not write out at all).
28+
//
29+
// This API is mostly used for F5 execution so it requires the foreground.
2830
private static readonly PowerShellExecutionOptions s_debuggerExecutionOptions = new()
2931
{
3032
MustRunInForeground = true,

src/PowerShellEditorServices/Services/PowerShell/Execution/BlockingConcurrentDeque.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public bool TryTake(out T item)
6565

6666
public IDisposable BlockConsumers() => PriorityQueueBlockLifetime.StartBlocking(_blockConsumersEvent);
6767

68-
public void Dispose() => ((IDisposable)_blockConsumersEvent).Dispose();
68+
public void Dispose() => _blockConsumersEvent.Dispose();
6969

7070
private class PriorityQueueBlockLifetime : IDisposable
7171
{

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -944,6 +944,7 @@ private Runspace CreateInitialRunspace(InitialSessionState initialSessionState)
944944
return runspace;
945945
}
946946

947+
// NOTE: This token is received from PSReadLine, and it _is_ the ReadKey cancellation token!
947948
private void OnPowerShellIdle(CancellationToken idleCancellationToken)
948949
{
949950
IReadOnlyList<PSEventSubscriber> eventSubscribers = _mainRunspaceEngineIntrinsics.Events.Subscribers;

src/PowerShellEditorServices/Services/Template/TemplateService.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,12 @@ public async Task<bool> CreateFromTemplateAsync(
158158
_logger.LogTrace(
159159
$"Invoking Plaster...\n\n TemplatePath: {templatePath}\n DestinationPath: {destinationPath}");
160160

161-
PSCommand command = new();
162-
command.AddCommand("Invoke-Plaster");
163-
command.AddParameter("TemplatePath", templatePath);
164-
command.AddParameter("DestinationPath", destinationPath);
161+
PSCommand command = new PSCommand()
162+
.AddCommand("Invoke-Plaster")
163+
.AddParameter("TemplatePath", templatePath)
164+
.AddParameter("DestinationPath", destinationPath);
165165

166+
// This command is interactive so it requires the foreground.
166167
await _executionService.ExecutePSCommandAsync(
167168
command,
168169
CancellationToken.None,

0 commit comments

Comments
 (0)