Class RDCoreServerApp
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
serverStateProviderIServerStateProviderManages the operational state of the server application.
healthCheckServiceIHealthCheckService<RDCoreServerApp>A service that monitors the server process.
transportLayerILanguageServerProtocolTransportLayerThe RDCore/LSP transport layer.
loggerILogger<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
Remarks
⚠️ Temporal coupling: this property getter will throw if it is used before RunAsync is called.
Exceptions
ServerStateProvider
protected IServerStateProvider ServerStateProvider { get; }
Property Value
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
builderIRDCoreLSPHandlerConfigurationBuilderA 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
disposingbool
GetServerInfo()
Gets information about this LSP server application and its configuration.
protected virtual ServerInfo GetServerInfo()
Returns
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
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
serverILanguageServerrequestInitializeParamscancellationTokenCancellationToken
Returns
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
serverILanguageServerrequestInitializeParamsresponseInitializeResultcancellationTokenCancellationToken
Returns
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
serverILanguageServer
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
serverILanguageServerThe initializing
OmniSharpLSP server instance.clientCapabilitiesClientCapabilitiesThe 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
externalServiceProviderIServiceProvider