Skip to content

Commit

Permalink
Publish JsonRpc package (#385)
Browse files Browse the repository at this point in the history
* Update publish.yaml

* Internalized JsonRpc

* Moved IVT to projectfile as per review comment
  • Loading branch information
LPeter1997 authored Jan 31, 2024
1 parent 7dfb8b8 commit 3065233
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ jobs:
run: |
cd src
$sdkProjects = "Compiler", "Compiler.Toolset", "Sdk", "ProjectTemplates"
$langserverProjects = "Compiler", "LanguageServer", "Lsp"
$debugadapterProjects = "DebugAdapter", "Dap"
$langserverProjects = "Compiler", "LanguageServer", "Lsp", "JsonRpc"
$debugadapterProjects = "DebugAdapter", "Dap", "JsonRpc"
$projects = @()
if ($${{ github.event.inputs.deploy-sdk }}) { $projects += $sdkProjects; }
Expand Down
5 changes: 0 additions & 5 deletions src/Draco.Compiler/Attributes.cs

This file was deleted.

6 changes: 6 additions & 0 deletions src/Draco.Compiler/Draco.Compiler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<InternalsVisibleTo Include="Draco.Compiler.Tests" />
<InternalsVisibleTo Include="Draco.Compiler.Benchmarks" />
<InternalsVisibleTo Include="Draco.Compiler.Fuzzer" />
</ItemGroup>

<ItemGroup>
<AdditionalFiles Include="Internal\Syntax\Syntax.xml" />
<AdditionalFiles Include="Internal\BoundTree\BoundNodes.xml" />
Expand Down
2 changes: 1 addition & 1 deletion src/Draco.Dap/Adapter/DebugAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static IDebugClient Connect(IDuplexPipe stream)
/// <returns>The task that completes when the communication is over.</returns>
public static async Task RunAsync(this IDebugClient client, IDebugAdapter adapter)
{
var connection = client.Connection;
var connection = ((DebugClientProxy)client).Connection;

// Register adapter methods
RegisterAdapterRpcMethods(adapter, connection);
Expand Down
2 changes: 1 addition & 1 deletion src/Draco.Dap/Adapter/IDebugClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Draco.Dap.Adapter;
/// <summary>
/// An interface representing the debug client on the remote.
/// </summary>
public interface IDebugClient : IJsonRpcClient
public interface IDebugClient
{
[Event("initialized")]
public Task Initialized();
Expand Down
5 changes: 5 additions & 0 deletions src/Draco.JsonRpc/Draco.JsonRpc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<InternalsVisibleTo Include="Draco.Dap" />
<InternalsVisibleTo Include="Draco.Lsp" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.IO.Pipelines" Version="7.0.0" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Draco.JsonRpc/IJsonRpcClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Draco.JsonRpc;
/// <summary>
/// The interface all JSON-RPC clients must implement.
/// </summary>
public interface IJsonRpcClient
internal interface IJsonRpcClient
{
/// <summary>
/// The connection.
Expand Down
2 changes: 1 addition & 1 deletion src/Draco.JsonRpc/IJsonRpcConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Draco.JsonRpc;
/// <summary>
/// Represents a JSON RPC connection.
/// </summary>
public interface IJsonRpcConnection
internal interface IJsonRpcConnection
{
/// <summary>
/// Registers a message handler.
Expand Down
2 changes: 1 addition & 1 deletion src/Draco.JsonRpc/IJsonRpcMethodHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Draco.JsonRpc;
/// <summary>
/// A registered JSON RPC method handler.
/// </summary>
public interface IJsonRpcMethodHandler
internal interface IJsonRpcMethodHandler
{
/// <summary>
/// The name of the method this handles.
Expand Down
2 changes: 1 addition & 1 deletion src/Draco.JsonRpc/JsonRpcClientProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Draco.JsonRpc;
/// <summary>
/// A proxy type for a JSON-RPC client.
/// </summary>
public abstract class JsonRpcClientProxy : DispatchProxy
internal abstract class JsonRpcClientProxy : DispatchProxy
{
/// <summary>
/// The connection of the client.
Expand Down
2 changes: 1 addition & 1 deletion src/Draco.JsonRpc/JsonRpcConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Draco.JsonRpc;
/// </summary>
/// <typeparam name="TMessage">The message type.</typeparam>
/// <typeparam name="TError">The error descriptor.</typeparam>
public abstract class JsonRpcConnection<TMessage, TError> : IJsonRpcConnection
internal abstract class JsonRpcConnection<TMessage, TError> : IJsonRpcConnection
{
protected sealed class JsonRpcResponseException : Exception
{
Expand Down
2 changes: 1 addition & 1 deletion src/Draco.JsonRpc/JsonRpcMethodHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Draco.JsonRpc;
/// <summary>
/// Utilities for construction <see cref="IJsonRpcMethodHandler"/>s.
/// </summary>
public static class JsonRpcMethodHandler
internal static class JsonRpcMethodHandler
{
/// <summary>
/// Constructs a new <see cref="IJsonRpcMethodHandler"/> from a given <see cref="MethodInfo"/>.
Expand Down
2 changes: 1 addition & 1 deletion src/Draco.Lsp/Server/ILanguageClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Draco.Lsp.Server;
/// <summary>
/// An interface representing the language client on the remote.
/// </summary>
public interface ILanguageClient : IJsonRpcClient
public interface ILanguageClient
{
// Language features

Expand Down
2 changes: 1 addition & 1 deletion src/Draco.Lsp/Server/LanguageServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static ILanguageClient Connect(IDuplexPipe stream)
/// <returns>The task that completes when the communication is over.</returns>
public static async Task RunAsync(this ILanguageClient client, ILanguageServer server)
{
var connection = client.Connection;
var connection = ((LanguageClientProxy)client).Connection;

// Register server methods
RegisterServerRpcMethods(server, connection);
Expand Down

0 comments on commit 3065233

Please sign in to comment.