@Override
    protected void innerResolveInContext(@NotNull String text, @NotNull PsiFileSystemItem context,
                                         @NotNull Collection<? super ResolveResult> result, boolean caseSensitive) {
      ProgressManager.checkCanceled();
      super.innerResolveInContext(text, context, result, caseSensitive);

      PsiFile containingFile = getContainingFile();
      if (!(containingFile instanceof IgnoreFile)) {
        return;
      }
      VirtualFile ignoreFileAffectedRoot =
        ((IgnoreLanguage)containingFile.getLanguage()).getAffectedRoot(context.getProject(), containingFile.getVirtualFile());
      if (ignoreFileAffectedRoot == null) return;

      VirtualFile ignoreFileVcsRoot = VcsUtil.getVcsRootFor(context.getProject(), ignoreFileAffectedRoot);
      if (ignoreFileVcsRoot == null) return;

      VirtualFile contextVirtualFile = context.getVirtualFile();

      if (contextVirtualFile != null) {
        IgnoreEntry entry = (IgnoreEntry)getFileReferenceSet().getElement();
        String current = getCanonicalText();
        Pattern pattern = myPatternCache.createPattern(current, entry.getSyntax());
        if (pattern != null) {
          PsiDirectory parent = getElement().getContainingFile().getParent();
          VirtualFile root = parent != null ? parent.getVirtualFile() : null;
          PsiManager psiManager = getElement().getManager();

          List<VirtualFile> files = new ArrayList<>(myIgnorePatternsMatchedFilesCache.getFilesForPattern(pattern));
          if (files.isEmpty()) {
            files.addAll(ContainerUtil.filter(
              context.getVirtualFile().getChildren(),
              virtualFile -> isFileUnderSameVcsRoot(context.getProject(), ignoreFileVcsRoot, virtualFile)
            ));
          }

          for (VirtualFile file : files) {
            ProgressManager.checkCanceled();
            if (!isFileUnderSameVcsRoot(context.getProject(), ignoreFileVcsRoot, file)) {
              continue;
            }

            String relativeToIgnoreFileVcsRoot = VfsUtilCore.getRelativePath(file, ignoreFileVcsRoot);
            String name = root != null
                          ? VfsUtilCore.getRelativePath(file, root)
                          : relativeToIgnoreFileVcsRoot != null ? relativeToIgnoreFileVcsRoot : file.getName();
            if (RegexUtil.match(pattern, name)) {
              PsiFileSystemItem psiFileSystemItem = getPsiFileSystemItem(psiManager, file);
              if (psiFileSystemItem == null) {
                continue;
              }
              result.add(new PsiElementResolveResult(psiFileSystemItem));
            }
          }
        }
      }
    }
@Override
    protected void innerResolveInContext(@NotNull String text, @NotNull PsiFileSystemItem context,
                                         @NotNull Collection<? super ResolveResult> result, boolean caseSensitive)