@Override
    protected boolean isEnabledForCaret(@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) {
      final TemplateState templateState = TemplateManagerImpl.getTemplateState(editor);
      return templateState != null && !templateState.isFinished();
    }
@Override
    protected boolean isEnabledForCaret(@NotNull Editor editor, @NotNull Caret caret, DataContext dataContext)