@NotNull
  private VirtualFile getBaseDirectory(@Nullable Module module) {
    VirtualFile projectBaseDir = getProject().getBaseDir();
    if (module == null) {
      return projectBaseDir;
    }

    VirtualFile firstContentRoot = getFirstContentRoot(module);
    if (firstContentRoot == null || !firstContentRoot.isDirectory()) {
      return projectBaseDir;
    }

    return firstContentRoot;
  }
@NotNull
  private VirtualFile getBaseDirectory(@Nullable Module module)