mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
expected type should always be at the top of the lookup in smart completion after new
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
import java.util.*;
|
||||
|
||||
public class FooBean3 extends JComponent {
|
||||
|
||||
{
|
||||
List<String> l = new <caret>
|
||||
}
|
||||
}
|
||||
+12
-2
@@ -40,14 +40,24 @@ public class SmartTypeCompletionOrderingTest extends CompletionSortingTestCase {
|
||||
imitateItemSelection(lookup, 2); //Container
|
||||
}
|
||||
refreshSorting(lookup);
|
||||
assertPreferredItems(0, "Container", "FooBean3", "JComponent");
|
||||
assertPreferredItems(2, "Component", "String", "Container", "FooBean3", "JComponent");
|
||||
|
||||
int component = lookup.items.findIndexOf { it.lookupString == 'Component' }
|
||||
for (int i = 0; i < StatisticsManager.OBLIVION_THRESHOLD; i++) {
|
||||
imitateItemSelection(lookup, component);
|
||||
}
|
||||
refreshSorting(lookup);
|
||||
assertPreferredItems(0, "Component", "Container");
|
||||
assertPreferredItems(1, "String", "Component", "FooBean3");
|
||||
}
|
||||
|
||||
public void testNewListAlwaysFirst() {
|
||||
def lookup = invokeCompletion(getTestName(false) + ".java")
|
||||
assertPreferredItems 1, 'List', 'AbstractList', 'AbstractSequentialList', 'ArrayList'
|
||||
for (int i = 0; i < StatisticsManager.OBLIVION_THRESHOLD + 10; i++) {
|
||||
imitateItemSelection(lookup, 3) //ArrayList
|
||||
}
|
||||
refreshSorting(lookup)
|
||||
assertPreferredItems 1, 'List', 'ArrayList', 'AbstractList', 'AbstractSequentialList'
|
||||
}
|
||||
|
||||
public void testNoStatsOnUnsuccessfulAttempt() {
|
||||
|
||||
Reference in New Issue
Block a user