mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-14 03:58:35 -05:00
Move unused forked code to external directory (#1192)
* Move unused forked code to external directory * Fix SLN build errors * Add back resource provider core since it's referenced by main resource provider project * Update PackageProjects step of pipeline
This commit is contained in:
33
external/Microsoft.SqlTools.Hosting.Contracts/EventType.cs
vendored
Normal file
33
external/Microsoft.SqlTools.Hosting.Contracts/EventType.cs
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.Hosting.Contracts
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines an event type with a particular method name.
|
||||
/// </summary>
|
||||
/// <typeparam name="TParams">The parameter type for this event.</typeparam>
|
||||
public class EventType<TParams>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the method name for the event type.
|
||||
/// </summary>
|
||||
public string MethodName { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates an EventType instance with the given parameter type and method name.
|
||||
/// </summary>
|
||||
/// <param name="methodName">The method name of the event.</param>
|
||||
/// <returns>A new EventType instance for the defined type.</returns>
|
||||
public static EventType<TParams> Create(string methodName)
|
||||
{
|
||||
return new EventType<TParams>()
|
||||
{
|
||||
MethodName = methodName
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
23
external/Microsoft.SqlTools.Hosting.Contracts/Internal/Error.cs
vendored
Normal file
23
external/Microsoft.SqlTools.Hosting.Contracts/Internal/Error.cs
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.Hosting.Contracts.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the message contract for errors returned via <see cref="Microsoft.SqlTools.Hosting.Protocol.RequestContext.SendError"/>
|
||||
/// </summary>
|
||||
public class Error
|
||||
{
|
||||
/// <summary>
|
||||
/// Error code. If omitted will default to 0
|
||||
/// </summary>
|
||||
public int Code { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Error message
|
||||
/// </summary>
|
||||
public string Message { get; set; }
|
||||
}
|
||||
}
|
||||
16
external/Microsoft.SqlTools.Hosting.Contracts/Internal/ExitNotification.cs
vendored
Normal file
16
external/Microsoft.SqlTools.Hosting.Contracts/Internal/ExitNotification.cs
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.Hosting.Contracts.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines an event that is sent from the client to notify that
|
||||
/// the client is exiting and the server should as well.
|
||||
/// </summary>
|
||||
public class ExitNotification
|
||||
{
|
||||
public static readonly EventType<object> Type = EventType<object>.Create("exit");
|
||||
}
|
||||
}
|
||||
26
external/Microsoft.SqlTools.Hosting.Contracts/Internal/HostingErrorNotification.cs
vendored
Normal file
26
external/Microsoft.SqlTools.Hosting.Contracts/Internal/HostingErrorNotification.cs
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.Hosting.Contracts.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Parameters to be used for reporting hosting-level errors, such as protocol violations
|
||||
/// </summary>
|
||||
public class HostingErrorParams
|
||||
{
|
||||
/// <summary>
|
||||
/// The message of the error
|
||||
/// </summary>
|
||||
public string Message { get; set; }
|
||||
}
|
||||
|
||||
public class HostingErrorNotification
|
||||
{
|
||||
public static readonly
|
||||
EventType<HostingErrorParams> Type =
|
||||
EventType<HostingErrorParams>.Create("hosting/error");
|
||||
|
||||
}
|
||||
}
|
||||
17
external/Microsoft.SqlTools.Hosting.Contracts/Internal/ShutdownRequest.cs
vendored
Normal file
17
external/Microsoft.SqlTools.Hosting.Contracts/Internal/ShutdownRequest.cs
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
namespace Microsoft.SqlTools.Hosting.Contracts.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a message that is sent from the client to request
|
||||
/// that the server shut down.
|
||||
/// </summary>
|
||||
public class ShutdownRequest
|
||||
{
|
||||
public static readonly RequestType<object, object> Type = RequestType<object, object>.Create("shutdown");
|
||||
}
|
||||
}
|
||||
|
||||
9
external/Microsoft.SqlTools.Hosting.Contracts/Microsoft.SqlTools.Hosting.Contracts.csproj
vendored
Normal file
9
external/Microsoft.SqlTools.Hosting.Contracts/Microsoft.SqlTools.Hosting.Contracts.csproj
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<PackageDescription>
|
||||
Defines the core messages needed for the Microsoft.SqlTools.Hosting service to communicate over the VSCode Language Server Protocol.
|
||||
</PackageDescription>
|
||||
<Description>$(PackageDescription)</Description>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
24
external/Microsoft.SqlTools.Hosting.Contracts/RequestType.cs
vendored
Normal file
24
external/Microsoft.SqlTools.Hosting.Contracts/RequestType.cs
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// Copyright (c) Microsoft. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Microsoft.SqlTools.Hosting.Contracts
|
||||
{
|
||||
[DebuggerDisplay("RequestType MethodName = {MethodName}")]
|
||||
public class RequestType<TParams, TResult>
|
||||
{
|
||||
public string MethodName { get; private set; }
|
||||
|
||||
public static RequestType<TParams, TResult> Create(string typeName)
|
||||
{
|
||||
return new RequestType<TParams, TResult>()
|
||||
{
|
||||
MethodName = typeName
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user