boolean (PsiElement element) { while (element instanceof PyReferenceExpression ref) { if (ref.getReference().resolve() instanceof PyNamedParameter) return true; element = ref.getQualifier(); } return false; }