LLVM 22.0.0git
|
#include "llvm/Support/LSP/Transport.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/LSP/Logging.h"
#include "llvm/Support/LSP/Protocol.h"
#include <atomic>
#include <optional>
#include <system_error>
#include <utility>
Go to the source code of this file.
Functions | |
static llvm::json::Object | encodeError (llvm::Error Error) |
Encode the given error as a JSON object. | |
llvm::Error | decodeError (const llvm::json::Object &O) |
Decode the given JSON object into an error. | |
LogicalResult | readLine (std::FILE *In, SmallVectorImpl< char > &Out) |
Tries to read a line up to and including . |
llvm::Error decodeError | ( | const llvm::json::Object & | O | ) |
Decode the given JSON object into an error.
Definition at line 168 of file Transport.cpp.
References llvm::inconvertibleErrorCode(), llvm::make_error(), and llvm::StringRef::str().
|
static |
Encode the given error as a JSON object.
Definition at line 150 of file Transport.cpp.
References llvm::handleErrors(), llvm::Error::success(), llvm::toString(), and llvm::lsp::UnknownErrorCode.
Referenced by llvm::lsp::JSONTransport::reply().
LogicalResult readLine | ( | std::FILE * | In, |
SmallVectorImpl< char > & | Out ) |
Tries to read a line up to and including
.
If failing, feof(), ferror(), or shutdownRequested() will be set.
Definition at line 278 of file Transport.cpp.
References llvm::SmallVectorImpl< T >::clear(), llvm::failure(), llvm::Read, llvm::SmallVectorImpl< T >::resize(), llvm::SmallVectorImpl< T >::resize_for_overwrite(), Size, and llvm::success.
Referenced by llvm::lsp::JSONTransportInputOverFile::readDelimitedMessage(), and llvm::lsp::JSONTransportInputOverFile::readStandardMessage().