MLIR
17.0.0git
|
A handler used to process the incoming transport messages. More...
#include "mlir/Tools/lsp-server-support/Transport.h"
Public Member Functions | |
MessageHandler (JSONTransport &transport) | |
bool | onNotify (StringRef method, llvm::json::Value value) |
bool | onCall (StringRef method, llvm::json::Value params, llvm::json::Value id) |
bool | onReply (llvm::json::Value id, llvm::Expected< llvm::json::Value > result) |
template<typename Param , typename Result , typename ThisT > | |
void | method (llvm::StringLiteral method, ThisT *thisPtr, void(ThisT::*handler)(const Param &, Callback< Result >)) |
template<typename Param , typename ThisT > | |
void | notification (llvm::StringLiteral method, ThisT *thisPtr, void(ThisT::*handler)(const Param &)) |
template<typename T > | |
OutgoingNotification< T > | outgoingNotification (llvm::StringLiteral method) |
Create an OutgoingNotification object used for the given method. More... | |
Static Public Member Functions | |
template<typename T > | |
static llvm::Expected< T > | parse (const llvm::json::Value &raw, StringRef payloadName, StringRef payloadKind) |
A handler used to process the incoming transport messages.
Definition at line 104 of file Transport.h.
|
inline |
Definition at line 106 of file Transport.h.
|
inline |
Definition at line 133 of file Transport.h.
Referenced by notification(), onCall(), onNotify(), outgoingNotification(), mlir::lsp::runMlirLSPServer(), mlir::lsp::runPdllLSPServer(), and mlir::lsp::runTableGenLSPServer().
|
inline |
Definition at line 146 of file Transport.h.
References method().
Referenced by mlir::lsp::runMlirLSPServer(), mlir::lsp::runPdllLSPServer(), and mlir::lsp::runTableGenLSPServer().
bool MessageHandler::onCall | ( | StringRef | method, |
llvm::json::Value | params, | ||
llvm::json::Value | id | ||
) |
Definition at line 97 of file Transport.cpp.
References mlir::lsp::Logger::info(), method(), and mlir::lsp::MethodNotFound.
bool MessageHandler::onNotify | ( | StringRef | method, |
llvm::json::Value | value | ||
) |
Definition at line 82 of file Transport.cpp.
References mlir::lsp::Logger::info(), and method().
bool MessageHandler::onReply | ( | llvm::json::Value | id, |
llvm::Expected< llvm::json::Value > | result | ||
) |
Definition at line 113 of file Transport.cpp.
References mlir::lsp::Logger::error().
|
inline |
Create an OutgoingNotification object used for the given method.
Definition at line 159 of file Transport.h.
References mlir::lsp::Logger::info(), method(), and mlir::lsp::JSONTransport::notify().
Referenced by mlir::lsp::runMlirLSPServer(), mlir::lsp::runPdllLSPServer(), and mlir::lsp::runTableGenLSPServer().
|
inlinestatic |
Definition at line 113 of file Transport.h.
References mlir::lsp::fromJSON(), and mlir::lsp::InvalidParams.