package scala.meta.internal.semanticdb.scalac

import scala.reflect.internal.util.Position
import scala.tools.nsc.reporters.{Reporter, StoreReporter}

class SemanticdbReporter(underlying: Reporter) extends StoreReporter {
  override protected def info0(
      pos: Position,
      msg: String,
      severity: Severity,
      force: Boolean
  ): Unit = {
    super.info0(pos, msg, severity, force)
    severity.id match {
      case 0 => underlying.info(pos, msg, force)
      case 1 => underlying.warning(pos, msg)
      case 2 => underlying.error(pos, msg)
      case _ =>
    }
    // underlying reporter may have filtered out the message
    updateCounts()
  }

  private def updateCounts(): Unit = {
    INFO.count = underlying.INFO.count
    WARNING.count = underlying.WARNING.count
    ERROR.count = underlying.ERROR.count
  }
}

package scala.meta.internal.semanticdb.scalac

import scala.reflect.internal.util.Position
import scala.tools.nsc.reporters.{Reporter, StoreReporter}

class SemanticdbReporter(underlying: Reporter) extends StoreReporter {
  override protected def info0(
      pos: Position,
      msg: String,
      severity: Severity,
      force: Boolean
  ): Unit = {
    super.info0(pos, msg, severity, force)
    severity.id match {
      case 0 => underlying.info(pos, msg, force)
      case 1 => underlying.warning(pos, msg)
      case 2 => underlying.error(pos, msg)
      case _ =>
    }

  }

  override def hasErrors: Boolean = underlying.hasErrors

  override def hasWarnings: Boolean = underlying.hasWarnings

}

Fix compile error reporting when using smenaticdb plugin
Fix compile error reporting when using smenaticdb plugin
