Fixing some issues, added documents

This commit is contained in:
Leila Lali
2016-08-22 15:32:41 -07:00
parent 3f1d3cb9db
commit ebfc5c57a5
2 changed files with 12 additions and 5 deletions

View File

@@ -7,10 +7,14 @@ using Microsoft.SqlTools.ServiceLayer.Hosting.Protocol.Contracts;
namespace Microsoft.SqlTools.ServiceLayer.Hosting.Contracts
{
/// <summary>
/// Defines a message that is sent from the client to request
/// the version of the server.
/// </summary>
public class VersionRequest
{
public static readonly
RequestType<string, string> Type =
RequestType<string, string>.Create("version");
RequestType<object, string> Type =
RequestType<object, string>.Create("version");
}
}

View File

@@ -71,7 +71,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Hosting
private readonly List<InitializeCallback> initializeCallbacks;
private static Version _serviceServion = Assembly.GetEntryAssembly().GetName().Version;
private static readonly Version serviceVersion = Assembly.GetEntryAssembly().GetName().Version;
#endregion
@@ -153,12 +153,15 @@ namespace Microsoft.SqlTools.ServiceLayer.Hosting
});
}
/// <summary>
/// Handles the version request. Sends back the server version as result.
/// </summary>
private static async Task HandleVersionRequest(
string workspaceSymbolParams,
object versionRequestParams,
RequestContext<string> requestContext)
{
Logger.Write(LogLevel.Verbose, "HandleVersionRequest");
await requestContext.SendResult(_serviceServion.ToString());
await requestContext.SendResult(serviceVersion.ToString());
}
#endregion