MLIR  16.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 "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.

References call(), mlir::lsp::Delimited, mlir::lsp::Error, notify(), reply(), and run().

Member Function Documentation

◆ call()

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

Definition at line 170 of file Transport.cpp.

Referenced by JSONTransport().

◆ 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 163 of file Transport.cpp.

Referenced by JSONTransport().

◆ reply()

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

Definition at line 179 of file Transport.cpp.

References encodeError().

Referenced by JSONTransport(), and mlir::lsp::MessageHandler::method().

◆ run()

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

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