Search in sources :

Example 1 with BaseCoverageSuite

use of com.intellij.coverage.BaseCoverageSuite in project go-lang-idea-plugin by go-lang-plugin-org.

the class GoCoverageRunner method loadCoverageData.

@Override
public ProjectData loadCoverageData(@NotNull File sessionDataFile, @Nullable CoverageSuite baseCoverageSuite) {
    if (!(baseCoverageSuite instanceof BaseCoverageSuite)) {
        return null;
    }
    Project project = baseCoverageSuite.getProject();
    if (project == null) {
        return null;
    }
    RunConfigurationBase configuration = ((BaseCoverageSuite) baseCoverageSuite).getConfiguration();
    Module module = configuration instanceof ModuleBasedConfiguration ? ((ModuleBasedConfiguration) configuration).getConfigurationModule().getModule() : null;
    try {
        BufferedReader reader = new BufferedReader(new FileReader(sessionDataFile.getAbsolutePath()));
        try {
            return parseCoverage(reader, project, module);
        } catch (IOException e) {
            LOG.warn(e);
        } finally {
            try {
                reader.close();
            } catch (IOException e) {
                LOG.warn(e);
            }
        }
    } catch (FileNotFoundException e) {
        LOG.warn(e);
    }
    return null;
}
Also used : RunConfigurationBase(com.intellij.execution.configurations.RunConfigurationBase) Project(com.intellij.openapi.project.Project) BaseCoverageSuite(com.intellij.coverage.BaseCoverageSuite) Module(com.intellij.openapi.module.Module) ModuleBasedConfiguration(com.intellij.execution.configurations.ModuleBasedConfiguration)

Aggregations

BaseCoverageSuite (com.intellij.coverage.BaseCoverageSuite)1 ModuleBasedConfiguration (com.intellij.execution.configurations.ModuleBasedConfiguration)1 RunConfigurationBase (com.intellij.execution.configurations.RunConfigurationBase)1 Module (com.intellij.openapi.module.Module)1 Project (com.intellij.openapi.project.Project)1