@Override
  public void setHighlighter(@NotNull EditorHighlighter highlighter) {
    if (isReleased) {
      // do not set highlighter to the released editor
      return;
    }

    assertIsDispatchThread();
    WriteIntentReadAction.run((Runnable)() -> {
      Document document = getDocument();
      Disposer.dispose(myHighlighterDisposable);

      document.addDocumentListener(highlighter);
      myHighlighterDisposable = () -> document.removeDocumentListener(highlighter);
      Disposer.register(myDisposable, myHighlighterDisposable);
      highlighter.setEditor(this);
      highlighter.setText(document.getImmutableCharSequence());
      if (!(highlighter instanceof EmptyEditorHighlighter)) {
        EditorHighlighterCache.rememberEditorHighlighterForCachesOptimization(document, highlighter);
      }

      EditorHighlighter oldHighlighter = myHighlighter;
      myHighlighter = highlighter;
      myPropertyChangeSupport.firePropertyChange(PROP_HIGHLIGHTER, oldHighlighter, highlighter);

      if (myPanel != null) {
        reinitSettings();
      }
    });
  }
@Override
  public void setHighlighter(@NotNull EditorHighlighter highlighter)