IDEA-99186 Ctrl+Space help when implementing/overriding methods

This commit is contained in:
peter
2013-02-01 17:40:54 +01:00
parent 1cfd13945c
commit 53a305b847
7 changed files with 195 additions and 10 deletions
@@ -0,0 +1,7 @@
interface Foo<T> {
void run(T t, int myInt);
}
public class A implements Foo<String> {
p<caret>
}
@@ -0,0 +1,10 @@
interface Foo<T> {
void run(T t, int myInt);
}
public class A implements Foo<String> {
@Override
public void run(String s, int myInt) {
<selection>//To change body of implemented methods use File | Settings | File Templates.</selection>
}
}
@@ -1316,5 +1316,20 @@ class XInternalError {}
assert lookup.items.size() == 1
}
public void testImplementViaCompletion() {
configure()
myFixture.assertPreferredCompletionItems 0, 'private', 'protected', 'public', 'public void run'
def item = lookup.items[3]
def p = LookupElementPresentation.renderElement(item)
assert p.itemText == 'public void run'
assert p.tailText == '(s, myInt) {...}'
assert p.typeText == 'Foo'
lookup.currentItem = item
myFixture.type('\n')
checkResult()
}
}