mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-24 17:24:14 -05:00
Enable Quick Info hover tooltips (#65)
Pushing to include in tomorrow's partner release build. Please send me any feedback and I'll address in the next Intellisense PR.
This commit is contained in:
@@ -7,18 +7,8 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.SqlServer.Management.Common;
|
||||
using Microsoft.SqlServer.Management.Smo;
|
||||
using Microsoft.SqlServer.Management.SmoMetadataProvider;
|
||||
using Microsoft.SqlServer.Management.SqlParser;
|
||||
using Microsoft.SqlServer.Management.SqlParser.Binder;
|
||||
using Microsoft.SqlServer.Management.SqlParser.Intellisense;
|
||||
using Microsoft.SqlServer.Management.SqlParser.MetadataProvider;
|
||||
using Microsoft.SqlServer.Management.SqlParser.Parser;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.Credentials;
|
||||
@@ -154,17 +144,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.LanguageServices
|
||||
|
||||
#region "General Language Service tests"
|
||||
|
||||
/// <summary>
|
||||
/// Check that autocomplete is enabled by default
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void CheckAutocompleteEnabledByDefault()
|
||||
{
|
||||
// get test service
|
||||
LanguageService service = TestObjects.GetTestLanguageService();
|
||||
Assert.True(service.ShouldEnableAutocomplete());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the service initialization code path and verify nothing throws
|
||||
/// </summary>
|
||||
@@ -260,8 +239,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.LanguageServices
|
||||
|
||||
// set up the host details and profile paths
|
||||
var hostDetails = new HostDetails(hostName, hostProfileId, hostVersion);
|
||||
var profilePaths = new ProfilePaths(hostProfileId, "baseAllUsersPath", "baseCurrentUserPath");
|
||||
SqlToolsContext sqlToolsContext = new SqlToolsContext(hostDetails, profilePaths);
|
||||
SqlToolsContext sqlToolsContext = new SqlToolsContext(hostDetails);
|
||||
|
||||
// Grab the instance of the service host
|
||||
Hosting.ServiceHost serviceHost = Hosting.ServiceHost.Instance;
|
||||
@@ -282,9 +260,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.LanguageServices
|
||||
private Hosting.ServiceHost GetTestServiceHost()
|
||||
{
|
||||
// set up the host details and profile paths
|
||||
var hostDetails = new HostDetails("Test Service Host", "SQLToolsService", new Version(1,0));
|
||||
var profilePaths = new ProfilePaths("SQLToolsService", "baseAllUsersPath", "baseCurrentUserPath");
|
||||
SqlToolsContext context = new SqlToolsContext(hostDetails, profilePaths);
|
||||
var hostDetails = new HostDetails("Test Service Host", "SQLToolsService", new Version(1,0));
|
||||
SqlToolsContext context = new SqlToolsContext(hostDetails);
|
||||
|
||||
// Grab the instance of the service host
|
||||
Hosting.ServiceHost host = Hosting.ServiceHost.Instance;
|
||||
|
||||
@@ -257,8 +257,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.QueryExecution
|
||||
new ScriptParseInfo
|
||||
{
|
||||
Binder = binder,
|
||||
MetadataProvider = metadataProvider,
|
||||
MetadataDisplayInfoProvider = displayInfoProvider
|
||||
MetadataProvider = metadataProvider
|
||||
});
|
||||
|
||||
scriptFile = new ScriptFile {ClientFilePath = textDocument.TextDocument.Uri};
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.LanguageServices
|
||||
Assert.True(sqlToolsSettings.SqlTools.EnableIntellisense);
|
||||
Assert.True(sqlToolsSettings.SqlTools.IntelliSense.EnableDiagnostics);
|
||||
Assert.True(sqlToolsSettings.SqlTools.IntelliSense.EnableSuggestions);
|
||||
Assert.True(sqlToolsSettings.SqlTools.IntelliSense.EnableQuickInfo);
|
||||
Assert.False(sqlToolsSettings.SqlTools.IntelliSense.LowerCaseSuggestions);
|
||||
}
|
||||
|
||||
@@ -52,7 +53,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.LanguageServices
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validate that the IsDiagnositicsEnabled flag behavior
|
||||
/// Validate that the IsSuggestionsEnabled flag behavior
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ValidateIsSuggestionsEnabled()
|
||||
@@ -73,5 +74,28 @@ namespace Microsoft.SqlTools.ServiceLayer.Test.LanguageServices
|
||||
sqlToolsSettings.SqlTools.IntelliSense.EnableSuggestions = false;
|
||||
Assert.False(sqlToolsSettings.IsSuggestionsEnabled);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validate that the IsQuickInfoEnabled flag behavior
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ValidateIsQuickInfoEnabled()
|
||||
{
|
||||
var sqlToolsSettings = new SqlToolsSettings();
|
||||
|
||||
// quick info is enabled if IntelliSense and quick info flags are set
|
||||
sqlToolsSettings.SqlTools.EnableIntellisense = true;
|
||||
sqlToolsSettings.SqlTools.IntelliSense.EnableQuickInfo = true;
|
||||
Assert.True(sqlToolsSettings.IsQuickInfoEnabled);
|
||||
|
||||
// quick info is disabled if either IntelliSense and quick info flags is not set
|
||||
sqlToolsSettings.SqlTools.EnableIntellisense = false;
|
||||
sqlToolsSettings.SqlTools.IntelliSense.EnableQuickInfo = true;
|
||||
Assert.False(sqlToolsSettings.IsQuickInfoEnabled);
|
||||
|
||||
sqlToolsSettings.SqlTools.EnableIntellisense = true;
|
||||
sqlToolsSettings.SqlTools.IntelliSense.EnableQuickInfo = false;
|
||||
Assert.False(sqlToolsSettings.IsQuickInfoEnabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user