
    updateCounts()
  }

  func updateCounts() {
    errorsCount.stringValue = "\(workbench?.diagnostics(severity: .error).values.flatMap{$0}.count ?? 0)"
    warningsCount.stringValue = "\(workbench?.diagnostics(severity: .warning).values.flatMap{$0}.count ?? 0)"

    errorsCount.sizeToFit()
    warningsCount.sizeToFit()

    let width = errorsCount.frame.size.width + warningsCount.frame.size.width + 65
    self.view.setFrameSize(NSSize(width: width, height: self.view.frame.size.height))
    self.view.invalidateIntrinsicContentSize()
  }