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

@@ -1,2 +1,6 @@
# sqltoolsservice # Microsoft SQL Tools Service
SQL Tools Service host The SQL Tools Service is an application that provides core functionality for various SQL Server tools. These features include the following:
* Connection management
* Language Service support using VS Code protocol
* Query execution and resultset management
* Schema discovery

View File

@@ -3,12 +3,12 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
// //
using Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter; using Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol; using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel; using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.Client namespace Microsoft.SqlTools.EditorServices.Protocol.Client
{ {
public class DebugAdapterClient : ProtocolEndpoint 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. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
// //
using Microsoft.PowerShell.EditorServices.Protocol.LanguageServer; using Microsoft.SqlTools.EditorServices.Protocol.LanguageServer;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol; using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel; using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.Client namespace Microsoft.SqlTools.EditorServices.Protocol.Client
{ {
/// <summary> /// <summary>
/// Provides a base implementation for language server clients. /// 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. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
// //
using Microsoft.PowerShell.EditorServices.Protocol.LanguageServer; using Microsoft.SqlTools.EditorServices.Protocol.LanguageServer;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol; using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel; using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.Client namespace Microsoft.SqlTools.EditorServices.Protocol.Client
{ {
public class LanguageServiceClient : LanguageClientBase 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. // 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 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. // 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 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. // 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 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. // 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 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. // 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 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. // 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 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. // 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 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. // 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 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. // 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 public class InitializedEvent
{ {

View File

@@ -4,9 +4,9 @@
// //
using System.Collections.Generic; 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 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. // 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". // /** StepOver request; value of command field is "next".
// he request starts the debuggee to run again for one step. // 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. // 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 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. // 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 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. // 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 public class Scope
{ {

View File

@@ -4,9 +4,9 @@
// //
using System.Diagnostics; 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 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. // 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> /// <summary>
/// SetBreakpoints request; value of command field is "setBreakpoints". /// 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. // 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> /// <summary>
/// SetExceptionBreakpoints request; value of command field is "setExceptionBreakpoints". /// 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. // 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 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. // 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 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. // 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 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. // 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 public class StackFrame
{ {

View File

@@ -4,9 +4,9 @@
// //
using System.Diagnostics; 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 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. // 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 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. // 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 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. // 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 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. // 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 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. // 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 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. // 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 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. // 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 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. // 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 public class Variable
{ {

View File

@@ -4,9 +4,9 @@
// //
using System.Diagnostics; 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 public class VariablesRequest
{ {

View File

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

View File

@@ -4,9 +4,9 @@
// //
using System.Diagnostics; 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 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. // 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> 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. // 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 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. // 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;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{ {
public class PublishDiagnosticsNotification 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. // 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 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. // 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 class ExtensionCommandAddedNotification
{ {
public static readonly public static readonly
EventType<ExtensionCommandAddedNotification> Type = EventType<ExtensionCommandAddedNotification> Type =
EventType<ExtensionCommandAddedNotification>.Create("powerShell/extensionCommandAdded"); EventType<ExtensionCommandAddedNotification>.Create("SqlTools/extensionCommandAdded");
public string Name { get; set; } public string Name { get; set; }
@@ -22,7 +22,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
{ {
public static readonly public static readonly
EventType<ExtensionCommandUpdatedNotification> Type = EventType<ExtensionCommandUpdatedNotification> Type =
EventType<ExtensionCommandUpdatedNotification>.Create("powerShell/extensionCommandUpdated"); EventType<ExtensionCommandUpdatedNotification>.Create("SqlTools/extensionCommandUpdated");
public string Name { get; set; } public string Name { get; set; }
} }
@@ -31,7 +31,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
{ {
public static readonly public static readonly
EventType<ExtensionCommandRemovedNotification> Type = EventType<ExtensionCommandRemovedNotification> Type =
EventType<ExtensionCommandRemovedNotification>.Create("powerShell/extensionCommandRemoved"); EventType<ExtensionCommandRemovedNotification>.Create("SqlTools/extensionCommandRemoved");
public string Name { get; set; } public string Name { get; set; }
} }
@@ -50,7 +50,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
{ {
public static readonly public static readonly
RequestType<InvokeExtensionCommandRequest, string> Type = RequestType<InvokeExtensionCommandRequest, string> Type =
RequestType<InvokeExtensionCommandRequest, string>.Create("powerShell/invokeExtensionCommand"); RequestType<InvokeExtensionCommandRequest, string>.Create("SqlTools/invokeExtensionCommand");
public string Name { get; set; } 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. // 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 class ExpandAliasRequest
{ {
public static readonly public static readonly
RequestType<string, string> Type = 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. // 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; using System.Collections.Generic;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{ {
public class FindModuleRequest public class FindModuleRequest
{ {
public static readonly public static readonly
RequestType<List<PSModuleMessage>, object> Type = 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. // 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;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer namespace Microsoft.SqlTools.EditorServices.Protocol.LanguageServer
{ {
public class MarkedString 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. // 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 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. // 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 class InstallModuleRequest
{ {
public static readonly public static readonly
RequestType<string, object> Type = 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. // 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 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. // 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 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. // 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 class ShowOnlineHelpRequest
{ {
public static readonly public static readonly
RequestType<string, object> Type = 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. // 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> /// <summary>
/// Defines a message that is sent from the client to request /// 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. // 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 public class SignatureHelpRequest
{ {

View File

@@ -4,9 +4,9 @@
// //
using System.Diagnostics; 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> /// <summary>
/// Defines a base parameter class for identifying a text document. /// 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. // 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 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. // 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; using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel
{ {
/// <summary> /// <summary>
/// Defines a base implementation for servers and their clients over a /// 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.IO.Pipes;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel
{ {
public class NamedPipeClientChannel : ChannelBase public class NamedPipeClientChannel : ChannelBase
{ {

View File

@@ -8,7 +8,7 @@ using System;
using System.IO.Pipes; using System.IO.Pipes;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel
{ {
public class NamedPipeServerChannel : ChannelBase 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. // 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.Diagnostics;
using System.IO; using System.IO;
using System.Text; using System.Text;
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel
{ {
/// <summary> /// <summary>
/// Provides a client implementation for the standard I/O channel. /// 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. // 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.IO;
using System.Text; using System.Text;
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel
{ {
/// <summary> /// <summary>
/// Provides a server implementation for the standard I/O channel. /// Provides a server implementation for the standard I/O channel.

View File

@@ -4,15 +4,9 @@
// //
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization; 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 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. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
// //
using Newtonsoft.Json.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{ {
/// <summary> /// <summary>
/// Provides context for a received event so that handlers /// 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. // 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> /// <summary>
/// Defines an event type with a particular method name. /// Defines an event type with a particular method name.

View File

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

View File

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

View File

@@ -6,7 +6,7 @@
using System.Diagnostics; using System.Diagnostics;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{ {
/// <summary> /// <summary>
/// Defines all possible message types. /// 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. // 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 Microsoft.PowerShell.EditorServices.Utility; using Microsoft.SqlTools.EditorServices.Utility;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{ {
public class MessageDispatcher public class MessageDispatcher
{ {

View File

@@ -5,7 +5,7 @@
using System; using System;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{ {
public class MessageParseException : Exception 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. // 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> /// <summary>
/// Defines the possible message protocol types. /// 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. // 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;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
@@ -12,7 +12,7 @@ using System.IO;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{ {
public class MessageReader 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. // 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;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System.IO; using System.IO;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{ {
public class MessageWriter 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. // 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;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{ {
/// <summary> /// <summary>
/// Provides behavior for a client or server endpoint that /// Provides behavior for a client or server endpoint that

View File

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

View File

@@ -5,7 +5,7 @@
using System.Diagnostics; using System.Diagnostics;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol
{ {
[DebuggerDisplay("RequestType MethodName = {MethodName}")] [DebuggerDisplay("RequestType MethodName = {MethodName}")]
public class RequestType<TParams, TResult> 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. // 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;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Serializers namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Serializers
{ {
/// <summary> /// <summary>
/// Serializes messages in the JSON RPC format. Used primarily /// 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. // 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;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
namespace Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Serializers namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Serializers
{ {
/// <summary> /// <summary>
/// Serializes messages in the V8 format. Used primarily for debug adapters. /// Serializes messages in the V8 format. Used primarily for debug adapters.

View File

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

View File

@@ -1,19 +1,37 @@
using System; //
using Microsoft.PowerShell.EditorServices.Protocol.Server; // Copyright (c) Microsoft. All rights reserved.
using Microsoft.PowerShell.EditorServices.Session; // 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 namespace Microsoft.SqlTools.ServiceHost
{ {
/// <summary>
/// Main application class for SQL Tools API Service Host executable
/// </summary>
class Program class Program
{ {
/// <summary>
/// Main entry point into the SQL Tools API Service Host
/// </summary>
static void Main(string[] args) static void Main(string[] args)
{ {
var hostDetails = new HostDetails("name", "profileId", new Version(1,0)); Logger.Initialize();
var profilePaths = new ProfilePaths("hostProfileId", "baseAllUsersPath", "baseCurrentUserPath"); Logger.Write(LogLevel.Normal, "Starting SQL Tools Service Host");
var languageServer = new LanguageServer(hostDetails, profilePaths);
const string hostName = "SQL Tools Service Host";
languageServer.Start().Wait(); 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(); languageServer.WaitForExit();
} }
} }

View File

@@ -10,11 +10,11 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("PowerShell Editor Services Host Protocol Library")] [assembly: AssemblyTitle("SqlTools Editor Services Host Protocol Library")]
[assembly: AssemblyDescription("Provides message types and client/server APIs for the PowerShell Editor Services JSON protocol.")] [assembly: AssemblyDescription("Provides message types and client/server APIs for the SqlTools Editor Services JSON protocol.")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("PowerShell Editor Services")] [assembly: AssemblyProduct("SqlTools Editor Services")]
[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] [assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
@@ -41,4 +41,4 @@ using System.Runtime.InteropServices;
[assembly: AssemblyFileVersion("0.0.0.0")] [assembly: AssemblyFileVersion("0.0.0.0")]
[assembly: AssemblyInformationalVersion("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 #if false
using Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter; using Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol; using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel; using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel;
using Microsoft.PowerShell.EditorServices.Session; using Microsoft.SqlTools.EditorServices.Session;
using Microsoft.PowerShell.EditorServices.Utility; using Microsoft.SqlTools.EditorServices.Utility;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@@ -17,7 +17,7 @@ using System.Linq;
using System.Management.Automation; using System.Management.Automation;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.Server namespace Microsoft.SqlTools.EditorServices.Protocol.Server
{ {
public class DebugAdapter : DebugAdapterBase public class DebugAdapter : DebugAdapterBase
{ {
@@ -40,7 +40,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Server
this.editorSession = new EditorSession(); this.editorSession = new EditorSession();
this.editorSession.StartSession(hostDetails, profilePaths); this.editorSession.StartSession(hostDetails, profilePaths);
this.editorSession.DebugService.DebuggerStopped += this.DebugService_DebuggerStopped; 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 // Set up the output debouncer to throttle output event writes
this.outputDebouncer = new OutputDebouncer(this); this.outputDebouncer = new OutputDebouncer(this);
@@ -75,7 +75,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Server
protected Task LaunchScript(RequestContext<object> requestContext) protected Task LaunchScript(RequestContext<object> requestContext)
{ {
return editorSession.PowerShellContext return editorSession.SqlToolsContext
.ExecuteScriptAtPath(this.scriptPathToLaunch, this.arguments) .ExecuteScriptAtPath(this.scriptPathToLaunch, this.arguments)
.ContinueWith( .ContinueWith(
async (t) => { async (t) => {
@@ -130,11 +130,11 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Server
LaunchRequestArguments launchParams, LaunchRequestArguments launchParams,
RequestContext<object> requestContext) 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 // 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. // working dir path is a file path then extract the directory and use that.
string workingDir = launchParams.Cwd ?? launchParams.Program; string workingDir = launchParams.Cwd ?? launchParams.Program;
workingDir = PowerShellContext.UnescapePath(workingDir); workingDir = SqlToolsContext.UnescapePath(workingDir);
try try
{ {
if ((File.GetAttributes(workingDir) & FileAttributes.Directory) != FileAttributes.Directory) if ((File.GetAttributes(workingDir) & FileAttributes.Directory) != FileAttributes.Directory)
@@ -153,7 +153,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Server
#endif #endif
} }
editorSession.PowerShellContext.SetWorkingDirectory(workingDir); editorSession.SqlToolsContext.SetWorkingDirectory(workingDir);
Logger.Write(LogLevel.Verbose, "Working dir set to: " + workingDir); Logger.Write(LogLevel.Verbose, "Working dir set to: " + workingDir);
// Prepare arguments to the script - if specified // Prepare arguments to the script - if specified
@@ -203,18 +203,18 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Server
handler = handler =
async (o, e) => async (o, e) =>
{ {
if (e.NewSessionState == PowerShellContextState.Ready) if (e.NewSessionState == SqlToolsContextState.Ready)
{ {
await requestContext.SendResult(null); await requestContext.SendResult(null);
editorSession.PowerShellContext.SessionStateChanged -= handler; editorSession.SqlToolsContext.SessionStateChanged -= handler;
// Stop the server // Stop the server
this.Stop(); this.Stop();
} }
}; };
editorSession.PowerShellContext.SessionStateChanged += handler; editorSession.SqlToolsContext.SessionStateChanged += handler;
editorSession.PowerShellContext.AbortExecution(); editorSession.SqlToolsContext.AbortExecution();
return Task.FromResult(true); 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 // Queue the output for writing
await this.outputDebouncer.Invoke(e); 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. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
// //
#if false #if false
using Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter; using Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol; using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel; using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.Server namespace Microsoft.SqlTools.EditorServices.Protocol.Server
{ {
public abstract class DebugAdapterBase : ProtocolEndpoint public abstract class DebugAdapterBase : ProtocolEndpoint
{ {

View File

@@ -4,12 +4,12 @@
// //
//using Microsoft.PowerShell.EditorServices.Extensions; //using Microsoft.SqlTools.EditorServices.Extensions;
using Microsoft.PowerShell.EditorServices.Protocol.LanguageServer; using Microsoft.SqlTools.EditorServices.Protocol.LanguageServer;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol; using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel; using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel;
using Microsoft.PowerShell.EditorServices.Session; using Microsoft.SqlTools.EditorServices.Session;
//using Microsoft.PowerShell.EditorServices.Utility; //using Microsoft.SqlTools.EditorServices.Utility;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@@ -18,9 +18,9 @@ using System.Linq;
//using System.Text.RegularExpressions; //using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using System.Threading.Tasks; 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 public class LanguageServer : LanguageServerBase
{ {
@@ -49,7 +49,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Server
#if false #if false
this.editorSession = new EditorSession(); this.editorSession = new EditorSession();
this.editorSession.StartSession(hostDetails, profilePaths); this.editorSession.StartSession(hostDetails, profilePaths);
this.editorSession.ConsoleService.OutputWritten += this.powerShellContext_OutputWritten; this.editorSession.ConsoleService.OutputWritten += this.SqlToolsContext_OutputWritten;
// Attach to ExtensionService events // Attach to ExtensionService events
this.editorSession.ExtensionService.CommandAdded += ExtensionService_ExtensionAdded; this.editorSession.ExtensionService.CommandAdded += ExtensionService_ExtensionAdded;
@@ -206,7 +206,7 @@ protected async Task HandleInitializeRequest(
psCommand.AddArgument(helpParams); psCommand.AddArgument(helpParams);
psCommand.AddParameter("Online"); psCommand.AddParameter("Online");
await editorSession.PowerShellContext.ExecuteCommand<object>(psCommand); await editorSession.SqlToolsContext.ExecuteCommand<object>(psCommand);
await requestContext.SendResult(null); await requestContext.SendResult(null);
} }
@@ -219,7 +219,7 @@ protected async Task HandleInitializeRequest(
var script = string.Format("Install-Module -Name {0} -Scope CurrentUser", moduleName); var script = string.Format("Install-Module -Name {0} -Scope CurrentUser", moduleName);
var executeTask = var executeTask =
editorSession.PowerShellContext.ExecuteScriptString( editorSession.SqlToolsContext.ExecuteScriptString(
script, script,
true, true,
true).ConfigureAwait(false); true).ConfigureAwait(false);
@@ -281,11 +281,11 @@ function __Expand-Alias {
}"; }";
var psCommand = new PSCommand(); var psCommand = new PSCommand();
psCommand.AddScript(script); psCommand.AddScript(script);
await this.editorSession.PowerShellContext.ExecuteCommand<PSObject>(psCommand); await this.editorSession.SqlToolsContext.ExecuteCommand<PSObject>(psCommand);
psCommand = new PSCommand(); psCommand = new PSCommand();
psCommand.AddCommand("__Expand-Alias").AddArgument(content); 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()); await requestContext.SendResult(result.First().ToString());
} }
@@ -297,7 +297,7 @@ function __Expand-Alias {
var psCommand = new PSCommand(); var psCommand = new PSCommand();
psCommand.AddScript("Find-Module | Select Name, Description"); 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>(); var moduleList = new List<PSModuleMessage>();
@@ -388,14 +388,14 @@ function __Expand-Alias {
this.currentSettings.ScriptAnalysis.SettingsPath; this.currentSettings.ScriptAnalysis.SettingsPath;
this.currentSettings.Update( this.currentSettings.Update(
configChangeParams.Settings.Powershell, configChangeParams.Settings.SqlTools,
this.editorSession.Workspace.WorkspacePath); this.editorSession.Workspace.WorkspacePath);
if (!this.profilesLoaded && if (!this.profilesLoaded &&
this.currentSettings.EnableProfileLoading && this.currentSettings.EnableProfileLoading &&
oldLoadProfiles != this.currentSettings.EnableProfileLoading) oldLoadProfiles != this.currentSettings.EnableProfileLoading)
{ {
await this.editorSession.PowerShellContext.LoadHostProfiles(); await this.editorSession.SqlToolsContext.LoadHostProfiles();
this.profilesLoaded = true; this.profilesLoaded = true;
} }
@@ -570,12 +570,12 @@ function __Expand-Alias {
CommandInfo commandInfo = CommandInfo commandInfo =
await CommandHelpers.GetCommandInfo( await CommandHelpers.GetCommandInfo(
completionItem.Label, completionItem.Label,
this.editorSession.PowerShellContext); this.editorSession.SqlToolsContext);
completionItem.Documentation = completionItem.Documentation =
await CommandHelpers.GetCommandSynopsis( await CommandHelpers.GetCommandSynopsis(
commandInfo, commandInfo,
this.editorSession.PowerShellContext); this.editorSession.SqlToolsContext);
} }
// Send back the updated CompletionItem // Send back the updated CompletionItem
@@ -696,7 +696,7 @@ function __Expand-Alias {
symbolInfo.Add( symbolInfo.Add(
new MarkedString new MarkedString
{ {
Language = "PowerShell", Language = "SqlTools",
Value = symbolDetails.DisplayString Value = symbolDetails.DisplayString
}); });
@@ -853,7 +853,7 @@ function __Expand-Alias {
// is executing. This important in cases where the pipeline thread // is executing. This important in cases where the pipeline thread
// gets blocked by something in the script like a prompt to the user. // gets blocked by something in the script like a prompt to the user.
var executeTask = var executeTask =
this.editorSession.PowerShellContext.ExecuteScriptString( this.editorSession.SqlToolsContext.ExecuteScriptString(
evaluateParams.Expression, evaluateParams.Expression,
true, true,
true); true);
@@ -881,7 +881,7 @@ function __Expand-Alias {
#region Event Handlers #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 // Queue the output for writing
await this.outputDebouncer.Invoke(e); await this.outputDebouncer.Invoke(e);
@@ -1149,7 +1149,7 @@ function __Expand-Alias {
(completionDetails.CompletionType == CompletionType.ParameterName)) (completionDetails.CompletionType == CompletionType.ParameterName))
{ {
// Look for type encoded in the tooltip for parameters and variables. // 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. // and now the debugger displays type names.
var matches = Regex.Matches(completionDetails.ToolTipText, @"^(\[.+\])"); var matches = Regex.Matches(completionDetails.ToolTipText, @"^(\[.+\])");
if ((matches.Count > 0) && (matches[0].Groups.Count > 1)) 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. // 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 // 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 // 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 // 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. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
// //
using Microsoft.PowerShell.EditorServices.Protocol.LanguageServer; using Microsoft.SqlTools.EditorServices.Protocol.LanguageServer;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol; using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.Channel; using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.Server namespace Microsoft.SqlTools.EditorServices.Protocol.Server
{ {
public abstract class LanguageServerBase : ProtocolEndpoint 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. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
// //
#if false #if false
using Microsoft.PowerShell.EditorServices.Extensions; using Microsoft.SqlTools.EditorServices.Extensions;
using Microsoft.PowerShell.EditorServices.Protocol.LanguageServer; using Microsoft.SqlTools.EditorServices.Protocol.LanguageServer;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol; using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.Server namespace Microsoft.SqlTools.EditorServices.Protocol.Server
{ {
internal class LanguageServerEditorOperations : IEditorOperations internal class LanguageServerEditorOperations : IEditorOperations
{ {

View File

@@ -4,9 +4,9 @@
// //
using System.IO; 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 public class LanguageServerSettings
{ {
@@ -57,7 +57,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Server
if (string.IsNullOrEmpty(workspaceRootPath)) if (string.IsNullOrEmpty(workspaceRootPath))
{ {
// The workspace root path could be an empty string // 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. // without opening an entire folder (workspace) first.
// In this case we should just log an error and let // In this case we should just log an error and let
// the specified settings path go through even though // the specified settings path go through even though
@@ -79,10 +79,10 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Server
public class LanguageServerSettingsWrapper public class LanguageServerSettingsWrapper
{ {
// NOTE: This property is capitalized as 'Powershell' because the // NOTE: This property is capitalized as 'SqlTools' because the
// mode name sent from the client is written as 'powershell' and // mode name sent from the client is written as 'SqlTools' and
// JSON.net is using camelCasing. // 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. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
// //
using Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter; using Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol; using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
using Microsoft.PowerShell.EditorServices.Utility; using Microsoft.SqlTools.EditorServices.Utility;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Protocol.Server namespace Microsoft.SqlTools.EditorServices.Protocol.Server
{ {
/// <summary> /// <summary>
/// Throttles output written via OutputEvents by batching all output /// Throttles output written via OutputEvents by batching all output

View File

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

View File

@@ -5,7 +5,7 @@
using System; using System;
namespace Microsoft.PowerShell.EditorServices.Session namespace Microsoft.SqlTools.EditorServices.Session
{ {
/// <summary> /// <summary>
/// Contains details about the current host application (most /// Contains details about the current host application (most
@@ -16,19 +16,19 @@ namespace Microsoft.PowerShell.EditorServices.Session
#region Constants #region Constants
/// <summary> /// <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. /// if no host name is specified by the host application.
/// </summary> /// </summary>
public const string DefaultHostName = "PowerShell Editor Services Host"; public const string DefaultHostName = "SqlTools Editor Services Host";
/// <summary> /// <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. /// for the host-specific profile path if no host ID is specified.
/// </summary> /// </summary>
public const string DefaultHostProfileId = "Microsoft.PowerShellEditorServices"; public const string DefaultHostProfileId = "Microsoft.SqlToolsEditorServices";
/// <summary> /// <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 /// no version is specified by the host application, we use 0.0.0
/// to indicate a lack of version. /// to indicate a lack of version.
/// </summary> /// </summary>
@@ -71,7 +71,7 @@ namespace Microsoft.PowerShell.EditorServices.Session
/// "[Application Name] Host". /// "[Application Name] Host".
/// </param> /// </param>
/// <param name="profileId"> /// <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' /// loaded. Used to resolve a profile path of the form 'X_profile.ps1'
/// where 'X' represents the value of hostProfileId. If null, a default /// where 'X' represents the value of hostProfileId. If null, a default
/// will be used. /// 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. // 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> /// <summary>
/// Enumerates the types of output lines that will be sent /// Enumerates the types of output lines that will be sent
@@ -34,7 +34,7 @@ namespace Microsoft.PowerShell.EditorServices
/// <summary> /// <summary>
/// An error output line, written with the Write-Error cmdlet or /// 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> /// </summary>
Error Error
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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