MLIR  20.0.0git
Public Member Functions | List of all members
mlir::lsp::JSONTransport Class Reference

A transport class that performs the JSON-RPC communication with the LSP client. More...

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

Public Member Functions

 JSONTransport (std::FILE *in, raw_ostream &out, JSONStreamStyle style=JSONStreamStyle::Standard, bool prettyOutput=false)
 
void notify (StringRef method, llvm::json::Value params)
 The following methods are used to send a message to the LSP client. More...
 
void call (StringRef method, llvm::json::Value params, llvm::json::Value id)
 
void reply (llvm::json::Value id, llvm::Expected< llvm::json::Value > result)
 
llvm::Error run (MessageHandler &handler)
 Start executing the JSON-RPC transport. More...
 

Detailed Description

A transport class that performs the JSON-RPC communication with the LSP client.

Definition at line 48 of file Transport.h.

Constructor & Destructor Documentation

◆ JSONTransport()

mlir::lsp::JSONTransport::JSONTransport ( std::FILE *  in,
raw_ostream &  out,
JSONStreamStyle  style = JSONStreamStyle::Standard,
bool  prettyOutput = false 
)
inline

Definition at line 50 of file Transport.h.

Member Function Documentation

◆ call()

void JSONTransport::call ( StringRef  method,
llvm::json::Value  params,
llvm::json::Value  id 
)

Definition at line 184 of file Transport.cpp.

Referenced by mlir::lsp::MessageHandler::outgoingRequest().

◆ notify()

void JSONTransport::notify ( StringRef  method,
llvm::json::Value  params 
)

The following methods are used to send a message to the LSP client.

Definition at line 177 of file Transport.cpp.

Referenced by mlir::lsp::MessageHandler::outgoingNotification().

◆ reply()

void JSONTransport::reply ( llvm::json::Value  id,
llvm::Expected< llvm::json::Value >  result 
)

Definition at line 193 of file Transport.cpp.

References encodeError().

◆ run()

llvm::Error JSONTransport::run ( MessageHandler handler)

Start executing the JSON-RPC transport.

Definition at line 210 of file Transport.cpp.

References mlir::lsp::Logger::error(), mlir::query::parse(), and toString().

Referenced by mlir::lsp::runMlirLSPServer(), mlir::lsp::runPdllLSPServer(), and mlir::lsp::runTableGenLSPServer().


The documentation for this class was generated from the following files: