Skip to content

[mlir-lsp] Rename OutgoingNotification #90076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions mlir/include/mlir/Tools/lsp-server-support/Transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ class JSONTransport {
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 {
Expand Down Expand Up @@ -160,9 +160,10 @@ class MessageHandler {
};
}

/// 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);
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Tools/mlir-lsp-server/LSPServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Tools/mlir-pdll-lsp-server/LSPServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Tools/tblgen-lsp-server/LSPServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading