use of org.sonarlint.daemon.model.ProxyIssueListener in project sonarlint-core by SonarSource.
the class StandaloneSonarLintImpl method analyze.
@Override
public void analyze(AnalysisReq requestConfig, StreamObserver<Issue> response) {
if (engine == null) {
response.onError(new IllegalStateException("Not registered"));
return;
}
try {
List<ClientInputFile> files = new LinkedList<>();
List<InputFile> requestFiles = requestConfig.getFileList();
Path baseDir = Paths.get(requestConfig.getBaseDir());
for (InputFile f : requestFiles) {
files.add(new DefaultClientInputFile(baseDir, Paths.get(f.getPath()), f.getIsTest(), Charset.forName(f.getCharset()), f.getUserObject(), trimToNull(f.getLanguage())));
}
StandaloneAnalysisConfiguration config = new StandaloneAnalysisConfiguration(baseDir, Paths.get(requestConfig.getWorkDir()), files, requestConfig.getPropertiesMap());
logOutput.log("Analysis configuration:\n" + config.toString(), Level.DEBUG);
engine.analyze(config, new ProxyIssueListener(response), logOutput, null);
response.onCompleted();
} catch (Exception e) {
LOGGER.error("Error analyzing", e);
response.onError(e);
}
}
use of org.sonarlint.daemon.model.ProxyIssueListener in project sonarlint-core by SonarSource.
the class ConnectedSonarLintImpl method analyze.
@Override
public void analyze(ConnectedAnalysisReq requestConfig, StreamObserver<org.sonarsource.sonarlint.daemon.proto.SonarlintDaemon.Issue> response) {
try {
List<ClientInputFile> files = new LinkedList<>();
List<InputFile> requestFiles = requestConfig.getFileList();
Path baseDir = Paths.get(requestConfig.getBaseDir());
for (InputFile f : requestFiles) {
files.add(new DefaultClientInputFile(baseDir, Paths.get(f.getPath()), f.getIsTest(), Charset.forName(f.getCharset()), f.getUserObject(), trimToNull(f.getLanguage())));
}
ConnectedAnalysisConfiguration config = new ConnectedAnalysisConfiguration(requestConfig.getModuleKey(), baseDir, Paths.get(requestConfig.getWorkDir()), files, requestConfig.getPropertiesMap());
engine.analyze(config, new ProxyIssueListener(response), logOutput, null);
response.onCompleted();
} catch (Exception e) {
LOGGER.error("Error analyzing", e);
response.onError(e);
}
}
Aggregations