Result (Expression @NotNull [] params, ExpressionContext context) { PsiElement place = context.getPsiElementAtStartOffset(); PyClass pyClass = PsiTreeUtil.getParentOfType(place, PyClass.class); if (pyClass == null) { return null; } String name = pyClass.getName(); return name == null ? null : new TextResult(name); }