mirror of
https://github.com/MaskRay/ccls.git
synced 2025-02-16 21:58:08 +00:00
Fix index not updating
This commit is contained in:
parent
545838f7eb
commit
ae26aa93db
@ -277,8 +277,7 @@ std::vector<FileContents> PreloadFileContents(
|
|||||||
|
|
||||||
std::vector<FileContents> file_contents = {contents};
|
std::vector<FileContents> file_contents = {contents};
|
||||||
cache_manager->IterateLoadedCaches([&](IndexFile* index) {
|
cache_manager->IterateLoadedCaches([&](IndexFile* index) {
|
||||||
optional<std::string> index_content =
|
optional<std::string> index_content = ReadContent(index->path);
|
||||||
cache_manager->LoadCachedFileContents(index->path);
|
|
||||||
if (!index_content) {
|
if (!index_content) {
|
||||||
LOG_S(ERROR) << "Failed to load index content for " << index->path;
|
LOG_S(ERROR) << "Failed to load index content for " << index->path;
|
||||||
return;
|
return;
|
||||||
@ -290,8 +289,7 @@ std::vector<FileContents> PreloadFileContents(
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!loaded_primary) {
|
if (!loaded_primary) {
|
||||||
optional<std::string> content =
|
optional<std::string> content = ReadContent(path_to_index);
|
||||||
cache_manager->LoadCachedFileContents(path_to_index);
|
|
||||||
if (!content) {
|
if (!content) {
|
||||||
// Modification timestamp should have detected this already.
|
// Modification timestamp should have detected this already.
|
||||||
LOG_S(ERROR) << "Skipping index (file cannot be found): "
|
LOG_S(ERROR) << "Skipping index (file cannot be found): "
|
||||||
|
Loading…
Reference in New Issue
Block a user