Added disconnect and connect when already connected service code

This commit is contained in:
Mitchell Sternke
2016-08-05 17:46:16 -07:00
parent 8fba793a46
commit 5c03ba336d
6 changed files with 364 additions and 94 deletions

View File

@@ -103,10 +103,7 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
WorkspaceService<SqlToolsSettings>.Instance.RegisterTextDocChangeCallback(HandleDidChangeTextDocumentNotification);
// Register the file open update handler
WorkspaceService<SqlToolsSettings>.Instance.RegisterTextDocOpenCallback(HandleDidOpenTextDocumentNotification);
// register an OnConnection callback
ConnectionService.Instance.RegisterOnConnectionTask(OnConnection);
WorkspaceService<SqlToolsSettings>.Instance.RegisterTextDocOpenCallback(HandleDidOpenTextDocumentNotification);
// Store the SqlToolsContext for future use
Context = context;
@@ -305,16 +302,6 @@ namespace Microsoft.SqlTools.ServiceLayer.LanguageServices
CurrentSettings.ScriptAnalysis.Update(newSettings.ScriptAnalysis, CurrentWorkspace.WorkspacePath);
}
/// <summary>
/// Callback for when a user connection is done processing
/// </summary>
/// <param name="sqlConnection"></param>
public async Task OnConnection(ConnectionInfo connectionInfo)
{
// TODO consider whether this is needed at all - currently AutoComplete service handles its own updating
await Task.FromResult(true);
}
#endregion
#region Private Helpers