public static boolean isInSource(@NotNull PsiDirectory directory) {
    return isInSource(directory.getVirtualFile(), directory.getProject());
  }
public static boolean isInSource(@NotNull PsiDirectory directory)