Runnable (@NotNull final CoverageSuitesBundle suite, final @NotNull CoverageDataManager dataManager) { final ProjectData data = suite.getCoverageData(); if (data == null) { return null; } return () -> { final Project project = getProject(); final VirtualFile[] modulesContentRoots = getRoots(project, dataManager, suite); if (modulesContentRoots == null) { return; } // gather coverage from all content roots for (VirtualFile root : modulesContentRoots) { annotate(root, suite, dataManager, data, project, new Annotator() { @Override public void annotateSourceDirectory(final String dirPath, final DirCoverageInfo info) { myDirCoverageInfos.put(dirPath, info); try { myDirCoverageInfos.put((new File(dirPath)).getCanonicalPath(), info); } catch (IOException e) { //pass } } @Override public void annotateTestDirectory(final String dirPath, final DirCoverageInfo info) { myTestDirCoverageInfos.put(dirPath, info); try { myTestDirCoverageInfos.put((new File(dirPath)).getCanonicalPath(), info); } catch (IOException e) { //pass } } @Override public void annotateFile(@NotNull final String filePath, @NotNull final FileCoverageInfo info) { myFileCoverageInfos.put(filePath, info); try { myFileCoverageInfos.put((new File(filePath)).getCanonicalPath(), info); } catch (IOException e) { //pass } } }); } //final VirtualFile[] roots = ProjectRootManagerEx.getInstanceEx(project).getContentRootsFromAllModules(); //index.iterateContentUnderDirectory(roots[0], new ContentIterator() { // public boolean processFile(final VirtualFile fileOrDir) { // // TODO support for libraries and sdk // if (index.isInContent(fileOrDir)) { // final String normalizedPath = RubyCoverageEngine.rcovalizePath(fileOrDir.getPath(), (RubyCoverageSuite)suite); // // // TODO - check filters // // if (fileOrDir.isDirectory()) { // //// process dir // //if (index.isInTestSourceContent(fileOrDir)) { // // //myTestDirCoverageInfos.put(RubyCoverageEngine.rcovalizePath(fileOrDir.getPath(), (RubyCoverageSuite)suite), ) // //} else { // // myDirCoverageInfos.put(normalizedPath, new FileCoverageInfo()); // //} // } else { // // process file // final ClassData classData = data.getOrCreateClassData(normalizedPath); // if (classData != null) { // final int count = classData.getLines().length; // if (count != 0) { // final FileCoverageInfo info = new FileCoverageInfo(); // info.totalLineCount = count; // // let's count covered lines // for (int i = 1; i <= count; i++) { // final LineData lineData = classData.getLineData(i); // if (lineData.getStatus() != LineCoverage.NONE){ // info.coveredLineCount++; // } // } // myFileCoverageInfos.put(normalizedPath, info); // } // } // } // } // return true; // } //}); dataManager.triggerPresentationUpdate(); }; }