mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
* Strings sweep for connection service * String sweep for credentials service * String sweep for hosting * String sweep for query execution service * String sweep for Workspace service * Renaming utility namespace to match standards Renaming Microsoft.SqlTools.EditorServices.Utility to Microsoft.SqlTools.ServiceLayer.Utility to match the naming changes done a while back. Also renaming them on the files that use them * Namespace change on reliable connection * Adding the new resx and designer files * Final bug fixes for srgen Fixing flakey moq package name * Removing todo as per @kevcunnane * Adding using statements as per @llali's comment * Fixing issues from broken unit tests Note: This feature contains changes that will break the contract for saving as CSV and JSON. On success, null is returned as a message instead of "Success". Changes will be made to the vscode component to handle this change.
58 lines
2.4 KiB
C#
58 lines
2.4 KiB
C#
//
|
|
// Copyright (c) Microsoft. All rights reserved.
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
using System;
|
|
using Microsoft.SqlTools.ServiceLayer.Hosting;
|
|
using Microsoft.SqlTools.ServiceLayer.SqlContext;
|
|
using Microsoft.SqlTools.ServiceLayer.Workspace;
|
|
using Microsoft.SqlTools.ServiceLayer.LanguageServices;
|
|
using Microsoft.SqlTools.ServiceLayer.Connection;
|
|
using Microsoft.SqlTools.ServiceLayer.QueryExecution;
|
|
using Microsoft.SqlTools.ServiceLayer.Credentials;
|
|
using Microsoft.SqlTools.ServiceLayer.Utility;
|
|
|
|
namespace Microsoft.SqlTools.ServiceLayer
|
|
{
|
|
/// <summary>
|
|
/// Main application class for SQL Tools API Service Host executable
|
|
/// </summary>
|
|
class Program
|
|
{
|
|
/// <summary>
|
|
/// Main entry point into the SQL Tools API Service Host
|
|
/// </summary>
|
|
static void Main(string[] args)
|
|
{
|
|
// turn on Verbose logging during early development
|
|
// we need to switch to Normal when preparing for public preview
|
|
Logger.Initialize(minimumLogLevel: LogLevel.Verbose);
|
|
Logger.Write(LogLevel.Normal, "Starting SQL Tools Service Host");
|
|
|
|
const string hostName = "SQL Tools Service Host";
|
|
const string hostProfileId = "SQLToolsService";
|
|
Version hostVersion = new Version(1,0);
|
|
|
|
// set up the host details and profile paths
|
|
var hostDetails = new HostDetails(hostName, hostProfileId, hostVersion);
|
|
var profilePaths = new ProfilePaths(hostProfileId, "baseAllUsersPath", "baseCurrentUserPath");
|
|
SqlToolsContext sqlToolsContext = new SqlToolsContext(hostDetails, profilePaths);
|
|
|
|
// Grab the instance of the service host
|
|
ServiceHost serviceHost = ServiceHost.Instance;
|
|
|
|
// Start the service
|
|
serviceHost.Start().Wait();
|
|
|
|
// Initialize the services that will be hosted here
|
|
WorkspaceService<SqlToolsSettings>.Instance.InitializeService(serviceHost);
|
|
LanguageService.Instance.InitializeService(serviceHost, sqlToolsContext);
|
|
ConnectionService.Instance.InitializeService(serviceHost);
|
|
CredentialService.Instance.InitializeService(serviceHost);
|
|
QueryExecutionService.Instance.InitializeService(serviceHost);
|
|
|
|
serviceHost.Initialize();
|
|
serviceHost.WaitForExit();
|
|
}
|
|
}
|
|
}
|