mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
calculate all classes in autopopup background
when completion is case insensitive, show all classes (IDEA-25979)
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ import sun.swing.BakedArrayList;
|
||||
class Foo {
|
||||
{
|
||||
Object element;
|
||||
if (element instanceof bar<caret>)
|
||||
if (element instanceof Bar<caret>)
|
||||
}
|
||||
|
||||
}
|
||||
+13
-6
@@ -34,6 +34,7 @@ import com.intellij.openapi.extensions.Extensions
|
||||
import com.intellij.openapi.extensions.LoadingOrder
|
||||
import com.intellij.openapi.progress.ProgressManager
|
||||
import com.intellij.psi.PsiFile
|
||||
import com.intellij.codeInsight.CodeInsightSettings
|
||||
|
||||
/**
|
||||
* @author peter
|
||||
@@ -637,8 +638,8 @@ public interface Test {
|
||||
public void testTemplateSelectionByComma() {
|
||||
myFixture.configureByText("a.java", """
|
||||
class Foo {
|
||||
int ITER = 2;
|
||||
int itea = 2;
|
||||
int itera = 2;
|
||||
|
||||
{
|
||||
it<caret>
|
||||
@@ -646,9 +647,9 @@ class Foo {
|
||||
}
|
||||
""")
|
||||
type 'e'
|
||||
assertOrderedEquals myFixture.lookupElementStrings, "itea"
|
||||
assertOrderedEquals myFixture.lookupElementStrings, "itea", "itera"
|
||||
type 'r'
|
||||
assertOrderedEquals myFixture.lookupElementStrings, "iter", "ITER", "Iterable", "Iterator"
|
||||
assertOrderedEquals myFixture.lookupElementStrings, "iter", "itera"
|
||||
type ','
|
||||
assert !lookup
|
||||
assert myFixture.editor.document.text.contains('iter,')
|
||||
@@ -670,9 +671,15 @@ class Foo {
|
||||
}
|
||||
|
||||
public void testNewClassParenthesis() {
|
||||
myFixture.configureByText("a.java", """ class Foo { { new <caret> } } """)
|
||||
type 'fil('
|
||||
assert myFixture.editor.document.text.contains('new File()')
|
||||
CodeInsightSettings.instance.COMPLETION_CASE_SENSITIVE = CodeInsightSettings.NONE
|
||||
try {
|
||||
myFixture.configureByText("a.java", """ class Foo { { new <caret> } } """)
|
||||
type 'fil('
|
||||
assert myFixture.editor.document.text.contains('new File()')
|
||||
}
|
||||
finally {
|
||||
CodeInsightSettings.instance.COMPLETION_CASE_SENSITIVE = CodeInsightSettings.FIRST_LETTER
|
||||
}
|
||||
}
|
||||
|
||||
public void testUnknownMethodParenthesis() {
|
||||
|
||||
+1
-1
@@ -242,7 +242,7 @@ public class NormalCompletionOrderingTest extends CompletionSortingTestCase {
|
||||
myFixture.addClass("package bar; public class Bar {}");
|
||||
final String path = getTestName(false) + ".java";
|
||||
myFixture.configureByFile(getTestName(false) + ".java");
|
||||
myFixture.complete(CompletionType.BASIC, 2);
|
||||
myFixture.complete(CompletionType.BASIC);
|
||||
assertPreferredItems(0, "Bar", "Bar");
|
||||
List<LookupElement> items = getLookup().getItems();
|
||||
assertEquals(((JavaPsiClassReferenceElement)items.get(0)).getQualifiedName(), "Bar");
|
||||
|
||||
Reference in New Issue
Block a user