Search in sources :

Example 1 with CaretAndSelectionState

use of com.intellij.testFramework.EditorTestUtil.CaretAndSelectionState 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 CaretAndSelectionState

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

the class EditorTestHelper method setCaretPosition.

public void setCaretPosition(Editor editor, int lineNumber, int columnNumber) throws Throwable {
    final CaretInfo info = new CaretInfo(new LogicalPosition(lineNumber, columnNumber), null);
    EdtTestUtil.runInEdtAndWait(() -> 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