@Override
  public PsiDirectory @NotNull [] getDirectories(@NotNull GlobalSearchScope scope) {
    Collection<PsiDirectory> directories = getAllDirectories(scope);
    return directories.isEmpty() ? PsiDirectory.EMPTY_ARRAY : directories.toArray(PsiDirectory.EMPTY_ARRAY);
  }
@Override
  public PsiDirectory @NotNull [] getDirectories(@NotNull GlobalSearchScope scope)