public static void disposeTemplateEditor(@Nullable Editor templateEditor) {
    if (templateEditor != null && !templateEditor.isDisposed()) {
      final Project project = templateEditor.getProject();
      if (project != null && !project.isDisposed()) {
        final PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(templateEditor.getDocument());
        if (psiFile != null) {
          DaemonCodeAnalyzer.getInstance(project).setHighlightingEnabled(psiFile, true);
        }
      }
      EditorFactory.getInstance().releaseEditor(templateEditor);
    }
  }
public static void disposeTemplateEditor(@Nullable Editor templateEditor)