Skip to content

Commit f16396f

Browse files
committed
Rename EmptyNotificationHandler to NotificationHandler where practical (#43).
1 parent cd0c4e6 commit f16396f

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

src/Client/Dispatcher/LspDispatcherExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ public static class LspDispatcherExtensions
1818
/// The name of the notification method to handle.
1919
/// </param>
2020
/// <param name="handler">
21-
/// A <see cref="EmptyNotificationHandler"/> delegate that implements the handler.
21+
/// A <see cref="NotificationHandler"/> delegate that implements the handler.
2222
/// </param>
2323
/// <returns>
2424
/// An <see cref="IDisposable"/> representing the registration.
2525
/// </returns>
26-
public static IDisposable HandleEmptyNotification(this LspDispatcher clientDispatcher, string method, EmptyNotificationHandler handler)
26+
public static IDisposable HandleEmptyNotification(this LspDispatcher clientDispatcher, string method, NotificationHandler handler)
2727
{
2828
if (clientDispatcher == null)
2929
throw new ArgumentNullException(nameof(clientDispatcher));

src/Client/HandlerDelegates.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace OmniSharp.Extensions.LanguageServerProtocol.Client
1212
/// <returns>
1313
/// A <see cref="Task"/> representing the operation.
1414
/// </returns>
15-
public delegate void EmptyNotificationHandler();
15+
public delegate void NotificationHandler();
1616

1717
/// <summary>
1818
/// A handler for notifications.

src/Client/Handlers/DelegateEmptyNotificationHandler.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ public class DelegateEmptyNotificationHandler
1616
/// The name of the method handled by the handler.
1717
/// </param>
1818
/// <param name="handler">
19-
/// The <see cref="EmptyNotificationHandler"/> delegate that implements the handler.
19+
/// The <see cref="NotificationHandler"/> delegate that implements the handler.
2020
/// </param>
21-
public DelegateEmptyNotificationHandler(string method, EmptyNotificationHandler handler)
21+
public DelegateEmptyNotificationHandler(string method, NotificationHandler handler)
2222
: base(method)
2323
{
2424
if (handler == null)
@@ -28,9 +28,9 @@ public DelegateEmptyNotificationHandler(string method, EmptyNotificationHandler
2828
}
2929

3030
/// <summary>
31-
/// The <see cref="EmptyNotificationHandler"/> delegate that implements the handler.
31+
/// The <see cref="NotificationHandler"/> delegate that implements the handler.
3232
/// </summary>
33-
public EmptyNotificationHandler Handler { get; }
33+
public NotificationHandler Handler { get; }
3434

3535
/// <summary>
3636
/// The kind of handler.

src/Client/LanguageClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ public Task HasShutdown
254254

255255
Log.Verbose("Sending 'initialized' notification to language server...");
256256

257-
SendEmptyNotification("initialized");
257+
SendNotification("initialized");
258258

259259
Log.Verbose("Sent 'initialized' notification to language server.");
260260

@@ -319,7 +319,7 @@ public async Task Shutdown()
319319
/// <param name="method">
320320
/// The notification method name.
321321
/// </param>
322-
public void SendEmptyNotification(string method)
322+
public void SendNotification(string method)
323323
{
324324
LspConnection connection = _connection;
325325
if (connection == null || !connection.IsOpen)

src/Client/LanguageClientRegistration.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ public static class LanguageRegistration
1919
/// The name of the notification method to handle.
2020
/// </param>
2121
/// <param name="handler">
22-
/// A <see cref="EmptyNotificationHandler"/> delegate that implements the handler.
22+
/// A <see cref="NotificationHandler"/> delegate that implements the handler.
2323
/// </param>
2424
/// <returns>
2525
/// An <see cref="IDisposable"/> representing the registration.
2626
/// </returns>
27-
public static IDisposable HandleEmptyNotification(this LanguageClient languageClient, string method, EmptyNotificationHandler handler)
27+
public static IDisposable HandleNotification(this LanguageClient languageClient, string method, NotificationHandler handler)
2828
{
2929
if (languageClient == null)
3030
throw new ArgumentNullException(nameof(languageClient));
@@ -55,7 +55,7 @@ public static IDisposable HandleEmptyNotification(this LanguageClient languageCl
5555
/// <returns>
5656
/// An <see cref="IDisposable"/> representing the registration.
5757
/// </returns>
58-
public static IDisposable HandleEmptyNotification(this LanguageClient languageClient, string method, INotificationHandler handler)
58+
public static IDisposable HandleNotification(this LanguageClient languageClient, string method, INotificationHandler handler)
5959
{
6060
if (languageClient == null)
6161
throw new ArgumentNullException(nameof(languageClient));

src/Client/Protocol/LspConnectionExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ public static class LspConnectionExtensions
1818
/// The name of the notification method to handle.
1919
/// </param>
2020
/// <param name="handler">
21-
/// A <see cref="EmptyNotificationHandler"/> delegate that implements the handler.
21+
/// A <see cref="NotificationHandler"/> delegate that implements the handler.
2222
/// </param>
2323
/// <returns>
2424
/// An <see cref="IDisposable"/> representing the registration.
2525
/// </returns>
26-
public static IDisposable HandleEmptyNotification(this LspConnection clientConnection, string method, EmptyNotificationHandler handler)
26+
public static IDisposable HandleEmptyNotification(this LspConnection clientConnection, string method, NotificationHandler handler)
2727
{
2828
if (clientConnection == null)
2929
throw new ArgumentNullException(nameof(clientConnection));

0 commit comments

Comments
 (0)