Skip to content

Commit b77416e

Browse files
authored
[mlir-lsp] Rename OutgoingNotification (NFC) (#90076)
Rename `OutgoingNotification` to `OutgoingMessage`, since the same callback function type will be used in a future commit to represent outgoing requests, in addition to outgoing notifications.
1 parent ba1b52e commit b77416e

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

mlir/include/mlir/Tools/lsp-server-support/Transport.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ class JSONTransport {
9595
template <typename T>
9696
using Callback = llvm::unique_function<void(llvm::Expected<T>)>;
9797

98-
/// An OutgoingNotification<T> is a function used for outgoing notifications
99-
/// send to the client.
98+
/// An OutgoingMessage<T> is a function used for outgoing requests or
99+
/// notifications to send to the client.
100100
template <typename T>
101-
using OutgoingNotification = llvm::unique_function<void(const T &)>;
101+
using OutgoingMessage = llvm::unique_function<void(const T &)>;
102102

103103
/// A handler used to process the incoming transport messages.
104104
class MessageHandler {
@@ -160,9 +160,10 @@ class MessageHandler {
160160
};
161161
}
162162

163-
/// Create an OutgoingNotification object used for the given method.
163+
/// Create an OutgoingMessage function that, when called, sends a notification
164+
/// with the given method via the transport.
164165
template <typename T>
165-
OutgoingNotification<T> outgoingNotification(llvm::StringLiteral method) {
166+
OutgoingMessage<T> outgoingNotification(llvm::StringLiteral method) {
166167
return [&, method](const T &params) {
167168
std::lock_guard<std::mutex> transportLock(transportOutputMutex);
168169
Logger::info("--> {0}", method);

mlir/lib/Tools/mlir-lsp-server/LSPServer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ struct LSPServer {
9191

9292
/// An outgoing notification used to send diagnostics to the client when they
9393
/// are ready to be processed.
94-
OutgoingNotification<PublishDiagnosticsParams> publishDiagnostics;
94+
OutgoingMessage<PublishDiagnosticsParams> publishDiagnostics;
9595

9696
/// Used to indicate that the 'shutdown' request was received from the
9797
/// Language Server client.

mlir/lib/Tools/mlir-pdll-lsp-server/LSPServer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ struct LSPServer {
104104

105105
/// An outgoing notification used to send diagnostics to the client when they
106106
/// are ready to be processed.
107-
OutgoingNotification<PublishDiagnosticsParams> publishDiagnostics;
107+
OutgoingMessage<PublishDiagnosticsParams> publishDiagnostics;
108108

109109
/// Used to indicate that the 'shutdown' request was received from the
110110
/// Language Server client.

mlir/lib/Tools/tblgen-lsp-server/LSPServer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct LSPServer {
7272

7373
/// An outgoing notification used to send diagnostics to the client when they
7474
/// are ready to be processed.
75-
OutgoingNotification<PublishDiagnosticsParams> publishDiagnostics;
75+
OutgoingMessage<PublishDiagnosticsParams> publishDiagnostics;
7676

7777
/// Used to indicate that the 'shutdown' request was received from the
7878
/// Language Server client.

0 commit comments

Comments
 (0)