[cli-repl] Minor: change API to support ABI reporting
This commit is contained in:
committed by
Pavel V. Talanov
parent
ad49272b3b
commit
4aa5a90370
+14
-2
@@ -171,7 +171,11 @@ public final class AnalyzerWithCompilerReport {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean reportDiagnostics(@NotNull Diagnostics diagnostics, @NotNull DiagnosticMessageReporter reporter, boolean incompatibleFilesFound) {
|
public static boolean reportDiagnostics(
|
||||||
|
@NotNull Diagnostics diagnostics,
|
||||||
|
@NotNull DiagnosticMessageReporter reporter,
|
||||||
|
boolean incompatibleFilesFound
|
||||||
|
) {
|
||||||
boolean hasErrors = false;
|
boolean hasErrors = false;
|
||||||
for (Diagnostic diagnostic : sortedDiagnostics(diagnostics.all())) {
|
for (Diagnostic diagnostic : sortedDiagnostics(diagnostics.all())) {
|
||||||
hasErrors |= reportDiagnostic(diagnostic, reporter, incompatibleFilesFound);
|
hasErrors |= reportDiagnostic(diagnostic, reporter, incompatibleFilesFound);
|
||||||
@@ -179,10 +183,18 @@ public final class AnalyzerWithCompilerReport {
|
|||||||
return hasErrors;
|
return hasErrors;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean reportDiagnostics(@NotNull Diagnostics diagnostics, @NotNull MessageCollector messageCollector, boolean incompatibleFilesFound) {
|
public static boolean reportDiagnostics(
|
||||||
|
@NotNull Diagnostics diagnostics,
|
||||||
|
@NotNull MessageCollector messageCollector,
|
||||||
|
boolean incompatibleFilesFound
|
||||||
|
) {
|
||||||
return reportDiagnostics(diagnostics, new DefaultDiagnosticReporter(messageCollector), incompatibleFilesFound);
|
return reportDiagnostics(diagnostics, new DefaultDiagnosticReporter(messageCollector), incompatibleFilesFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean reportDiagnostics(@NotNull Diagnostics diagnostics, @NotNull MessageCollector messageCollector) {
|
||||||
|
return reportDiagnostics(diagnostics, new DefaultDiagnosticReporter(messageCollector), false);
|
||||||
|
}
|
||||||
|
|
||||||
private void reportSyntaxErrors(@NotNull Collection<JetFile> files) {
|
private void reportSyntaxErrors(@NotNull Collection<JetFile> files) {
|
||||||
for (JetFile file : files) {
|
for (JetFile file : files) {
|
||||||
reportSyntaxErrors(file, messageCollector);
|
reportSyntaxErrors(file, messageCollector);
|
||||||
|
|||||||
@@ -406,7 +406,7 @@ public class ReplInterpreter {
|
|||||||
trace.record(BindingContext.FILE_TO_PACKAGE_FRAGMENT, psiFile, resolveSession.getPackageFragment(FqName.ROOT));
|
trace.record(BindingContext.FILE_TO_PACKAGE_FRAGMENT, psiFile, resolveSession.getPackageFragment(FqName.ROOT));
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean hasErrors = AnalyzerWithCompilerReport.reportDiagnostics(trace.getBindingContext().getDiagnostics(), errorReporter);
|
boolean hasErrors = AnalyzerWithCompilerReport.reportDiagnostics(trace.getBindingContext().getDiagnostics(), errorReporter, false);
|
||||||
if (hasErrors) {
|
if (hasErrors) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user