From 3e56ce10f5ff068241cb3eef95396110380fdfbc Mon Sep 17 00:00:00 2001 From: Dmitry Batkovich Date: Thu, 14 Apr 2016 08:38:40 +0300 Subject: [PATCH] inspection tool window: do not rebuild the whole tree when tree node was excluded and FILTER_RESOLVED_ITEMS == true --- .../codeInspection/ui/InspectionResultsView.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java index 4b1e89f86781..3712b0f94b8a 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java @@ -77,6 +77,7 @@ import javax.swing.*; import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.TreePath; import java.awt.*; import java.awt.event.InputEvent; @@ -159,6 +160,14 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren @Override public void excludeNode(@NotNull InspectionTreeNode node) { node.ignoreElement(myExcludedInspectionTreeNodesManager); + if (myGlobalInspectionContext.getUIOptions().FILTER_RESOLVED_ITEMS) { + InspectionTreeNode parent = (InspectionTreeNode)node.getParent(); + synchronized (myTreeStructureUpdateLock) { + parent.remove(node); + ((DefaultTreeModel)myTree.getModel()).reload(parent); + } + TreeUtil.selectInTree(parent, true, myTree); + } } @Override @@ -173,10 +182,7 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren @Override public void onDone(boolean isExcludeAction) { - if (isExcludeAction && myGlobalInspectionContext.getUIOptions().FILTER_RESOLVED_ITEMS) { - update(); - } - else { + if (!isExcludeAction || !myGlobalInspectionContext.getUIOptions().FILTER_RESOLVED_ITEMS) { myTree.queueUpdate(); } }