diff --git a/ServiceHost/.vscode/launch.json b/ServiceHost/.vscode/launch.json
index 51cdc900..ea4209f7 100644
--- a/ServiceHost/.vscode/launch.json
+++ b/ServiceHost/.vscode/launch.json
@@ -10,13 +10,15 @@
"args": [],
"cwd": "${workspaceRoot}",
"externalConsole": true,
+ "requireExactSource": false,
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
- "processId": 16900
+ "requireExactSource": false,
+ "processId": 14720
}
]
}
\ No newline at end of file
diff --git a/ServiceHost/Client/DebugAdapterClientBase.cs b/ServiceHost/Client/DebugAdapterClientBase.cs
deleted file mode 100644
index e2949307..00000000
--- a/ServiceHost/Client/DebugAdapterClientBase.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-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.SqlTools.EditorServices.Protocol.Client
-{
- public class DebugAdapterClient : ProtocolEndpoint
- {
- public DebugAdapterClient(ChannelBase clientChannel)
- : base(clientChannel, MessageProtocolType.DebugAdapter)
- {
- }
-
- public async Task LaunchScript(string scriptFilePath)
- {
- await this.SendRequest(
- LaunchRequest.Type,
- new LaunchRequestArguments {
- Program = scriptFilePath
- });
-
- await this.SendRequest(ConfigurationDoneRequest.Type, null);
- }
-
- protected override Task OnStart()
- {
- return Task.FromResult(true);
- }
-
- protected override Task OnConnect()
- {
- // Initialize the debug adapter
- return this.SendRequest(
- InitializeRequest.Type,
- new InitializeRequestArguments
- {
- LinesStartAt1 = true
- });
- }
- }
-}
-
diff --git a/ServiceHost/Client/LanguageClientBase.cs b/ServiceHost/Client/LanguageClientBase.cs
deleted file mode 100644
index 22522252..00000000
--- a/ServiceHost/Client/LanguageClientBase.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-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.SqlTools.EditorServices.Protocol.Client
-{
- ///
- /// Provides a base implementation for language server clients.
- ///
- public abstract class LanguageClientBase : ProtocolEndpoint
- {
- ///
- /// Initializes an instance of the language client using the
- /// specified channel for communication.
- ///
- /// The channel to use for communication with the server.
- public LanguageClientBase(ChannelBase clientChannel)
- : base(clientChannel, MessageProtocolType.LanguageServer)
- {
- }
-
- protected override Task OnStart()
- {
- // Initialize the implementation class
- return this.Initialize();
- }
-
- protected override async Task OnStop()
- {
- // First, notify the language server that we're stopping
- var response = await this.SendRequest(ShutdownRequest.Type, new object());
- await this.SendEvent(ExitNotification.Type, new object());
- }
-
- protected abstract Task Initialize();
- }
-}
-
diff --git a/ServiceHost/Client/LanguageServiceClient.cs b/ServiceHost/Client/LanguageServiceClient.cs
deleted file mode 100644
index 7ec5fba0..00000000
--- a/ServiceHost/Client/LanguageServiceClient.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-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.SqlTools.EditorServices.Protocol.Client
-{
- public class LanguageServiceClient : LanguageClientBase
- {
- private Dictionary cachedDiagnostics =
- new Dictionary();
-
- public LanguageServiceClient(ChannelBase clientChannel)
- : base(clientChannel)
- {
- }
-
- protected override Task Initialize()
- {
- // Add handlers for common events
- this.SetEventHandler(PublishDiagnosticsNotification.Type, HandlePublishDiagnosticsEvent);
-
- return Task.FromResult(true);
- }
-
- protected override Task OnConnect()
- {
- // Send the 'initialize' request and wait for the response
- var initializeRequest = new InitializeRequest
- {
- RootPath = "",
- Capabilities = new ClientCapabilities()
- };
-
- return this.SendRequest(
- InitializeRequest.Type,
- initializeRequest);
- }
-
- #region Events
-
- public event EventHandler DiagnosticsReceived;
-
- protected void OnDiagnosticsReceived(string filePath)
- {
- if (this.DiagnosticsReceived != null)
- {
- this.DiagnosticsReceived(this, filePath);
- }
- }
-
- #endregion
-
- #region Private Methods
-
- private Task HandlePublishDiagnosticsEvent(
- PublishDiagnosticsNotification diagnostics,
- EventContext eventContext)
- {
- string normalizedPath = diagnostics.Uri.ToLower();
-
- this.cachedDiagnostics[normalizedPath] =
- diagnostics.Diagnostics
- .Select(GetMarkerFromDiagnostic)
- .ToArray();
-
- this.OnDiagnosticsReceived(normalizedPath);
-
- return Task.FromResult(true);
- }
-
- private static ScriptFileMarker GetMarkerFromDiagnostic(Diagnostic diagnostic)
- {
- DiagnosticSeverity severity =
- diagnostic.Severity.GetValueOrDefault(
- DiagnosticSeverity.Error);
-
- return new ScriptFileMarker
- {
- Level = MapDiagnosticSeverityToLevel(severity),
- Message = diagnostic.Message,
- ScriptRegion = new ScriptRegion
- {
- StartLineNumber = diagnostic.Range.Start.Line + 1,
- StartColumnNumber = diagnostic.Range.Start.Character + 1,
- EndLineNumber = diagnostic.Range.End.Line + 1,
- EndColumnNumber = diagnostic.Range.End.Character + 1
- }
- };
- }
-
- private static ScriptFileMarkerLevel MapDiagnosticSeverityToLevel(DiagnosticSeverity severity)
- {
- switch (severity)
- {
- case DiagnosticSeverity.Hint:
- case DiagnosticSeverity.Information:
- return ScriptFileMarkerLevel.Information;
-
- case DiagnosticSeverity.Warning:
- return ScriptFileMarkerLevel.Warning;
-
- case DiagnosticSeverity.Error:
- return ScriptFileMarkerLevel.Error;
-
- default:
- return ScriptFileMarkerLevel.Error;
- }
- }
-
- #endregion
- }
-}
diff --git a/ServiceHost/DebugAdapter/AttachRequest.cs b/ServiceHost/DebugAdapter/AttachRequest.cs
deleted file mode 100644
index 49fdc5b2..00000000
--- a/ServiceHost/DebugAdapter/AttachRequest.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
-{
- public class AttachRequest
- {
- public static readonly
- RequestType Type =
- RequestType.Create("attach");
- }
-
- public class AttachRequestArguments
- {
- public string Address { get; set; }
-
- public int Port { get; set; }
- }
-}
diff --git a/ServiceHost/DebugAdapter/Breakpoint.cs b/ServiceHost/DebugAdapter/Breakpoint.cs
deleted file mode 100644
index 14de1790..00000000
--- a/ServiceHost/DebugAdapter/Breakpoint.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.SqlTools.EditorServices.Utility;
-
-namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
-{
- public class Breakpoint
- {
- ///
- /// Gets an boolean indicator that if true, breakpoint could be set
- /// (but not necessarily at the desired location).
- ///
- public bool Verified { get; set; }
-
- ///
- /// Gets an optional message about the state of the breakpoint. This is shown to the user
- /// and can be used to explain why a breakpoint could not be verified.
- ///
- public string Message { get; set; }
-
- public string Source { get; set; }
-
- public int? Line { get; set; }
-
- public int? Column { get; set; }
-
- private Breakpoint()
- {
- }
-
-#if false
- public static Breakpoint Create(
- BreakpointDetails breakpointDetails)
- {
- //Validate.IsNotNull(nameof(breakpointDetails), breakpointDetails);
-
- return new Breakpoint
- {
- Verified = breakpointDetails.Verified,
- Message = breakpointDetails.Message,
- Source = breakpointDetails.Source,
- Line = breakpointDetails.LineNumber,
- Column = breakpointDetails.ColumnNumber
- };
- }
-
- public static Breakpoint Create(
- CommandBreakpointDetails breakpointDetails)
- {
- //Validate.IsNotNull(nameof(breakpointDetails), breakpointDetails);
-
- return new Breakpoint {
- Verified = breakpointDetails.Verified,
- Message = breakpointDetails.Message
- };
- }
-#endif
-
- public static Breakpoint Create(
- SourceBreakpoint sourceBreakpoint,
- string source,
- string message,
- bool verified = false)
- {
- Validate.IsNotNull(nameof(sourceBreakpoint), sourceBreakpoint);
- Validate.IsNotNull(nameof(source), source);
- Validate.IsNotNull(nameof(message), message);
-
- return new Breakpoint {
- Verified = verified,
- Message = message,
- Source = source,
- Line = sourceBreakpoint.Line,
- Column = sourceBreakpoint.Column
- };
- }
- }
-}
diff --git a/ServiceHost/DebugAdapter/ConfigurationDoneRequest.cs b/ServiceHost/DebugAdapter/ConfigurationDoneRequest.cs
deleted file mode 100644
index 2fc2203f..00000000
--- a/ServiceHost/DebugAdapter/ConfigurationDoneRequest.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-
-using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol;
-
-namespace Microsoft.SqlTools.EditorServices.Protocol.DebugAdapter
-{
- public class ConfigurationDoneRequest
- {
- public static readonly
- RequestType