use of com.intellij.util.indexing.FileBasedIndex in project idea-php-typo3-plugin by cedricziel.
the class CoreServiceParser method collectServices.
private void collectServices(Project project) {
FileBasedIndex index = FileBasedIndex.getInstance();
Collection<VirtualFile> containingFiles = index.getContainingFiles(FileTypeIndex.NAME, PhpFileType.INSTANCE, GlobalSearchScope.allScope(project));
containingFiles.removeIf(virtualFile -> !(virtualFile.getName().contains("ext_localconf.php")));
for (VirtualFile projectFile : containingFiles) {
PsiFile psiFile = PsiManager.getInstance(project).findFile(projectFile);
if (psiFile != null) {
psiFile.accept(new CoreServiceDefinitionParserVisitor(serviceMap));
}
}
}
use of com.intellij.util.indexing.FileBasedIndex in project Perl5-IDEA by Camelcade.
the class Mason2Util method reindexProjectRoots.
public static void reindexProjectRoots(Project project, List<String> rootsToReindex) {
if (rootsToReindex.isEmpty()) {
return;
}
PsiDocumentManager.getInstance(project).commitAllDocuments();
VirtualFile projectRoot = project.getBaseDir();
if (projectRoot != null) {
final FileBasedIndex index = FileBasedIndex.getInstance();
for (String root : rootsToReindex) {
VirtualFile componentRoot = VfsUtil.findRelativeFile(root, projectRoot);
if (componentRoot != null) {
for (VirtualFile file : VfsUtil.collectChildrenRecursively(componentRoot)) {
if (file.getFileType() instanceof MasonPurePerlComponentFileType) {
index.requestReindex(file);
}
}
}
}
if (index instanceof FileBasedIndexImpl) {
DumbModeTask changedFilesIndexingTask = FileBasedIndexProjectHandler.createChangedFilesIndexingTask(project);
if (changedFilesIndexingTask != null) {
DumbServiceImpl.getInstance(project).queueTask(changedFilesIndexingTask);
}
}
}
}
Aggregations