final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(module.getProject()).getFileIndex();
final VirtualFile root = pubspecYamlFile.getParent();
// java.io.File is used here because exclusion is done before FS refresh (in order not to trigger indexing of files that are going to be excluded)
final File pubFolder = new File(root.getPath() + "/.pub");
if (pubFolder.isDirectory() || ApplicationManager.getApplication().isUnitTestMode() && root.findChild(".pub") != null) {
newExcludedPackagesUrls.add(root.getUrl() + "/.pub");
}
final File buildFolder = new File(root.getPath() + "/build");
if (buildFolder.isDirectory() || ApplicationManager.getApplication().isUnitTestMode() && root.findChild("build") != null) {