After FuzzyFindRequest JSON (de)serialization was introduced, it should replace ad-hoc fuzzy-find request parsing implemented in the IndexBenchmark driver.
|21 ↗||(On Diff #165051)|
We don't need the usings, just shorten the name on usage sites (usages are inside namespace clangd)
|39 ↗||(On Diff #165051)|
Maybe read a JSON array from the file instead?
Pros: we get valid json, can have prettified forms too.
|45 ↗||(On Diff #165110)|
I thought that this should panic instead of returning empty Requests: otherwise it wouldn't be possible to detect problems in the benchmark driver in test, for example (it will just run benchmark over empty list of requests instead of doing something useful).
|47 ↗||(On Diff #165235)|
If there was a json parsing error, we should consume it and print to the user, i.e.
llvm::errs() << "Error when parsing json requests file: " << llvm::toString(std::move(JSONArray));
The user-facing error when an object is not an array should probably be a separate one.
|53 ↗||(On Diff #165235)|
Check for return value of fromJSON and also report an error if it failed?
|48 ↗||(On Diff #165248)|
We should only call takeError() when JSONArray is an error. Not an array value should be handled separately.
BTW, can we add tests with invalid inputs for both of these cases?
|56 ↗||(On Diff #165248)|
Maybe also output the request that failed to parse?