Servicehost cleanup (#1)

Merge some code clean ups.  Find+Replace 'PowerShell' with 'SQL Tools'.
Enable logger in ServiceHost project.
This commit is contained in:
Karl Burtram
2016-07-15 20:48:31 -07:00
committed by GitHub
parent 790825cfab
commit c78292a680
108 changed files with 347 additions and 340 deletions

View File

@@ -3,12 +3,12 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel;
using Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.Client
namespace Microsoft.SqlTools.EditorServices.Protocol.Client
{
public class DebugAdapterClient : ProtocolEndpoint
{

View File

@@ -3,12 +3,12 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.LanguageServer;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel;
using Microsoft.SqlTools.EditorServices.Protocol.LanguageServer;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.Client
namespace Microsoft.SqlTools.EditorServices.Protocol.Client
{
/// <summary>
/// Provides a base implementation for language server clients.

View File

@@ -3,15 +3,15 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.LanguageServer;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel;
using Microsoft.SqlTools.EditorServices.Protocol.LanguageServer;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.Client
namespace Microsoft.SqlTools.EditorServices.Protocol.Client
{
public class LanguageServiceClient : LanguageClientBase
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class AttachRequest
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Utility;
using Microsoft.SqlTools.EditorServices.Utility;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class Breakpoint
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class ConfigurationDoneRequest
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class ContinueRequest
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class DisconnectRequest
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class EvaluateRequest
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class ExitedEvent
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class InitializeRequest
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class InitializedEvent
{

View File

@@ -4,9 +4,9 @@
//
using System.Collections.Generic;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class LaunchRequest
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
// /** StepOver request; value of command field is "next".
// he request starts the debuggee to run again for one step.

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class OutputEvent
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class PauseRequest
{

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class Scope
{

View File

@@ -4,9 +4,9 @@
//
using System.Diagnostics;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class ScopesRequest
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
/// <summary>
/// SetBreakpoints request; value of command field is "setBreakpoints".

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
/// <summary>
/// SetExceptionBreakpoints request; value of command field is "setExceptionBreakpoints".

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class SetFunctionBreakpointsRequest
{

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class Source
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class SourceRequest
{

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class StackFrame
{

View File

@@ -4,9 +4,9 @@
//
using System.Diagnostics;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class StackTraceRequest
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class StartedEvent
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class StepInRequest
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class StepOutRequest
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class StoppedEvent
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class TerminatedEvent
{

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class Thread
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class ThreadsRequest
{

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class Variable
{

View File

@@ -4,9 +4,9 @@
//
using System.Diagnostics;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
{
public class VariablesRequest
{

View File

@@ -9,7 +9,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{
/// <summary>
/// Defines a class that describes the capabilities of a language

View File

@@ -4,9 +4,9 @@
//
using System.Diagnostics;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{
public class CompletionRequest
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{
public class DidChangeConfigurationNotification<TConfig>
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{
public class DefinitionRequest
{

View File

@@ -3,14 +3,14 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{
public class PublishDiagnosticsNotification
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{
public enum DocumentHighlightKind
{

View File

@@ -3,15 +3,15 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{
public class ExtensionCommandAddedNotification
{
public static readonly
EventType<ExtensionCommandAddedNotification> Type =
EventType<ExtensionCommandAddedNotification>.Create("powerShell/extensionCommandAdded");
EventType<ExtensionCommandAddedNotification>.Create("SqlTools/extensionCommandAdded");
public string Name { get; set; }
@@ -22,7 +22,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
{
public static readonly
EventType<ExtensionCommandUpdatedNotification> Type =
EventType<ExtensionCommandUpdatedNotification>.Create("powerShell/extensionCommandUpdated");
EventType<ExtensionCommandUpdatedNotification>.Create("SqlTools/extensionCommandUpdated");
public string Name { get; set; }
}
@@ -31,7 +31,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
{
public static readonly
EventType<ExtensionCommandRemovedNotification> Type =
EventType<ExtensionCommandRemovedNotification>.Create("powerShell/extensionCommandRemoved");
EventType<ExtensionCommandRemovedNotification>.Create("SqlTools/extensionCommandRemoved");
public string Name { get; set; }
}
@@ -50,7 +50,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
{
public static readonly
RequestType<InvokeExtensionCommandRequest, string> Type =
RequestType<InvokeExtensionCommandRequest, string>.Create("powerShell/invokeExtensionCommand");
RequestType<InvokeExtensionCommandRequest, string>.Create("SqlTools/invokeExtensionCommand");
public string Name { get; set; }

View File

@@ -3,14 +3,14 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{
public class ExpandAliasRequest
{
public static readonly
RequestType<string, string> Type =
RequestType<string, string>.Create("powerShell/expandAlias");
RequestType<string, string>.Create("SqlTools/expandAlias");
}
}

View File

@@ -3,16 +3,16 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using System.Collections.Generic;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{
public class FindModuleRequest
{
public static readonly
RequestType<List<PSModuleMessage>, object> Type =
RequestType<List<PSModuleMessage>, object>.Create("powerShell/findModule");
RequestType<List<PSModuleMessage>, object>.Create("SqlTools/findModule");
}

View File

@@ -3,14 +3,14 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{
public class MarkedString
{

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{
public class InitializeRequest
{

View File

@@ -3,14 +3,14 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{
class InstallModuleRequest
{
public static readonly
RequestType<string, object> Type =
RequestType<string, object>.Create("powerShell/installModule");
RequestType<string, object>.Create("SqlTools/installModule");
}
}

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{
public class ReferencesRequest
{

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{
public class ServerCapabilities
{

View File

@@ -3,14 +3,14 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{
public class ShowOnlineHelpRequest
{
public static readonly
RequestType<string, object> Type =
RequestType<string, object>.Create("powerShell/showOnlineHelp");
RequestType<string, object>.Create("SqlTools/showOnlineHelp");
}
}

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{
/// <summary>
/// Defines a message that is sent from the client to request

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{
public class SignatureHelpRequest
{

View File

@@ -4,9 +4,9 @@
//
using System.Diagnostics;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{
/// <summary>
/// Defines a base parameter class for identifying a text document.

View File

@@ -3,9 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{
public enum SymbolKind
{

View File

@@ -3,10 +3,10 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Serializers;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Serializers;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel
{
/// <summary>
/// Defines a base implementation for servers and their clients over a

View File

@@ -9,7 +9,7 @@ using System;
using System.IO.Pipes;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel
{
public class NamedPipeClientChannel : ChannelBase
{

View File

@@ -8,7 +8,7 @@ using System;
using System.IO.Pipes;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel
{
public class NamedPipeServerChannel : ChannelBase
{

View File

@@ -3,14 +3,14 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Serializers;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Serializers;
using System.Diagnostics;
using System.IO;
using System.Text;
using System;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel
{
/// <summary>
/// Provides a client implementation for the standard I/O channel.

View File

@@ -3,13 +3,13 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Serializers;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Serializers;
using System.IO;
using System.Text;
using System;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel
{
/// <summary>
/// Provides a server implementation for the standard I/O channel.

View File

@@ -4,15 +4,9 @@
//
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{
public static class Constants
{

View File

@@ -3,10 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Newtonsoft.Json.Linq;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{
/// <summary>
/// Provides context for a received event so that handlers

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{
/// <summary>
/// Defines an event type with a particular method name.

View File

@@ -5,7 +5,7 @@
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{
internal interface IMessageSender
{

View File

@@ -5,7 +5,7 @@
using Newtonsoft.Json.Linq;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{
/// <summary>
/// Defines a common interface for message serializers.

View File

@@ -6,7 +6,7 @@
using System.Diagnostics;
using Newtonsoft.Json.Linq;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{
/// <summary>
/// Defines all possible message types.

View File

@@ -3,15 +3,15 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel;
using Microsoft.PowerShell.EditorServices.Utility;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel;
using Microsoft.SqlTools.EditorServices.Utility;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{
public class MessageDispatcher
{

View File

@@ -5,7 +5,7 @@
using System;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{
public class MessageParseException : Exception
{

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{
/// <summary>
/// Defines the possible message protocol types.

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Utility;
using Microsoft.SqlTools.EditorServices.Utility;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
@@ -12,7 +12,7 @@ using System.IO;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{
public class MessageReader
{

View File

@@ -3,15 +3,14 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Utility;
using Microsoft.SqlTools.EditorServices.Utility;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using System;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{
public class MessageWriter
{

View File

@@ -3,13 +3,13 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{
/// <summary>
/// Provides behavior for a client or server endpoint that

View File

@@ -6,7 +6,7 @@
using Newtonsoft.Json.Linq;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{
public class RequestContext<TResult>
{

View File

@@ -5,7 +5,7 @@
using System.Diagnostics;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{
[DebuggerDisplay("RequestType MethodName = {MethodName}")]
public class RequestType<TParams, TResult>

View File

@@ -3,12 +3,12 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Serializers
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Serializers
{
/// <summary>
/// Serializes messages in the JSON RPC format. Used primarily

View File

@@ -3,12 +3,12 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Serializers
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Serializers
{
/// <summary>
/// Serializes messages in the V8 format. Used primarily for debug adapters.

View File

@@ -4,15 +4,15 @@
//
#if false
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
namespace Microsoft.PowerShell.EditorServices.Protocol.Messages
namespace Microsoft.SqlTools.EditorServices.Protocol.Messages
{
public class ShowChoicePromptRequest
{
public static readonly
RequestType<ShowChoicePromptRequest, ShowChoicePromptResponse> Type =
RequestType<ShowChoicePromptRequest, ShowChoicePromptResponse>.Create("powerShell/showChoicePrompt");
RequestType<ShowChoicePromptRequest, ShowChoicePromptResponse>.Create("SqlTools/showChoicePrompt");
public string Caption { get; set; }
@@ -34,7 +34,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Messages
{
public static readonly
RequestType<ShowInputPromptRequest, ShowInputPromptResponse> Type =
RequestType<ShowInputPromptRequest, ShowInputPromptResponse>.Create("powerShell/showInputPrompt");
RequestType<ShowInputPromptRequest, ShowInputPromptResponse>.Create("SqlTools/showInputPrompt");
/// <summary>
/// Gets or sets the name of the field.

View File

@@ -1,19 +1,37 @@
using System;
using Microsoft.PowerShell.EditorServices.Protocol.Server;
using Microsoft.PowerShell.EditorServices.Session;
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using Microsoft.SqlTools.EditorServices.Protocol.Server;
using Microsoft.SqlTools.EditorServices.Session;
using Microsoft.SqlTools.EditorServices.Utility;
namespace Microsoft.SqlTools.ServiceHost
{
{
/// <summary>
/// Main application class for SQL Tools API Service Host executable
/// </summary>
class Program
{
/// <summary>
/// Main entry point into the SQL Tools API Service Host
/// </summary>
static void Main(string[] args)
{
var hostDetails = new HostDetails("name", "profileId", new Version(1,0));
var profilePaths = new ProfilePaths("hostProfileId", "baseAllUsersPath", "baseCurrentUserPath");
var languageServer = new LanguageServer(hostDetails, profilePaths);
languageServer.Start().Wait();
Logger.Initialize();
Logger.Write(LogLevel.Normal, "Starting SQL Tools Service Host");
const string hostName = "SQL Tools Service Host";
const string hostProfileId = "SQLToolsService";
Version hostVersion = new Version(1,0);
// set up the host details and profile paths
var hostDetails = new HostDetails(hostName, hostProfileId, hostVersion);
var profilePaths = new ProfilePaths(hostProfileId, "baseAllUsersPath", "baseCurrentUserPath");
// create and run the language server
var languageServer = new LanguageServer(hostDetails, profilePaths);
languageServer.Start().Wait();
languageServer.WaitForExit();
}
}

View File

@@ -10,11 +10,11 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("PowerShell Editor Services Host Protocol Library")]
[assembly: AssemblyDescription("Provides message types and client/server APIs for the PowerShell Editor Services JSON protocol.")]
[assembly: AssemblyTitle("SqlTools Editor Services Host Protocol Library")]
[assembly: AssemblyDescription("Provides message types and client/server APIs for the SqlTools Editor Services JSON protocol.")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("PowerShell Editor Services")]
[assembly: AssemblyProduct("SqlTools Editor Services")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -41,4 +41,4 @@ using System.Runtime.InteropServices;
[assembly: AssemblyFileVersion("0.0.0.0")]
[assembly: AssemblyInformationalVersion("0.0.0.0")]
[assembly: InternalsVisibleTo("Microsoft.PowerShell.EditorServices.Test.Protocol")]
[assembly: InternalsVisibleTo("Microsoft.SqlTools.EditorServices.Test.Protocol")]

View File

@@ -5,11 +5,11 @@
#if false
using Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel;
using Microsoft.PowerShell.EditorServices.Session;
using Microsoft.PowerShell.EditorServices.Utility;
using Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel;
using Microsoft.SqlTools.EditorServices.Session;
using Microsoft.SqlTools.EditorServices.Utility;
using System;
using System.Collections.Generic;
using System.IO;
@@ -17,7 +17,7 @@ using System.Linq;
using System.Management.Automation;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.Server
namespace Microsoft.SqlTools.EditorServices.Protocol.Server
{
public class DebugAdapter : DebugAdapterBase
{
@@ -40,7 +40,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Server
this.editorSession = new EditorSession();
this.editorSession.StartSession(hostDetails, profilePaths);
this.editorSession.DebugService.DebuggerStopped += this.DebugService_DebuggerStopped;
this.editorSession.ConsoleService.OutputWritten += this.powerShellContext_OutputWritten;
this.editorSession.ConsoleService.OutputWritten += this.SqlToolsContext_OutputWritten;
// Set up the output debouncer to throttle output event writes
this.outputDebouncer = new OutputDebouncer(this);
@@ -75,7 +75,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Server
protected Task LaunchScript(RequestContext<object> requestContext)
{
return editorSession.PowerShellContext
return editorSession.SqlToolsContext
.ExecuteScriptAtPath(this.scriptPathToLaunch, this.arguments)
.ContinueWith(
async (t) => {
@@ -130,11 +130,11 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Server
LaunchRequestArguments launchParams,
RequestContext<object> requestContext)
{
// Set the working directory for the PowerShell runspace to the cwd passed in via launch.json.
// Set the working directory for the SqlTools runspace to the cwd passed in via launch.json.
// In case that is null, use the the folder of the script to be executed. If the resulting
// working dir path is a file path then extract the directory and use that.
string workingDir = launchParams.Cwd ?? launchParams.Program;
workingDir = PowerShellContext.UnescapePath(workingDir);
workingDir = SqlToolsContext.UnescapePath(workingDir);
try
{
if ((File.GetAttributes(workingDir) & FileAttributes.Directory) != FileAttributes.Directory)
@@ -153,7 +153,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Server
#endif
}
editorSession.PowerShellContext.SetWorkingDirectory(workingDir);
editorSession.SqlToolsContext.SetWorkingDirectory(workingDir);
Logger.Write(LogLevel.Verbose, "Working dir set to: " + workingDir);
// Prepare arguments to the script - if specified
@@ -203,18 +203,18 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Server
handler =
async (o, e) =>
{
if (e.NewSessionState == PowerShellContextState.Ready)
if (e.NewSessionState == SqlToolsContextState.Ready)
{
await requestContext.SendResult(null);
editorSession.PowerShellContext.SessionStateChanged -= handler;
editorSession.SqlToolsContext.SessionStateChanged -= handler;
// Stop the server
this.Stop();
}
};
editorSession.PowerShellContext.SessionStateChanged += handler;
editorSession.PowerShellContext.AbortExecution();
editorSession.SqlToolsContext.SessionStateChanged += handler;
editorSession.SqlToolsContext.AbortExecution();
return Task.FromResult(true);
}
@@ -571,7 +571,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Server
});
}
async void powerShellContext_OutputWritten(object sender, OutputWrittenEventArgs e)
async void SqlToolsContext_OutputWritten(object sender, OutputWrittenEventArgs e)
{
// Queue the output for writing
await this.outputDebouncer.Invoke(e);

View File

@@ -3,12 +3,12 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
#if false
using Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel;
using Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.Server
namespace Microsoft.SqlTools.EditorServices.Protocol.Server
{
public abstract class DebugAdapterBase : ProtocolEndpoint
{

View File

@@ -4,12 +4,12 @@
//
//using Microsoft.PowerShell.EditorServices.Extensions;
using Microsoft.PowerShell.EditorServices.Protocol.LanguageServer;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel;
using Microsoft.PowerShell.EditorServices.Session;
//using Microsoft.PowerShell.EditorServices.Utility;
//using Microsoft.SqlTools.EditorServices.Extensions;
using Microsoft.SqlTools.EditorServices.Protocol.LanguageServer;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel;
using Microsoft.SqlTools.EditorServices.Session;
//using Microsoft.SqlTools.EditorServices.Utility;
using System;
using System.Collections.Generic;
using System.IO;
@@ -18,9 +18,9 @@ using System.Linq;
//using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using DebugAdapterMessages = Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter;
using DebugAdapterMessages = Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter;
namespace Microsoft.PowerShell.EditorServices.Protocol.Server
namespace Microsoft.SqlTools.EditorServices.Protocol.Server
{
public class LanguageServer : LanguageServerBase
{
@@ -49,7 +49,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Server
#if false
this.editorSession = new EditorSession();
this.editorSession.StartSession(hostDetails, profilePaths);
this.editorSession.ConsoleService.OutputWritten += this.powerShellContext_OutputWritten;
this.editorSession.ConsoleService.OutputWritten += this.SqlToolsContext_OutputWritten;
// Attach to ExtensionService events
this.editorSession.ExtensionService.CommandAdded += ExtensionService_ExtensionAdded;
@@ -206,7 +206,7 @@ protected async Task HandleInitializeRequest(
psCommand.AddArgument(helpParams);
psCommand.AddParameter("Online");
await editorSession.PowerShellContext.ExecuteCommand<object>(psCommand);
await editorSession.SqlToolsContext.ExecuteCommand<object>(psCommand);
await requestContext.SendResult(null);
}
@@ -219,7 +219,7 @@ protected async Task HandleInitializeRequest(
var script = string.Format("Install-Module -Name {0} -Scope CurrentUser", moduleName);
var executeTask =
editorSession.PowerShellContext.ExecuteScriptString(
editorSession.SqlToolsContext.ExecuteScriptString(
script,
true,
true).ConfigureAwait(false);
@@ -281,11 +281,11 @@ function __Expand-Alias {
}";
var psCommand = new PSCommand();
psCommand.AddScript(script);
await this.editorSession.PowerShellContext.ExecuteCommand<PSObject>(psCommand);
await this.editorSession.SqlToolsContext.ExecuteCommand<PSObject>(psCommand);
psCommand = new PSCommand();
psCommand.AddCommand("__Expand-Alias").AddArgument(content);
var result = await this.editorSession.PowerShellContext.ExecuteCommand<string>(psCommand);
var result = await this.editorSession.SqlToolsContext.ExecuteCommand<string>(psCommand);
await requestContext.SendResult(result.First().ToString());
}
@@ -297,7 +297,7 @@ function __Expand-Alias {
var psCommand = new PSCommand();
psCommand.AddScript("Find-Module | Select Name, Description");
var modules = await editorSession.PowerShellContext.ExecuteCommand<PSObject>(psCommand);
var modules = await editorSession.SqlToolsContext.ExecuteCommand<PSObject>(psCommand);
var moduleList = new List<PSModuleMessage>();
@@ -388,14 +388,14 @@ function __Expand-Alias {
this.currentSettings.ScriptAnalysis.SettingsPath;
this.currentSettings.Update(
configChangeParams.Settings.Powershell,
configChangeParams.Settings.SqlTools,
this.editorSession.Workspace.WorkspacePath);
if (!this.profilesLoaded &&
this.currentSettings.EnableProfileLoading &&
oldLoadProfiles != this.currentSettings.EnableProfileLoading)
{
await this.editorSession.PowerShellContext.LoadHostProfiles();
await this.editorSession.SqlToolsContext.LoadHostProfiles();
this.profilesLoaded = true;
}
@@ -570,12 +570,12 @@ function __Expand-Alias {
CommandInfo commandInfo =
await CommandHelpers.GetCommandInfo(
completionItem.Label,
this.editorSession.PowerShellContext);
this.editorSession.SqlToolsContext);
completionItem.Documentation =
await CommandHelpers.GetCommandSynopsis(
commandInfo,
this.editorSession.PowerShellContext);
this.editorSession.SqlToolsContext);
}
// Send back the updated CompletionItem
@@ -696,7 +696,7 @@ function __Expand-Alias {
symbolInfo.Add(
new MarkedString
{
Language = "PowerShell",
Language = "SqlTools",
Value = symbolDetails.DisplayString
});
@@ -853,7 +853,7 @@ function __Expand-Alias {
// is executing. This important in cases where the pipeline thread
// gets blocked by something in the script like a prompt to the user.
var executeTask =
this.editorSession.PowerShellContext.ExecuteScriptString(
this.editorSession.SqlToolsContext.ExecuteScriptString(
evaluateParams.Expression,
true,
true);
@@ -881,7 +881,7 @@ function __Expand-Alias {
#region Event Handlers
private async void powerShellContext_OutputWritten(object sender, OutputWrittenEventArgs e)
private async void SqlToolsContext_OutputWritten(object sender, OutputWrittenEventArgs e)
{
// Queue the output for writing
await this.outputDebouncer.Invoke(e);
@@ -1149,7 +1149,7 @@ function __Expand-Alias {
(completionDetails.CompletionType == CompletionType.ParameterName))
{
// Look for type encoded in the tooltip for parameters and variables.
// Display PowerShell type names in [] to be consistent with PowerShell syntax
// Display SqlTools type names in [] to be consistent with SqlTools syntax
// and now the debugger displays type names.
var matches = Regex.Matches(completionDetails.ToolTipText, @"^(\[.+\])");
if ((matches.Count > 0) && (matches[0].Groups.Count > 1))
@@ -1187,7 +1187,7 @@ function __Expand-Alias {
}
// We want a special "sort order" for parameters that is not lexicographical.
// Fortunately, PowerShell returns parameters in the preferred sort order by
// Fortunately, SqlTools returns parameters in the preferred sort order by
// default (with common params at the end). We just need to make sure the default
// order also be the lexicographical order which we do by prefixig the ListItemText
// with a leading 0's four digit index. This would not sort correctly for a list

View File

@@ -3,12 +3,12 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.LanguageServer;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel;
using Microsoft.SqlTools.EditorServices.Protocol.LanguageServer;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.Server
namespace Microsoft.SqlTools.EditorServices.Protocol.Server
{
public abstract class LanguageServerBase : ProtocolEndpoint
{

View File

@@ -3,12 +3,12 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
#if false
using Microsoft.PowerShell.EditorServices.Extensions;
using Microsoft.PowerShell.EditorServices.Protocol.LanguageServer;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Extensions;
using Microsoft.SqlTools.EditorServices.Protocol.LanguageServer;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.Server
namespace Microsoft.SqlTools.EditorServices.Protocol.Server
{
internal class LanguageServerEditorOperations : IEditorOperations
{

View File

@@ -4,9 +4,9 @@
//
using System.IO;
using Microsoft.PowerShell.EditorServices.Utility;
using Microsoft.SqlTools.EditorServices.Utility;
namespace Microsoft.PowerShell.EditorServices.Protocol.Server
namespace Microsoft.SqlTools.EditorServices.Protocol.Server
{
public class LanguageServerSettings
{
@@ -57,7 +57,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Server
if (string.IsNullOrEmpty(workspaceRootPath))
{
// The workspace root path could be an empty string
// when the user has opened a PowerShell script file
// when the user has opened a SqlTools script file
// without opening an entire folder (workspace) first.
// In this case we should just log an error and let
// the specified settings path go through even though
@@ -79,10 +79,10 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Server
public class LanguageServerSettingsWrapper
{
// NOTE: This property is capitalized as 'Powershell' because the
// mode name sent from the client is written as 'powershell' and
// NOTE: This property is capitalized as 'SqlTools' because the
// mode name sent from the client is written as 'SqlTools' and
// JSON.net is using camelCasing.
public LanguageServerSettings Powershell { get; set; }
public LanguageServerSettings SqlTools { get; set; }
}
}

View File

@@ -3,12 +3,12 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.PowerShell.EditorServices.Utility;
using Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Utility;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.Server
namespace Microsoft.SqlTools.EditorServices.Protocol.Server
{
/// <summary>
/// Throttles output written via OutputEvents by batching all output

View File

@@ -5,13 +5,13 @@
#if false
using System;
using Microsoft.PowerShell.EditorServices.Console;
using Microsoft.PowerShell.EditorServices.Protocol.Messages;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Microsoft.PowerShell.EditorServices.Utility;
using Microsoft.SqlTools.EditorServices.Console;
using Microsoft.SqlTools.EditorServices.Protocol.Messages;
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Microsoft.SqlTools.EditorServices.Utility;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.Server
namespace Microsoft.SqlTools.EditorServices.Protocol.Server
{
internal class ProtocolPromptHandlerContext : IPromptHandlerContext
{

View File

@@ -3,13 +3,13 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
// using Microsoft.PowerShell.EditorServices.Console;
// using Microsoft.PowerShell.EditorServices.Extensions;
using Microsoft.PowerShell.EditorServices.Session;
// using Microsoft.PowerShell.EditorServices.Utility;
// using Microsoft.SqlTools.EditorServices.Console;
// using Microsoft.SqlTools.EditorServices.Extensions;
using Microsoft.SqlTools.EditorServices.Session;
// using Microsoft.SqlTools.EditorServices.Utility;
// using System.IO;
namespace Microsoft.PowerShell.EditorServices
namespace Microsoft.SqlTools.EditorServices
{
/// <summary>
/// Manages a single session for all editor services. This
@@ -29,9 +29,9 @@ namespace Microsoft.PowerShell.EditorServices
public Workspace Workspace { get; private set; }
/// <summary>
/// Gets the PowerShellContext instance for this session.
/// Gets the SqlToolsContext instance for this session.
/// </summary>
public PowerShellContext PowerShellContext { get; private set; }
public SqlToolsContext SqlToolsContext { get; private set; }
/// <summary>
/// Gets the LanguageService instance for this session.
@@ -75,16 +75,16 @@ namespace Microsoft.PowerShell.EditorServices
public void StartSession(HostDetails hostDetails, ProfilePaths profilePaths)
{
// Initialize all services
this.PowerShellContext = new PowerShellContext(hostDetails, profilePaths);
this.LanguageService = new LanguageService(this.PowerShellContext);
this.DebugService = new DebugService(this.PowerShellContext);
this.ConsoleService = new ConsoleService(this.PowerShellContext);
this.ExtensionService = new ExtensionService(this.PowerShellContext);
this.SqlToolsContext = new SqlToolsContext(hostDetails, profilePaths);
this.LanguageService = new LanguageService(this.SqlToolsContext);
this.DebugService = new DebugService(this.SqlToolsContext);
this.ConsoleService = new ConsoleService(this.SqlToolsContext);
this.ExtensionService = new ExtensionService(this.SqlToolsContext);
this.InstantiateAnalysisService();
// Create a workspace to contain open files
this.Workspace = new Workspace(this.PowerShellContext.PowerShellVersion);
this.Workspace = new Workspace(this.SqlToolsContext.SqlToolsVersion);
}
/// <summary>
@@ -99,20 +99,20 @@ namespace Microsoft.PowerShell.EditorServices
internal void InstantiateAnalysisService(string settingsPath = null)
{
// Only enable the AnalysisService if the machine has PowerShell
// v5 installed. Script Analyzer works on earlier PowerShell
// Only enable the AnalysisService if the machine has SqlTools
// v5 installed. Script Analyzer works on earlier SqlTools
// versions but our hard dependency on their binaries complicates
// the deployment and assembly loading since we would have to
// conditionally load the binaries for v3/v4 support. This problem
// will be solved in the future by using Script Analyzer as a
// module rather than an assembly dependency.
if (this.PowerShellContext.PowerShellVersion.Major >= 5)
if (this.SqlToolsContext.SqlToolsVersion.Major >= 5)
{
// AnalysisService will throw FileNotFoundException if
// Script Analyzer binaries are not included.
try
{
this.AnalysisService = new AnalysisService(this.PowerShellContext.ConsoleHost, settingsPath);
this.AnalysisService = new AnalysisService(this.SqlToolsContext.ConsoleHost, settingsPath);
}
catch (FileNotFoundException)
{
@@ -125,8 +125,8 @@ namespace Microsoft.PowerShell.EditorServices
{
Logger.Write(
LogLevel.Normal,
"Script Analyzer cannot be loaded due to unsupported PowerShell version " +
this.PowerShellContext.PowerShellVersion.ToString());
"Script Analyzer cannot be loaded due to unsupported SqlTools version " +
this.SqlToolsContext.SqlToolsVersion.ToString());
}
}
@@ -146,10 +146,10 @@ namespace Microsoft.PowerShell.EditorServices
this.AnalysisService = null;
}
if (this.PowerShellContext != null)
if (this.SqlToolsContext != null)
{
this.PowerShellContext.Dispose();
this.PowerShellContext = null;
this.SqlToolsContext.Dispose();
this.SqlToolsContext = null;
}
}

View File

@@ -5,7 +5,7 @@
using System;
namespace Microsoft.PowerShell.EditorServices.Session
namespace Microsoft.SqlTools.EditorServices.Session
{
/// <summary>
/// Contains details about the current host application (most
@@ -16,19 +16,19 @@ namespace Microsoft.PowerShell.EditorServices.Session
#region Constants
/// <summary>
/// The default host name for PowerShell Editor Services. Used
/// The default host name for SqlTools Editor Services. Used
/// if no host name is specified by the host application.
/// </summary>
public const string DefaultHostName = "PowerShell Editor Services Host";
public const string DefaultHostName = "SqlTools Editor Services Host";
/// <summary>
/// The default host ID for PowerShell Editor Services. Used
/// The default host ID for SqlTools Editor Services. Used
/// for the host-specific profile path if no host ID is specified.
/// </summary>
public const string DefaultHostProfileId = "Microsoft.PowerShellEditorServices";
public const string DefaultHostProfileId = "Microsoft.SqlToolsEditorServices";
/// <summary>
/// The default host version for PowerShell Editor Services. If
/// The default host version for SqlTools Editor Services. If
/// no version is specified by the host application, we use 0.0.0
/// to indicate a lack of version.
/// </summary>
@@ -71,7 +71,7 @@ namespace Microsoft.PowerShell.EditorServices.Session
/// "[Application Name] Host".
/// </param>
/// <param name="profileId">
/// The identifier of the PowerShell host to use for its profile path.
/// The identifier of the SqlTools host to use for its profile path.
/// loaded. Used to resolve a profile path of the form 'X_profile.ps1'
/// where 'X' represents the value of hostProfileId. If null, a default
/// will be used.

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
namespace Microsoft.PowerShell.EditorServices
namespace Microsoft.SqlTools.EditorServices
{
/// <summary>
/// Enumerates the types of output lines that will be sent
@@ -34,7 +34,7 @@ namespace Microsoft.PowerShell.EditorServices
/// <summary>
/// An error output line, written with the Write-Error cmdlet or
/// as a result of some error during PowerShell pipeline execution.
/// as a result of some error during SqlTools pipeline execution.
/// </summary>
Error
}

View File

@@ -5,11 +5,11 @@
using System;
namespace Microsoft.PowerShell.EditorServices
namespace Microsoft.SqlTools.EditorServices
{
/// <summary>
/// Provides details about output that has been written to the
/// PowerShell host.
/// SqlTools host.
/// </summary>
public class OutputWrittenEventArgs
{

View File

@@ -8,11 +8,11 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Microsoft.PowerShell.EditorServices.Session
namespace Microsoft.SqlTools.EditorServices.Session
{
/// <summary>
/// Provides profile path resolution behavior relative to the name
/// of a particular PowerShell host.
/// of a particular SqlTools host.
/// </summary>
public class ProfilePaths
{

View File

@@ -7,7 +7,7 @@ using System;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Utility
namespace Microsoft.SqlTools.EditorServices.Utility
{
/// <summary>
/// Simplifies the setup of a SynchronizationContext for the use

View File

@@ -7,7 +7,7 @@ using System;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Utility
namespace Microsoft.SqlTools.EditorServices.Utility
{
/// <summary>
/// Provides a simplified interface for creating a new thread

View File

@@ -6,7 +6,7 @@
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Utility
namespace Microsoft.SqlTools.EditorServices.Utility
{
/// <summary>
/// Restricts the invocation of an operation to a specified time

View File

@@ -7,7 +7,7 @@ using System;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Utility
namespace Microsoft.SqlTools.EditorServices.Utility
{
/// <summary>
/// Provides a simple wrapper over a SemaphoreSlim to allow

View File

@@ -8,7 +8,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Utility
namespace Microsoft.SqlTools.EditorServices.Utility
{
/// <summary>
/// Provides a synchronized queue which can be used from within async

View File

@@ -5,7 +5,7 @@
using System;
namespace Microsoft.PowerShell.EditorServices.Utility
namespace Microsoft.SqlTools.EditorServices.Utility
{
internal static class ObjectExtensions
{

View File

@@ -8,7 +8,7 @@ using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
namespace Microsoft.PowerShell.EditorServices.Utility
namespace Microsoft.SqlTools.EditorServices.Utility
{
/// <summary>
/// Defines the level indicators for log messages.
@@ -54,7 +54,7 @@ namespace Microsoft.PowerShell.EditorServices.Utility
/// Optional. Specifies the minimum log message level to write to the log file.
/// </param>
public static void Initialize(
string logFilePath = "EditorServices.log",
string logFilePath = "SqlToolsService.log",
LogLevel minimumLogLevel = LogLevel.Normal)
{
if (logWriter != null)
@@ -118,32 +118,25 @@ namespace Microsoft.PowerShell.EditorServices.Utility
this.minimumLogLevel = minimumLogLevel;
// Ensure that we have a usable log file path
// if (!Path.IsPathRooted(logFilePath))
// {
// logFilePath =
// Path.Combine(
// #if NanoServer
// AppContext.BaseDirectory,
// #else
// AppDomain.CurrentDomain.BaseDirectory,
// #endif
// logFilePath);
// }
if (!Path.IsPathRooted(logFilePath))
{
logFilePath =
Path.Combine(
AppContext.BaseDirectory,
logFilePath);
}
// if (!this.TryOpenLogFile(logFilePath, deleteExisting))
// {
// // If the log file couldn't be opened at this location,
// // try opening it in a more reliable path
// this.TryOpenLogFile(
// Path.Combine(
// #if NanoServer
// Environment.GetEnvironmentVariable("TEMP"),
// #else
// Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
// #endif
// Path.GetFileName(logFilePath)),
// deleteExisting);
// }
if (!this.TryOpenLogFile(logFilePath, deleteExisting))
{
// If the log file couldn't be opened at this location,
// try opening it in a more reliable path
this.TryOpenLogFile(
Path.Combine(
Environment.GetEnvironmentVariable("TEMP"),
Path.GetFileName(logFilePath)),
deleteExisting);
}
}
public void Write(

View File

@@ -7,7 +7,7 @@ using System;
using System.Collections.Concurrent;
using System.Threading;
namespace Microsoft.PowerShell.EditorServices.Utility
namespace Microsoft.SqlTools.EditorServices.Utility
{
/// <summary>
/// Provides a SynchronizationContext implementation that can be used

View File

@@ -6,7 +6,7 @@
using System;
using System.Collections.Generic;
namespace Microsoft.PowerShell.EditorServices.Utility
namespace Microsoft.SqlTools.EditorServices.Utility
{
/// <summary>
/// Provides common validation methods to simplify method

View File

@@ -5,7 +5,7 @@
using System.Diagnostics;
namespace Microsoft.PowerShell.EditorServices
namespace Microsoft.SqlTools.EditorServices
{
/// <summary>
/// Provides details about a position in a file buffer. All

Some files were not shown because too many files have changed in this diff Show More