CPP-11585 When checking out a project from VCS, auto-detect CmakeLists.txt and suggest to load it: refreshing VFS before traversing

This commit is contained in:
Anton Makeev
2018-01-31 12:36:11 +01:00
parent d7f9f168bd
commit dbe45be804
@@ -9,6 +9,7 @@ import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.projectImport.ProjectOpenProcessor;
import java.io.File;
import java.util.Collections;
public class ProjectImporterCheckoutListener implements CheckoutListener {
@Override
@@ -16,6 +17,10 @@ public class ProjectImporterCheckoutListener implements CheckoutListener {
final File[] files = directory.listFiles();
if (files != null) {
final LocalFileSystem localFileSystem = LocalFileSystem.getInstance();
// need to refresh the project folder in order to get actual files via findFileByIoFile
localFileSystem.refreshIoFiles(Collections.singleton(directory));
for (File file : files) {
if (file.isDirectory()) continue;
final VirtualFile virtualFile = localFileSystem.findFileByIoFile(file);