mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-02 01:25:42 -05:00
Add LanguageFlavorNotification handling and refactor LanguageService (#375)
* Add LanguageFlavorNotification handling and refactor LanguageService - Added new notification handler for language flavor changed - Refactored the LanguageService so that it no longer relies on so many intertwined static calls, which meant it was impossible to test without modifying the static instance. This will help with test reliability in the future, and prep for replacing the instance with a service provider. * Skip if not an MSSQL doc and add test * Handle definition requests * Fix diagnostics handling
This commit is contained in:
@@ -8,15 +8,15 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.SqlTools.Extensibility;
|
||||
using Microsoft.SqlTools.Extensibility;
|
||||
using Microsoft.SqlTools.Hosting;
|
||||
using Microsoft.SqlTools.Hosting.Contracts;
|
||||
using Microsoft.SqlTools.Hosting.Protocol;
|
||||
using Microsoft.SqlTools.Hosting.Protocol.Channel;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection;
|
||||
using Microsoft.SqlTools.ServiceLayer.Admin;
|
||||
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection;
|
||||
using Microsoft.SqlTools.ServiceLayer.Admin;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.Hosting
|
||||
{
|
||||
/// <summary>
|
||||
@@ -26,7 +26,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Hosting
|
||||
/// </summary>
|
||||
public sealed class ServiceHost : ServiceHostBase
|
||||
{
|
||||
private const string ProviderName = "MSSQL";
|
||||
public const string ProviderName = "MSSQL";
|
||||
private const string ProviderDescription = "Microsoft SQL Server";
|
||||
private const string ProviderProtocolVersion = "1.0";
|
||||
|
||||
@@ -62,17 +62,17 @@ namespace Microsoft.SqlTools.ServiceLayer.Hosting
|
||||
// Initialize the shutdown activities
|
||||
shutdownCallbacks = new List<ShutdownCallback>();
|
||||
initializeCallbacks = new List<InitializeCallback>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public IMultiServiceProvider ServiceProvider
|
||||
{
|
||||
get
|
||||
{
|
||||
return serviceProvider;
|
||||
get
|
||||
{
|
||||
return serviceProvider;
|
||||
}
|
||||
internal set
|
||||
{
|
||||
serviceProvider = value;
|
||||
internal set
|
||||
{
|
||||
serviceProvider = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,8 +192,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Hosting
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles a request for the capabilities request
|
||||
/// <summary>
|
||||
/// Handles a request for the capabilities request
|
||||
/// </summary>
|
||||
internal async Task HandleCapabilitiesRequest(
|
||||
CapabilitiesRequest initializeParams,
|
||||
|
||||
Reference in New Issue
Block a user