Skip to content

Commit 3c88939

Browse files
committed
Fix all compiler warnings
1 parent 638a066 commit 3c88939

File tree

8 files changed

+29
-29
lines changed

8 files changed

+29
-29
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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ protected async Task HandleLaunchRequest(
150150
string workingDir =
151151
launchParams.Cwd ??
152152
launchParams.Script ??
153+
#pragma warning disable 618
153154
launchParams.Program;
155+
#pragma warning restore 618
154156

155157
if (workingDir != null)
156158
{
@@ -192,7 +194,9 @@ protected async Task HandleLaunchRequest(
192194

193195
// Store the launch parameters so that they can be used later
194196
this.noDebug = launchParams.NoDebug;
197+
#pragma warning disable 618
195198
this.scriptPathToLaunch = launchParams.Script ?? launchParams.Program;
199+
#pragma warning restore 618
196200
this.arguments = arguments;
197201

198202
await requestContext.SendResult(null);

src/PowerShellEditorServices.Protocol/Server/LanguageServer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
using Microsoft.PowerShell.EditorServices.Utility;
1313
using Newtonsoft.Json.Linq;
1414
using System;
15-
using System.Collections;
1615
using System.Collections.Generic;
1716
using System.IO;
1817
using System.Linq;

src/PowerShellEditorServices.Protocol/Server/LanguageServerBase.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Server
1212
{
1313
public abstract class LanguageServerBase : ProtocolEndpoint
1414
{
15-
private bool isStarted;
1615
private ChannelBase serverChannel;
17-
private TaskCompletionSource<bool> serverExitedTask;
1816

1917
public LanguageServerBase(ChannelBase serverChannel) :
2018
base(serverChannel, MessageProtocolType.LanguageServer)
@@ -72,12 +70,6 @@ private async Task HandleExitNotification(
7270
{
7371
// Stop the server channel
7472
await this.Stop();
75-
76-
// Notify any waiter that the server has exited
77-
if (this.serverExitedTask != null)
78-
{
79-
this.serverExitedTask.SetResult(true);
80-
}
8173
}
8274
}
8375
}

test/PowerShellEditorServices.Test.Host/LanguageServerTests.cs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -168,19 +168,22 @@ await this.SendRequest(
168168
[Fact(Skip = "Skipped until variable documentation gathering is added back.")]
169169
public async Task CompletesDetailOnVariableDocSuggestion()
170170
{
171-
//await this.SendOpenFileEvent("TestFiles\\CompleteFunctionName.ps1");
171+
await this.SendOpenFileEvent("TestFiles\\CompleteFunctionName.ps1");
172172

173-
//await this.SendRequest(
174-
// CompletionRequest.Type,
175-
// new TextDocumentPosition
176-
// {
177-
// Uri = "TestFiles\\CompleteFunctionName.ps1",
178-
// Position = new Position
179-
// {
180-
// Line = 7,
181-
// Character = 5
182-
// }
183-
// });
173+
await this.SendRequest(
174+
CompletionRequest.Type,
175+
new TextDocumentPosition
176+
{
177+
Uri = "TestFiles\\CompleteFunctionName.ps1",
178+
Position = new Position
179+
{
180+
Line = 7,
181+
Character = 5
182+
}
183+
});
184+
185+
// TODO: This section needs to be updated, seems that
186+
// CompletionsResponse is missing.
184187

185188
//CompletionsResponse completion = this.WaitForMessage<CompletionsResponse>();
186189
//List<string> entryName = new List<string>();

test/PowerShellEditorServices.Test/Debugging/DebugServiceTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ await this.debugService.SetLineBreakpoints(
112112
string arguments = string.Join(" ", args);
113113

114114
// Execute the script and wait for the breakpoint to be hit
115-
this.powerShellContext.ExecuteScriptAtPath(
116-
debugWithParamsFile.FilePath, arguments);
115+
Task executeTask =
116+
this.powerShellContext.ExecuteScriptAtPath(
117+
debugWithParamsFile.FilePath, arguments);
117118

118119
await this.AssertDebuggerStopped(debugWithParamsFile.FilePath);
119120

test/PowerShellEditorServices.Test/Session/PowerShellContextTests.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ public async Task CanExecutePSCommand()
7373
public async Task CanQueueParallelRunspaceRequests()
7474
{
7575
// Concurrently initiate 4 requests in the session
76-
this.powerShellContext.ExecuteScriptString("$x = 100");
76+
Task taskOne = this.powerShellContext.ExecuteScriptString("$x = 100");
7777
Task<RunspaceHandle> handleTask = this.powerShellContext.GetRunspaceHandle();
78-
this.powerShellContext.ExecuteScriptString("$x += 200");
79-
this.powerShellContext.ExecuteScriptString("$x = $x / 100");
78+
Task taskTwo = this.powerShellContext.ExecuteScriptString("$x += 200");
79+
Task taskThree = this.powerShellContext.ExecuteScriptString("$x = $x / 100");
8080

8181
PSCommand psCommand = new PSCommand();
8282
psCommand.AddScript("$x");
@@ -86,8 +86,11 @@ public async Task CanQueueParallelRunspaceRequests()
8686
RunspaceHandle handle = await handleTask;
8787
handle.Dispose();
8888

89+
// Wait for all of the executes to complete
90+
await Task.WhenAll(taskOne, taskTwo, taskThree, resultTask);
91+
8992
// At this point, the remaining command executions should execute and complete
90-
int result = (await resultTask).FirstOrDefault();
93+
int result = resultTask.Result.FirstOrDefault();
9194

9295
// 100 + 200 = 300, then divided by 100 is 3. We are ensuring that
9396
// the commands were executed in the sequence they were called.

0 commit comments

Comments
 (0)