Lines Matching defs:method
34 Reply(const llvm::json::Value &id, StringRef method, JSONTransport &transport,
44 std::string method;
52 Reply::Reply(const llvm::json::Value &id, llvm::StringRef method,
54 : method(method), id(id), transport(&transport),
58 : method(other.method), replied(other.replied.load()),
66 Logger::error("Replied twice to message {0}({1})", method, id);
74 Logger::info("--> reply:{0}({1})", method, id);
78 Logger::info("--> reply:{0}({1}): {2}", method, id, error);
87 bool MessageHandler::onNotify(llvm::StringRef method, llvm::json::Value value) {
88 Logger::info("--> {0}", method);
90 if (method == "exit")
92 if (method == "$cancel") {
95 auto it = notificationHandlers.find(method);
102 bool MessageHandler::onCall(llvm::StringRef method, llvm::json::Value params,
104 Logger::info("--> {0}({1})", method, id);
106 Reply reply(id, method, transport, transportOutputMutex);
108 auto it = methodHandlers.find(method);
112 reply(llvm::make_error<LSPError>("method not found: " + method.str(),
177 void JSONTransport::notify(StringRef method, llvm::json::Value params) {
180 {"method", method},
184 void JSONTransport::call(StringRef method, llvm::json::Value params,
189 {"method", method},
252 std::optional<StringRef> method = object->getString("method");
255 if (!method) {
273 return handler.onCall(*method, std::move(params), std::move(*id));
274 return handler.onNotify(*method, std::move(params));