PsiModifierListOwner (Editor editor, PsiFile file) { PsiElement element = file.findElementAt(editor.getCaretModel().getOffset()); PsiParameter parameter = PsiTreeUtil.getParentOfType(element, PsiParameter.class, false); if (parameter == null) return null; PsiMethod method = PsiTreeUtil.getParentOfType(parameter, PsiMethod.class); if (method == null) return null; PsiType type = parameter.getType(); return type.equalsToText(CommonClassNames.JAVA_LANG_STRING) ? parameter : null; }