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 418dae912378..3186f4cad10e 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java @@ -205,7 +205,7 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren myTree.repaint(); } else { - myTree.queueUpdate(); + InspectionViewPsiTreeChangeAdapter.resetTree(InspectionResultsView.this); } syncRightPanel(); } diff --git a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionViewPsiTreeChangeAdapter.java b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionViewPsiTreeChangeAdapter.java index 393ff4981ae9..647534430e67 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionViewPsiTreeChangeAdapter.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionViewPsiTreeChangeAdapter.java @@ -116,12 +116,7 @@ class InspectionViewPsiTreeChangeAdapter extends PsiTreeChangeAdapter { if (needUpdateUI[0]) { myAlarm.cancelAllRequests(); myAlarm.addRequest(() -> { - final InspectionTree tree = myView.getTree(); - final TreePath[] selectionPath = tree.getSelectionPaths(); - final List expandedPaths = TreeUtil.collectExpandedPaths(tree); - ((DefaultTreeModel)tree.getModel()).reload(); - TreeUtil.restoreExpandedPaths(tree, expandedPaths); - tree.setSelectionPaths(selectionPath); + resetTree(myView); }, 100, ModalityState.NON_MODAL); } } @@ -178,6 +173,15 @@ class InspectionViewPsiTreeChangeAdapter extends PsiTreeChangeAdapter { processEventFileOrDir(event, false); } + public static void resetTree(@NotNull InspectionResultsView view) { + final InspectionTree tree = view.getTree(); + final TreePath[] selectionPath = tree.getSelectionPaths(); + final List expandedPaths = TreeUtil.collectExpandedPaths(tree); + ((DefaultTreeModel)tree.getModel()).reload(); + TreeUtil.restoreExpandedPaths(tree, expandedPaths); + tree.setSelectionPaths(selectionPath); + } + private void processEventFileOrDir(@NotNull PsiTreeChangeEvent event, boolean eagerEvaluateFiles) { final PsiFile file = event.getFile(); if (file != null) {