Set<VirtualFile> (final @NotNull LocalSearchScope scope) { return ReadAction.compute(() -> { Set<VirtualFile> files = new LinkedHashSet<>(); for (PsiElement element : scope.getScope()) { PsiFile file = element.getContainingFile(); if (file != null) { ContainerUtil.addIfNotNull(files, file.getVirtualFile()); ContainerUtil.addIfNotNull(files, file.getNavigationElement().getContainingFile().getVirtualFile()); } } return files; }); }