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(IServerStateProvider, IHealthCheckService<RDCoreServerApp>, ILanguageServerProtocolTransportLayer, ILogger<RDCoreServerApp>)

A server-side (LSP) RDCore app.

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

Parameters

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

LanguageServer

Gets the encapsulated OmniSharp language server interface.

public ILanguageServer LanguageServer { get; }

Property Value

ILanguageServer

Remarks

⚠️ Temporal coupling: this property getter will throw if it is used before RunAsync is called.

Exceptions

LanguageServerProtocolSdkException

Thrown

ServerStateProvider

protected IServerStateProvider ServerStateProvider { get; }

Property Value

IServerStateProvider

Methods

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:

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.

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)

Bootstraps and starts the application.

public Task RunAsync(IServiceProvider externalServiceProvider)

Parameters

externalServiceProvider IServiceProvider

Returns

Task