diff --git a/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeTreeViewPanel.java b/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeTreeViewPanel.java index 66ee79c41741..2c5c679941b9 100644 --- a/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeTreeViewPanel.java +++ b/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeTreeViewPanel.java @@ -402,6 +402,7 @@ public class ScopeTreeViewPanel extends JPanel implements Disposable { final DefaultTreeModel treeModel = (DefaultTreeModel)myTree.getModel(); if (rootToReload != null && rootToReload != treeModel.getRoot()) { final List treePaths = TreeUtil.collectExpandedPaths(myTree, new TreePath(rootToReload.getPath())); + final List selectionPaths = TreeUtil.collectSelectedPaths(myTree, new TreePath(rootToReload.getPath())); treeModel.reload(rootToReload); final TreePath path = new TreePath(rootToReload.getPath()); final boolean wasCollapsed = myTree.isCollapsed(path); @@ -412,6 +413,9 @@ public class ScopeTreeViewPanel extends JPanel implements Disposable { for (TreePath treePath : treePaths) { myTree.expandPath(treePath); } + for (TreePath selectionPath : selectionPaths) { + TreeUtil.selectPath(myTree, selectionPath); + } } TreeUtil.sort(rootToReload, getNodeComparator()); }