Add info about the end of range in scripting REPL compiler messages

This commit is contained in:
Ilya Muradyan
2020-02-12 18:57:52 +03:00
committed by Ilya Chernikov
parent a70a128d9e
commit af251cafa4
7 changed files with 115 additions and 14 deletions
@@ -37,10 +37,20 @@ internal class ScriptDiagnosticsMessageCollector(private val parentMessageCollec
if (mappedSeverity != null) {
val mappedLocation = location?.let {
if (it.line < 0 && it.column < 0) null // special location created by CompilerMessageLocation.create
else if (it.lineEnd < 0 && it.columnEnd < 0) SourceCode.Location(
SourceCode.Position(
it.line,
it.column
)
)
else SourceCode.Location(
SourceCode.Position(
it.line,
it.column
),
SourceCode.Position(
it.lineEnd,
it.columnEnd
)
)
}