void (@NotNull AnActionEvent e) { VirtualFile[] roots = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY); Project project = e.getProject(); assert project != null; assert roots != null && roots.length > 0; VirtualFile projectBasePath = ShowAffectedTestsAction.getBasePathAsVirtualFile(project); if (projectBasePath == null) return; Application application = ApplicationManager.getApplication(); application.executeOnPooledThread(() -> { Set<String> paths = JBIterable.of(roots).flatMap(f -> VfsUtil.collectChildrenRecursively(f)) .map(f -> VcsFileUtil.getRelativeFilePath(f, projectBasePath)) .filter(Objects::nonNull) .map(p -> "/" + p) .toSet(); try { List<String> filesWithoutTests = new IntellijTestDiscoveryProducer().getFilesWithoutTests(project, paths); if (!filesWithoutTests.isEmpty()) { VirtualFileManager vfm = VirtualFileManager.getInstance(); PsiManager psiManager = PsiManager.getInstance(project); String basePath = projectBasePath.getPath(); application.runReadAction(() -> { PsiFile[] files = JBIterable.of(filesWithoutTests) .flatten(FunctionUtil.id()) .map(f -> vfm.refreshAndFindFileByUrl(PROTOCOL_PREFIX + basePath + f)) .map(psiManager::findFile) .filter(Objects::nonNull).toSet().toArray(PsiFile.EMPTY_ARRAY); if (files.length == 0) { nothingToDo(); } else { application.invokeLater( () -> FindUtil.showInUsageView( null, files, file -> new UsageInfo2UsageAdapter(new UsageInfo(file)), JavaCompilerBundle.message("test.discovery.unused.test.data.tab.title"), p -> { p.setCodeUsages(false); }, project)); } }); } else { nothingToDo(); } } catch (IOException io) { LOG.warn(io); } }); }