[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.
This commit is contained in:
Brian Gesiak
2024-04-25 15:39:55 -04:00
committed by GitHub
parent ba1b52e6e7
commit b77416ea15
4 changed files with 9 additions and 8 deletions

View File

@@ -95,10 +95,10 @@ private:
template <typename T>
using Callback = llvm::unique_function<void(llvm::Expected<T>)>;
/// An OutgoingNotification<T> is a function used for outgoing notifications
/// send to the client.
/// An OutgoingMessage<T> is a function used for outgoing requests or
/// notifications to send to the client.
template <typename T>
using OutgoingNotification = llvm::unique_function<void(const T &)>;
using OutgoingMessage = llvm::unique_function<void(const T &)>;
/// A handler used to process the incoming transport messages.
class MessageHandler {
@@ -160,9 +160,10 @@ public:
};
}
/// Create an OutgoingNotification object used for the given method.
/// Create an OutgoingMessage function that, when called, sends a notification
/// with the given method via the transport.
template <typename T>
OutgoingNotification<T> outgoingNotification(llvm::StringLiteral method) {
OutgoingMessage<T> outgoingNotification(llvm::StringLiteral method) {
return [&, method](const T &params) {
std::lock_guard<std::mutex> transportLock(transportOutputMutex);
Logger::info("--> {0}", method);

View File

@@ -91,7 +91,7 @@ struct LSPServer {
/// An outgoing notification used to send diagnostics to the client when they
/// are ready to be processed.
OutgoingNotification<PublishDiagnosticsParams> publishDiagnostics;
OutgoingMessage<PublishDiagnosticsParams> publishDiagnostics;
/// Used to indicate that the 'shutdown' request was received from the
/// Language Server client.

View File

@@ -104,7 +104,7 @@ struct LSPServer {
/// An outgoing notification used to send diagnostics to the client when they
/// are ready to be processed.
OutgoingNotification<PublishDiagnosticsParams> publishDiagnostics;
OutgoingMessage<PublishDiagnosticsParams> publishDiagnostics;
/// Used to indicate that the 'shutdown' request was received from the
/// Language Server client.

View File

@@ -72,7 +72,7 @@ struct LSPServer {
/// An outgoing notification used to send diagnostics to the client when they
/// are ready to be processed.
OutgoingNotification<PublishDiagnosticsParams> publishDiagnostics;
OutgoingMessage<PublishDiagnosticsParams> publishDiagnostics;
/// Used to indicate that the 'shutdown' request was received from the
/// Language Server client.