From 4ee14ed976f3e2f84e3da7e90b67a48f680d1a36 Mon Sep 17 00:00:00 2001 From: Gabriele Petronella Date: Mon, 11 Jun 2018 23:02:23 +0200 Subject: [PATCH 1/2] Append line and column to the default reporter --- .../main/scala/bloop/reporter/DefaultReporterFormat.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/src/main/scala/bloop/reporter/DefaultReporterFormat.scala b/backend/src/main/scala/bloop/reporter/DefaultReporterFormat.scala index 8030a40785..cf0f2436f1 100644 --- a/backend/src/main/scala/bloop/reporter/DefaultReporterFormat.scala +++ b/backend/src/main/scala/bloop/reporter/DefaultReporterFormat.scala @@ -25,8 +25,10 @@ object DefaultReporterFormat extends (ConfigurableReporter => ReporterFormat) { class DefaultReporterFormat(reporter: ConfigurableReporter) extends ReporterFormat(reporter) { protected def formatSourcePath(problem: Problem): Option[String] = - problem.position.pfile.map { f => - colored(reporter.config.sourcePathColor, f) + problem.position.pfile.map { filePath => + val line = toOption(problem.position.line).map(":" + _).getOrElse("") + val column = toOption(problem.position.pointer).map(o => s":${o + 1}").getOrElse("") + colored(reporter.config.sourcePathColor, s"$filePath$line$column") } protected def formatSource(problem: Problem): Option[String] = From 7b42db0af85d725ff0c9db45f1880208a58d6f9a Mon Sep 17 00:00:00 2001 From: Gabriele Petronella Date: Tue, 12 Jun 2018 14:33:56 +0200 Subject: [PATCH 2/2] Move :line:column outside of colored formatter --- .../src/main/scala/bloop/reporter/DefaultReporterFormat.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/scala/bloop/reporter/DefaultReporterFormat.scala b/backend/src/main/scala/bloop/reporter/DefaultReporterFormat.scala index cf0f2436f1..16f1fdc30c 100644 --- a/backend/src/main/scala/bloop/reporter/DefaultReporterFormat.scala +++ b/backend/src/main/scala/bloop/reporter/DefaultReporterFormat.scala @@ -28,7 +28,7 @@ class DefaultReporterFormat(reporter: ConfigurableReporter) extends ReporterForm problem.position.pfile.map { filePath => val line = toOption(problem.position.line).map(":" + _).getOrElse("") val column = toOption(problem.position.pointer).map(o => s":${o + 1}").getOrElse("") - colored(reporter.config.sourcePathColor, s"$filePath$line$column") + colored(reporter.config.sourcePathColor, filePath) + s"$line$column" } protected def formatSource(problem: Problem): Option[String] =