@Nullable
  public static ToolWindow ensureToolWindowContentInitialized(
      @NotNull Project project, @NotNull ProjectSystemId externalSystemId) {
    final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
    if (toolWindowManager == null) return null;

    final ToolWindow toolWindow =
        toolWindowManager.getToolWindow(externalSystemId.getReadableName());
    if (toolWindow == null) return null;

    if (toolWindow instanceof ToolWindowImpl) {
      ((ToolWindowImpl) toolWindow).ensureContentInitialized();
    }
    return toolWindow;
  }
 public static void ensureToolWindowInitialized(
     @NotNull Project project, @NotNull ProjectSystemId externalSystemId) {
   ToolWindowManager manager = ToolWindowManager.getInstance(project);
   if (!(manager instanceof ToolWindowManagerEx)) {
     return;
   }
   ToolWindowManagerEx managerEx = (ToolWindowManagerEx) manager;
   String id = externalSystemId.getReadableName();
   ToolWindow window = manager.getToolWindow(id);
   if (window != null) {
     return;
   }
   ToolWindowEP[] beans = Extensions.getExtensions(ToolWindowEP.EP_NAME);
   for (final ToolWindowEP bean : beans) {
     if (id.equals(bean.id)) {
       managerEx.initToolWindow(bean);
     }
   }
 }