Table of Contents

Class RDCoreClientApp

Namespace
RDCore.SDK.Client
Assembly
RDCore.SDK.dll

A client-side (LSP) RDCore app.

public abstract class RDCoreClientApp : IRDCoreClientApp, IRDCoreApp, IDisposable
Inheritance
RDCoreClientApp
Implements
Derived
Inherited Members

Remarks

🧩 Most RDCore apps are server-side, but if you were making an IDE or a CLI app, this would be your LSP app.

Constructors

RDCoreClientApp(IOptions<SdkAppOptions>, IChildConnectionFactory, ILogger<RDCoreClientApp>)

protected RDCoreClientApp(IOptions<SdkAppOptions> options, IChildConnectionFactory connectionFactory, ILogger<RDCoreClientApp> logger)

Parameters

options IOptions<SdkAppOptions>
connectionFactory IChildConnectionFactory
logger ILogger<RDCoreClientApp>

Properties

Connection

The connection to the child server. Throws before RunAsync(IServiceProvider, string[]).

protected ChildConnection Connection { get; }

Property Value

ChildConnection

ExtensionInfo

The extension manifest for this Extension component.

public ExtensionInfo? ExtensionInfo { get; init; }

Property Value

ExtensionInfo

PlatformComponent

The type of platform client.

public abstract CoreServerComponent PlatformComponent { get; }

Property Value

CoreServerComponent

Remarks

If Extension, ExtensionInfo should not be null.

PlatformInfo

The result of the rdcore/platform/initialize handshake; null until the connection is Ready.

public PlatformInitializeResult? PlatformInfo { get; }

Property Value

PlatformInitializeResult

Methods

BeforeRunAsync(string[])

protected virtual Task BeforeRunAsync(string[] args)

Parameters

args string[]

Returns

Task

ConfigureClientCapabilities(ClientCapabilities)

protected abstract ClientCapabilities ConfigureClientCapabilities(ClientCapabilities capabilities)

Parameters

capabilities ClientCapabilities

Returns

ClientCapabilities

ConfigureHandlers(IRDCoreLSPHandlerConfigurationBuilder)

Configures OmniSharp LSP-compliant JSON-RPC handlers for any LSP 3.17 specified protocol event.

protected abstract void ConfigureHandlers(IRDCoreLSPHandlerConfigurationBuilder builder)

Parameters

builder IRDCoreLSPHandlerConfigurationBuilder

A builder that lets you fluently chain repetitive calls.

Remarks

🧩 This method is invoked immediately after configuring ClientInfo and the client/server lifecycle protocol handlers:

ConfigureServices(IServiceCollection)

Configures services with the OmniSharp service collection.

protected abstract void ConfigureServices(IServiceCollection services)

Parameters

services IServiceCollection

The OmniSharp internal service collection.

CreateInitializationParams()

protected virtual InitializeParams CreateInitializationParams()

Returns

InitializeParams

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

protected abstract void Dispose(bool disposing)

Parameters

disposing bool

GetClientCapabilities()

protected virtual ClientCapabilities GetClientCapabilities()

Returns

ClientCapabilities

GetClientInfo()

Gets information about this LSP client application and its configuration.

protected virtual ClientInfo GetClientInfo()

Returns

ClientInfo

Remarks

🧩 The base implementation returns the Name and Version of the executing Assembly, which is everything ClientInfo needs.

GetExpectedCapabilities()

The platform capabilities this app expects the child to provide (sent in the platform handshake). The base implementation expects nothing; a server proxy overrides this with the LS's expectations.

protected virtual CorePlatformClientCapabilities GetExpectedCapabilities()

Returns

CorePlatformClientCapabilities

HandleLanguageClientInitializeAsync(ILanguageClient, InitializeParams, CancellationToken)

Gives your class or handler an opportunity to interact with the InitializeParams before it is sent to the server.

protected Task HandleLanguageClientInitializeAsync(ILanguageClient client, InitializeParams request, CancellationToken cancellationToken)

Parameters

client ILanguageClient

The LSP language client.

request InitializeParams

The Initialize request payload.

cancellationToken CancellationToken

A CancellationToken for cooperative cancellation.

Returns

