PsiFile (PsiElement element) { PsiFile containingFile = element.getContainingFile(); if (containingFile == null) return null; FileViewProvider viewProvider = containingFile.getViewProvider(); return viewProvider.getPsi(viewProvider.getBaseLanguage()); }