use of org.sonarlint.intellij.editor.AccumulatorIssueListener in project sonarlint-intellij by SonarSource.
the class SonarLintTask method run.
@Override
public void run(ProgressIndicator indicator) {
AccumulatorIssueListener listener = new AccumulatorIssueListener();
try {
checkCanceled(indicator, myProject);
List<AnalysisResults> results = analyze(myProject, indicator, listener);
// last chance to cancel (to avoid the possibility of having interrupt flag set)
checkCanceled(indicator, myProject);
LOGGER.info("SonarLint analysis done");
indicator.setIndeterminate(false);
indicator.setFraction(.9);
List<Issue> issues = listener.getIssues();
indicator.setText("Creating SonarLint issues: " + issues.size());
List<ClientInputFile> allFailedAnalysisFiles = results.stream().flatMap(r -> r.failedAnalysisFiles().stream()).collect(Collectors.toList());
processor.process(job, indicator, issues, allFailedAnalysisFiles);
} catch (CanceledException e1) {
console.info("Analysis canceled");
return;
} catch (Throwable e) {
handleError(e, indicator);
} finally {
myProject.getMessageBus().syncPublisher(TaskListener.SONARLINT_TASK_TOPIC).ended(job);
}
}
Aggregations