summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang-tools-extra/clangd/JSONRPCDispatcher.cpp8
-rw-r--r--clang-tools-extra/clangd/JSONRPCDispatcher.h3
2 files changed, 2 insertions, 9 deletions
diff --git a/clang-tools-extra/clangd/JSONRPCDispatcher.cpp b/clang-tools-extra/clangd/JSONRPCDispatcher.cpp
index 9dbcdaa903b..435dca134c1 100644
--- a/clang-tools-extra/clangd/JSONRPCDispatcher.cpp
+++ b/clang-tools-extra/clangd/JSONRPCDispatcher.cpp
@@ -58,7 +58,7 @@ Key<std::unique_ptr<RequestSpan>> RequestSpan::RSKey;
} // namespace
void clangd::reply(json::Value &&Result) {
- auto ID = getRequestId();
+ auto ID = Context::current().get(RequestID);
if (!ID) {
elog("Attempted to reply to a notification!");
return;
@@ -77,7 +77,7 @@ void clangd::replyError(ErrorCode Code, const llvm::StringRef &Message) {
{"message", Message.str()}};
});
- if (auto ID = getRequestId()) {
+ if (auto ID = Context::current().get(RequestID)) {
log("--> reply({0}) error: {1}", *ID, Message);
Context::current()
.getExisting(CurrentTransport)
@@ -206,7 +206,3 @@ llvm::Error JSONRPCDispatcher::runLanguageServerLoop(Transport &Transport) {
WithContextValue WithTransport(CurrentTransport, &Transport);
return Transport.loop(*this);
}
-
-const json::Value *clangd::getRequestId() {
- return Context::current().get(RequestID);
-}
diff --git a/clang-tools-extra/clangd/JSONRPCDispatcher.h b/clang-tools-extra/clangd/JSONRPCDispatcher.h
index de7ea9f7967..0d6e3bfcfe5 100644
--- a/clang-tools-extra/clangd/JSONRPCDispatcher.h
+++ b/clang-tools-extra/clangd/JSONRPCDispatcher.h
@@ -35,9 +35,6 @@ void replyError(ErrorCode Code, const llvm::StringRef &Message);
/// fetches the related message from error's message method. If error doesn't
/// match any known errors, uses ErrorCode::InvalidParams for the error.
void replyError(llvm::Error E);
-/// Returns the request-id of the current request. Should not be used directly
-/// for replying to requests, use the above mentioned methods for that case.
-const llvm::json::Value *getRequestId();
/// Sends a request to the client.
/// Current context must derive from JSONRPCDispatcher::Handler.
void call(llvm::StringRef Method, llvm::json::Value &&Params);
OpenPOWER on IntegriCloud