PsiMember (Editor editor, PsiFile file) { PsiElement element = file.findElementAt(editor.getCaretModel().getOffset()); if (element == null) return null; return PsiTreeUtil.getParentOfType(element, PsiMethod.class, GrField.class, PsiClass.class); }