PsiNameValuePair (PsiElement highlightedElement) { PsiElement nameValuePair = highlightedElement; while (!(nameValuePair == null || nameValuePair instanceof PsiNameValuePair)) { nameValuePair = nameValuePair.getContext(); } return (PsiNameValuePair) nameValuePair; }