PsiFile (@NotNull PsiFile file, final int offset) { if (file instanceof PsiFileWithOneLanguage) { return file; } PsiElement elt = getElementAtOffset(file, offset); ensureValid(elt); return elt.getContainingFile(); }