@Override
  public @Nullable PsiDirectory getContainingDirectory() {
    VirtualFile file = getViewProvider().getVirtualFile();
    VirtualFile parentFile = file.getParent();
    if (parentFile == null) return null;
    if (!parentFile.isValid()) {
      LOG.error("Invalid parent: " + parentFile + " of file " + file + ", file.valid=" + file.isValid());
      return null;
    }
    return getManager().findDirectory(parentFile);
  }
@Override
  public @Nullable PsiDirectory getContainingDirectory()