mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-25 17:11:59 +00:00
Only delta update on file save if the file is already imported.
This commit is contained in:
parent
dc605bc5c3
commit
da6a8f335f
@ -1711,8 +1711,17 @@ bool QueryDbMainLoop(
|
|||||||
// mutex and check to see if we should skip the current request.
|
// mutex and check to see if we should skip the current request.
|
||||||
// if so, ignore that index response.
|
// if so, ignore that index response.
|
||||||
WorkingFile* working_file = working_files->GetFileByFilename(path);
|
WorkingFile* working_file = working_files->GetFileByFilename(path);
|
||||||
if (working_file)
|
if (working_file) {
|
||||||
queue_do_index->PriorityEnqueue(Index_DoIndex(Index_DoIndex::Type::Parse, project->FindCompilationEntryForFile(path), working_file->buffer_content, true /*is_interactive*/));
|
// Only do a delta update (Type::Parse) if we've already imported the
|
||||||
|
// file. If the user saves a file not loaded by the project we don't
|
||||||
|
// want the initial import to be a delta-update.
|
||||||
|
Index_DoIndex::Type index_type = Index_DoIndex::Type::Parse;
|
||||||
|
QueryFile* file = FindFile(db, path);
|
||||||
|
if (!file)
|
||||||
|
index_type = Index_DoIndex::Type::ImportThenParse;
|
||||||
|
|
||||||
|
queue_do_index->PriorityEnqueue(Index_DoIndex(index_type, project->FindCompilationEntryForFile(path), working_file->buffer_content, true /*is_interactive*/));
|
||||||
|
}
|
||||||
completion_manager->UpdateActiveSession(path);
|
completion_manager->UpdateActiveSession(path);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user