mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-18 20:41:22 +07:00
IDEA-105093 Eclipse-way getter/setter completion
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
public class A {
|
||||
int field;
|
||||
|
||||
publ<caret>
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
public class A {
|
||||
int field;
|
||||
|
||||
public int getField() {
|
||||
<caret><selection>return field;</selection>
|
||||
}
|
||||
}
|
||||
@@ -1325,6 +1325,29 @@ class XInternalError {}
|
||||
checkResult()
|
||||
}
|
||||
|
||||
public void testAccessorViaCompletion() {
|
||||
configure()
|
||||
|
||||
def getter = myFixture.lookupElements.find { it.lookupString == 'public int getField' }
|
||||
def setter = myFixture.lookupElements.find { it.lookupString == 'public void setField' }
|
||||
assert getter : myFixture.lookupElementStrings
|
||||
assert setter : myFixture.lookupElementStrings
|
||||
|
||||
def p = LookupElementPresentation.renderElement(getter)
|
||||
assert p.itemText == getter.lookupString
|
||||
assert p.tailText == '() {...}'
|
||||
assert !p.typeText
|
||||
|
||||
p = LookupElementPresentation.renderElement(setter)
|
||||
assert p.itemText == setter.lookupString
|
||||
assert p.tailText == '(field) {...}'
|
||||
assert !p.typeText
|
||||
|
||||
lookup.currentItem = getter
|
||||
myFixture.type('\n')
|
||||
checkResult()
|
||||
}
|
||||
|
||||
public void testBraceOnNextLine() {
|
||||
codeStyleSettings.BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE
|
||||
doTest()
|
||||
|
||||
Reference in New Issue
Block a user