mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-13 17:23:02 -05:00
Fix for srGen designer issues (#321)
* removing designer files * adding designer files to gitignore * updating refs and tests
This commit is contained in:
@@ -5,20 +5,20 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Composition;
|
||||
using System.Composition;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.SqlTools.Extensibility;
|
||||
using Microsoft.SqlTools.Hosting;
|
||||
using Microsoft.SqlTools.Hosting.Protocol;
|
||||
using Microsoft.SqlTools.Extensibility;
|
||||
using Microsoft.SqlTools.Hosting;
|
||||
using Microsoft.SqlTools.Hosting.Protocol;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes;
|
||||
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
|
||||
using Microsoft.SqlTools.Utility;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
||||
{
|
||||
/// <summary>
|
||||
@@ -61,8 +61,8 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
||||
{
|
||||
return applicableNodeChildFactories.Value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// As an <see cref="IComposableService"/>, this will be set whenever the service is initialized
|
||||
/// via an <see cref="IMultiServiceProvider"/>
|
||||
@@ -126,18 +126,18 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
||||
await HandleRequestAsync(doCreateSession, context, "HandleCreateSessionRequest");
|
||||
}
|
||||
|
||||
internal async Task<NodeInfo[]> ExpandNode(ObjectExplorerSession session, string nodePath)
|
||||
{
|
||||
return await Task.Factory.StartNew(() =>
|
||||
{
|
||||
NodeInfo[] nodes = null;
|
||||
TreeNode node = session.Root.FindNodeByPath(nodePath);
|
||||
if(node != null)
|
||||
{
|
||||
nodes = node.Expand().Select(x => x.ToNodeInfo()).ToArray();
|
||||
}
|
||||
return nodes;
|
||||
});
|
||||
internal async Task<NodeInfo[]> ExpandNode(ObjectExplorerSession session, string nodePath)
|
||||
{
|
||||
return await Task.Factory.StartNew(() =>
|
||||
{
|
||||
NodeInfo[] nodes = null;
|
||||
TreeNode node = session.Root.FindNodeByPath(nodePath);
|
||||
if(node != null)
|
||||
{
|
||||
nodes = node.Expand().Select(x => x.ToNodeInfo()).ToArray();
|
||||
}
|
||||
return nodes;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -168,14 +168,14 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
||||
{
|
||||
// open connection based on request details
|
||||
ConnectionCompleteParams result = await connectionService.Connect(connectParams);
|
||||
if(result != null && !string.IsNullOrEmpty(result.ConnectionId))
|
||||
{
|
||||
return result;
|
||||
if(result != null && !string.IsNullOrEmpty(result.ConnectionId))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
await serviceHost.SendEvent(ConnectionCompleteNotification.Type, result);
|
||||
return null;
|
||||
else
|
||||
{
|
||||
await serviceHost.SendEvent(ConnectionCompleteNotification.Type, result);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -202,13 +202,13 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
||||
string uri = expandParams.SessionId;
|
||||
ObjectExplorerSession session = null;
|
||||
NodeInfo[] nodes = null;
|
||||
if (sessionMap.ContainsKey(uri))
|
||||
{
|
||||
session = sessionMap[uri];
|
||||
if (sessionMap.ContainsKey(uri))
|
||||
{
|
||||
session = sessionMap[uri];
|
||||
}
|
||||
else
|
||||
{
|
||||
//TODO: error
|
||||
else
|
||||
{
|
||||
//TODO: error
|
||||
}
|
||||
|
||||
|
||||
@@ -303,11 +303,11 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
||||
{
|
||||
if (serviceProvider == null)
|
||||
{
|
||||
throw new InvalidOperationException(SqlTools.Hosting.Localization.sr.ServiceProviderNotSet);
|
||||
throw new InvalidOperationException(SqlTools.Hosting.SR.ServiceProviderNotSet);
|
||||
}
|
||||
if (connectionService == null)
|
||||
{
|
||||
throw new InvalidOperationException(SqlTools.Hosting.Localization.sr.ServiceProviderNotSet);
|
||||
throw new InvalidOperationException(SqlTools.Hosting.SR.ServiceProviderNotSet);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
||||
childFactories[parent] = applicableFactories;
|
||||
}
|
||||
applicableFactories.Add(factory);
|
||||
}
|
||||
}
|
||||
|
||||
internal class ObjectExplorerSession
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user