IDEA-167834 Prioritize down classes from "exclude imports" in the "Go to class" list

This commit is contained in:
peter
2017-03-20 18:25:50 +01:00
parent e26b225d50
commit d243d61455
2 changed files with 18 additions and 4 deletions
@@ -15,6 +15,7 @@
*/
package com.intellij.navigation
import com.intellij.codeInsight.JavaProjectCodeInsightSettings
import com.intellij.ide.actions.GotoFileItemProvider
import com.intellij.ide.util.gotoByName.*
import com.intellij.lang.java.JavaLanguage
@@ -352,6 +353,17 @@ class Intf {
assert file in elements
}
void "test classes sorted by qualified name dispreferring excluded from import and completion"() {
def foo = myFixture.addClass('package foo; class List {}')
def bar = myFixture.addClass('package bar; class List {}')
def popup = createPopup(new GotoClassModel2(project), myFixture.addClass('class Context {}'))
assert calcPopupElements(popup, "List", false) == [bar, foo]
JavaProjectCodeInsightSettings.setExcludedNames(project, testRootDisposable, 'bar')
assert calcPopupElements(popup, "List", false) == [foo, bar]
}
private List<Object> getPopupElements(ChooseByNameModel model, String text, boolean checkboxState = false) {
return calcPopupElements(createPopup(model), text, checkboxState)
}