Changed errorCount in TrafficLightRenderer visibility to protected, exposed more abilities for DaemonCodeAnalyzerStatus overriding to Renderer inheritors

This commit is contained in:
Alexander.Kirsanov
2017-02-02 20:14:56 +03:00
parent 0d75dc1f3a
commit 311d0e0198
@@ -82,7 +82,7 @@ public class TrafficLightRenderer implements ErrorStripeRenderer, Disposable {
* errorCount[idx] == number of highlighters of severity with index idx in this markup model.
* severity index can be obtained via com.intellij.codeInsight.daemon.impl.SeverityRegistrar#getSeverityIdx(com.intellij.lang.annotation.HighlightSeverity)
*/
private int[] errorCount;
protected int[] errorCount;
public TrafficLightRenderer(@Nullable Project project, Document document, PsiFile file) {
myProject = project;
@@ -164,8 +164,8 @@ public class TrafficLightRenderer implements ErrorStripeRenderer, Disposable {
public boolean errorAnalyzingFinished; // all passes done
List<ProgressableTextEditorHighlightingPass> passStati = Collections.emptyList();
public int[] errorCount = ArrayUtil.EMPTY_INT_ARRAY;
private String reasonWhyDisabled;
private String reasonWhySuspended;
public String reasonWhyDisabled;
public String reasonWhySuspended;
public DaemonCodeAnalyzerStatus() {
}
@@ -239,9 +239,8 @@ public class TrafficLightRenderer implements ErrorStripeRenderer, Disposable {
}
status.errorCount = errorCount.clone();
fillDaemonCodeAnalyzerErrorsStatus(status, severityRegistrar);
List<TextEditorHighlightingPass> passes = myDaemonCodeAnalyzer.getPassesToShowProgressFor(myDocument);
status.passStati = passes.isEmpty() ? Collections.<ProgressableTextEditorHighlightingPass>emptyList() :
status.passStati = passes.isEmpty() ? Collections.emptyList() :
new ArrayList<>(passes.size());
//noinspection ForLoopReplaceableByForEach
for (int i = 0; i < passes.size(); i++) {
@@ -254,6 +253,7 @@ public class TrafficLightRenderer implements ErrorStripeRenderer, Disposable {
}
status.errorAnalyzingFinished = myDaemonCodeAnalyzer.isAllAnalysisFinished(myFile);
status.reasonWhySuspended = myDaemonCodeAnalyzer.isUpdateByTimerEnabled() ? null : "Highlighting is paused temporarily";
fillDaemonCodeAnalyzerErrorsStatus(status, severityRegistrar);
return status;
}