boolean (DeclarationDescriptor descriptor, PsiElement declaration, KtSimpleNameExpression reference) { KtCallElement callElement = PsiTreeUtil.getParentOfType(reference, KtCallElement.class); if (callElement == null || !PsiTreeUtil.isAncestor(callElement.getCalleeExpression(), reference, false)) return false; return descriptor instanceof FunctionDescriptor && (declaration instanceof KtClassOrObject || declaration instanceof KtNamedFunction || declaration instanceof PsiMethod); }