IDEA-175681 Duplicate "void" suggestion

This commit is contained in:
peter
2017-07-12 22:03:49 +02:00
parent 9b8ee499e9
commit 4ce6e7c0df
3 changed files with 10 additions and 1 deletions
@@ -60,7 +60,7 @@ class MethodReturnTypeProvider extends CompletionProvider<CompletionParameters>
@Nullable
@Override
public PsiType visitType(PsiType type) {
if (myProcessed.add(type)) {
if (!(type instanceof PsiPrimitiveType) && myProcessed.add(type)) {
int priority = type.equalsToText(CommonClassNames.JAVA_LANG_OBJECT) ? 1 : 1000 - myProcessed.size();
consumer.consume(PrioritizedLookupElement.withPriority(PsiTypeLookupItem.createLookupItem(type, position), priority));
}
@@ -0,0 +1,5 @@
class Foo {
voi<caret>d foo() {
return;
}
}
@@ -678,6 +678,10 @@ public class ListUtils {
configure()
assert myFixture.lookupElementStrings == ['boolean', 'byte']
}
void testNoExpectedVoidReturnTypeDuplication() {
configure()
assert myFixture.lookupElementStrings == ['void']
}
void testMethodReturnType() throws Throwable {
doTest()