boolean (PsiCodeBlock parent, PsiElement declaration) { if (!(declaration instanceof PsiLocalVariable)) return false; String name = ((PsiLocalVariable)declaration).getName(); return PsiResolveHelper.getInstance(declaration.getProject()).resolveAccessibleReferencedVariable(name, parent) != null; }