Skip to content

Commit 29b56ce

Browse files
committed
Clean up DebugStateService.cs and ConfigurationDoneHandler.cs
1 parent fcb910e commit 29b56ce

File tree

2 files changed

+7
-21
lines changed

2 files changed

+7
-21
lines changed

src/PowerShellEditorServices/Services/DebugAdapter/DebugStateService.cs

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation.
1+
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

44
using System.Threading;
@@ -37,14 +37,8 @@ internal class DebugStateService
3737
// This gets set at the end of the Launch/Attach handler which set debug state.
3838
internal TaskCompletionSource<bool> ServerStarted { get; set; }
3939

40-
internal void ReleaseSetBreakpointHandle()
41-
{
42-
_setBreakpointInProgressHandle.Release();
43-
}
40+
internal int ReleaseSetBreakpointHandle() => _setBreakpointInProgressHandle.Release();
4441

45-
internal async Task WaitForSetBreakpointHandleAsync()
46-
{
47-
await _setBreakpointInProgressHandle.WaitAsync().ConfigureAwait(false);
48-
}
42+
internal Task WaitForSetBreakpointHandleAsync() => _setBreakpointInProgressHandle.WaitAsync();
4943
}
5044
}

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

+4-12
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
1-
// Copyright (c) Microsoft Corporation.
1+
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4+
using System.Threading;
5+
using System.Threading.Tasks;
46
using Microsoft.Extensions.Logging;
57
using Microsoft.PowerShell.EditorServices.Services;
6-
using Microsoft.PowerShell.EditorServices.Services.DebugAdapter;
78
using Microsoft.PowerShell.EditorServices.Services.PowerShell;
89
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Debugging;
910
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution;
10-
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Runspace;
1111
using Microsoft.PowerShell.EditorServices.Services.TextDocument;
1212
using Microsoft.PowerShell.EditorServices.Utility;
1313
using OmniSharp.Extensions.DebugAdapter.Protocol.Events;
1414
using OmniSharp.Extensions.DebugAdapter.Protocol.Requests;
1515
using OmniSharp.Extensions.DebugAdapter.Protocol.Server;
16-
using System.Management.Automation;
17-
using System.Management.Automation.Language;
18-
using System.Threading;
19-
using System.Threading.Tasks;
2016

2117
namespace Microsoft.PowerShell.EditorServices.Handlers
2218
{
@@ -38,9 +34,7 @@ internal class ConfigurationDoneHandler : IConfigurationDoneHandler
3834
private readonly DebugEventHandlerService _debugEventHandlerService;
3935
private readonly IInternalPowerShellExecutionService _executionService;
4036
private readonly WorkspaceService _workspaceService;
41-
4237
private readonly IPowerShellDebugContext _debugContext;
43-
private readonly IRunspaceContext _runspaceContext;
4438

4539
public ConfigurationDoneHandler(
4640
ILoggerFactory loggerFactory,
@@ -50,8 +44,7 @@ public ConfigurationDoneHandler(
5044
DebugEventHandlerService debugEventHandlerService,
5145
IInternalPowerShellExecutionService executionService,
5246
WorkspaceService workspaceService,
53-
IPowerShellDebugContext debugContext,
54-
IRunspaceContext runspaceContext)
47+
IPowerShellDebugContext debugContext)
5548
{
5649
_logger = loggerFactory.CreateLogger<ConfigurationDoneHandler>();
5750
_debugAdapterServer = debugAdapterServer;
@@ -61,7 +54,6 @@ public ConfigurationDoneHandler(
6154
_executionService = executionService;
6255
_workspaceService = workspaceService;
6356
_debugContext = debugContext;
64-
_runspaceContext = runspaceContext;
6557
}
6658

6759
public Task<ConfigurationDoneResponse> Handle(ConfigurationDoneArguments request, CancellationToken cancellationToken)

0 commit comments

Comments
 (0)