PsiNewExpression.getClassReference() to PsiClass

From PsiNewExpression, how do you get to the PsiClass of the instance
that is being constructed in the new expression? I don't seem to be
getting there from PsiNewExpression.getClassReference().

TIA,
Jon

2 comments
Comment actions Permalink

Jon Steelman wrote:

From PsiNewExpression, how do you get to the PsiClass of the instance
that is being constructed in the new expression? I don't seem to be
getting there from PsiNewExpression.getClassReference().


One more step: PsiNewExpression.getClassReference().resolve().
Beware of the JavaDoc comment for getClassReference() though.

Friendly,
Dmitry
--
Dmitry Lomov
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Dmitry Lomov (JetBrains) wrote:

Jon Steelman wrote:

>> From PsiNewExpression, how do you get to the PsiClass of the instance
>>that is being constructed in the new expression? I don't seem to be
>>getting there from PsiNewExpression.getClassReference().


One more step: PsiNewExpression.getClassReference().resolve().
Beware of the JavaDoc comment for getClassReference() though.

Friendly,
Dmitry


Thanks!

0

Please sign in to leave a comment.