PopupStep (String selectedValue, boolean finalChoice) { WriteCommandAction.runWriteCommandAction(myProject, () -> editor.getDocument() .insertString(editor.getCaretModel().getOffset(), "${" + selectedValue + "}")); return FINAL_CHOICE; }