Result (Expression @NotNull [] params, ExpressionContext context) { PsiElement place = context.getPsiElementAtStartOffset(); while (place != null) { if (place instanceof PsiMethod) { PsiType returnType = ((PsiMethod)place).getReturnType(); if (returnType != null) { return new PsiTypeResult(returnType, place.getProject()); } else { break; } } place = place.getParent(); } return null; }