diff --git a/java/java-tests/testData/codeInsight/typing/columnMode_after.java b/java/java-tests/testData/codeInsight/typing/columnMode_after.java new file mode 100644 index 000000000000..78c14369ab56 --- /dev/null +++ b/java/java-tests/testData/codeInsight/typing/columnMode_after.java @@ -0,0 +1,5 @@ +class Foo { + void m() { + System.exit() + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/typing/columnMode_before.java b/java/java-tests/testData/codeInsight/typing/columnMode_before.java new file mode 100644 index 000000000000..ba4c1bfa09ff --- /dev/null +++ b/java/java-tests/testData/codeInsight/typing/columnMode_before.java @@ -0,0 +1,5 @@ +class Foo { + void m() { + System.exit + } +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/JavaTypingTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/JavaTypingTest.java index 8c3837fe1722..f59162a6d5b2 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/JavaTypingTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/JavaTypingTest.java @@ -15,6 +15,7 @@ */ package com.intellij.codeInsight; +import com.intellij.openapi.editor.ex.EditorEx; import com.intellij.testFramework.PlatformTestUtil; import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase; @@ -57,6 +58,13 @@ public class JavaTypingTest extends LightPlatformCodeInsightFixtureTestCase { doTest('"'); } + public void testColumnMode() { + myFixture.configureByFile(getTestName(true) + "_before.java"); + ((EditorEx)myFixture.getEditor()).setColumnMode(true); + myFixture.type('('); + myFixture.checkResultByFile(getTestName(true) + "_after.java"); + } + private void doTest(char c) { myFixture.configureByFile(getTestName(true) + "_before.java"); myFixture.type(c); diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy b/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy index 8a54c9594144..7391f93a1ab2 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy @@ -42,6 +42,7 @@ import com.intellij.openapi.editor.Editor import com.intellij.openapi.editor.EditorFactory import com.intellij.openapi.editor.LogicalPosition import com.intellij.openapi.editor.actionSystem.EditorActionManager +import com.intellij.openapi.editor.ex.EditorEx import com.intellij.openapi.extensions.Extensions import com.intellij.openapi.extensions.LoadingOrder import com.intellij.openapi.fileEditor.FileEditor @@ -1642,4 +1643,14 @@ class Foo { assert lookup assert myFixture.lookupElementStrings == ['goo'] } + + public void "test in column selection mode"() { + myFixture.configureByText "a.java", """ +class Foo {{ + +}}""" + edt { ((EditorEx)myFixture.editor).setColumnMode(true) } + type 'toStr' + assert lookup + } }