Skip to content

Commit 8ac1a74

Browse files
committed
Enable client to handle array-type requests.
#56
1 parent 2c634ed commit 8ac1a74

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Client/Protocol/ClientMessage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class ClientMessage
3232
/// The request / notification message, if the message represents a request or a notification.
3333
/// </summary>
3434
[Optional]
35-
public JObject Params { get; set; }
35+
public JToken Params { get; set; }
3636

3737
/// <summary>
3838
/// The response message, if the message represents a response.

src/Client/Protocol/LspConnection.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ public void SendNotification(string method, object notification)
343343
{
344344
// No Id means it's a notification.
345345
Method = method,
346-
Params = JObject.FromObject(notification, Serializer.JsonSerializer)
346+
Params = JToken.FromObject(notification, Serializer.JsonSerializer)
347347
});
348348
}
349349

@@ -401,7 +401,7 @@ public void SendNotification(string method, object notification)
401401
{
402402
Id = requestId,
403403
Method = method,
404-
Params = request != null ? JObject.FromObject(request, Serializer.JsonSerializer) : null
404+
Params = request != null ? JToken.FromObject(request, Serializer.JsonSerializer) : null
405405
});
406406

407407
await responseCompletion.Task;
@@ -464,7 +464,7 @@ public void SendNotification(string method, object notification)
464464
{
465465
Id = requestId,
466466
Method = method,
467-
Params = request != null ? JObject.FromObject(request, Serializer.JsonSerializer) : null
467+
Params = request != null ? JToken.FromObject(request, Serializer.JsonSerializer) : null
468468
});
469469

470470
ServerMessage response = await responseCompletion.Task;

0 commit comments

Comments
 (0)