mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-26 09:31:59 +00:00
Hotfix of stale file contents in 186898
This commit is contained in:
parent
3e16055b31
commit
871ae34a1b
@ -285,7 +285,12 @@ std::vector<FileContents> PreloadFileContents(
|
|||||||
bool loaded_entry = false;
|
bool loaded_entry = false;
|
||||||
std::vector<FileContents> file_contents;
|
std::vector<FileContents> file_contents;
|
||||||
cache_manager->IterateLoadedCaches([&](IndexFile* index) {
|
cache_manager->IterateLoadedCaches([&](IndexFile* index) {
|
||||||
file_contents.push_back(FileContents(index->path, index->file_contents));
|
optional<std::string> index_content = ReadContent(index->path);
|
||||||
|
if (!index_content) {
|
||||||
|
LOG_S(ERROR) << "Failed to load index content for " << index->path;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
file_contents.push_back(FileContents(index->path, *index_content));
|
||||||
loaded_entry = loaded_entry || index->path == entry.filename;
|
loaded_entry = loaded_entry || index->path == entry.filename;
|
||||||
});
|
});
|
||||||
if (!loaded_entry)
|
if (!loaded_entry)
|
||||||
|
Loading…
Reference in New Issue
Block a user