[PATCH] D52233: [dexp] Allow users to dump JSON representations of fuzzy find requests
Kirill Bobyrev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 18 07:22:23 PDT 2018
kbobyrev created this revision.
kbobyrev added reviewers: ioeric, ilya-biryukov.
kbobyrev added a project: clang-tools-extra.
Herald added subscribers: kadircet, arphaman, jkorous.
This might be useful for benchmark construction.
https://reviews.llvm.org/D52233
Files:
clang-tools-extra/clangd/index/dex/dexp/Dexp.cpp
Index: clang-tools-extra/clangd/index/dex/dexp/Dexp.cpp
===================================================================
--- clang-tools-extra/clangd/index/dex/dexp/Dexp.cpp
+++ clang-tools-extra/clangd/index/dex/dexp/Dexp.cpp
@@ -113,6 +113,11 @@
cl::init(10),
cl::desc("Max results to display"),
};
+ cl::opt<bool> ShowJSONRequest{
+ "show-json",
+ cl::desc("Print Fuzzy Find Request in JSON format"),
+ cl::init(false),
+ };
void run() override {
FuzzyFindRequest Request;
@@ -123,6 +128,8 @@
StringRef(this->Scopes).split(Scopes, ',');
Request.Scopes = {Scopes.begin(), Scopes.end()};
}
+ if (ShowJSONRequest)
+ llvm::outs() << llvm::formatv("Request:\n{0}\n\n", toJSON(Request));
// FIXME(kbobyrev): Print symbol final scores to see the distribution.
static const auto OutputFormat = "{0,-4} | {1,-40} | {2,-25}\n";
llvm::outs() << llvm::formatv(OutputFormat, "Rank", "Symbol ID",
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52233.165971.patch
Type: text/x-patch
Size: 975 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180918/792125ed/attachment.bin>
More information about the cfe-commits
mailing list