[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:
@@ -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 ¶ms) {
|
||||
std::lock_guard<std::mutex> transportLock(transportOutputMutex);
|
||||
Logger::info("--> {0}", method);
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user