PostfixTemplateExpressionSelector (@NotNull PostfixTemplateExpressionSelector selector, @NotNull LanguageLevel minimalLevel) { return new PostfixTemplateExpressionSelector() { @Override public boolean hasExpression(@NotNull PsiElement context, @NotNull Document copyDocument, int newOffset) { return PsiUtil.getLanguageLevel(context).isAtLeast(minimalLevel) && selector.hasExpression(context, copyDocument, newOffset); } @NotNull @Override public List<PsiElement> getExpressions(@NotNull PsiElement context, @NotNull Document document, int offset) { return PsiUtil.getLanguageLevel(context).isAtLeast(minimalLevel) ? selector.getExpressions(context, document, offset) : Collections.emptyList(); } @NotNull @Override public Function<PsiElement, String> getRenderer() { return selector.getRenderer(); } }; }