summaryrefslogtreecommitdiff
path: root/platform/lang-impl/src/com/intellij/codeInsight/template/LiveTemplateBuilder.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-07-25 20:12:40 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-07-24 20:55:36 +0000
commit6044be7330c93bc8dacb0f63e62da8029f39a16f (patch)
tree0ba72f5de1949e0527874a799baa224cbe1537e0 /platform/lang-impl/src/com/intellij/codeInsight/template/LiveTemplateBuilder.java
parentb03a5855292feb8c331815f883fe64372aacd872 (diff)
parente5266e2343c8d275d79fa0be725180d0fe3a993c (diff)
downloadidea-6044be7330c93bc8dacb0f63e62da8029f39a16f.tar.gz
Merge "Merge remote-tracking branch 'aosp/upstream-master' into merge"
Diffstat (limited to 'platform/lang-impl/src/com/intellij/codeInsight/template/LiveTemplateBuilder.java')
-rw-r--r--platform/lang-impl/src/com/intellij/codeInsight/template/LiveTemplateBuilder.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/LiveTemplateBuilder.java b/platform/lang-impl/src/com/intellij/codeInsight/template/LiveTemplateBuilder.java
index 512bfa1b27fb..9678ef213f45 100644
--- a/platform/lang-impl/src/com/intellij/codeInsight/template/LiveTemplateBuilder.java
+++ b/platform/lang-impl/src/com/intellij/codeInsight/template/LiveTemplateBuilder.java
@@ -247,8 +247,13 @@ public class LiveTemplateBuilder {
else {
newVarName = varName;
}
- Variable var =
- new Variable(newVarName, template.getExpressionStringAt(i), template.getDefaultValueStringAt(i), template.isAlwaysStopAt(i));
+ Variable var = new Variable(newVarName, template.getExpressionStringAt(i), template.getDefaultValueStringAt(i), template.isAlwaysStopAt(i));
+ if (mySegmentLimit >= 0 && myVariables.size() >= mySegmentLimit) {
+ if (mySegmentLimit > 0) {
+ LOGGER.warn("Template with more than " + mySegmentLimit + " segments had been build. Text: " + myText);
+ }
+ break;
+ }
myVariables.add(var);
myVarNames.add(newVarName);
}