mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
in a class, prefer member modifiers to other classes
This commit is contained in:
@@ -116,6 +116,7 @@ public class JavaCompletionSorting {
|
||||
@Override
|
||||
public Comparable weigh(@NotNull LookupElement element) {
|
||||
final Object o = element.getObject();
|
||||
if (o instanceof PsiKeyword) return -3;
|
||||
if (!(o instanceof PsiMember)) return 0;
|
||||
|
||||
if (((PsiMember)o).hasModifierProperty(PsiModifier.STATIC)) {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
public class Test {
|
||||
|
||||
p<caret>
|
||||
|
||||
class paaa {}
|
||||
|
||||
static class paab {}
|
||||
|
||||
}
|
||||
+6
-2
@@ -95,11 +95,11 @@ public class NormalCompletionOrderingTest extends CompletionSortingTestCase {
|
||||
}
|
||||
|
||||
public void testClassStaticMembersInVoidContext() throws Throwable {
|
||||
checkPreferredItems(0, "booleanMethod", "voidMethod", "AN_OBJECT", "BOOLEAN", "Inner");
|
||||
checkPreferredItems(0, "booleanMethod", "voidMethod", "AN_OBJECT", "BOOLEAN", "class");
|
||||
}
|
||||
|
||||
public void testClassStaticMembersInBooleanContext() throws Throwable {
|
||||
checkPreferredItems(0, "booleanMethod", "voidMethod", "BOOLEAN", "AN_OBJECT", "Inner");
|
||||
checkPreferredItems(0, "booleanMethod", "voidMethod", "BOOLEAN", "AN_OBJECT", "class");
|
||||
}
|
||||
|
||||
public void testDispreferDeclared() throws Throwable {
|
||||
@@ -213,4 +213,8 @@ public class NormalCompletionOrderingTest extends CompletionSortingTestCase {
|
||||
checkPreferredItems(0, "return", "rLocal", "rParam", "rMethod");
|
||||
}
|
||||
|
||||
public void testPreferModifiers() {
|
||||
checkPreferredItems(0, "private", "protected", "public", "paaa", "paab");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user