Search in sources :

Example 1 with CaretInfo

use of com.intellij.testFramework.EditorTestUtil.CaretInfo in project intellij by bazelbuild.

the class EditorTestHelper method assertCaretPosition.

public void assertCaretPosition(Editor editor, int lineNumber, int columnNumber) {
    CaretInfo info = new CaretInfo(new LogicalPosition(lineNumber, columnNumber), null);
    EditorTestUtil.verifyCaretAndSelectionState(editor, new CaretAndSelectionState(ImmutableList.of(info), null));
}
Also used : CaretInfo(com.intellij.testFramework.EditorTestUtil.CaretInfo) LogicalPosition(com.intellij.openapi.editor.LogicalPosition) CaretAndSelectionState(com.intellij.testFramework.EditorTestUtil.CaretAndSelectionState)

Example 2 with CaretInfo

use of com.intellij.testFramework.EditorTestUtil.CaretInfo in project intellij by bazelbuild.

the class EditorTestHelper method setCaretPosition.

public void setCaretPosition(Editor editor, int lineNumber, int columnNumber) {
    final CaretInfo info = new CaretInfo(new LogicalPosition(lineNumber, columnNumber), null);
    EdtTestUtil.runInEdtAndWait((ThrowableRunnable<Throwable>) () -> EditorTestUtil.setCaretsAndSelection(editor, new CaretAndSelectionState(ImmutableList.of(info), null)));
}
Also used : CaretInfo(com.intellij.testFramework.EditorTestUtil.CaretInfo) LogicalPosition(com.intellij.openapi.editor.LogicalPosition) CaretAndSelectionState(com.intellij.testFramework.EditorTestUtil.CaretAndSelectionState)

Aggregations

LogicalPosition (com.intellij.openapi.editor.LogicalPosition)2 CaretAndSelectionState (com.intellij.testFramework.EditorTestUtil.CaretAndSelectionState)2 CaretInfo (com.intellij.testFramework.EditorTestUtil.CaretInfo)2