Ignore intervals that has no mapping for origin line (KT-12896)

This commit is contained in:
Nikolay Krasko
2016-08-01 17:48:00 +03:00
parent 2dd7470cdc
commit a9ee10a8b7
5 changed files with 113 additions and 1 deletions
@@ -352,6 +352,10 @@ data class RangeMapping(val source: Int, val dest: Int, var range: Int = 1, var
return skip || (dest <= destLine && destLine < dest + range)
}
fun hasMappingForSource(sourceLine: Int): Boolean {
return skip || (source <= sourceLine && sourceLine < source + range)
}
fun mapDestToSource(destLine: Int): Int {
return if (skip) -1 else source + (destLine - dest)
}