mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 10:58:30 -05:00
fixed the issue with loading dlls for service provider (#312)
* fixed the issue with loading dlls for service provider
This commit is contained in:
@@ -3,7 +3,8 @@
|
|||||||
"version": "1.0.0-*",
|
"version": "1.0.0-*",
|
||||||
"buildOptions": {
|
"buildOptions": {
|
||||||
"debugType": "portable",
|
"debugType": "portable",
|
||||||
"emitEntryPoint": false
|
"emitEntryPoint": false,
|
||||||
|
"preserveCompilationContext": true
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"Integration": {
|
"Integration": {
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Formatter
|
|||||||
|
|
||||||
public override void InitializeService(IProtocolEndpoint serviceHost)
|
public override void InitializeService(IProtocolEndpoint serviceHost)
|
||||||
{
|
{
|
||||||
|
Logger.Write(LogLevel.Verbose, "TSqlFormatter initialized");
|
||||||
serviceHost.SetRequestHandler(DocumentFormattingRequest.Type, HandleDocFormatRequest);
|
serviceHost.SetRequestHandler(DocumentFormattingRequest.Type, HandleDocFormatRequest);
|
||||||
serviceHost.SetRequestHandler(DocumentRangeFormattingRequest.Type, HandleDocRangeFormatRequest);
|
serviceHost.SetRequestHandler(DocumentRangeFormattingRequest.Type, HandleDocRangeFormatRequest);
|
||||||
WorkspaceService?.RegisterConfigChangeCallback(HandleDidChangeConfigurationNotification);
|
WorkspaceService?.RegisterConfigChangeCallback(HandleDidChangeConfigurationNotification);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Composition;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -24,6 +25,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
|||||||
/// A Service to support querying server and database information as an Object Explorer tree.
|
/// A Service to support querying server and database information as an Object Explorer tree.
|
||||||
/// The APIs used for this are modeled closely on the VSCode TreeExplorerNodeProvider API.
|
/// The APIs used for this are modeled closely on the VSCode TreeExplorerNodeProvider API.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[Export(typeof(IHostedService))]
|
||||||
public class ObjectExplorerService : HostedService<ObjectExplorerService>, IComposableService
|
public class ObjectExplorerService : HostedService<ObjectExplorerService>, IComposableService
|
||||||
{
|
{
|
||||||
internal const string uriPrefix = "objectexplorer://";
|
internal const string uriPrefix = "objectexplorer://";
|
||||||
@@ -79,6 +81,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
|||||||
/// <param name="serviceHost">The service host instance to register with</param>
|
/// <param name="serviceHost">The service host instance to register with</param>
|
||||||
public override void InitializeService(IProtocolEndpoint serviceHost)
|
public override void InitializeService(IProtocolEndpoint serviceHost)
|
||||||
{
|
{
|
||||||
|
Logger.Write(LogLevel.Verbose, "ObjectExplorer service initialized");
|
||||||
this.serviceHost = serviceHost;
|
this.serviceHost = serviceHost;
|
||||||
// Register handlers for requests
|
// Register handlers for requests
|
||||||
serviceHost.SetRequestHandler(CreateSessionRequest.Type, HandleCreateSessionRequest);
|
serviceHost.SetRequestHandler(CreateSessionRequest.Type, HandleCreateSessionRequest);
|
||||||
@@ -165,7 +168,16 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
|||||||
{
|
{
|
||||||
// open connection based on request details
|
// open connection based on request details
|
||||||
ConnectionCompleteParams result = await connectionService.Connect(connectParams);
|
ConnectionCompleteParams result = await connectionService.Connect(connectParams);
|
||||||
return result;
|
if(result != null && !string.IsNullOrEmpty(result.ConnectionId))
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await serviceHost.SendEvent(ConnectionCompleteNotification.Type, result);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
"version": "1.0.0-*",
|
"version": "1.0.0-*",
|
||||||
"buildOptions": {
|
"buildOptions": {
|
||||||
"debugType": "portable",
|
"debugType": "portable",
|
||||||
"emitEntryPoint": true
|
"emitEntryPoint": true,
|
||||||
|
"preserveCompilationContext": true
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"Integration": {
|
"Integration": {
|
||||||
@@ -33,7 +34,7 @@
|
|||||||
"System.Threading.Thread": "4.0.0",
|
"System.Threading.Thread": "4.0.0",
|
||||||
"System.Runtime.Loader": "4.0.0",
|
"System.Runtime.Loader": "4.0.0",
|
||||||
"System.Composition": "1.0.31-beta-24326-02",
|
"System.Composition": "1.0.31-beta-24326-02",
|
||||||
"Microsoft.Extensions.DependencyModel": "1.0.0",
|
"Microsoft.Extensions.DependencyModel": "1.0.0",
|
||||||
"Microsoft.SqlTools.Hosting": {
|
"Microsoft.SqlTools.Hosting": {
|
||||||
"target": "project"
|
"target": "project"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ObjectExplorer
|
|||||||
{
|
{
|
||||||
return new ConnectionCompleteParams()
|
return new ConnectionCompleteParams()
|
||||||
{
|
{
|
||||||
|
ConnectionId = Guid.NewGuid().ToString(),
|
||||||
OwnerUri = uri,
|
OwnerUri = uri,
|
||||||
ConnectionSummary = new ConnectionSummary()
|
ConnectionSummary = new ConnectionSummary()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user