mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-17 02:51:45 -05:00
Fixing a handful of warnings that showed up since the upgrade to .NET Core 2 (#411)
This commit is contained in:
@@ -67,13 +67,13 @@ namespace Microsoft.SqlTools.Hosting
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async Task<T> HandleRequestAsync<T>(Func<Task<T>> handler, RequestContext<T> requestContext, string requestType)
|
protected async Task<THandler> HandleRequestAsync<THandler>(Func<Task<THandler>> handler, RequestContext<THandler> requestContext, string requestType)
|
||||||
{
|
{
|
||||||
Logger.Write(LogLevel.Verbose, requestType);
|
Logger.Write(LogLevel.Verbose, requestType);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
T result = await handler();
|
THandler result = await handler();
|
||||||
await requestContext.SendResult(result);
|
await requestContext.SendResult(result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -81,7 +81,7 @@ namespace Microsoft.SqlTools.Hosting
|
|||||||
{
|
{
|
||||||
await requestContext.SendError(ex.ToString());
|
await requestContext.SendError(ex.ToString());
|
||||||
}
|
}
|
||||||
return default(T);
|
return default(THandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract void InitializeService(IProtocolEndpoint serviceHost);
|
public abstract void InitializeService(IProtocolEndpoint serviceHost);
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ namespace Microsoft.SqlTools.Hosting
|
|||||||
{
|
{
|
||||||
public abstract class ServiceHostBase : ProtocolEndpoint
|
public abstract class ServiceHostBase : ProtocolEndpoint
|
||||||
{
|
{
|
||||||
private bool isStarted;
|
|
||||||
private TaskCompletionSource<bool> serverExitedTask;
|
private TaskCompletionSource<bool> serverExitedTask;
|
||||||
|
|
||||||
protected ServiceHostBase(ChannelBase serverChannel) :
|
protected ServiceHostBase(ChannelBase serverChannel) :
|
||||||
@@ -25,6 +24,7 @@ namespace Microsoft.SqlTools.Hosting
|
|||||||
// Register handlers for server lifetime messages
|
// Register handlers for server lifetime messages
|
||||||
|
|
||||||
this.SetEventHandler(ExitNotification.Type, this.HandleExitNotification);
|
this.SetEventHandler(ExitNotification.Type, this.HandleExitNotification);
|
||||||
|
this.serverExitedTask = new TaskCompletionSource<bool>();
|
||||||
|
|
||||||
return Task.FromResult(true);
|
return Task.FromResult(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
||||||
//
|
|
||||||
|
|
||||||
namespace System
|
|
||||||
{
|
|
||||||
internal interface ICloneable
|
|
||||||
{
|
|
||||||
object Clone();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -21,10 +21,11 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
|
|||||||
origContext = context;
|
origContext = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual async Task SendEvent<TParams>(EventType<TParams> eventType, TParams eventParams)
|
public virtual Task SendEvent<TParams>(EventType<TParams> eventType, TParams eventParams)
|
||||||
{
|
{
|
||||||
// no op to swallow events
|
// no op to swallow events
|
||||||
// in the future this could be used to roll up events and send them back in the result
|
// in the future this could be used to roll up events and send them back in the result
|
||||||
|
return Task.FromResult(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -933,8 +933,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Connection
|
|||||||
[Fact]
|
[Fact]
|
||||||
public void StatementCompletedTests()
|
public void StatementCompletedTests()
|
||||||
{
|
{
|
||||||
bool handlerCalled = false;
|
StatementCompletedEventHandler handler = (s, e) => { };
|
||||||
StatementCompletedEventHandler handler = (s, e) => handlerCalled = true;
|
|
||||||
var command = new DbCommandWrapper(new SqlCommand());
|
var command = new DbCommandWrapper(new SqlCommand());
|
||||||
command.StatementCompleted += handler;
|
command.StatementCompleted += handler;
|
||||||
command.StatementCompleted -= handler;
|
command.StatementCompleted -= handler;
|
||||||
|
|||||||
Reference in New Issue
Block a user