@Override
      public void templateFinished(@NotNull Template template, boolean brokenOff) {
        if (index + 1 < templates.size()){
          ApplicationManager.getApplication().invokeLater(() -> WriteCommandAction.runWriteCommandAction(myProject, ()->
              runTemplates(myProject, editor, templates, index + 1)
          ));
        }
      }
@Override
      public void templateFinished(@NotNull Template template, boolean brokenOff)