mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 18:47:57 -05:00
Fix signature help test to run synchronously (#2186)
This commit is contained in:
@@ -986,12 +986,22 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update the autocomplete metadata provider when the user connects to a database
|
||||
/// Starts a Task to update the autocomplete metadata provider when the user connects to a database
|
||||
/// </summary>
|
||||
/// <param name="info"></param>
|
||||
/// <param name="info">Connection info</param>
|
||||
public Task UpdateLanguageServiceOnConnection(ConnectionInfo info)
|
||||
{
|
||||
return Task.Run(() =>
|
||||
{
|
||||
DoUpdateLanguageServiceOnConnection(info);
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update the autocomplete metadata provider when the user connects to a database synchronously
|
||||
/// </summary>
|
||||
/// <param name="info">Connection info</param>
|
||||
public void DoUpdateLanguageServiceOnConnection(ConnectionInfo info)
|
||||
{
|
||||
if (ConnectionService.IsDedicatedAdminConnection(info.ConnectionDetails))
|
||||
{
|
||||
@@ -1022,7 +1032,6 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
|
||||
|
||||
// Send a notification to signal that autocomplete is ready
|
||||
ServiceHostInstance.SendEvent(IntelliSenseReadyNotification.Type, new IntelliSenseReadyParams() { OwnerUri = info.OwnerUri });
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.SqlTools.ServiceLayer.IntegrationTests.Utility;
|
||||
using Microsoft.SqlTools.ServiceLayer.LanguageServices;
|
||||
@@ -220,7 +219,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.LanguageServer
|
||||
/// provide signature help.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public async Task GetSignatureHelpReturnsNotNullIfParseInfoInitialized()
|
||||
public void GetSignatureHelpReturnsNotNullIfParseInfoInitialized()
|
||||
{
|
||||
// When we make a connection to a live database
|
||||
Hosting.ServiceHost.SendEventIgnoreExceptions = true;
|
||||
@@ -244,8 +243,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.LanguageServer
|
||||
|
||||
// If the SQL has already been parsed
|
||||
var service = CreateLanguageService(result.ScriptFile);
|
||||
await service.UpdateLanguageServiceOnConnection(result.ConnectionInfo);
|
||||
Thread.Sleep(2000);
|
||||
service.DoUpdateLanguageServiceOnConnection(result.ConnectionInfo);
|
||||
|
||||
// We should get back a non-null ScriptParseInfo
|
||||
ScriptParseInfo? parseInfo = service.GetScriptParseInfo(result.ScriptFile.ClientUri);
|
||||
|
||||
Reference in New Issue
Block a user