Skip to content

Commit df5136f

Browse files
committed
Resolve compiler warnings in Protocol project
This change makes some spot fixes to alleviate compiler warnings that were being produced in the Protocol project.
1 parent e7652b6 commit df5136f

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

src/PowerShellEditorServices.Protocol/MessageProtocol/Channel/NamedPipeClientChannel.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel
1212
public class NamedPipeClientChannel : ChannelBase
1313
{
1414
private string pipeName;
15-
private bool isClientConnected;
1615
private NamedPipeClientStream pipeClient;
1716

1817
public NamedPipeClientChannel(string pipeName)

src/PowerShellEditorServices.Protocol/MessageProtocol/MessageDispatcher.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public class MessageDispatcher
1818
#region Fields
1919

2020
private ChannelBase protocolChannel;
21-
private AsyncQueue<Message> messagesToWrite;
2221
private AsyncContextThread messageLoopThread;
2322

2423
private Dictionary<string, Func<Message, MessageWriter, Task>> requestHandlers =

src/PowerShellEditorServices.Protocol/Server/DebugAdapter.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,12 @@ protected async Task HandleConfigurationDoneRequest(
115115
// launch request.
116116
if (this.isLaunchRequestComplete)
117117
{
118-
this.LaunchScript(requestContext);
118+
// The script needs to be launched asynchronously but we
119+
// don't need to wait for it to complete. Store the task
120+
// in a variable to avoid the compiler warning.
121+
var unusedTask =
122+
this.LaunchScript(requestContext)
123+
.ConfigureAwait(false);
119124
}
120125

121126
this.isConfigurationDoneRequestComplete = true;
@@ -175,7 +180,12 @@ protected async Task HandleLaunchRequest(
175180
// configurationDone request.
176181
if (this.isConfigurationDoneRequestComplete)
177182
{
178-
this.LaunchScript(requestContext);
183+
// The script needs to be launched asynchronously but we
184+
// don't need to wait for it to complete. Store the task
185+
// in a variable to avoid the compiler warning.
186+
var unusedTask =
187+
this.LaunchScript(requestContext)
188+
.ConfigureAwait(false);
179189
}
180190

181191
this.isLaunchRequestComplete = true;

0 commit comments

Comments
 (0)