Skip to content

Commit 28fcda7

Browse files
committed
Miscellaneous cleanups
1 parent 08d241d commit 28fcda7

File tree

7 files changed

+10
-16
lines changed

7 files changed

+10
-16
lines changed

src/PowerShellEditorServices/Services/DebugAdapter/DebugEventHandlerService.cs

+3-3
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.Management.Automation;
@@ -131,8 +131,8 @@ private void OnDebuggerResuming(object sender, DebuggerResumingEventArgs e)
131131
_debugAdapterServer.SendNotification(EventNames.Continued,
132132
new ContinuedEvent
133133
{
134-
AllThreadsContinued = true,
135134
ThreadId = ThreadsHandler.PipelineThread.Id,
135+
AllThreadsContinued = true,
136136
});
137137
}
138138

@@ -151,7 +151,7 @@ private void OnBreakpointUpdated(object sender, BreakpointUpdatedEventArgs e)
151151
BreakpointDetails.Create(e.Breakpoint, e.UpdateType)
152152
);
153153

154-
string reason = (e.UpdateType) switch {
154+
string reason = e.UpdateType switch {
155155
BreakpointUpdateType.Set => BreakpointEventReason.New,
156156
BreakpointUpdateType.Removed => BreakpointEventReason.Removed,
157157
BreakpointUpdateType.Enabled => BreakpointEventReason.Changed,

src/PowerShellEditorServices/Services/DebugAdapter/DebugStateService.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ internal void ReleaseSetBreakpointHandle()
4646

4747
internal async Task WaitForSetBreakpointHandleAsync()
4848
{
49-
await _setBreakpointInProgressHandle.WaitAsync()
50-
.ConfigureAwait(continueOnCapturedContext: false);
49+
await _setBreakpointInProgressHandle.WaitAsync().ConfigureAwait(false);
5150
}
5251
}
5352
}

src/PowerShellEditorServices/Services/DebugAdapter/Debugging/DebuggerStoppedEventArgs.cs

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

4+
using System.Management.Automation;
5+
using System.Security.Cryptography;
46
using Microsoft.PowerShell.EditorServices.Services.PowerShell.Runspace;
57
using Microsoft.PowerShell.EditorServices.Utility;
6-
using System.Management.Automation;
78

89
namespace Microsoft.PowerShell.EditorServices.Services.DebugAdapter
910
{

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ await _debugService.SetVariableAsync(
3636
request.Name,
3737
request.Value).ConfigureAwait(false);
3838

39-
return new SetVariableResponse
40-
{
41-
Value = updatedValue
42-
};
43-
39+
return new SetVariableResponse { Value = updatedValue };
4440
}
4541
catch (Exception ex) when(ex is ArgumentTransformationMetadataException ||
4642
ex is InvalidPowerShellExpressionException ||

src/PowerShellEditorServices/Services/Extension/EditorOperationsService.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public void ClearTerminal()
264264
if (!TestHasLanguageServer(warnUser: false))
265265
{
266266
return;
267-
};
267+
}
268268

269269
_languageServer.SendNotification("editor/clearTerminal");
270270
}

src/PowerShellEditorServices/Services/PowerShell/Debugging/PowerShellDebugContext.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public void SetDebuggerResumed()
151151

152152
public void ProcessDebuggerResult(DebuggerCommandResults debuggerResult)
153153
{
154-
if (debuggerResult.ResumeAction != null)
154+
if (debuggerResult.ResumeAction is not null)
155155
{
156156
SetDebugResuming(debuggerResult.ResumeAction.Value);
157157
RaiseDebuggerResumingEvent(new DebuggerResumingEventArgs(debuggerResult.ResumeAction.Value));

src/PowerShellEditorServices/Services/PowerShell/Utility/PowerShellExtensions.cs

-2
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ public static void LoadProfiles(this PowerShell pwsh, ProfilePathInfo profilePat
180180
pwsh.Runspace.SessionStateProxy.SetVariable("PROFILE", profileVariable);
181181

182182
pwsh.InvokeCommand(psCommand);
183-
184183
}
185184

186185
public static void ImportModule(this PowerShell pwsh, string moduleNameOrPath)
@@ -190,7 +189,6 @@ public static void ImportModule(this PowerShell pwsh, string moduleNameOrPath)
190189
.InvokeAndClear();
191190
}
192191

193-
194192
public static string GetErrorString(this PowerShell pwsh)
195193
{
196194
var sb = new StringBuilder(capacity: 1024)

0 commit comments

Comments
 (0)