PsiFile (Editor editor) { Project project = editor.getProject(); assert project != null; PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()); assert psiFile != null; return psiFile; }