Collection<ModuleSourceSet> () { if (myProject.isDefault()) { return Collections.emptyList(); } final @NotNull ProjectFileIndex fileIndex = ProjectFileIndex.getInstance(myProject); final Module module = fileIndex.getModuleForFile(myFile); if (module == null || !fileIndex.isInSourceContent(myFile)) { return Collections.emptyList(); } JpsModuleSourceRootType<?> rootType = fileIndex.getContainingSourceRootType(myFile); if (rootType == null) return Collections.emptyList(); final boolean isResource = rootType instanceof JavaResourceRootType; final ModuleSourceSet.Type type = rootType.isForTests()? isResource? ModuleSourceSet.Type.RESOURCES_TEST : ModuleSourceSet.Type.TEST : isResource? ModuleSourceSet.Type.RESOURCES : ModuleSourceSet.Type.PRODUCTION; return Collections.singleton(new ModuleSourceSet(module, type)); }