private void invokeLaterIfNeeded(@NotNull Runnable runnable) {
    if (project.isDefault()) {
      return;
    }

    StartupManagerEx.getInstanceEx(project).runAfterOpened(() -> {
      ModalityUiUtil.invokeLaterIfNeeded(ModalityState.defaultModalityState(), project.getDisposed(), runnable);
    });
  }
private void invokeLaterIfNeeded(@NotNull Runnable runnable)