IDEA-27091 When finishing method lookup item with '(', put caret after this '(' even if method has no parameters

IDEA-51789 When "Insert pair bracket" on Editor->Smart keys page is off, IDEA still inserts both parentheses on autocomplete lookup, but overtype doesn't work
This commit is contained in:
peter
2010-03-09 12:54:15 +00:00
parent c4fdc0f5af
commit eed9138dbd
8 changed files with 72 additions and 16 deletions
@@ -308,6 +308,25 @@ public class NormalCompletionTest extends LightCompletionTestCase {
checkResultByFile("/codeInsight/completion/normal/MethodWithLeftParTailType2_after.java");
}
public void testMethodWithLeftParTailTypeNoPairBrace() throws Exception {
final boolean old = CodeInsightSettings.getInstance().AUTOINSERT_PAIR_BRACKET;
CodeInsightSettings.getInstance().AUTOINSERT_PAIR_BRACKET = false;
try {
configureByFile("/codeInsight/completion/normal/" + getTestName(false) + ".java");
selectItem(myItems[0], '(');
checkResultByFile("/codeInsight/completion/normal/" + getTestName(false) + "_after.java");
//no tail type should work the normal way
configureByFile("/codeInsight/completion/normal/" + getTestName(false) + ".java");
selectItem(myItems[0]);
checkResultByFile("/codeInsight/completion/normal/" + getTestName(false) + "_after2.java");
}
finally {
CodeInsightSettings.getInstance().AUTOINSERT_PAIR_BRACKET = old;
}
}
public void testExcessSpaceInTypeCast() throws Throwable {
configureByFile("/codeInsight/completion/normal/" + getTestName(false) + ".java");
selectItem(myItems[0]);