diff --git a/java/java-impl/src/com/intellij/psi/impl/ElementPresentationUtil.java b/java/java-impl/src/com/intellij/psi/impl/ElementPresentationUtil.java index 09f0296df5e6..9a7d2f41a218 100644 --- a/java/java-impl/src/com/intellij/psi/impl/ElementPresentationUtil.java +++ b/java/java-impl/src/com/intellij/psi/impl/ElementPresentationUtil.java @@ -18,9 +18,10 @@ package com.intellij.psi.impl; import com.intellij.codeInsight.CodeInsightBundle; import com.intellij.codeInsight.TestUtil; import com.intellij.compiler.CompilerConfiguration; +import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.project.DumbService; import com.intellij.openapi.project.Project; -import com.intellij.openapi.roots.ProjectRootManager; +import com.intellij.openapi.roots.ExcludedFileIndex; import com.intellij.openapi.util.IconLoader; import com.intellij.openapi.util.Iconable; import com.intellij.openapi.util.Key; @@ -94,7 +95,7 @@ public class ElementPresentationUtil implements PlatformIcons { public static boolean isExcluded(final VirtualFile vFile, final Project project) { return vFile != null - && ProjectRootManager.getInstance(project).getFileIndex().isInSource(vFile) + && ServiceManager.getService(project, ExcludedFileIndex.class).isInSource(vFile) && CompilerConfiguration.getInstance(project).isExcludedFromCompilation(vFile); } diff --git a/platform/core-api/src/com/intellij/openapi/roots/ExcludedFileIndex.java b/platform/core-api/src/com/intellij/openapi/roots/ExcludedFileIndex.java index bb054c1b6564..3d90703bd460 100644 --- a/platform/core-api/src/com/intellij/openapi/roots/ExcludedFileIndex.java +++ b/platform/core-api/src/com/intellij/openapi/roots/ExcludedFileIndex.java @@ -29,6 +29,7 @@ public abstract class ExcludedFileIndex { } public abstract boolean isInContent(VirtualFile file); + public abstract boolean isInSource(VirtualFile file); public abstract boolean isExcludedFile(VirtualFile file); /** diff --git a/platform/lang-impl/src/com/intellij/openapi/vcs/impl/ProjectExcludedFileIndex.java b/platform/lang-impl/src/com/intellij/openapi/vcs/impl/ProjectExcludedFileIndex.java index 903aa8eae7a5..5d2a05306f3e 100644 --- a/platform/lang-impl/src/com/intellij/openapi/vcs/impl/ProjectExcludedFileIndex.java +++ b/platform/lang-impl/src/com/intellij/openapi/vcs/impl/ProjectExcludedFileIndex.java @@ -39,6 +39,11 @@ public class ProjectExcludedFileIndex extends ExcludedFileIndex { return myRootManager.getFileIndex().isInContent(file); } + @Override + public boolean isInSource(VirtualFile file) { + return myRootManager.getFileIndex().isInSource(file); + } + public boolean isExcludedFile(final VirtualFile file) { return myRootManager.getFileIndex().isIgnored(file); } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/DefaultExcludedFileIndex.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/DefaultExcludedFileIndex.java index 925ee04f5654..f51c89e54e76 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/DefaultExcludedFileIndex.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/impl/DefaultExcludedFileIndex.java @@ -38,6 +38,11 @@ public class DefaultExcludedFileIndex extends ExcludedFileIndex { return VfsUtil.isAncestor(getBaseDir(), file, false); } + @Override + public boolean isInSource(VirtualFile file) { + return isInContent(file); + } + public boolean isExcludedFile(final VirtualFile file) { return false; }