summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/Protocol.h
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2017-12-20 10:26:53 +0000
committerSam McCall <sam.mccall@gmail.com>2017-12-20 10:26:53 +0000
commitfffa8229e36771a97682cb85db7d536c2076ad68 (patch)
tree4575a14dec689bf14b06433f53f2e802f9a66db6 /clang-tools-extra/clangd/Protocol.h
parent030123e8e8fe46be132cbf4b4d1240e8d5c446fe (diff)
downloadbcm5719-llvm-fffa8229e36771a97682cb85db7d536c2076ad68.tar.gz
bcm5719-llvm-fffa8229e36771a97682cb85db7d536c2076ad68.zip
[clangd] Add debug printers for basic protocol types. NFC
llvm-svn: 321161
Diffstat (limited to 'clang-tools-extra/clangd/Protocol.h')
-rw-r--r--clang-tools-extra/clangd/Protocol.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/Protocol.h b/clang-tools-extra/clangd/Protocol.h
index f2ad0db0ff1..1b91b3c18c5 100644
--- a/clang-tools-extra/clangd/Protocol.h
+++ b/clang-tools-extra/clangd/Protocol.h
@@ -16,6 +16,9 @@
// Each struct has a toJSON and fromJSON function, that converts between
// the struct and a JSON representation. (See JSONExpr.h)
//
+// Some structs also have operator<< serialization. This is for debugging and
+// tests, and is not generally machine-readable.
+//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_PROTOCOL_H
@@ -65,6 +68,7 @@ struct URI {
};
json::Expr toJSON(const URI &U);
bool fromJSON(const json::Expr &, URI &);
+llvm::raw_ostream &operator<<(llvm::raw_ostream &, const URI &);
struct TextDocumentIdentifier {
/// The text document's URI.
@@ -90,6 +94,7 @@ struct Position {
};
bool fromJSON(const json::Expr &, Position &);
json::Expr toJSON(const Position &);
+llvm::raw_ostream &operator<<(llvm::raw_ostream &, const Position &);
struct Range {
/// The range's start position.
@@ -107,6 +112,7 @@ struct Range {
};
bool fromJSON(const json::Expr &, Range &);
json::Expr toJSON(const Range &);
+llvm::raw_ostream &operator<<(llvm::raw_ostream &, const Range &);
struct Location {
/// The text document's URI.
@@ -126,6 +132,7 @@ struct Location {
}
};
json::Expr toJSON(const Location &);
+llvm::raw_ostream &operator<<(llvm::raw_ostream &, const Location &);
struct Metadata {
std::vector<std::string> extraFlags;
OpenPOWER on IntegriCloud