PsiLocalVariable (Editor editor) { PsiElement element = TargetElementUtil .findTargetElement(editor, TargetElementUtil.ELEMENT_NAME_ACCEPTED | TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED); assertTrue(element instanceof PsiLocalVariable); return (PsiLocalVariable)element; }