Skip to content

Commit 1fae784

Browse files
committed
Rename BodyType to PayloadType.
1 parent 07b6f60 commit 1fae784

11 files changed

+22
-22
lines changed

src/Client/Dispatcher/LspDispatcher.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public async Task<bool> TryHandleNotification(string method, JObject notificatio
105105

106106
if (_handlers.TryGetValue(method, out IHandler handler) && handler is IInvokeNotificationHandler notificationHandler)
107107
{
108-
object notificationPayload = DeserializePayload(notificationHandler.BodyType, notification);
108+
object notificationPayload = DeserializePayload(notificationHandler.PayloadType, notification);
109109

110110
await notificationHandler.Invoke(notificationPayload);
111111

@@ -137,7 +137,7 @@ public Task<object> TryHandleRequest(string method, JObject request, Cancellatio
137137

138138
if (_handlers.TryGetValue(method, out IHandler handler) && handler is IInvokeRequestHandler requestHandler)
139139
{
140-
object requestPayload = DeserializePayload(requestHandler.BodyType, request);
140+
object requestPayload = DeserializePayload(requestHandler.PayloadType, request);
141141

142142
return requestHandler.Invoke(requestPayload, cancellationToken);
143143
}

src/Client/Handlers/DelegateEmptyNotificationHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public DelegateEmptyNotificationHandler(string method, NotificationHandler handl
3333
public NotificationHandler Handler { get; }
3434

3535
/// <summary>
36-
/// The expected CLR type of the notification body (<c>null</c>, since the handler does not use the request body).
36+
/// The expected CLR type of the notification payload (<c>null</c>, since the handler does not use the request payload).
3737
/// </summary>
38-
public override Type BodyType => null;
38+
public override Type PayloadType => null;
3939

4040
/// <summary>
4141
/// Invoke the handler.

src/Client/Handlers/DelegateHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ protected DelegateHandler(string method)
2828
public string Method { get; }
2929

3030
/// <summary>
31-
/// The expected CLR type of the request / notification body (if any; <c>null</c> if the handler does not use the request body).
31+
/// The expected CLR type of the request / notification payload (if any; <c>null</c> if the handler does not use the request payload).
3232
/// </summary>
33-
public abstract Type BodyType { get; }
33+
public abstract Type PayloadType { get; }
3434
}
3535
}

src/Client/Handlers/DelegateNotificationHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ public DelegateNotificationHandler(string method, NotificationHandler<TNotificat
3939
public NotificationHandler<TNotification> Handler { get; }
4040

4141
/// <summary>
42-
/// The expected CLR type of the notification body.
42+
/// The expected CLR type of the notification payload.
4343
/// </summary>
44-
public override Type BodyType => typeof(TNotification);
44+
public override Type PayloadType => typeof(TNotification);
4545

4646
/// <summary>
4747
/// Invoke the handler.

src/Client/Handlers/DelegateRequestHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ public DelegateRequestHandler(string method, RequestHandler<TRequest> handler)
4040
public RequestHandler<TRequest> Handler { get; }
4141

4242
/// <summary>
43-
/// The expected CLR type of the request body.
43+
/// The expected CLR type of the request payload.
4444
/// </summary>
45-
public override Type BodyType => typeof(TRequest);
45+
public override Type PayloadType => typeof(TRequest);
4646

4747
/// <summary>
4848
/// Invoke the handler.

src/Client/Handlers/DelegateRequestResponseHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ public DelegateRequestResponseHandler(string method, RequestHandler<TRequest, TR
4343
public RequestHandler<TRequest, TResponse> Handler { get; }
4444

4545
/// <summary>
46-
/// The expected CLR type of the request body.
46+
/// The expected CLR type of the request payload.
4747
/// </summary>
48-
public override Type BodyType => typeof(TRequest);
48+
public override Type PayloadType => typeof(TRequest);
4949

5050
/// <summary>
5151
/// Invoke the handler.

src/Client/Handlers/DynamicRegistrationHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public DynamicRegistrationHandler()
3333
public string Method => "client/registerCapability";
3434

3535
/// <summary>
36-
/// The expected CLR type of the request / notification body (if any; <c>null</c> if the handler does not use the request body).
36+
/// The expected CLR type of the request / notification payload (if any; <c>null</c> if the handler does not use the request payload).
3737
/// </summary>
38-
public Type BodyType => null;
38+
public Type PayloadType => null;
3939

4040
/// <summary>
4141
/// Invoke the handler.

src/Client/Handlers/IHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ public interface IHandler
1313
string Method { get; }
1414

1515
/// <summary>
16-
/// The expected CLR type of the request / notification body (if any; <c>null</c> if the handler does not use the request body).
16+
/// The expected CLR type of the request / notification payload (if any; <c>null</c> if the handler does not use the request body).
1717
/// </summary>
18-
Type BodyType { get; }
18+
Type PayloadType { get; }
1919
}
2020
}

src/Client/Handlers/JsonRpcEmptyNotificationHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public JsonRpcEmptyNotificationHandler(string method, INotificationHandler handl
3434
public INotificationHandler Handler { get; }
3535

3636
/// <summary>
37-
/// The expected CLR type of the notification body (<c>null</c>, since the handler does not use the request body).
37+
/// The expected CLR type of the notification payload (<c>null</c>, since the handler does not use the request payload).
3838
/// </summary>
39-
public override Type BodyType => null;
39+
public override Type PayloadType => null;
4040

4141
/// <summary>
4242
/// Invoke the handler.

src/Client/Handlers/JsonRpcHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ protected JsonRpcHandler(string method)
2929
public string Method { get; }
3030

3131
/// <summary>
32-
/// The expected CLR type of the request / notification body (if any; <c>null</c> if the handler does not use the request body).
32+
/// The expected CLR type of the request / notification payload (if any; <c>null</c> if the handler does not use the request payload).
3333
/// </summary>
34-
public abstract Type BodyType { get; }
34+
public abstract Type PayloadType { get; }
3535
}
3636
}

src/Client/Handlers/JsonRpcNotificationHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ public JsonRpcNotificationHandler(string method, INotificationHandler<TNotificat
3939
public INotificationHandler<TNotification> Handler { get; }
4040

4141
/// <summary>
42-
/// The expected CLR type of the notification body.
42+
/// The expected CLR type of the notification payload.
4343
/// </summary>
44-
public override Type BodyType => typeof(TNotification);
44+
public override Type PayloadType => typeof(TNotification);
4545

4646
/// <summary>
4747
/// Invoke the handler.

0 commit comments

Comments
 (0)