[clangd] Hide unused function. NFC
authorSam McCall <sam.mccall@gmail.com>
Wed, 17 Oct 2018 07:41:53 +0000 (07:41 +0000)
committerSam McCall <sam.mccall@gmail.com>
Wed, 17 Oct 2018 07:41:53 +0000 (07:41 +0000)
llvm-svn: 344676

clang-tools-extra/clangd/JSONRPCDispatcher.cpp
clang-tools-extra/clangd/JSONRPCDispatcher.h

index 9dbcdaa..435dca1 100644 (file)
@@ -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);
-}
index de7ea9f..0d6e3bf 100644 (file)
@@ -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);