Table of Contents

Class RDCoreServerApp

Namespace
RDCore.SDK.Server
Assembly
RDCore.SDK.dll

A server-side (LSP) RDCore app.

public abstract class RDCoreServerApp : IRDCoreServerApp, IRDCoreApp, IDisposable
Inheritance
RDCoreServerApp
Implements
Derived
Inherited Members

Remarks

🧩 Since RDCore extensions are LSP servers, this is the base class for most RDCore applications.

Constructors

RDCoreServerApp(IOptions<SdkAppOptions>, IServerStateProvider, IHealthCheckService<RDCoreServerApp>, ILanguageServerProtocolTransportLayer, ILogger<RDCoreServerApp>)

A server-side (LSP) RDCore app.

protected RDCoreServerApp(IOptions<SdkAppOptions> options, IServerStateProvider serverStateProvider, IHealthCheckService<RDCoreServerApp> healthCheckService, ILanguageServerProtocolTransportLayer transportLayer, ILogger<RDCoreServerApp> logger)

Parameters

options IOptions<SdkAppOptions>

The current server configuration options.

serverStateProvider IServerStateProvider

Manages the operational state of the server application.

healthCheckService IHealthCheckService<RDCoreServerApp>

A service that monitors the server process.

transportLayer ILanguageServerProtocolTransportLayer

The RDCore/LSP transport layer.

logger ILogger<RDCoreServerApp>

A standard logger.

Remarks

🧩 Since RDCore extensions are LSP servers, this is the base class for most RDCore applications.

Properties

ExternalServices

The external (host) service provider, as opposed to the OmniSharp language server's internal Services.

protected IServiceProvider ExternalServices { get; }

Property Value

IServiceProvider

Remarks

👉 Platform services such as IPlatformCompositionService and the orchestration services are registered here, not on the internal server container. Server apps that bring up child components must pass this provider to IRDCoreClientApp.RunAsync.

PlatformComponent

Identifies the type of RDCore platform application.

public abstract CoreServerComponent PlatformComponent { get; }

Property Value

CoreServerComponent

ServerStateProvider

protected IServerStateProvider ServerStateProvider { get; }

Property Value

IServerStateProvider

Methods

BeforeRunAsync(string[])

protected virtual Task BeforeRunAsync(string[] args)

Parameters

args string[]

Returns

Task

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 language server's internal service collection.

protected virtual void ConfigureServices(IServiceCollection services)

Parameters

services IServiceCollection

The OmniSharp language server's internal service collection.

Remarks

🧩 Register here the dependencies required by any handler configured in ConfigureHandlers(IRDCoreLSPHandlerConfigurationBuilder). The base implementation does nothing.

Dispose()

Disposes of any unmanaged resources held at instance level.

public void Dispose()

Dispose(bool)

Disposes of any unmanaged resources held at instance level.

protected abstract void Dispose(bool disposing)

Parameters

disposing bool

GetServerInfo()

Gets information about this LSP server application and its configuration.

protected virtual ServerInfo GetServerInfo()

Returns

ServerInfo

Remarks

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

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.

OnLanguageServerInitializeAsync(ILanguageServer, InitializeParams, CancellationToken)

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

protected virtual Task OnLanguageServerInitializeAsync(ILanguageServer server, InitializeParams request, CancellationToken cancellationToken)

Parameters

server ILanguageServer
request InitializeParams
cancellationToken CancellationToken

Returns

Task

Remarks

🧩 The base implementation simply logs handler completion at Trace level. This method runs after server capabilities registration .

OnLanguageServerInitializedAsync(ILanguageServer, InitializeParams, InitializeResult, CancellationToken)

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

protected virtual Task OnLanguageServerInitializedAsync(ILanguageServer server, InitializeParams request, InitializeResult response, CancellationToken cancellationToken)

Parameters

server ILanguageServer
request InitializeParams
response InitializeResult
cancellationToken CancellationToken

Returns

Task

Remarks

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

OnLanguageServerStarted(ILanguageServer)

🚀 LSP initialization has completed, server is ready to start receiving and responding to client requests and notifications.

protected virtual void OnLanguageServerStarted(ILanguageServer server)

Parameters

server ILanguageServer

Remarks

The client owns the file system for any document that is currently opened.
DO NOT configure any server-side FileSystemWatcher.

OnServerStoppingAsync()

Invoked when the server has been asked to stop, concurrently with its own teardown. Override to gracefully shut down any supervised child components. Base implementation does nothing.

protected virtual Task OnServerStoppingAsync()

Returns

Task

RegisterServerCapabilities(ILanguageServer, ClientCapabilities)

Registers the capabilities of this LSP server application, using the provided ClientCapabilities.

protected abstract void RegisterServerCapabilities(ILanguageServer server, ClientCapabilities clientCapabilities)

Parameters

server ILanguageServer

The initializing OmniSharp LSP server instance.

clientCapabilities ClientCapabilities

The client capabilities reported by the client.

Remarks

🧩 This method is invoked during the initialization handshake when the client emits its capabilities in an InitializeParams (LSP Initialize request).

RunAsync(IServiceProvider, string[])

Bootstraps and starts the application.

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

Parameters

externalServiceProvider IServiceProvider
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