index: remove unused SemaManager parameter

This commit is contained in:
Fangrui Song 2025-08-14 21:45:02 -07:00
parent 4427527ed8
commit e0a6ee33cc
4 changed files with 6 additions and 8 deletions

View File

@ -1226,8 +1226,8 @@ void init() {
multiVersionMatcher = new GroupMatch(g_config->index.multiVersionWhitelist, g_config->index.multiVersionBlacklist);
}
IndexResult index(SemaManager *manager, WorkingFiles *wfiles, VFS *vfs, const std::string &opt_wdir,
const std::string &main, const std::vector<const char *> &args,
IndexResult index(WorkingFiles *wfiles, VFS *vfs, const std::string &opt_wdir, const std::string &main,
const std::vector<const char *> &args,
const std::vector<std::pair<std::string, std::string>> &remapped, bool no_linkage, bool &ok) {
ok = true;
auto pch = std::make_shared<PCHContainerOperations>();

View File

@ -317,8 +317,8 @@ struct VFS;
namespace idx {
void init();
IndexResult index(SemaManager *complete, WorkingFiles *wfiles, VFS *vfs, const std::string &opt_wdir,
const std::string &file, const std::vector<const char *> &args,
IndexResult index(WorkingFiles *wfiles, VFS *vfs, const std::string &opt_wdir, const std::string &file,
const std::vector<const char *> &args,
const std::vector<std::pair<std::string, std::string>> &remapped, bool all_linkages, bool &ok);
} // namespace idx
} // namespace ccls

View File

@ -338,8 +338,7 @@ bool indexer_Parse(SemaManager *completion, WorkingFiles *wfiles, Project *proje
remapped.emplace_back(path_to_index, content);
}
bool ok;
auto result =
idx::index(completion, wfiles, vfs, entry.directory, path_to_index, entry.args, remapped, no_linkage, ok);
auto result = idx::index(wfiles, vfs, entry.directory, path_to_index, entry.args, remapped, no_linkage, ok);
indexes = std::move(result.indexes);
n_errs = result.n_errs;
first_error = std::move(result.first_error);

View File

@ -259,7 +259,6 @@ bool runIndexTests(const std::string &filter_path, bool enable_update) {
bool update_all = false;
// FIXME: show diagnostics in STL/headers when running tests. At the moment
// this can be done by conRequestIdex index(1, 1);
SemaManager completion(nullptr, nullptr, [&](std::string, std::vector<Diagnostic>) {}, [](RequestId id) {});
getFilesInFolder("index_tests", true /*recursive*/, true /*add_folder_to_path*/, [&](const std::string &path) {
bool is_fail_allowed = false;
@ -293,7 +292,7 @@ bool runIndexTests(const std::string &filter_path, bool enable_update) {
for (auto &arg : flags)
cargs.push_back(arg.c_str());
bool ok;
auto result = ccls::idx::index(&completion, &wfiles, &vfs, "", path, cargs, {}, true, ok);
auto result = ccls::idx::index(&wfiles, &vfs, "", path, cargs, {}, true, ok);
for (const auto &entry : all_expected_output) {
const std::string &expected_path = entry.first;