aboutsummaryrefslogtreecommitdiff
path: root/sbt-bridge
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2017-03-14 14:19:37 +0100
committerGuillaume Martres <smarter@ubuntu.com>2017-03-14 14:19:37 +0100
commit4885c6a54355f43468f982fdba8103e8be533407 (patch)
tree4ed3c6a9d0bfc30fdf8243cb1b791512978acf0c /sbt-bridge
parent961201e1f6d8f9efa19f88ddc1204a0f20aaab1c (diff)
downloaddotty-4885c6a54355f43468f982fdba8103e8be533407.tar.gz
dotty-4885c6a54355f43468f982fdba8103e8be533407.tar.bz2
dotty-4885c6a54355f43468f982fdba8103e8be533407.zip
sbt-bridge: simpler way to get file path
Diffstat (limited to 'sbt-bridge')
-rw-r--r--sbt-bridge/src/xsbt/DelegatingReporter.scala9
1 files changed, 5 insertions, 4 deletions
diff --git a/sbt-bridge/src/xsbt/DelegatingReporter.scala b/sbt-bridge/src/xsbt/DelegatingReporter.scala
index 17a52feaa..d0a4e0bf7 100644
--- a/sbt-bridge/src/xsbt/DelegatingReporter.scala
+++ b/sbt-bridge/src/xsbt/DelegatingReporter.scala
@@ -28,17 +28,18 @@ final class DelegatingReporter(delegate: xsbti.Reporter) extends Reporter
}
val position =
- if (cont.pos.exists)
+ if (cont.pos.exists) {
+ val src = cont.pos.source
new Position {
+ val sourceFile: Maybe[java.io.File] = maybe(Option(src.file.file))
+ val sourcePath: Maybe[String] = maybe(Option(src.file.path))
val line: Maybe[Integer] = Maybe.just(cont.pos.line)
val lineContent: String = cont.pos.lineContent
val offset: Maybe[Integer] = Maybe.just(cont.pos.point)
val pointer: Maybe[Integer] = Maybe.just(cont.pos.point)
val pointerSpace: Maybe[String] = Maybe.just(" " * cont.pos.point)
- val sourceFile: Maybe[java.io.File] = maybe(Option(cont.pos.source.file.file))
- val sourcePath: Maybe[String] = maybe(Option(cont.pos.source.file.file).map(_.getPath))
}
- else
+ } else
noPosition
val sb = new StringBuilder()