IDEA-189742: update presentation for parent folders of removed files

This commit is contained in:
Sergey Malenkov
2018-07-10 21:59:37 +03:00
parent 4d983b858c
commit 00a97e3005
2 changed files with 10 additions and 0 deletions
@@ -225,6 +225,11 @@ class AsyncProjectViewSupport {
}
private void updatePresentationsFromRootTo(@NotNull VirtualFile file) {
// find first valid parent for removed file
while (!file.isValid()) {
file = file.getParent();
if (file == null) return;
}
SmartList<TreePath> list = new SmartList<>();
acceptAndUpdate(new ProjectViewFileVisitor(file, null) {
@NotNull
@@ -273,6 +273,11 @@ public final class ScopeViewTreeModel extends BaseTreeModel<AbstractTreeNode> im
}
private void notifyPresentationChanged(@NotNull VirtualFile file) {
// find first valid parent for removed file
while (!file.isValid()) {
file = file.getParent();
if (file == null) return;
}
List<Node> list = new SmartList<>();
find(file, list, found -> {
list.forEach(node -> update(node, false));