Table of Contents

Class AnyTextJsonRpcServerUtil

Namespace
NMF.AnyText
Assembly
NMF.AnyText.Lsp.dll

Helper class to configure Stream JSON RPC for the usage with the LSP implementation

public static class AnyTextJsonRpcServerUtil
Inheritance
AnyTextJsonRpcServerUtil
Inherited Members

Methods

AddLocalRpcTarget(JsonRpc, ILspServer)

Registers an ILspServer implementation as a local RPC target on the specified JsonRpc instance.

public static void AddLocalRpcTarget(JsonRpc rpc, ILspServer server)

Parameters

rpc JsonRpc

The JsonRpc instance that will handle incoming RPC calls.

server ILspServer

The ILspServer implementation to be registered as the local target.

CreateServer(IDuplexPipe, ILspServer)

Creates a StreamJSON RPC object for the given transport

public static JsonRpc CreateServer(IDuplexPipe pipe, ILspServer server)

Parameters

pipe IDuplexPipe

The pipe used for the connection

server ILspServer

The server implementation

Returns

JsonRpc

A JSON RPC object that manages the connection to the client

CreateServer(Stream)

Creates a StreamJSON RPC object for the given transport without localRpcTarget

public static JsonRpc CreateServer(Stream stream)

Parameters

stream Stream

The stream that represents the connection with the client

Returns

JsonRpc

A JSON RPC object that manages the connection to the client

CreateServer(Stream, ILspServer)

Creates a StreamJSON RPC object for the given transport

public static JsonRpc CreateServer(Stream stream, ILspServer server)

Parameters

stream Stream

The stream that represents the connection with the client

server ILspServer

The server implementation

Returns

JsonRpc

A JSON RPC object that manages the connection to the client

CreateServer(WebSocket, ILspServer)

Creates a StreamJSON RPC object for the given transport

public static JsonRpc CreateServer(WebSocket webSocket, ILspServer server)

Parameters

webSocket WebSocket

The websocket connection

server ILspServer

The server implementation

Returns

JsonRpc

A JSON RPC object that manages the connection to the client

CreateTraceSource(SourceLevels)

Creates and configures a TraceSource instance for logging trace information.

public static TraceSource CreateTraceSource(SourceLevels sourceLevels = (SourceLevels)-1)

Parameters

sourceLevels SourceLevels

The SourceLevel used to filter messages by type and severity. Defaults to All.

Returns

TraceSource

A TraceSource instance configured for the specified logging level.