private void flushWhenSmart(boolean scroll) {
    DumbService.getInstance(myProject).runWhenSmart(() -> {
      if (!myIsOutputPaused) {
        new OutputFlusher().doFlush();
        if (scroll) {
          myTreeView.scrollToLastMessage();
        }
      }
    });
  }
private void flushWhenSmart(boolean scroll)