diff --git a/src/include_complete.cc b/src/include_complete.cc index e6296e1c5..e83de8f6d 100644 --- a/src/include_complete.cc +++ b/src/include_complete.cc @@ -185,7 +185,7 @@ void IncludeComplete::InsertIncludesFromDirectory(std::string directory0, } std::vector results; - GetFilesInFolder( + GetFilesAndDirectoriesInFolder( directory->path, true /*recursive*/, false /*add_folder_to_path*/, [&](const std::string& path) { if (!EndsWithAny(path, g_config->completion.includeSuffixWhitelist)) diff --git a/src/project.cc b/src/project.cc index 2565925c6..1e5aafb8e 100644 --- a/src/project.cc +++ b/src/project.cc @@ -478,7 +478,7 @@ std::vector LoadFromDirectoryListing( } } - GetFilesInFolder( + GetFilesAndDirectoriesInFolder( config->project_dir, true /*recursive*/, true /*add_folder_to_path*/, [&folder_args, &files](const std::string& path) { if (SourceFileLanguage(path) != LanguageId::Unknown) { diff --git a/src/test.cc b/src/test.cc index 3fb4746a2..f00a75ee7 100644 --- a/src/test.cc +++ b/src/test.cc @@ -320,7 +320,7 @@ bool RunIndexTests(const std::string& filter_path, bool enable_update) { // FIXME: show diagnostics in STL/headers when running tests. At the moment // this can be done by constructing ClangIndex index(1, 1); ClangIndex index; - for (std::string path : GetFilesInFolder("index_tests", true /*recursive*/, + for (std::string path : GetFilesAndDirectoriesInFolder("index_tests", true /*recursive*/, true /*add_folder_to_path*/)) { bool is_fail_allowed = false; diff --git a/src/utils.cc b/src/utils.cc index 107733c2f..825759a75 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -226,7 +226,7 @@ static void GetFilesInFolderHelper( } } -std::vector GetFilesInFolder(std::string folder, +std::vector GetFilesAndDirectoriesInFolder(std::string folder, bool recursive, bool add_folder_to_path) { EnsureEndsInSlash(folder); @@ -237,7 +237,7 @@ std::vector GetFilesInFolder(std::string folder, return result; } -void GetFilesInFolder(std::string folder, +void GetFilesAndDirectoriesInFolder(std::string folder, bool recursive, bool add_folder_to_path, const std::function& handler) { diff --git a/src/utils.h b/src/utils.h index e99798f52..9c62f6aa5 100644 --- a/src/utils.h +++ b/src/utils.h @@ -76,10 +76,10 @@ bool ContainsValue(const TCollection& collection, const TValue& value) { } // Finds all files in the given folder. This is recursive. -std::vector GetFilesInFolder(std::string folder, +std::vector GetFilesAndDirectoriesInFolder(std::string folder, bool recursive, bool add_folder_to_path); -void GetFilesInFolder(std::string folder, +void GetFilesAndDirectoriesInFolder(std::string folder, bool recursive, bool add_folder_to_path, const std::function& handler);