From a7d1e0d33a9c7a55d720ab3386b8ab8594a82ced Mon Sep 17 00:00:00 2001 From: Yaroslav Lepenkin Date: Tue, 11 Aug 2015 12:04:18 +0300 Subject: [PATCH] Addded "iter" postfix template working like "for" one to be consistent with live templates --- .../template/postfix/templates/ForeachPostfixTemplate.java | 4 ++-- .../postfix/templates/JavaPostfixTemplateProvider.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/java/java-impl/src/com/intellij/codeInsight/template/postfix/templates/ForeachPostfixTemplate.java b/java/java-impl/src/com/intellij/codeInsight/template/postfix/templates/ForeachPostfixTemplate.java index 72404efa582f..7daeb5e3e1ca 100644 --- a/java/java-impl/src/com/intellij/codeInsight/template/postfix/templates/ForeachPostfixTemplate.java +++ b/java/java-impl/src/com/intellij/codeInsight/template/postfix/templates/ForeachPostfixTemplate.java @@ -28,8 +28,8 @@ import static com.intellij.codeInsight.template.postfix.util.JavaPostfixTemplate import static com.intellij.codeInsight.template.postfix.util.JavaPostfixTemplatesUtils.selectorTopmost; public class ForeachPostfixTemplate extends StringBasedPostfixTemplate { - public ForeachPostfixTemplate() { - super("for", "for (T item : expr)", selectorTopmost(IS_ITERABLE_OR_ARRAY)); + public ForeachPostfixTemplate(String name) { + super(name, "for (T item : expr)", selectorTopmost(IS_ITERABLE_OR_ARRAY)); } @Override diff --git a/java/java-impl/src/com/intellij/codeInsight/template/postfix/templates/JavaPostfixTemplateProvider.java b/java/java-impl/src/com/intellij/codeInsight/template/postfix/templates/JavaPostfixTemplateProvider.java index 7f21ad2bfcca..dbfe90d7a27f 100644 --- a/java/java-impl/src/com/intellij/codeInsight/template/postfix/templates/JavaPostfixTemplateProvider.java +++ b/java/java-impl/src/com/intellij/codeInsight/template/postfix/templates/JavaPostfixTemplateProvider.java @@ -42,7 +42,8 @@ public class JavaPostfixTemplateProvider implements PostfixTemplateProvider { new ElseStatementPostfixTemplate(), new ForAscendingPostfixTemplate(), new ForDescendingPostfixTemplate(), - new ForeachPostfixTemplate(), + new ForeachPostfixTemplate("iter"), + new ForeachPostfixTemplate("for"), new FormatPostfixTemplate(), new IfStatementPostfixTemplate(), new InstanceofExpressionPostfixTemplate(),