mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 18:47:57 -05:00
Remove Hosting InternalsVisibleTo (#2009)
This commit is contained in:
@@ -45,7 +45,7 @@ namespace Microsoft.SqlTools.Hosting.Protocol
|
|||||||
/// handlers for requests, responses, and events that are
|
/// handlers for requests, responses, and events that are
|
||||||
/// transmitted through the channel.
|
/// transmitted through the channel.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal MessageDispatcher MessageDispatcher { get; set; }
|
public MessageDispatcher MessageDispatcher { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes an instance of the protocol server using the
|
/// Initializes an instance of the protocol server using the
|
||||||
|
|||||||
@@ -93,22 +93,6 @@ namespace Microsoft.SqlTools.Hosting
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string ServiceProviderNotSet
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Keys.GetString(Keys.ServiceProviderNotSet);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string ServiceNotFound
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Keys.GetString(Keys.ServiceNotFound);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string ServiceNotOfExpectedType
|
public static string ServiceNotOfExpectedType
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -181,12 +165,6 @@ namespace Microsoft.SqlTools.Hosting
|
|||||||
public const string IncompatibleServiceForExtensionLoader = "IncompatibleServiceForExtensionLoader";
|
public const string IncompatibleServiceForExtensionLoader = "IncompatibleServiceForExtensionLoader";
|
||||||
|
|
||||||
|
|
||||||
public const string ServiceProviderNotSet = "ServiceProviderNotSet";
|
|
||||||
|
|
||||||
|
|
||||||
public const string ServiceNotFound = "ServiceNotFound";
|
|
||||||
|
|
||||||
|
|
||||||
public const string ServiceNotOfExpectedType = "ServiceNotOfExpectedType";
|
public const string ServiceNotOfExpectedType = "ServiceNotOfExpectedType";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -149,14 +149,6 @@
|
|||||||
<value>Service of type {0} cannot be created by ExtensionLoader<{1}></value>
|
<value>Service of type {0} cannot be created by ExtensionLoader<{1}></value>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
</data>
|
</data>
|
||||||
<data name="ServiceProviderNotSet" xml:space="preserve">
|
|
||||||
<value>SetServiceProvider() was not called to establish the required service provider</value>
|
|
||||||
<comment></comment>
|
|
||||||
</data>
|
|
||||||
<data name="ServiceNotFound" xml:space="preserve">
|
|
||||||
<value>Service {0} was not found in the service provider</value>
|
|
||||||
<comment></comment>
|
|
||||||
</data>
|
|
||||||
<data name="ServiceNotOfExpectedType" xml:space="preserve">
|
<data name="ServiceNotOfExpectedType" xml:space="preserve">
|
||||||
<value>Service of Type {0} is not compatible with registered Type {1}</value>
|
<value>Service of Type {0} is not compatible with registered Type {1}</value>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
|
|||||||
@@ -42,10 +42,6 @@ MultipleServicesFound = Multiple services found for type {0}, expected only 1
|
|||||||
|
|
||||||
IncompatibleServiceForExtensionLoader = Service of type {0} cannot be created by ExtensionLoader<{1}>
|
IncompatibleServiceForExtensionLoader = Service of type {0} cannot be created by ExtensionLoader<{1}>
|
||||||
|
|
||||||
ServiceProviderNotSet = SetServiceProvider() was not called to establish the required service provider
|
|
||||||
|
|
||||||
ServiceNotFound = Service {0} was not found in the service provider
|
|
||||||
|
|
||||||
ServiceNotOfExpectedType = Service of Type {0} is not compatible with registered Type {1}
|
ServiceNotOfExpectedType = Service of Type {0} is not compatible with registered Type {1}
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|||||||
@@ -62,16 +62,6 @@
|
|||||||
<target state="new">Service of type {0} cannot be created by ExtensionLoader<{1}></target>
|
<target state="new">Service of type {0} cannot be created by ExtensionLoader<{1}></target>
|
||||||
<note></note>
|
<note></note>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="ServiceProviderNotSet">
|
|
||||||
<source>SetServiceProvider() was not called to establish the required service provider</source>
|
|
||||||
<target state="new">SetServiceProvider() was not called to establish the required service provider</target>
|
|
||||||
<note></note>
|
|
||||||
</trans-unit>
|
|
||||||
<trans-unit id="ServiceNotFound">
|
|
||||||
<source>Service {0} was not found in the service provider</source>
|
|
||||||
<target state="new">Service {0} was not found in the service provider</target>
|
|
||||||
<note></note>
|
|
||||||
</trans-unit>
|
|
||||||
<trans-unit id="ServiceNotOfExpectedType">
|
<trans-unit id="ServiceNotOfExpectedType">
|
||||||
<source>Service of Type {0} is not compatible with registered Type {1}</source>
|
<source>Service of Type {0} is not compatible with registered Type {1}</source>
|
||||||
<target state="new">Service of Type {0} is not compatible with registered Type {1}</target>
|
<target state="new">Service of Type {0} is not compatible with registered Type {1}</target>
|
||||||
|
|||||||
@@ -26,10 +26,6 @@
|
|||||||
<InternalsVisibleTo Include="Microsoft.SqlTools.ServiceLayer.UnitTests" />
|
<InternalsVisibleTo Include="Microsoft.SqlTools.ServiceLayer.UnitTests" />
|
||||||
<InternalsVisibleTo Include="Microsoft.SqlTools.ServiceLayer.IntegrationTests" />
|
<InternalsVisibleTo Include="Microsoft.SqlTools.ServiceLayer.IntegrationTests" />
|
||||||
<InternalsVisibleTo Include="Microsoft.SqlTools.ServiceLayer.Test.Common" />
|
<InternalsVisibleTo Include="Microsoft.SqlTools.ServiceLayer.Test.Common" />
|
||||||
<!-- Workaround for SRGen issues -->
|
|
||||||
<InternalsVisibleTo Include="MicrosoftSqlToolsServiceLayer" />
|
|
||||||
<InternalsVisibleTo Include="MicrosoftKustoServiceLayer" />
|
|
||||||
<InternalsVisibleTo Include="MicrosoftSqlToolsCredentials" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Localization\*.resx" />
|
<EmbeddedResource Include="Localization\*.resx" />
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Utility
|
|||||||
/// This listener class will listen for events from the SqlClientEventSource class
|
/// This listener class will listen for events from the SqlClientEventSource class
|
||||||
/// and forward them to the logger.
|
/// and forward them to the logger.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal class SqlClientListener : EventListener
|
public class SqlClientListener : EventListener
|
||||||
{
|
{
|
||||||
protected override void OnEventSourceCreated(EventSource eventSource)
|
protected override void OnEventSourceCreated(EventSource eventSource)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10613,6 +10613,14 @@ namespace Microsoft.SqlTools.ServiceLayer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string ServiceProviderNotSet
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Keys.GetString(Keys.ServiceProviderNotSet);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static string ConnectionServiceListDbErrorNotConnected(string uri)
|
public static string ConnectionServiceListDbErrorNotConnected(string uri)
|
||||||
{
|
{
|
||||||
return Keys.GetString(Keys.ConnectionServiceListDbErrorNotConnected, uri);
|
return Keys.GetString(Keys.ConnectionServiceListDbErrorNotConnected, uri);
|
||||||
@@ -11043,6 +11051,11 @@ namespace Microsoft.SqlTools.ServiceLayer
|
|||||||
return Keys.GetString(Keys.ObjectNotRenamable, urn);
|
return Keys.GetString(Keys.ObjectNotRenamable, urn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string ServiceNotFound(string serviceName)
|
||||||
|
{
|
||||||
|
return Keys.GetString(Keys.ServiceNotFound, serviceName);
|
||||||
|
}
|
||||||
|
|
||||||
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
public class Keys
|
public class Keys
|
||||||
{
|
{
|
||||||
@@ -15278,6 +15291,12 @@ namespace Microsoft.SqlTools.ServiceLayer
|
|||||||
public const string Permission_ImpersonateAnyLogin = "Permission_ImpersonateAnyLogin";
|
public const string Permission_ImpersonateAnyLogin = "Permission_ImpersonateAnyLogin";
|
||||||
|
|
||||||
|
|
||||||
|
public const string ServiceProviderNotSet = "ServiceProviderNotSet";
|
||||||
|
|
||||||
|
|
||||||
|
public const string ServiceNotFound = "ServiceNotFound";
|
||||||
|
|
||||||
|
|
||||||
private Keys()
|
private Keys()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|||||||
@@ -5843,4 +5843,13 @@ The Query Processor estimates that implementing the following index could improv
|
|||||||
<value>Impersonate Any Login</value>
|
<value>Impersonate Any Login</value>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ServiceProviderNotSet" xml:space="preserve">
|
||||||
|
<value>SetServiceProvider() was not called to establish the required service provider</value>
|
||||||
|
<comment></comment>
|
||||||
|
</data>
|
||||||
|
<data name="ServiceNotFound" xml:space="preserve">
|
||||||
|
<value>Service {0} was not found in the service provider</value>
|
||||||
|
<comment>.
|
||||||
|
Parameters: 0 - serviceName (string) </comment>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
|
|||||||
@@ -2567,3 +2567,6 @@ Permission_CreateAvailabilityGroup = Create availability group
|
|||||||
Permission_SelectAllUserSecurables = Select All User Securables
|
Permission_SelectAllUserSecurables = Select All User Securables
|
||||||
Permission_ConnectAnyDatabase = Connect Any Database
|
Permission_ConnectAnyDatabase = Connect Any Database
|
||||||
Permission_ImpersonateAnyLogin = Impersonate Any Login
|
Permission_ImpersonateAnyLogin = Impersonate Any Login
|
||||||
|
|
||||||
|
ServiceProviderNotSet = SetServiceProvider() was not called to establish the required service provider
|
||||||
|
ServiceNotFound(string serviceName) = Service {0} was not found in the service provider
|
||||||
|
|||||||
@@ -7137,6 +7137,16 @@ The Query Processor estimates that implementing the following index could improv
|
|||||||
<target state="new">Impersonate Any Login</target>
|
<target state="new">Impersonate Any Login</target>
|
||||||
<note></note>
|
<note></note>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="ServiceProviderNotSet">
|
||||||
|
<source>SetServiceProvider() was not called to establish the required service provider</source>
|
||||||
|
<target state="new">SetServiceProvider() was not called to establish the required service provider</target>
|
||||||
|
<note></note>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="ServiceNotFound">
|
||||||
|
<source>Service {0} was not found in the service provider</source>
|
||||||
|
<target state="new">Service {0} was not found in the service provider</target>
|
||||||
|
<note></note>
|
||||||
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
@@ -714,11 +714,11 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
|||||||
{
|
{
|
||||||
if (serviceProvider == null)
|
if (serviceProvider == null)
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException(SqlTools.Hosting.SR.ServiceProviderNotSet);
|
throw new InvalidOperationException(SR.ServiceProviderNotSet);
|
||||||
}
|
}
|
||||||
if (connectionService == null)
|
if (connectionService == null)
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException(SqlTools.Hosting.SR.ServiceProviderNotSet);
|
throw new InvalidOperationException(SR.ServiceProviderNotSet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
#nullable disable
|
#nullable disable
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
|
||||||
using Microsoft.SqlServer.Management.Smo;
|
using Microsoft.SqlServer.Management.Smo;
|
||||||
using Microsoft.SqlTools.Extensibility;
|
using Microsoft.SqlTools.Extensibility;
|
||||||
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes;
|
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes;
|
||||||
@@ -116,12 +115,11 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
|||||||
{
|
{
|
||||||
if (ServiceProvider == null)
|
if (ServiceProvider == null)
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException(SqlTools.Hosting.SR.ServiceProviderNotSet);
|
throw new InvalidOperationException(SR.ServiceProviderNotSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ServiceProvider.GetService<ObjectExplorerService>()
|
return ServiceProvider.GetService<ObjectExplorerService>()
|
||||||
?? throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture,
|
?? throw new InvalidOperationException(SR.ServiceNotFound(nameof(ObjectExplorerService)));
|
||||||
SqlTools.Hosting.SR.ServiceNotFound, nameof(ObjectExplorerService)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user