Skip to content

Commit

Permalink
improvement: deduplicate reports (#7048)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek authored Jan 8, 2025
1 parent cdf4dcd commit 73a8a32
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import scala.util.matching.Regex
import scala.meta.internal.metals.utils.LimitedFilesManager
import scala.meta.internal.metals.utils.TimestampedFile
import scala.meta.internal.mtags.CommonMtagsEnrichments._
import scala.meta.internal.mtags.MD5

trait ReportContext {
def unsanitized: Reporter
Expand Down Expand Up @@ -244,7 +245,11 @@ case class Report(
def fullText(withIdAndSummary: Boolean): String = {
val sb = new StringBuilder
if (withIdAndSummary) {
id.foreach(id => sb.append(s"${Report.idPrefix}$id\n"))
id.orElse(
error.map(error =>
MD5.compute(s"${name}:${error.getStackTrace().mkString("\n")}")
)
).foreach(id => sb.append(s"${Report.idPrefix}$id\n"))
}
path.foreach(path => sb.append(s"$path\n"))
error match {
Expand Down

0 comments on commit 73a8a32

Please sign in to comment.