typing 'new File(' shouldn't insert some File* imported class when java.io.File is...
authorpeter <peter@jetbrains.com>
Tue, 17 Jan 2012 16:56:07 +0000 (17:56 +0100)
committerpeter <peter@jetbrains.com>
Tue, 17 Jan 2012 16:57:53 +0000 (17:57 +0100)
java/java-impl/src/com/intellij/codeInsight/completion/JavaCharFilter.java
java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GroovyReferenceCharFilter.java

index 0a7274a33f073f38a2f820149b1d98b1fb495883..1c17d3eb3c4b30f8d2773875a8002a1df5c323fa 100644 (file)
@@ -102,7 +102,7 @@ public class JavaCharFilter extends CharFilter {
     }
     if (c == '.' && isWithinLiteral(lookup)) return Result.ADD_TO_PREFIX;
 
-    if ((c == '[' || c == '<' || c == '.' || c == ' ') && isNonImportedClassEntered((LookupImpl)lookup)) {
+    if ((c == '[' || c == '<' || c == '.' || c == ' ' || c == '(') && isNonImportedClassEntered((LookupImpl)lookup)) {
       return Result.HIDE_LOOKUP;
     }
     
index d6248547b48aa519bd1a0c5b13ae6fc050d40c01..aab6671085cfeb300203be500d8b8c65e747788c 100644 (file)
@@ -1100,6 +1100,10 @@ public class UTest {
     edt { myFixture.performEditorAction IdeActions.ACTION_EDITOR_MOVE_CARET_DOWN }
     type ' '
     assert myFixture.file.text.contains('Foo239Util2 ')
+
+    myFixture.configureByText "a.java", "class Foo {{ <caret> }}"
+    type 'new Foo239('
+    assert myFixture.file.text.contains('new Foo239()')
   }
 
   public void testTypingFirstVarargDot() {
index 6a9c5b0050336e4fc084edb3105c796ea63db6c8..eae8a4c942f487230a07a7c16a1cd44a4908039e 100644 (file)
@@ -41,7 +41,7 @@ public class GroovyReferenceCharFilter extends CharFilter {
       return Result.ADD_TO_PREFIX;
     }
 
-    if ((c == '[' || c == '<' || c == '.' || c == ' ') && JavaCharFilter.isNonImportedClassEntered((LookupImpl)lookup)) {
+    if ((c == '[' || c == '<' || c == '.' || c == ' ' || c == '(') && JavaCharFilter.isNonImportedClassEntered((LookupImpl)lookup)) {
       return Result.HIDE_LOOKUP;
     }