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(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
optionsIOptions<SdkAppOptions>The current server configuration options.
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
ExternalServices
The external (host) service provider, as opposed to the OmniSharp language server's
internal Services.
protected IServiceProvider ExternalServices { get; }
Property Value
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
ServerStateProvider
protected IServerStateProvider ServerStateProvider { get; }
Property Value
Methods
BeforeRunAsync(string[])
protected virtual Task BeforeRunAsync(string[] args)
Parameters
argsstring[]
Returns
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:
ConfigureServices(IServiceCollection)
Configures services with the OmniSharp language server's internal service collection.
protected virtual void ConfigureServices(IServiceCollection services)
Parameters
servicesIServiceCollectionThe
OmniSharplanguage 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
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.
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
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, string[])
Bootstraps and starts the application.
public Task RunAsync(IServiceProvider externalServiceProvider, string[] args)
Parameters
externalServiceProviderIServiceProviderargsstring[]
Returns
SendNotificationAsync<TParams>(TParams, CancellationToken)
public Task SendNotificationAsync<TParams>(TParams notification, CancellationToken token) where TParams : IRequest
Parameters
notificationTParamstokenCancellationToken
Returns
Type Parameters
TParams
SendRequestAsync<TParams, TResult>(TParams, CancellationToken)
public Task<TResult> SendRequestAsync<TParams, TResult>(TParams request, CancellationToken token) where TParams : IRequest<TResult>
Parameters
requestTParamstokenCancellationToken
Returns
- Task<TResult>
Type Parameters
TParamsTResult