mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
annotate stacktrace: turned off by default. check before async start
This commit is contained in:
+7
@@ -54,10 +54,12 @@ public class VcsContentAnnotationExceptionFilter implements Filter, FilterMixin
|
||||
private final Project myProject;
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vcs.contentAnnotation.VcsContentAnnotationExceptionFilter");
|
||||
private final GlobalSearchScope myScope;
|
||||
private final VcsContentAnnotationSettings mySettings;
|
||||
|
||||
public VcsContentAnnotationExceptionFilter(GlobalSearchScope scope) {
|
||||
myScope = scope;
|
||||
myProject = scope.getProject();
|
||||
mySettings = VcsContentAnnotationSettings.getInstance(myProject);
|
||||
}
|
||||
|
||||
private static class MyAdditionalHighlight extends AdditionalHighlight {
|
||||
@@ -81,6 +83,11 @@ public class VcsContentAnnotationExceptionFilter implements Filter, FilterMixin
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRunHeavy() {
|
||||
return mySettings.isShow();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyHeavyFilter(final Document copiedFragment,
|
||||
int startOffset,
|
||||
|
||||
@@ -51,6 +51,14 @@ public class CompositeFilter implements Filter, FilterMixin {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRunHeavy() {
|
||||
for (Filter filter : myFilters) {
|
||||
if (filter instanceof FilterMixin && ((FilterMixin)filter).shouldRunHeavy()) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyHeavyFilter(Document copiedFragment,
|
||||
int startOffset,
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
* Time: 4:50 PM
|
||||
*/
|
||||
public interface FilterMixin {
|
||||
boolean shouldRunHeavy();
|
||||
@Nullable
|
||||
void applyHeavyFilter(Document copiedFragment, int startOffset, int startLineNumber, Consumer<AdditionalHighlight> consumer);
|
||||
|
||||
|
||||
@@ -823,7 +823,7 @@ public class ConsoleViewImpl implements ConsoleView, ObservableConsoleView, Data
|
||||
myHyperlinks.highlightHyperlinks(myCustomFilter, myPredefinedMessageFilter, line1, endLine);
|
||||
}
|
||||
|
||||
if (myPredefinedMessageFilter.isAnyHeavy()) {
|
||||
if (myPredefinedMessageFilter.isAnyHeavy() && myPredefinedMessageFilter.shouldRunHeavy()) {
|
||||
final int startLine = Math.max(0, line1);
|
||||
|
||||
final Document document = getEditor().getDocument();
|
||||
@@ -837,6 +837,7 @@ public class ConsoleViewImpl implements ConsoleView, ObservableConsoleView, Data
|
||||
myHeavyAlarm.addRequest(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (! myPredefinedMessageFilter.shouldRunHeavy()) return;
|
||||
myPredefinedMessageFilter.applyHeavyFilter(documentCopy, startOffset, startLine, new Consumer<FilterMixin.AdditionalHighlight>() {
|
||||
@Override
|
||||
public void consume(final FilterMixin.AdditionalHighlight additionalHighlight) {
|
||||
|
||||
+3
-3
@@ -45,7 +45,7 @@ public class VcsContentAnnotationSettings implements PersistentStateComponent<Vc
|
||||
}
|
||||
|
||||
public static class State {
|
||||
public boolean myShow = true;
|
||||
public boolean myShow1 = false;
|
||||
public long myLimit;
|
||||
}
|
||||
|
||||
@@ -72,10 +72,10 @@ public class VcsContentAnnotationSettings implements PersistentStateComponent<Vc
|
||||
}
|
||||
|
||||
public boolean isShow() {
|
||||
return myState.myShow;
|
||||
return myState.myShow1;
|
||||
}
|
||||
|
||||
public void setShow(final boolean value) {
|
||||
myState.myShow = value;
|
||||
myState.myShow1 = value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user