Skip to content

Commit

Permalink
improvement: deduplicate reports
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek committed Dec 18, 2024
1 parent 1ce512a commit 3cd23bf
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,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 @@ -235,7 +236,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 3cd23bf

Please sign in to comment.