Skip to content

Commit

Permalink
com-lihaoyi#1011 Correct range end position in problem reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
joan38 committed Nov 30, 2020
1 parent 7df6c0e commit 074dd74
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bsp/src/mill/bsp/BspLoggedReporter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ class BspLoggedReporter(client: bsp.BuildClient,
val line = pos.line.map(_ - 1) // Zinc's range starts at 1 whereas BSP 0
val start = new bsp.Position(
pos.startLine.orElse(line).getOrElse[Int](0),
pos.startOffset.orElse(pos.pointer).getOrElse[Int](0)
pos.endColumn.orElse(pos.pointer).getOrElse[Int](0)
)
val end = new bsp.Position(
pos.endLine.orElse(line).getOrElse[Int](start.getLine.intValue()),
pos.endOffset.orElse(pos.pointer).getOrElse[Int](start.getCharacter.intValue())
pos.endColumn.orElse(pos.pointer).getOrElse[Int](start.getCharacter.intValue())
)
val diagnostic = new bsp.Diagnostic(new bsp.Range(start, end), problem.message)
diagnostic.setCode(pos.lineContent)
diagnostic.setSource("compiler from mill")
diagnostic.setSource("mill")
diagnostic.setSeverity(
problem.severity match {
case mill.api.Info => bsp.DiagnosticSeverity.INFORMATION
Expand Down

0 comments on commit 074dd74

Please sign in to comment.