use of org.sonarsource.sonarlint.core.client.api.common.ProgressMonitor in project sonarlint-core by SonarSource.
the class ConnectedSonarLintEngineImpl method update.
@Override
public UpdateResult update(ServerConfiguration serverConfig, @Nullable ProgressMonitor monitor) {
checkNotNull(serverConfig);
setLogging(null);
return withRwLock(() -> {
stop(false);
changeState(State.UPDATING);
List<SonarAnalyzer> analyzers;
try {
analyzers = runInConnectedContainer(serverConfig, container -> container.update(new ProgressWrapper(monitor)));
} finally {
start();
}
return new UpdateResult(getHandler().getGlobalStorageStatus(), analyzers);
});
}
use of org.sonarsource.sonarlint.core.client.api.common.ProgressMonitor in project sonarlint-core by SonarSource.
the class ConnectedSonarLintEngineImpl method checkIfModuleStorageNeedUpdate.
@Override
public StorageUpdateCheckResult checkIfModuleStorageNeedUpdate(ServerConfiguration serverConfig, String moduleKey, @Nullable ProgressMonitor monitor) {
checkNotNull(serverConfig);
checkNotNull(moduleKey);
return withReadLock(() -> runInConnectedContainer(serverConfig, container -> container.checkForUpdate(moduleKey, new ProgressWrapper(monitor))));
}
use of org.sonarsource.sonarlint.core.client.api.common.ProgressMonitor in project sonarlint-intellij by SonarSource.
the class SonarLintTask method analyze.
private List<AnalysisResults> analyze(Project project, ProgressIndicator indicator, AccumulatorIssueListener listener) {
SonarLintAnalyzer analyzer = SonarLintUtils.get(project, SonarLintAnalyzer.class);
indicator.setIndeterminate(true);
int numModules = job.filesPerModule().keySet().size();
String suffix = "";
if (numModules > 1) {
suffix = String.format(" in %d modules", numModules);
}
int numFiles = job.allFiles().size();
if (numFiles > 1) {
indicator.setText("Running SonarLint Analysis for " + numFiles + " files" + suffix);
} else {
indicator.setText("Running SonarLint Analysis for '" + getFileName(job.allFiles().iterator().next()) + "'");
}
LOGGER.info(indicator.getText());
ProgressMonitor progressMonitor = new TaskProgressMonitor(indicator);
List<AnalysisResults> results = new LinkedList<>();
for (Map.Entry<Module, Collection<VirtualFile>> e : job.filesPerModule().entrySet()) {
results.add(analyzer.analyzeModule(e.getKey(), e.getValue(), listener, progressMonitor));
checkCanceled(indicator, myProject);
}
indicator.startNonCancelableSection();
return results;
}
Aggregations