private void showMessageWhenNoHighlights(Project project, PsiFile file, Editor editor, int caretOffset) {
    DaemonCodeAnalyzerImpl codeHighlighter = (DaemonCodeAnalyzerImpl)DaemonCodeAnalyzer.getInstance(project);
    HintManagerImpl hintManager = HintManagerImpl.getInstanceImpl();
    if (codeHighlighter.isErrorAnalyzingFinished(file)) {
      hintManager.showInformationHint(editor, InspectionsBundle.message("no.errors.found.in.this.file"));
      return;
    }

    JComponent component = HintUtil.createInformationLabel(InspectionsBundle.message("error.analysis.is.in.progress"), null, null, null);
    AccessibleContextUtil.setName(component, IdeBundle.message("information.hint.accessible.context.name"));
    LightweightHint hint = new LightweightHint(component);
    Point p = hintManager.getHintPosition(hint, editor, HintManager.ABOVE);

    Disposable hintDisposable = Disposer.newDisposable("GotoNextErrorHandler.showMessageWhenNoHighlights");
    Disposer.register(project, hintDisposable);
    hint.addHintListener((eventObject) -> {
      Disposer.dispose(hintDisposable);
    });

    MessageBusConnection busConnection = project.getMessageBus().connect(hintDisposable);
    busConnection.subscribe(DaemonCodeAnalyzer.DAEMON_EVENT_TOPIC, new DaemonCodeAnalyzer.DaemonListener() {
      @Override
      public void daemonFinished() {
        hint.hide();
        gotoNextError(project, editor, file, caretOffset);
      }
    });

    hintManager.showEditorHint(hint, editor, p,
                               HintManager.HIDE_BY_ANY_KEY | HintManager.HIDE_BY_TEXT_CHANGE | HintManager.HIDE_BY_SCROLLING,
                               0, false, HintManager.ABOVE);
  }
private void showMessageWhenNoHighlights(Project project, PsiFile file, Editor editor, int caretOffset)