Class RDCoreClientApp
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
optionsIOptions<SdkAppOptions>connectionFactoryIChildConnectionFactoryloggerILogger<RDCoreClientApp>
Properties
Connection
The connection to the child server. Throws before RunAsync(IServiceProvider, string[]).
protected ChildConnection Connection { get; }
Property Value
ExtensionInfo
The extension manifest for this Extension component.
public ExtensionInfo? ExtensionInfo { get; init; }
Property Value
PlatformComponent
The type of platform client.
public abstract CoreServerComponent PlatformComponent { get; }
Property Value
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
Methods
BeforeRunAsync(string[])
protected virtual Task BeforeRunAsync(string[] args)
Parameters
argsstring[]
Returns
ConfigureClientCapabilities(ClientCapabilities)
protected abstract ClientCapabilities ConfigureClientCapabilities(ClientCapabilities capabilities)
Parameters
capabilitiesClientCapabilities
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 service collection.
protected abstract void ConfigureServices(IServiceCollection services)
Parameters
servicesIServiceCollectionThe OmniSharp internal service collection.
CreateInitializationParams()
protected virtual InitializeParams CreateInitializationParams()
Returns
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
disposingbool
GetClientCapabilities()
protected virtual ClientCapabilities GetClientCapabilities()
Returns
GetClientInfo()
Gets information about this LSP client application and its configuration.
protected virtual ClientInfo GetClientInfo()
Returns
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
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
clientILanguageClientThe LSP language client.
requestInitializeParamsThe
Initializerequest payload.cancellationTokenCancellationTokenA CancellationToken for cooperative cancellation.
Returns
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
clientILanguageClientrequestInitializeParamsresponseInitializeResultcancellationTokenCancellationToken
Returns
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
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
clientILanguageClientThe LSP language client.
requestInitializeParamsThe
Initializerequest payload.tokenCancellationTokenA CancellationToken for cooperative cancellation.
Returns
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
clientILanguageClientrequestInitializeParamsresponseInitializeResultcancellationTokenCancellationToken
Returns
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
clientILanguageClienttokenCancellationToken
Returns
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
providerIServiceProviderAn IServiceProvider to configure the application.
argsstring[]
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
ShutdownAsync()
Gracefully tears down the child connection: LSP shutdown request, exit notification, then a kill fallback.
public Task ShutdownAsync()
Returns
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
tokenCancellationToken
Returns
WaitForTerminalAsync()
Completes once the connection is terminally lost — the child exited and restart-with-backoff was exhausted.
public Task WaitForTerminalAsync()