Added notification for when language service is done updating after connect (#146)

* Added notification for when language service is done updating after connect

* Addressing feedback

* Added unit test
This commit is contained in:
Mitchell Sternke
2016-11-15 17:39:17 -08:00
committed by GitHub
parent f2b8a16d29
commit 2211bd0403
4 changed files with 56 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
//
// 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.ServiceLayer.Hosting.Protocol.Contracts;
namespace Microsoft.SqlTools.ServiceLayer.LanguageServices.Contracts
{
/// <summary>
/// Parameters sent back with an IntelliSense ready event
/// </summary>
public class IntelliSenseReadyParams
{
/// <summary>
/// URI identifying the text document
/// </summary>
public string OwnerUri { get; set; }
}
/// <summary>
/// Event sent when the language service is finished updating after a connection
/// </summary>
public class IntelliSenseReadyNotification
{
public static readonly
EventType<IntelliSenseReadyParams> Type =
EventType<IntelliSenseReadyParams>.Create("textDocument/intelliSenseReady");
}
}

View File

@@ -561,7 +561,10 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
}
}
AutoCompleteHelper.PrepopulateCommonMetadata(info, scriptInfo, this.BindingQueue);
AutoCompleteHelper.PrepopulateCommonMetadata(info, scriptInfo, this.BindingQueue);
// Send a notification to signal that autocomplete is ready
ServiceHost.Instance.SendEvent(IntelliSenseReadyNotification.Type, new IntelliSenseReadyParams() {OwnerUri = info.OwnerUri});
});
}