[clang-tools-extra] 41d2987 - [clangd] Stop logging in fromJSON, report instead.
Sam McCall via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 9 07:15:59 PDT 2020
Author: Sam McCall
Date: 2020-10-09T16:15:45+02:00
New Revision: 41d2987c7558734cef74151e743645f47d9df501
URL: https://github.com/llvm/llvm-project/commit/41d2987c7558734cef74151e743645f47d9df501
DIFF: https://github.com/llvm/llvm-project/commit/41d2987c7558734cef74151e743645f47d9df501.diff
LOG: [clangd] Stop logging in fromJSON, report instead.
Added:
Modified:
clang-tools-extra/clangd/Protocol.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/Protocol.cpp b/clang-tools-extra/clangd/Protocol.cpp
index 5d50a7bea034..f8aca226a599 100644
--- a/clang-tools-extra/clangd/Protocol.cpp
+++ b/clang-tools-extra/clangd/Protocol.cpp
@@ -851,7 +851,7 @@ static llvm::StringRef toTextKind(MarkupKind Kind) {
bool fromJSON(const llvm::json::Value &V, MarkupKind &K, llvm::json::Path P) {
auto Str = V.getAsString();
if (!Str) {
- elog("Failed to parse markup kind: expected a string");
+ P.report("expected string");
return false;
}
if (*Str == "plaintext")
@@ -859,7 +859,7 @@ bool fromJSON(const llvm::json::Value &V, MarkupKind &K, llvm::json::Path P) {
else if (*Str == "markdown")
K = MarkupKind::Markdown;
else {
- elog("Unknown markup kind: {0}", *Str);
+ P.report("unknown markup kind");
return false;
}
return true;
More information about the cfe-commits
mailing list