Skip to content

Commit

Permalink
Merge pull request #736 from eed3si9n/bport/range
Browse files Browse the repository at this point in the history
[1.3.x] workaround Scaladoc range position bug
  • Loading branch information
eed3si9n authored Feb 3, 2020
2 parents 2b61287 + ff5b915 commit 77a3d47
Showing 1 changed file with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,24 @@ private object DelegatingReporter {
val endOffset = if (pos.isRange) Some(pos.end) else None
val startLine = if (pos.isRange) Some(lineOf(pos.start)) else None
val startColumn = if (pos.isRange) Some(columnOf(pos.start)) else None
val endLine = if (pos.isRange) Some(lineOf(pos.end)) else None
val endColumn = if (pos.isRange) Some(columnOf(pos.end)) else None
val endLine =
if (pos.isRange)
try {
Some(lineOf(pos.end))
} catch {
// work around for https://github.com/scala/bug/issues/11865 by falling back to start pos
case _: ArrayIndexOutOfBoundsException =>
startLine
} else None
val endColumn =
if (pos.isRange)
try {
Some(columnOf(pos.end))
} catch {
// work around for https://github.com/scala/bug/issues/11865 by falling back to start pos
case _: ArrayIndexOutOfBoundsException =>
startColumn
} else None

new PositionImpl(
Option(sourcePath),
Expand Down

0 comments on commit 77a3d47

Please sign in to comment.