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:
Kevin Cunnane
2017-06-12 13:28:24 -07:00
committed by GitHub
parent b0263f8867
commit 869cd1439f
13 changed files with 537 additions and 434 deletions

View File

@@ -0,0 +1,42 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlTools.Hosting.Protocol.Contracts;
namespace Microsoft.SqlTools.ServiceLayer.Connection.Contracts
{
/// <summary>
/// Parameters for the Language Flavor Change notification.
/// </summary>
public class LanguageFlavorChangeParams
{
/// <summary>
/// A URI identifying the affected resource
/// </summary>
public string Uri { get; set; }
/// <summary>
/// The primary language
/// </summary>
public string Language { get; set; }
/// <summary>
/// The specific language flavor that is being set
/// </summary>
public string Flavor { get; set; }
}
/// <summary>
/// Defines an event that is sent from the client to notify that
/// the client is exiting and the server should as well.
/// </summary>
public class LanguageFlavorChangeNotification
{
public static readonly
EventType<LanguageFlavorChangeParams> Type =
EventType<LanguageFlavorChangeParams>.Create("connection/languageflavorchanged");
}
}