public static PsiFile getPsiFileAtOffset(@NotNull PsiFile file, final int offset) {
    if (file instanceof PsiFileWithOneLanguage) {
      return file;
    }

    PsiElement elt = getElementAtOffset(file, offset);
    ensureValid(elt);
    return elt.getContainingFile();
  }
public static PsiFile getPsiFileAtOffset(@NotNull PsiFile file, final int offset)