private void expandForChooseExpression(@NotNull PsiElement element, @NotNull Editor editor) {
    Project project = element.getProject();
    Document document = editor.getDocument();
    TextRange range = getRangeToRemove(element);
    document.deleteString(range.getStartOffset(), range.getEndOffset());
    TemplateManager manager = TemplateManager.getInstance(project);

    TemplateImpl template = myLiveTemplate.copy();
    template.addVariable("EXPR", new TextExpression(element.getText()), false);
    addTemplateVariables(element, template);
    manager.startTemplate(editor, template);
  }
private void expandForChooseExpression(@NotNull PsiElement element, @NotNull Editor editor)