mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-66243 Support moving caret in lookups as in JB
This commit is contained in:
@@ -539,5 +539,37 @@ public interface Test {
|
||||
|
||||
}
|
||||
|
||||
public void testLeftRightMovements() {
|
||||
myFixture.configureByText("a.java", """
|
||||
class Foo {
|
||||
void foo(String iterable) {
|
||||
<caret>ter
|
||||
}
|
||||
}
|
||||
""")
|
||||
type('i')
|
||||
def offset = myFixture.editor.caretModel.offset
|
||||
assertSameElements myFixture.lookupElementStrings, "if", "iterable", "int"
|
||||
|
||||
edt { myFixture.performEditorAction(IdeActions.ACTION_EDITOR_MOVE_CARET_RIGHT) }
|
||||
assert myFixture.editor.caretModel.offset == offset + 1
|
||||
assertOrderedEquals myFixture.lookupElementStrings, "iterable"
|
||||
assertEquals 'iterable', lookup.currentItem.lookupString
|
||||
|
||||
edt { myFixture.performEditorAction(IdeActions.ACTION_EDITOR_MOVE_CARET_LEFT) }
|
||||
assert myFixture.editor.caretModel.offset == offset
|
||||
assertSameElements myFixture.lookupElementStrings, "if", "iterable", "int"
|
||||
assertEquals 'iterable', lookup.currentItem.lookupString
|
||||
|
||||
edt { myFixture.performEditorAction(IdeActions.ACTION_EDITOR_MOVE_CARET_LEFT) }
|
||||
joinAlarm()
|
||||
joinCompletion()
|
||||
assert lookup.items.size() > 3
|
||||
|
||||
for (i in 0.."iter".size()) {
|
||||
edt { myFixture.performEditorAction(IdeActions.ACTION_EDITOR_MOVE_CARET_RIGHT) }
|
||||
}
|
||||
assert !lookup
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user