diff --git a/NuGet.Config b/NuGet.Config
index 45f5379b9..6efc7f7b9 100644
--- a/NuGet.Config
+++ b/NuGet.Config
@@ -3,10 +3,4 @@
-
-
-
-
-
-
-
\ No newline at end of file
+
diff --git a/PowerShellEditorServices.build.ps1 b/PowerShellEditorServices.build.ps1
index 0b36d5176..8f543c3a4 100644
--- a/PowerShellEditorServices.build.ps1
+++ b/PowerShellEditorServices.build.ps1
@@ -198,7 +198,7 @@ task SetupDotNet -Before Clean, Build, TestHost, TestServer, TestProtocol, Packa
# dotnet --version can return a semver that System.Version can't handle
# e.g.: 2.1.300-preview-01. The replace operator is used to remove any build suffix.
$version = (& $dotnetExePath --version) -replace '[+-].*$',''
- if ([version]$version -ge [version]$script:RequiredSdkVersion) {
+ if ($version -and [version]$version -ge [version]$script:RequiredSdkVersion) {
$script:dotnetExe = $dotnetExePath
}
else {
diff --git a/src/PowerShellEditorServices.Channel.WebSocket/WebsocketClientChannel.cs b/src/PowerShellEditorServices.Channel.WebSocket/WebsocketClientChannel.cs
index ea1142f76..edf2fd52f 100644
--- a/src/PowerShellEditorServices.Channel.WebSocket/WebsocketClientChannel.cs
+++ b/src/PowerShellEditorServices.Channel.WebSocket/WebsocketClientChannel.cs
@@ -39,7 +39,7 @@ public WebsocketClientChannel(string url)
this.serverUrl = url;
}
- public override async Task WaitForConnection()
+ public override async Task WaitForConnectionAsync()
{
try
{
@@ -52,7 +52,7 @@ public override async Task WaitForConnection()
{
Logger.Write(LogLevel.Warning,
string.Format("Failed to connect to WebSocket server. Error was '{0}'", wsException.Message));
-
+
}
throw;
@@ -99,7 +99,7 @@ protected override void Shutdown()
}
///
- /// Extension of that sends data to a WebSocket during FlushAsync
+ /// Extension of that sends data to a WebSocket during FlushAsync
/// and reads during WriteAsync.
///
internal class ClientWebSocketStream : MemoryStream
@@ -110,7 +110,7 @@ internal class ClientWebSocketStream : MemoryStream
/// Constructor
///
///
- /// It is expected that the socket is in an Open state.
+ /// It is expected that the socket is in an Open state.
///
///
public ClientWebSocketStream(ClientWebSocket socket)
@@ -119,7 +119,7 @@ public ClientWebSocketStream(ClientWebSocket socket)
}
///
- /// Reads from the WebSocket.
+ /// Reads from the WebSocket.
///
///
///
@@ -138,7 +138,7 @@ public override async Task ReadAsync(byte[] buffer, int offset, int count,
{
result = await socket.ReceiveAsync(new ArraySegment(buffer, offset, count), cancellationToken);
} while (!result.EndOfMessage);
-
+
if (result.MessageType == WebSocketMessageType.Close)
{
await socket.CloseAsync(WebSocketCloseStatus.NormalClosure, "Closing", cancellationToken);
diff --git a/src/PowerShellEditorServices.Channel.WebSocket/WebsocketServerChannel.cs b/src/PowerShellEditorServices.Channel.WebSocket/WebsocketServerChannel.cs
index 07acf953a..c3cb907de 100644
--- a/src/PowerShellEditorServices.Channel.WebSocket/WebsocketServerChannel.cs
+++ b/src/PowerShellEditorServices.Channel.WebSocket/WebsocketServerChannel.cs
@@ -17,8 +17,8 @@
namespace Microsoft.PowerShell.EditorServices.Channel.WebSocket
{
///
- /// Implementation of that implements the streams necessary for
- /// communicating via OWIN WebSockets.
+ /// Implementation of that implements the streams necessary for
+ /// communicating via OWIN WebSockets.
///
public class WebSocketServerChannel : ChannelBase
{
@@ -42,22 +42,22 @@ protected override void Initialize(IMessageSerializer messageSerializer)
this.MessageWriter =
new MessageWriter(
- new WebSocketStream(socketConnection),
+ new WebSocketStream(socketConnection),
messageSerializer);
}
///
- /// Dispatches data received during calls to OnMessageReceived in the class.
+ /// Dispatches data received during calls to OnMessageReceivedAsync in the class.
///
///
- /// This method calls an overriden version of the that dispatches messages on
- /// demand rather than running on a background thread.
+ /// This method calls an overriden version of the that dispatches messages on
+ /// demand rather than running on a background thread.
///
///
///
- public async Task Dispatch(ArraySegment message)
+ public async Task DispatchAsync(ArraySegment message)
{
- //Clear our stream
+ //Clear our stream
inStream.SetLength(0);
//Write data and dispatch to handlers
@@ -70,7 +70,7 @@ protected override void Shutdown()
this.socketConnection.Close(WebSocketCloseStatus.NormalClosure, "Server shutting down");
}
- public override Task WaitForConnection()
+ public override Task WaitForConnectionAsync()
{
// TODO: Need to update behavior here
return Task.FromResult(true);
@@ -78,11 +78,11 @@ public override Task WaitForConnection()
}
///
- /// Overriden that sends data through a during the FlushAsync call.
+ /// Overriden that sends data through a during the FlushAsync call.
///
///
/// FlushAsync will send data via the SendBinary method of the class. The memory streams length will
- /// then be set to 0 to reset the stream for additional data to be written.
+ /// then be set to 0 to reset the stream for additional data to be written.
///
internal class WebSocketStream : MemoryStream
{
@@ -106,7 +106,7 @@ public override async Task FlushAsync(CancellationToken cancellationToken)
///
public abstract class EditorServiceWebSocketConnection : WebSocketConnection
{
- protected EditorServiceWebSocketConnection()
+ protected EditorServiceWebSocketConnection()
{
Channel = new WebSocketServerChannel(this);
}
@@ -120,9 +120,9 @@ public override void OnOpen()
Server.Start();
}
- public override async Task OnMessageReceived(ArraySegment message, WebSocketMessageType type)
+ public override async Task OnMessageReceivedAsync(ArraySegment message, WebSocketMessageType type)
{
- await Channel.Dispatch(message);
+ await Channel.DispatchAsync(message);
}
public override Task OnCloseAsync(WebSocketCloseStatus? closeStatus, string closeStatusDescription)
diff --git a/src/PowerShellEditorServices.Host/CodeLens/CodeLensFeature.cs b/src/PowerShellEditorServices.Host/CodeLens/CodeLensFeature.cs
index ac5f388a3..e7e2f6910 100644
--- a/src/PowerShellEditorServices.Host/CodeLens/CodeLensFeature.cs
+++ b/src/PowerShellEditorServices.Host/CodeLens/CodeLensFeature.cs
@@ -49,11 +49,11 @@ public static CodeLensFeature Create(
messageHandlers.SetRequestHandler(
CodeLensRequest.Type,
- codeLenses.HandleCodeLensRequest);
+ codeLenses.HandleCodeLensRequestAsync);
messageHandlers.SetRequestHandler(
CodeLensResolveRequest.Type,
- codeLenses.HandleCodeLensResolveRequest);
+ codeLenses.HandleCodeLensResolveRequestAsync);
codeLenses.Providers.Add(
new ReferencesCodeLensProvider(
@@ -111,7 +111,7 @@ public CodeLens[] ProvideCodeLenses(ScriptFile scriptFile)
///
/// Parameters on the CodeLens request that was received.
///
- private async Task HandleCodeLensRequest(
+ private async Task HandleCodeLensRequestAsync(
CodeLensRequest codeLensParams,
RequestContext requestContext)
{
@@ -132,7 +132,7 @@ private async Task HandleCodeLensRequest(
_jsonSerializer);
}
- await requestContext.SendResult(codeLensResponse);
+ await requestContext.SendResultAsync(codeLensResponse);
}
///
@@ -140,7 +140,7 @@ private async Task HandleCodeLensRequest(
///
/// The CodeLens to be resolved/updated.
///
- private async Task HandleCodeLensResolveRequest(
+ private async Task HandleCodeLensResolveRequestAsync(
LanguageServer.CodeLens codeLens,
RequestContext requestContext)
{
@@ -178,13 +178,13 @@ await originalProvider.ResolveCodeLensAsync(
originalCodeLens,
CancellationToken.None);
- await requestContext.SendResult(
+ await requestContext.SendResultAsync(
resolvedCodeLens.ToProtocolCodeLens(
_jsonSerializer));
}
else
{
- await requestContext.SendError(
+ await requestContext.SendErrorAsync(
$"Could not find provider for the original CodeLens: {codeLensData.ProviderId}");
}
}
diff --git a/src/PowerShellEditorServices.Host/CodeLens/ReferencesCodeLensProvider.cs b/src/PowerShellEditorServices.Host/CodeLens/ReferencesCodeLensProvider.cs
index c833aec27..6a5312a93 100644
--- a/src/PowerShellEditorServices.Host/CodeLens/ReferencesCodeLensProvider.cs
+++ b/src/PowerShellEditorServices.Host/CodeLens/ReferencesCodeLensProvider.cs
@@ -82,7 +82,7 @@ public async Task ResolveCodeLensAsync(
codeLens.ScriptExtent.StartLineNumber,
codeLens.ScriptExtent.StartColumnNumber);
- FindReferencesResult referencesResult = await _editorSession.LanguageService.FindReferencesOfSymbol(
+ FindReferencesResult referencesResult = await _editorSession.LanguageService.FindReferencesOfSymbolAsync(
foundSymbol,
references,
_editorSession.Workspace);
diff --git a/src/PowerShellEditorServices.Host/EditorServicesHost.cs b/src/PowerShellEditorServices.Host/EditorServicesHost.cs
index 51e4a2db3..2f3275bf3 100644
--- a/src/PowerShellEditorServices.Host/EditorServicesHost.cs
+++ b/src/PowerShellEditorServices.Host/EditorServicesHost.cs
@@ -191,7 +191,7 @@ public void StartLanguageService(
this.languageServiceListener = CreateServiceListener(MessageProtocolType.LanguageServer, config);
- this.languageServiceListener.ClientConnect += this.OnLanguageServiceClientConnect;
+ this.languageServiceListener.ClientConnect += this.OnLanguageServiceClientConnectAsync;
this.languageServiceListener.Start();
this.logger.Write(
@@ -201,7 +201,7 @@ public void StartLanguageService(
config.TransportType, config.Endpoint));
}
- private async void OnLanguageServiceClientConnect(
+ private async void OnLanguageServiceClientConnectAsync(
object sender,
ChannelBase serverChannel)
{
@@ -231,7 +231,7 @@ private async void OnLanguageServiceClientConnect(
this.serverCompletedTask,
this.logger);
- await this.editorSession.PowerShellContext.ImportCommandsModule(
+ await this.editorSession.PowerShellContext.ImportCommandsModuleAsync(
Path.Combine(
Path.GetDirectoryName(this.GetType().GetTypeInfo().Assembly.Location),
@"..\Commands"));
@@ -247,7 +247,7 @@ await this.editorSession.PowerShellContext.ImportCommandsModule(
.AddCommand("Microsoft.PowerShell.Core\\Import-Module")
.AddParameter("Name", module);
- await this.editorSession.PowerShellContext.ExecuteCommand(
+ await this.editorSession.PowerShellContext.ExecuteCommandAsync(
command,
sendOutputToHost: false,
sendErrorToHost: true);
diff --git a/src/PowerShellEditorServices.Host/PSHost/PromptHandlers.cs b/src/PowerShellEditorServices.Host/PSHost/PromptHandlers.cs
index bae68616f..d8ec88c4e 100644
--- a/src/PowerShellEditorServices.Host/PSHost/PromptHandlers.cs
+++ b/src/PowerShellEditorServices.Host/PSHost/PromptHandlers.cs
@@ -37,7 +37,7 @@ protected override void ShowPrompt(PromptStyle promptStyle)
base.ShowPrompt(promptStyle);
messageSender
- .SendRequest(
+ .SendRequestAsync(
ShowChoicePromptRequest.Type,
new ShowChoicePromptRequest
{
@@ -51,7 +51,7 @@ protected override void ShowPrompt(PromptStyle promptStyle)
.ConfigureAwait(false);
}
- protected override Task ReadInputString(CancellationToken cancellationToken)
+ protected override Task ReadInputStringAsync(CancellationToken cancellationToken)
{
this.readLineTask = new TaskCompletionSource();
return this.readLineTask.Task;
@@ -120,7 +120,7 @@ protected override void ShowFieldPrompt(FieldDetails fieldDetails)
base.ShowFieldPrompt(fieldDetails);
messageSender
- .SendRequest(
+ .SendRequestAsync(
ShowInputPromptRequest.Type,
new ShowInputPromptRequest
{
@@ -131,7 +131,7 @@ protected override void ShowFieldPrompt(FieldDetails fieldDetails)
.ConfigureAwait(false);
}
- protected override Task ReadInputString(CancellationToken cancellationToken)
+ protected override Task ReadInputStringAsync(CancellationToken cancellationToken)
{
this.readLineTask = new TaskCompletionSource();
return this.readLineTask.Task;
@@ -176,7 +176,7 @@ private void HandlePromptResponse(
this.readLineTask = null;
}
- protected override Task ReadSecureString(CancellationToken cancellationToken)
+ protected override Task ReadSecureStringAsync(CancellationToken cancellationToken)
{
// TODO: Write a message to the console
throw new NotImplementedException();
diff --git a/src/PowerShellEditorServices.Host/PSHost/ProtocolPSHostUserInterface.cs b/src/PowerShellEditorServices.Host/PSHost/ProtocolPSHostUserInterface.cs
index c9a07e4a6..76b1f7252 100644
--- a/src/PowerShellEditorServices.Host/PSHost/ProtocolPSHostUserInterface.cs
+++ b/src/PowerShellEditorServices.Host/PSHost/ProtocolPSHostUserInterface.cs
@@ -47,7 +47,7 @@ public void Dispose()
// Make sure remaining output is flushed before exiting
if (this.outputDebouncer != null)
{
- this.outputDebouncer.Flush().Wait();
+ this.outputDebouncer.FlushAsync().Wait();
this.outputDebouncer = null;
}
}
@@ -82,7 +82,7 @@ public override void WriteOutput(
ConsoleColor backgroundColor)
{
// TODO: This should use a synchronous method!
- this.outputDebouncer.Invoke(
+ this.outputDebouncer.InvokeAsync(
new OutputWrittenEventArgs(
outputString,
includeNewLine,
@@ -102,7 +102,7 @@ protected override void UpdateProgress(
{
}
- protected override Task ReadCommandLine(CancellationToken cancellationToken)
+ protected override Task ReadCommandLineAsync(CancellationToken cancellationToken)
{
// This currently does nothing because the "evaluate" request
// will cancel the current prompt and execute the user's
diff --git a/src/PowerShellEditorServices.Host/Symbols/DocumentSymbolFeature.cs b/src/PowerShellEditorServices.Host/Symbols/DocumentSymbolFeature.cs
index 3db2a8dc8..da3402bde 100644
--- a/src/PowerShellEditorServices.Host/Symbols/DocumentSymbolFeature.cs
+++ b/src/PowerShellEditorServices.Host/Symbols/DocumentSymbolFeature.cs
@@ -33,7 +33,7 @@ public DocumentSymbolFeature(
messageHandlers.SetRequestHandler(
DocumentSymbolRequest.Type,
- this.HandleDocumentSymbolRequest);
+ this.HandleDocumentSymbolRequestAsync);
}
public static DocumentSymbolFeature Create(
@@ -69,7 +69,7 @@ public IEnumerable ProvideDocumentSymbols(
.SelectMany(r => r);
}
- protected async Task HandleDocumentSymbolRequest(
+ protected async Task HandleDocumentSymbolRequestAsync(
DocumentSymbolParams documentSymbolParams,
RequestContext requestContext)
{
@@ -109,7 +109,7 @@ protected async Task HandleDocumentSymbolRequest(
symbols = new SymbolInformation[0];
}
- await requestContext.SendResult(symbols);
+ await requestContext.SendResultAsync(symbols);
}
}
}
diff --git a/src/PowerShellEditorServices.Protocol/Client/DebugAdapterClientBase.cs b/src/PowerShellEditorServices.Protocol/Client/DebugAdapterClientBase.cs
index c90730a6d..b226fd0c4 100644
--- a/src/PowerShellEditorServices.Protocol/Client/DebugAdapterClientBase.cs
+++ b/src/PowerShellEditorServices.Protocol/Client/DebugAdapterClientBase.cs
@@ -28,12 +28,12 @@ public DebugAdapterClient(ChannelBase clientChannel, ILogger logger)
logger);
}
- public async Task Start()
+ public async Task StartAsync()
{
this.protocolEndpoint.Start();
// Initialize the debug adapter
- await this.SendRequest(
+ await this.SendRequestAsync(
InitializeRequest.Type,
new InitializeRequestArguments
{
@@ -48,34 +48,34 @@ public void Stop()
this.protocolEndpoint.Stop();
}
- public async Task LaunchScript(string scriptFilePath)
+ public async Task LaunchScriptAsync(string scriptFilePath)
{
- await this.SendRequest(
+ await this.SendRequestAsync(
LaunchRequest.Type,
new LaunchRequestArguments {
Script = scriptFilePath
},
true);
- await this.SendRequest(
+ await this.SendRequestAsync(
ConfigurationDoneRequest.Type,
null,
true);
}
- public Task SendEvent(NotificationType eventType, TParams eventParams)
+ public Task SendEventAsync(NotificationType eventType, TParams eventParams)
{
- return ((IMessageSender)protocolEndpoint).SendEvent(eventType, eventParams);
+ return ((IMessageSender)protocolEndpoint).SendEventAsync(eventType, eventParams);
}
- public Task SendRequest(RequestType requestType, TParams requestParams, bool waitForResponse)
+ public Task SendRequestAsync(RequestType requestType, TParams requestParams, bool waitForResponse)
{
- return ((IMessageSender)protocolEndpoint).SendRequest(requestType, requestParams, waitForResponse);
+ return ((IMessageSender)protocolEndpoint).SendRequestAsync(requestType, requestParams, waitForResponse);
}
- public Task SendRequest(RequestType0 requestType0)
+ public Task SendRequestAsync(RequestType0 requestType0)
{
- return ((IMessageSender)protocolEndpoint).SendRequest(requestType0);
+ return ((IMessageSender)protocolEndpoint).SendRequestAsync(requestType0);
}
public void SetRequestHandler(RequestType requestType, Func, Task> requestHandler)
diff --git a/src/PowerShellEditorServices.Protocol/Client/LanguageClientBase.cs b/src/PowerShellEditorServices.Protocol/Client/LanguageClientBase.cs
index c8dc383dc..0ccb3d5b5 100644
--- a/src/PowerShellEditorServices.Protocol/Client/LanguageClientBase.cs
+++ b/src/PowerShellEditorServices.Protocol/Client/LanguageClientBase.cs
@@ -41,46 +41,46 @@ public Task Start()
this.protocolEndpoint.Start();
// Initialize the implementation class
- return this.Initialize();
+ return this.InitializeAsync();
}
- public async Task Stop()
+ public async Task StopAsync()
{
- await this.OnStop();
+ await this.OnStopAsync();
// First, notify the language server that we're stopping
var response =
- await this.SendRequest