Preserve errors order when publishing diagnostics

The `sbt-server` was prepending a new probem and not appending.

The result was a `textDocument/publishDiagnostics` notification
containing a inverted list of problems compare to what was show in the
sbt console.
This commit is contained in:
Thomas Droxler 2018-12-21 14:24:03 +01:00
parent f514f4fb78
commit a5388fed60
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ class LanguageServerReporter(
val pos = problem.position
pos.sourceFile.toOption foreach { sourceFile: File =>
problemsByFile.get(sourceFile) match {
case Some(xs: List[Problem]) => problemsByFile(sourceFile) = problem :: xs
case Some(xs: List[Problem]) => problemsByFile(sourceFile) = xs :+ problem
case _ => problemsByFile(sourceFile) = List(problem)
}
}