diff --git a/java/java-tests/testSrc/com/intellij/openapi/roots/impl/DirectoryIndexTest.java b/java/java-tests/testSrc/com/intellij/openapi/roots/impl/DirectoryIndexTest.java index 5a0180cdf738..318126d84e62 100644 --- a/java/java-tests/testSrc/com/intellij/openapi/roots/impl/DirectoryIndexTest.java +++ b/java/java-tests/testSrc/com/intellij/openapi/roots/impl/DirectoryIndexTest.java @@ -358,6 +358,13 @@ public class DirectoryIndexTest extends IdeaTestCase { } } + public void testIgnoredFile() throws IOException { + VirtualFile ignoredFile = myModule1Dir.createChildData(this, "CVS"); + DirectoryInfo info = myIndex.getInfoForFile(ignoredFile); + assertTrue(info.isIgnored()); + assertTrue(ProjectRootManager.getInstance(myProject).getFileIndex().isIgnored(ignoredFile)); + } + public void testAddModule() throws Exception { myIndex.checkConsistency(); diff --git a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/RootIndex.java b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/RootIndex.java index 8673a76effd4..a117e5fdac42 100644 --- a/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/RootIndex.java +++ b/platform/projectModel-impl/src/com/intellij/openapi/roots/impl/RootIndex.java @@ -272,6 +272,9 @@ public class RootIndex extends DirectoryIndex { if (info != null) { return info; } + if (isIgnored(file)) { + return NonProjectDirectoryInfo.IGNORED; + } dir = file.getParent(); } else {