Promise<Object> (final @NotNull PlaybackContext context) { final ActionCallback actionCallback = new ActionCallbackProfilerStopper(); String input = extractCommandArgument(PREFIX); String[] args = input.split(" "); if (args.length == 1) { int offset = Integer.parseInt(args[0]); ApplicationManager.getApplication().invokeLater(() -> { Project project = context.getProject(); final Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor(); assert editor != null; goToOffset(context, actionCallback, editor, offset); }); } else { final int line = Integer.parseInt(args[0]) - 1; final int columnArg = Integer.parseInt(args[1]); final int column = columnArg == 0 ? 0 : columnArg - 1; ApplicationManager.getApplication().invokeLater(() -> { Project project = context.getProject(); final Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor(); assert editor != null; Document document = editor.getDocument(); if (line <= document.getLineCount()) { int lineStartOffset = document.getLineStartOffset(line); int lineLength = document.getLineEndOffset(line) - lineStartOffset; if (column > lineLength) { //noinspection TestOnlyProblems WriteCommandAction.runWriteCommandAction(project, () -> document.insertString(lineStartOffset + lineLength, IntStream.range(0, column - lineLength).mapToObj(i -> " ").collect(Collectors.joining()))); } int offset = lineStartOffset + column; goToOffset(context, actionCallback, editor, offset); } else { context.error("Line is out of range", getLine()); actionCallback.setRejected(); } }); } return Promises.toPromise(actionCallback); }