summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/JSONRPCDispatcher.h
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2018-07-09 14:25:59 +0000
committerSam McCall <sam.mccall@gmail.com>2018-07-09 14:25:59 +0000
commitd20d7989c678f9458df7880f7644b3316ee5f1dd (patch)
tree78af542bf097f028e8fd6dfd98cce481c47e7860 /clang-tools-extra/clangd/JSONRPCDispatcher.h
parent3d76326d24310638fff26267e24b5473b543913d (diff)
downloadbcm5719-llvm-d20d7989c678f9458df7880f7644b3316ee5f1dd.tar.gz
bcm5719-llvm-d20d7989c678f9458df7880f7644b3316ee5f1dd.zip
[clangd] Remove JSON library in favor of llvm/Support/JSON
Summary: The library has graduated from clangd to llvm/Support. This is a mechanical change to move to the new API and remove the old one. Main API changes: - namespace clang::clangd::json --> llvm::json - json::Expr --> json::Value - Expr::asString() etc --> Value::getAsString() etc - unsigned longs need a cast (due to r336541 adding lossless integer support) Reviewers: ilya-biryukov Subscribers: mgorny, ioeric, MaskRay, jkorous, omtcyfz, cfe-commits Differential Revision: https://reviews.llvm.org/D49077 llvm-svn: 336549
Diffstat (limited to 'clang-tools-extra/clangd/JSONRPCDispatcher.h')
-rw-r--r--clang-tools-extra/clangd/JSONRPCDispatcher.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang-tools-extra/clangd/JSONRPCDispatcher.h b/clang-tools-extra/clangd/JSONRPCDispatcher.h
index 502b5a3f746..3c0387ca2ef 100644
--- a/clang-tools-extra/clangd/JSONRPCDispatcher.h
+++ b/clang-tools-extra/clangd/JSONRPCDispatcher.h
@@ -10,13 +10,13 @@
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_JSONRPCDISPATCHER_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_JSONRPCDISPATCHER_H
-#include "JSONExpr.h"
#include "Logger.h"
#include "Protocol.h"
#include "Trace.h"
#include "clang/Basic/LLVM.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringMap.h"
+#include "llvm/Support/JSON.h"
#include <iosfwd>
#include <mutex>
@@ -34,7 +34,7 @@ public:
: Pretty(Pretty), Outs(Outs), Logs(Logs), InputMirror(InputMirror) {}
/// Emit a JSONRPC message.
- void writeMessage(const json::Expr &Result);
+ void writeMessage(const llvm::json::Value &Result);
/// Write a line to the logging stream.
void log(const Twine &Message) override;
@@ -57,20 +57,20 @@ private:
/// Sends a successful reply.
/// Current context must derive from JSONRPCDispatcher::Handler.
-void reply(json::Expr &&Result);
+void reply(llvm::json::Value &&Result);
/// Sends an error response to the client, and logs it.
/// Current context must derive from JSONRPCDispatcher::Handler.
void replyError(ErrorCode code, const llvm::StringRef &Message);
/// Sends a request to the client.
/// Current context must derive from JSONRPCDispatcher::Handler.
-void call(llvm::StringRef Method, json::Expr &&Params);
+void call(llvm::StringRef Method, llvm::json::Value &&Params);
/// Main JSONRPC entry point. This parses the JSONRPC "header" and calls the
/// registered Handler for the method received.
class JSONRPCDispatcher {
public:
// A handler responds to requests for a particular method name.
- using Handler = std::function<void(const json::Expr &)>;
+ using Handler = std::function<void(const llvm::json::Value &)>;
/// Create a new JSONRPCDispatcher. UnknownHandler is called when an unknown
/// method is received.
@@ -81,7 +81,7 @@ public:
void registerHandler(StringRef Method, Handler H);
/// Parses a JSONRPC message and calls the Handler for it.
- bool call(const json::Expr &Message, JSONOutput &Out) const;
+ bool call(const llvm::json::Value &Message, JSONOutput &Out) const;
private:
llvm::StringMap<Handler> Handlers;
OpenPOWER on IntegriCloud