Skip to content

Commit 69cd810

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 ee8ebb8 commit 69cd810

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
@@ -113,7 +113,12 @@ protected async Task HandleConfigurationDoneRequest(
113113
// launch request.
114114
if (this.isLaunchRequestComplete)
115115
{
116-
this.LaunchScript(requestContext);
116+
// The script needs to be launched asynchronously but we
117+
// don't need to wait for it to complete. Store the task
118+
// in a variable to avoid the compiler warning.
119+
var unusedTask =
120+
this.LaunchScript(requestContext)
121+
.ConfigureAwait(false);
117122
}
118123

119124
this.isConfigurationDoneRequestComplete = true;
@@ -173,7 +178,12 @@ protected async Task HandleLaunchRequest(
173178
// configurationDone request.
174179
if (this.isConfigurationDoneRequestComplete)
175180
{
176-
this.LaunchScript(requestContext);
181+
// The script needs to be launched asynchronously but we
182+
// don't need to wait for it to complete. Store the task
183+
// in a variable to avoid the compiler warning.
184+
var unusedTask =
185+
this.LaunchScript(requestContext)
186+
.ConfigureAwait(false);
177187
}
178188

179189
this.isLaunchRequestComplete = true;

0 commit comments

Comments
 (0)