Skip to content

Commit b22d149

Browse files
Adds extra check to only consider regular files (e.g. not directories / device files) for inclusion.
1 parent d0854cb commit b22d149

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

libsolidity/lsp/LanguageServer.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,13 @@ vector<boost::filesystem::path> LanguageServer::allSolidityFilesFromProject() co
207207

208208
auto directoryIterator = fs::recursive_directory_iterator(m_fileRepository.basePath(), fs::symlink_option::recurse);
209209
for (fs::directory_entry const& dirEntry: directoryIterator)
210-
if (dirEntry.path().extension() == ".sol")
211-
collectedPaths.push_back(dirEntry.path());
210+
{
211+
if (
212+
dirEntry.status().type() == fs::file_type::regular_file &&
213+
dirEntry.path().extension() == ".sol"
214+
)
215+
collectedPaths.push_back(dirEntry.path());
216+
}
212217

213218
return collectedPaths;
214219
}

0 commit comments

Comments
 (0)