platform project view: excluded files from project root were shown as top level elements

This commit is contained in:
Andrey Starovoyt
2016-09-05 19:20:58 +03:00
parent 57b69f74be
commit efdd7caac8
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@ import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleUtil;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.roots.ProjectFileIndex;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.vfs.VfsUtilCore;
@@ -73,8 +74,8 @@ public class ProjectViewProjectNode extends AbstractProjectNode {
final VirtualFile[] files = baseDir.getChildren();
for (VirtualFile file : files) {
if (ModuleUtil.findModuleForFile(file, getProject()) == null) {
if (!file.isDirectory()) {
if (!file.isDirectory()) {
if (ProjectFileIndex.SERVICE.getInstance(getProject()).getModuleForFile(file, false) == null) {
nodes.add(new PsiFileNode(getProject(), psiManager.findFile(file), getSettings()));
}
}