Skip to content

Commit 82ce908

Browse files
Merge pull request #61 from tintoy/fix/client/server-message-type
Fix client-level handling of non-object params / results in server messages
2 parents 52df6f2 + d2ddc99 commit 82ce908

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Client/Dispatcher/LspDispatcher.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public async Task<bool> TryHandleEmptyNotification(string method)
9898
/// <returns>
9999
/// <c>true</c>, if a notification handler was registered for specified method; otherwise, <c>false</c>.
100100
/// </returns>
101-
public async Task<bool> TryHandleNotification(string method, JObject notification)
101+
public async Task<bool> TryHandleNotification(string method, JToken notification)
102102
{
103103
if (string.IsNullOrWhiteSpace(method))
104104
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(method)}.", nameof(method));
@@ -130,7 +130,7 @@ public async Task<bool> TryHandleNotification(string method, JObject notificatio
130130
/// <returns>
131131
/// If a registered handler was found, a <see cref="Task"/> representing the operation; otherwise, <c>null</c>.
132132
/// </returns>
133-
public Task<object> TryHandleRequest(string method, JObject request, CancellationToken cancellationToken)
133+
public Task<object> TryHandleRequest(string method, JToken request, CancellationToken cancellationToken)
134134
{
135135
if (string.IsNullOrWhiteSpace(method))
136136
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(method)}.", nameof(method));
@@ -157,7 +157,7 @@ public Task<object> TryHandleRequest(string method, JObject request, Cancellatio
157157
/// <returns>
158158
/// The deserialised payload (if one is present and expected).
159159
/// </returns>
160-
object DeserializePayload(Type payloadType, JObject payload)
160+
object DeserializePayload(Type payloadType, JToken payload)
161161
{
162162
if (payloadType == null)
163163
throw new ArgumentNullException(nameof(payloadType));

src/Client/Protocol/ServerMessage.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ public class ServerMessage
3131
/// The request / notification message, if the message represents a request or a notification.
3232
/// </summary>
3333
[Optional]
34-
public JObject Params { get; set; }
34+
public JToken Params { get; set; }
3535

3636
/// <summary>
3737
/// The response message, if the message represents a response.
3838
/// </summary>
3939
[Optional]
40-
public JObject Result { get; set; }
40+
public JToken Result { get; set; }
4141

4242
/// <summary>
4343
/// The response error (if any).

0 commit comments

Comments
 (0)