From 39d3648fdd8f58ba81160156740b176da729f51e Mon Sep 17 00:00:00 2001 From: Myriad-Dreamin Date: Mon, 26 Jan 2026 17:34:57 +0800 Subject: [PATCH] feat: add method to check indices size --- include/Server/Indexer.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/Server/Indexer.h b/include/Server/Indexer.h index eb1b591b..2884ee7a 100644 --- a/include/Server/Indexer.h +++ b/include/Server/Indexer.h @@ -44,6 +44,11 @@ public: if(it2 != project_index.indices.end()) { auto path = project_index.path_pool.path(it2->second); it->second = index::MergedIndex::load(path); + } else { + std::println(stderr, + "failed to load project index for path_id: {} {}", + path_id, + project_index.indices.size()); } return it->second; @@ -67,6 +72,14 @@ public: /// TODO: Types ... + bool empty() const { + return project_index.indices.empty(); + } + + size_t size() const { + return project_index.indices.size(); + } + private: CompilationDatabase& database;