mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-22 07:35:08 +00:00
Add an option to disable EmitProgress methods during indexing
This commit is contained in:
parent
d1692c8deb
commit
76785105ed
@ -796,16 +796,18 @@ struct IndexManager {
|
||||
}
|
||||
};
|
||||
|
||||
// Sends indexing progress to client.
|
||||
void EmitProgress(QueueManager* queue) {
|
||||
Out_Progress out;
|
||||
out.params.indexRequestCount = queue->index_request.Size();
|
||||
out.params.doIdMapCount = queue->do_id_map.Size();
|
||||
out.params.loadPreviousIndexCount = queue->load_previous_index.Size();
|
||||
out.params.onIdMappedCount = queue->on_id_mapped.Size();
|
||||
out.params.onIndexedCount = queue->on_indexed.Size();
|
||||
// Send indexing progress to client if reporting is enabled.
|
||||
void EmitProgress(Config *config, QueueManager* queue) {
|
||||
if (config->enableProgressReports) {
|
||||
Out_Progress out;
|
||||
out.params.indexRequestCount = queue->index_request.Size();
|
||||
out.params.doIdMapCount = queue->do_id_map.Size();
|
||||
out.params.loadPreviousIndexCount = queue->load_previous_index.Size();
|
||||
out.params.onIdMappedCount = queue->on_id_mapped.Size();
|
||||
out.params.onIndexedCount = queue->on_indexed.Size();
|
||||
|
||||
IpcManager::instance()->SendOutMessageToClient(IpcId::Cout, out);
|
||||
IpcManager::instance()->SendOutMessageToClient(IpcId::Cout, out);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@ -1211,7 +1213,7 @@ WorkThread::Result IndexMain(Config* config,
|
||||
WorkingFiles* working_files,
|
||||
MultiQueueWaiter* waiter,
|
||||
QueueManager* queue) {
|
||||
EmitProgress(queue);
|
||||
EmitProgress(config, queue);
|
||||
|
||||
// TODO: dispose of index after it is not used for a while.
|
||||
ClangIndex index;
|
||||
@ -1256,7 +1258,7 @@ bool QueryDb_ImportMain(Config* config,
|
||||
ImportManager* import_manager,
|
||||
QueueManager* queue,
|
||||
WorkingFiles* working_files) {
|
||||
EmitProgress(queue);
|
||||
EmitProgress(config, queue);
|
||||
|
||||
bool did_work = false;
|
||||
|
||||
|
@ -36,6 +36,9 @@ struct Config {
|
||||
// If false, the index will not be loaded from a previous run.
|
||||
bool enableCacheRead = true;
|
||||
|
||||
// If true, cquery will send progress reports while indexing
|
||||
bool enableProgressReports = true;
|
||||
|
||||
// If true, document links are reported for #include directives.
|
||||
bool showDocumentLinksOnIncludes = true;
|
||||
|
||||
@ -87,6 +90,7 @@ MAKE_REFLECT_STRUCT(Config,
|
||||
enableIndexing,
|
||||
enableCacheWrite,
|
||||
enableCacheRead,
|
||||
enableProgressReports,
|
||||
|
||||
includeCompletionMaximumPathLength,
|
||||
includeCompletionWhitelistLiteralEnding,
|
||||
|
Loading…
Reference in New Issue
Block a user