How to create a PsiMethodCallExpression?

I have a factory for creating nodes, but I don't see any way to programmatically create a PsiMethodCallExpression. The closest methods I can find are createMethod and createMethodFromText which both create method bodies.

As far as I can tell, I'll have to get the string representation of what I'll want my call expression to look like, and use createExpressionFromText. Is that the way to do it, or are there other/better ways to do this?

1 comment
Comment actions Permalink

Yes, this is the correct way to create a PsiMethodCallExpression.


Please sign in to leave a comment.