static void setOrRefreshErrorStripeRenderer(
      @NotNull EditorMarkupModel editorMarkupModel,
      @NotNull Project project,
      @NotNull Document document,
      PsiFile file) {
    ApplicationManager.getApplication().assertIsDispatchThread();
    if (!editorMarkupModel.isErrorStripeVisible()
        || !DaemonCodeAnalyzer.getInstance(project).isHighlightingAvailable(file)) {
      return;
    }
    ErrorStripeRenderer renderer = editorMarkupModel.getErrorStripeRenderer();
    if (renderer instanceof TrafficLightRenderer) {
      TrafficLightRenderer tlr = (TrafficLightRenderer) renderer;
      tlr.refresh();
      ((EditorMarkupModelImpl) editorMarkupModel).repaintVerticalScrollBar();
      if (tlr.myFile == null || tlr.myFile.isValid()) return;
      Disposer.dispose(tlr);
    }
    EditorImpl editor = (EditorImpl) editorMarkupModel.getEditor();

    if (!editor.isDisposed()) {
      renderer = new TrafficLightRenderer(project, document, file);
      Disposer.register(editor.getDisposable(), (Disposable) renderer);
      editorMarkupModel.setErrorStripeRenderer(renderer);
    }
  }
 @Override
 public boolean isDisposed() {
   return !myDisposed && myDelegate.isDisposed();
 }