mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-19 12:05:50 +00:00
Enable configuration of max workspace search results.
This commit is contained in:
parent
c86dd569c1
commit
2b6f4b7cdf
@ -33,7 +33,6 @@
|
||||
|
||||
namespace {
|
||||
|
||||
const int kMaxWorkspaceSearchResults = 1000;
|
||||
const bool kUseMultipleProcesses = false; // TODO: initialization options not passed properly when set to true.
|
||||
|
||||
|
||||
@ -1519,8 +1518,8 @@ void QueryDbMainLoop(
|
||||
|
||||
std::string query = msg->params.query;
|
||||
for (int i = 0; i < db->detailed_names.size(); ++i) {
|
||||
if (response.result.size() > kMaxWorkspaceSearchResults) {
|
||||
std::cerr << "Query exceeded maximum number of responses (" << kMaxWorkspaceSearchResults << "), output may not contain all results" << std::endl;
|
||||
if (response.result.size() >= config->maxWorkspaceSearchResults) {
|
||||
std::cerr << "Query exceeded maximum number of responses (" << config->maxWorkspaceSearchResults << "), output may not contain all results" << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -60,8 +60,9 @@ struct IndexerConfig {
|
||||
NonElidedVector<std::string> whitelist;
|
||||
NonElidedVector<std::string> blacklist;
|
||||
int indexerCount = 1;
|
||||
int maxWorkspaceSearchResults = 1000;
|
||||
};
|
||||
MAKE_REFLECT_STRUCT(IndexerConfig, cacheDirectory, whitelist, blacklist, indexerCount);
|
||||
MAKE_REFLECT_STRUCT(IndexerConfig, cacheDirectory, whitelist, blacklist, indexerCount, maxWorkspaceSearchResults);
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user