Task

HandleLanguageClientInitializedAsync(ILanguageClient, InitializeParams, InitializeResult, CancellationToken)

Gives your class or handler an opportunity to interact with the InitializeParams and InitializeResult before it is processed by the client.

protected Task HandleLanguageClientInitializedAsync(ILanguageClient client, InitializeParams request, InitializeResult response, CancellationToken cancellationToken)

Parameters

client ILanguageClient
request InitializeParams
response InitializeResult
cancellationToken CancellationToken

Returns

Task

LogIfEnabled(LogLevel, string)

Logs the specified message at the specified level, if logging is enabled at that level.

public void LogIfEnabled(LogLevel logLevel, string message)

Parameters

logLevel LogLevel

The LogLevel for this message.

message string

The log message.

OnConnectionTerminated()

The child server was lost and restart-with-backoff is exhausted. The base implementation stops the host application, which is correct for a standalone client (e.g. rdc.exe). A server that supervises the child (the language server) overrides this and escalates through its own shutdown path instead.

protected virtual void OnConnectionTerminated()

OnLanguageClientInitializeAsync(ILanguageClient, InitializeParams, CancellationToken)

Signals the completion of the Initialize request handler.
👉 Gives your class or handler an opportunity to interact with the InitializeParams before it is sent to the server.

protected virtual Task OnLanguageClientInitializeAsync(ILanguageClient client, InitializeParams request, CancellationToken token)

Parameters

client ILanguageClient

The LSP language client.

request InitializeParams

The Initialize request payload.

token CancellationToken

A CancellationToken for cooperative cancellation.

Returns

Task

Remarks

🧩 This method is invoked at the end of the initialization handshake; the base implementation logs handler completion at Trace level.

OnLanguageClientInitializedAsync(ILanguageClient, InitializeParams, InitializeResult, CancellationToken)

Signals the completion of the Initialized notification handler.
👉 Gives your class or handler an opportunity to interact with the InitializeParams and InitializeResult before it is processed by the client.

protected virtual Task OnLanguageClientInitializedAsync(ILanguageClient client, InitializeParams request, InitializeResult response, CancellationToken cancellationToken)

Parameters

client ILanguageClient
request InitializeParams
response InitializeResult
cancellationToken CancellationToken

Returns

Task

Remarks

🧩 The base implementation logs handler completion at Trace level.

OnLanguageClientStartedAsync(ILanguageClient, CancellationToken)

Gives your class or handler an opportunity to interact with the ILanguageClient after the connection has been established.

protected virtual Task OnLanguageClientStartedAsync(ILanguageClient client, CancellationToken token)

Parameters

client ILanguageClient
token CancellationToken

Returns

Task

Remarks

🧩 The base implementation simply logs handler completion at Trace level.

RunAsync(IServiceProvider, string[])

Bootstraps and starts the application.

public Task RunAsync(IServiceProvider provider, string[] args)

Parameters

provider IServiceProvider

An IServiceProvider to configure the application.

args string[]

Returns

Task

SendNotificationAsync<TParams>(TParams, CancellationToken)

public Task SendNotificationAsync<TParams>(TParams notification, CancellationToken token) where TParams : IRequest

Parameters

notification TParams
token CancellationToken

Returns

Task

Type Parameters

TParams

SendRequestAsync<TParams, TResult>(TParams, CancellationToken)

public Task<TResult> SendRequestAsync<TParams, TResult>(TParams request, CancellationToken token) where TParams : IRequest<TResult>

Parameters

request TParams
token CancellationToken

Returns

Task<TResult>

Type Parameters

TParams
TResult

ShutdownAsync()

Gracefully tears down the child connection: LSP shutdown request, exit notification, then a kill fallback.

public Task ShutdownAsync()

Returns

Task

WaitForReadyAsync(CancellationToken)

Completes once the connection to the child server is Ready; faults if the connection reaches a terminal state first.

public Task WaitForReadyAsync(CancellationToken token)

Parameters

token CancellationToken

Returns

Task

WaitForTerminalAsync()

Completes once the connection is terminally lost — the child exited and restart-with-backoff was exhausted.

public Task WaitForTerminalAsync()

Returns

Task