PsiElement (@Nullable PsiElement elementAt, Editor editor) { if (elementAt instanceof PsiKeyword && PsiKeyword.VAR.equals(elementAt.getText())) { PsiElement parent = elementAt.getParent(); if (parent instanceof PsiTypeElement && ((PsiTypeElement)parent).isInferredType()) { return PsiUtil.resolveClassInClassTypeOnly(((PsiTypeElement)parent).getType()); } } return null; }