Add info about the end of range in scripting REPL compiler messages
This commit is contained in:
committed by
Ilya Chernikov
parent
a70a128d9e
commit
af251cafa4
+20
-7
@@ -19,10 +19,12 @@ package org.jetbrains.kotlin.cli.common.messages
|
||||
import java.io.Serializable
|
||||
|
||||
data class CompilerMessageLocation private constructor(
|
||||
val path: String,
|
||||
val line: Int,
|
||||
val column: Int,
|
||||
val lineContent: String?
|
||||
val path: String,
|
||||
val line: Int,
|
||||
val column: Int,
|
||||
val lineEnd: Int,
|
||||
val columnEnd: Int,
|
||||
val lineContent: String?
|
||||
) : Serializable {
|
||||
override fun toString(): String =
|
||||
path + (if (line != -1 || column != -1) " ($line:$column)" else "")
|
||||
@@ -30,12 +32,23 @@ data class CompilerMessageLocation private constructor(
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun create(path: String?): CompilerMessageLocation? =
|
||||
create(path, -1, -1, null)
|
||||
create(path, -1, -1, null)
|
||||
|
||||
@JvmStatic
|
||||
fun create(path: String?, line: Int, column: Int, lineContent: String?): CompilerMessageLocation? =
|
||||
if (path == null) null else CompilerMessageLocation(path, line, column, lineContent)
|
||||
if (path == null) null else CompilerMessageLocation(path, line, column, -1, -1, lineContent)
|
||||
|
||||
private val serialVersionUID: Long = 8228357578L
|
||||
@JvmStatic
|
||||
fun create(
|
||||
path: String?,
|
||||
lineStart: Int,
|
||||
columnStart: Int,
|
||||
lineEnd: Int?,
|
||||
columnEnd: Int?,
|
||||
lineContent: String?
|
||||
): CompilerMessageLocation? =
|
||||
if (path == null) null else CompilerMessageLocation(path, lineStart, columnStart, lineEnd ?: -1, columnEnd ?: -1, lineContent)
|
||||
|
||||
private val serialVersionUID: Long = 8228357579L
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user