diff --git a/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeViewTreeModel.java b/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeViewTreeModel.java index ad8b927303b1..b688c13abf6a 100644 --- a/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeViewTreeModel.java +++ b/platform/lang-impl/src/com/intellij/ide/scopeView/ScopeViewTreeModel.java @@ -583,7 +583,17 @@ public final class ScopeViewTreeModel extends BaseTreeModel im String title = getTitle(); presentation.setPresentableText(title != null ? title : toString()); Icon icon = getIcon(); - presentation.setIcon(icon != null ? icon : getFileIcon(node)); + if (icon == null && node.isValid()) { + VirtualFile file = node.getVirtualFile(); + if (file.isDirectory()) { + AbstractTreeNode parent = getParent(); + icon = getFolderIcon(node, null, parent == null ? null : parent.getIcon()); + } + else { + icon = file.getFileType().getIcon(); + } + } + presentation.setIcon(icon); decorate(presentation); } @@ -1037,15 +1047,6 @@ public final class ScopeViewTreeModel extends BaseTreeModel im return index == null ? null : index.getModuleForFile(file); } - @Nullable - private static Icon getFileIcon(@NotNull ProjectFileNode node) { - if (!node.isValid()) return null; - VirtualFile file = node.getVirtualFile(); - return file.isDirectory() - ? getFolderIcon(node, null, null) - : file.getFileType().getIcon(); - } - @NotNull private static Icon getFolderIcon(@NotNull ProjectFileNode node, @Nullable PsiElement element, @Nullable Icon parent) { if (parent == AllIcons.Nodes.Package) return parent;