don't print weird position link for dummy positions

This commit is contained in:
Irmen de Jong 2023-03-16 23:37:33 +01:00
parent 1152191f48
commit b399b0f182

View File

@ -7,6 +7,9 @@ import kotlin.io.path.absolute
data class Position(val file: String, val line: Int, val startCol: Int, val endCol: Int) {
override fun toString(): String = "[$file: line $line col ${startCol+1}-${endCol+1}]"
fun toClickableStr(): String {
if(this===DUMMY) {
return ""
}
return try {
val path = Path(file).absolute().normalize().toString()
"file://$path:$line:$startCol:"