public async Task DefinitionTest() { using (SelfCleaningTempFile queryTempFile = new SelfCleaningTempFile()) using (TestServiceDriverProvider testService = new TestServiceDriverProvider()) { string query = "SELECT * FROM sys.objects"; int lineNumber = 0; int position = 23; testService.WriteToFile(queryTempFile.FilePath, query); DidOpenTextDocumentNotification openParams = new DidOpenTextDocumentNotification { TextDocument = new TextDocumentItem { Uri = queryTempFile.FilePath, LanguageId = "enu", Version = 1, Text = query } }; await testService.RequestOpenDocumentNotification(openParams); Thread.Sleep(500); bool connected = await testService.Connect(TestServerType.OnPrem, queryTempFile.FilePath); // Wait for intellisense to be ready var readyParams = await testService.Driver.WaitForEvent(IntelliSenseReadyNotification.Type, 30000); Assert.NotNull(readyParams); Assert.True(connected, "Connection is successful"); // Request definition for "objects" Location[] locations = await testService.RequestDefinition(queryTempFile.FilePath, query, lineNumber, position); Assert.True(locations != null, "Location is not null and not empty"); await testService.Disconnect(queryTempFile.FilePath); } }