CPP-13007 When 'Import from Existing Sources' is pointed to an existing CMakeLists.txt, it should offer opening the project

This commit is contained in:
Anton Makeev
2018-05-16 17:22:25 +02:00
parent b5ea86dc70
commit 03a3ab87d2
@@ -49,8 +49,17 @@ public abstract class ProjectOpenProcessor {
@Nullable
public static ProjectOpenProcessor getImportProvider(VirtualFile file) {
return getImportProvider(file, false);
}
/**
* @param onlyIfExistingProjectFile when true, doesn't return 'generic' providers that can open any non-project directory/text file
* (e.g. PlatformProjectOpenProcessor)
*/
@Nullable
public static ProjectOpenProcessor getImportProvider(VirtualFile file, boolean onlyIfExistingProjectFile) {
for (ProjectOpenProcessor provider : Extensions.getExtensions(EXTENSION_POINT_NAME)) {
if (provider.canOpenProject(file)) {
if (provider.canOpenProject(file) && (!onlyIfExistingProjectFile || provider.isProjectFile(file))) {
return provider;
}
}