PostfixTemplateExpressionSelector (Condition<? super PsiElement> additionalFilter) { return new PostfixTemplateExpressionSelectorBase(additionalFilter) { @Override protected List<PsiElement> getNonFilteredExpressions(@NotNull PsiElement context, @NotNull Document document, int offset) { return ContainerUtil.createMaybeSingletonList(getTopmostExpression(context)); } @Override protected Condition<PsiElement> getFilters(int offset) { return and(super.getFilters(offset), getPsiErrorFilter()); } @NotNull @Override public Function<PsiElement, String> getRenderer() { return JavaPostfixTemplatesUtils.getRenderer(); } }; }