boolean (PsiFile file, int offset) { final PsiElement psiElement = file.findElementAt(offset); if (psiElement instanceof PsiIdentifier){ if (psiElement.getParent() instanceof PsiMethod) { return true; } } return false; }