This commit is contained in:
Alexander Zolotov
2014-04-04 17:14:38 +04:00
parent 49e4236cfd
commit c3a806c92d
4 changed files with 35 additions and 2 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -127,7 +127,8 @@ public class PostfixLiveTemplate extends CustomLiveTemplateBase {
newContext = addSemicolonIfNeeded(editor, editor.getDocument(), newContext, currentOffset - key.length());
expandTemplate(template, editor, newContext);
}
else {
// don't care about errors in multiCaret mode
else if (editor.getCaretModel().getAllCarets().size() == 1) {
LOG.error("Template not found by key: " + key);
}
}
@@ -0,0 +1,12 @@
class A {
Object foo;
Object bar;
public static void main(String[] args) {
foo == null<caret>
bar<caret>
bar == null<caret>
}
}
@@ -0,0 +1,16 @@
class A {
Object foo;
Object bar;
public static void main(String[] args) {
if (foo == null) {
}
bar.if
if (bar == null) {
}
}
}
@@ -156,6 +156,10 @@ public class TemplatesCompletionTest extends CompletionAutoPopupTestCase {
checkResultByFile();
}
public void testMultiCaret() {
doCompleteTest(".if", '\t');
}
@Override
protected String getBasePath() {
return JavaTestUtil.getRelativeJavaTestDataPath() + "/codeInsight/template/postfix/completion";