Clear and rebuild IntelliSense cache (#238)

* Stage changes to other machine

* IntelliSense cache rebuild command

* Move to other machine

* Add a test for overwriting binding queue.

* Move event handler into lanaguageservice.cs
This commit is contained in:
Karl Burtram
2017-02-16 12:23:26 -08:00
committed by GitHub
parent 6f8fc51d6f
commit 5d0c187684
8 changed files with 148 additions and 8 deletions

View File

@@ -135,5 +135,27 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.LanguageServer
SignatureHelp signatureHelp = service.GetSignatureHelp(textDocument, result.ScriptFile);
Assert.NotNull(signatureHelp);
}
/// <summary>
/// Test overwriting the binding queue context
/// </summary>
[Fact]
public void OverwriteBindingContext()
{
var result = TestObjects.InitLiveConnectionInfo();
// add a new connection context
var connectionKey = LanguageService.Instance.BindingQueue.AddConnectionContext(result.ConnectionInfo, overwrite: true);
Assert.True(LanguageService.Instance.BindingQueue.BindingContextMap.ContainsKey(connectionKey));
// cache the server connection
var orgServerConnection = LanguageService.Instance.BindingQueue.BindingContextMap[connectionKey].ServerConnection;
Assert.NotNull(orgServerConnection);
// add a new connection context
connectionKey = LanguageService.Instance.BindingQueue.AddConnectionContext(result.ConnectionInfo, overwrite: true);
Assert.True(LanguageService.Instance.BindingQueue.BindingContextMap.ContainsKey(connectionKey));
Assert.False(object.ReferenceEquals(LanguageService.Instance.BindingQueue.BindingContextMap[connectionKey].ServerConnection, orgServerConnection));
}
}
}