Exemplo n.º 1
0
  @Override
  public boolean contains(@NotNull VirtualFile file) {
    if (file instanceof VirtualFileWindow) return true;

    if (myFileIndex.isInLibraryClasses(file) && !myFileIndex.isInSourceContent(file)) return false;

    return myFileIndex.isInContent(file);
  }
 private boolean checkClassUnderSources(final PsiElement element, final Project project) {
   final PsiFile file = element.getContainingFile();
   if (file != null && file.getVirtualFile() != null) {
     final FileIndexFacade indexFacade = FileIndexFacade.getInstance(project);
     final VirtualFile vf = file.getVirtualFile();
     return indexFacade.isInSource(vf) || indexFacade.isInSourceContent(vf);
   }
   return false;
 }