How to find the class of a function call (KtNameReferenceExpression)
已回答
Hello,
I have a PsiElement of type KtCallExpression which I can use to get access to a KtNameReferenceExpression`. Is there an utility class in Intellij Idea Plugin SDK in order to give you the class where the function is declared?
Example:
Having the following code:
LayoutInflater.from(context).inflate(R.layout.my_layout)
How can I get the class name of the method inflate?
Thank you in advance.
请先登录再写评论。
Hi! You can use something like this to get the class name
If you want to get KtClassOrObject, then you can use
or
Thank you a lot Dmitry, I still didn't manage to find a solution, so that its helpful. I will leave the feedback as soon as I can test the suggestion. Kind regards.