Adds extra check to only consider regular files (e.g. not directories / device files) for inclusion.

This commit is contained in:
Christian Parpart 2022-08-22 14:53:15 +02:00
parent d0854cb485
commit b22d149e3c

View File

@ -207,8 +207,13 @@ vector<boost::filesystem::path> LanguageServer::allSolidityFilesFromProject() co
auto directoryIterator = fs::recursive_directory_iterator(m_fileRepository.basePath(), fs::symlink_option::recurse);
for (fs::directory_entry const& dirEntry: directoryIterator)
if (dirEntry.path().extension() == ".sol")
{
if (
dirEntry.status().type() == fs::file_type::regular_file &&
dirEntry.path().extension() == ".sol"
)
collectedPaths.push_back(dirEntry.path());
}
return collectedPaths;
}