Interface IRDCorePlatformChannel
A JSON-RPC connection to the RDCore language server, as far as its rdcore/* messages go: what a client implements over whatever carries its messages,
so that RDCorePlatformClient speaks the platform's protocol through it.
public interface IRDCorePlatformChannel
- Extension Methods
Remarks
The channel moves JSON and nothing else: the messages are written and read by the callers, with Options
(RDCorePlatformChannelExtensions). An IDE whose own LSP client owns the connection implements it over that client's custom-message API;
RDCore.SDK implements it over OmniSharp's language client, which is what rdc.exe speaks through.
A request the server answers with a JSON-RPC error faults the returned task with whatever exception the implementation raises for one; the channel adds no error model of its own.
An implementation hands the JSON on as it is: a string stays the string it is, whatever it looks like. 👉 The language server and rdc.exe read through
OmniSharp, which does not keep to that for one shape of string: an ISO 8601 date and time (19 to 40 characters, a digit first, a T at the eleventh) with an
offset, a Z or a fraction of a second is read as a date and written back as one, so "2026-10-30T12:34:56+02:00" arrives in the offset of the machine that
read it, and "2026-10-30T12:34:56.000Z" without its fraction. A date and time with none of them, as VBA's Format writes one
(yyyy-mm-ddThh:nn:ss), arrives as it was written.
Methods
OnNotification(string, Func<JsonElement?, CancellationToken, Task>)
Handles the notifications of a method the server sends the client, until the returned registration is disposed.
IDisposable OnNotification(string method, Func<JsonElement?, CancellationToken, Task> handler)
Parameters
methodstringThe JSON-RPC method.
handlerFunc<JsonElement?, CancellationToken, Task>Handles a notification, given its
params(null when it has none).
Returns
- IDisposable
The registration; disposing it stops handling the method.
Remarks
A method has one handler at a time: another is registered once the registration of the first is disposed.
Exceptions
- InvalidOperationException
The method is already answered or handled on this channel.
OnRequest(string, Func<JsonElement?, CancellationToken, Task<JsonElement?>>)
Answers the requests of a method the server sends the client, until the returned registration is disposed.
IDisposable OnRequest(string method, Func<JsonElement?, CancellationToken, Task<JsonElement?>> handler)
Parameters
methodstringThe JSON-RPC method.
handlerFunc<JsonElement?, CancellationToken, Task<JsonElement?>>Answers a request: given its
params(null when it has none), returns itsresult.
Returns
- IDisposable
The registration; disposing it stops answering the method.
Remarks
A method has one handler at a time: another is registered once the registration of the first is disposed.
Exceptions
- InvalidOperationException
The method is already answered or handled on this channel.
SendNotificationAsync(string, JsonElement?, CancellationToken)
Sends a notification to the server.
Task SendNotificationAsync(string method, JsonElement? parameters, CancellationToken token)
Parameters
methodstringThe JSON-RPC method.
parametersJsonElement?The
paramsof the notification; null to send none.tokenCancellationTokenCancels before the notification is sent.
Returns
SendRequestAsync(string, JsonElement?, CancellationToken)
Sends a request to the server and returns its result.
Task<JsonElement?> SendRequestAsync(string method, JsonElement? parameters, CancellationToken token)
Parameters
methodstringThe JSON-RPC method: one of RDCorePlatformProtocol.
parametersJsonElement?The
paramsof the request; null to send none.tokenCancellationTokenCancels the request.
Returns
- Task<JsonElement?>
The
resultof the response; null when it is JSONnull.