(offset)
| 168 | } |
| 169 | |
| 170 | fromOffset(offset) { |
| 171 | let lineToIndex = getLineToIndex(this) |
| 172 | let lastLine = lineToIndex[lineToIndex.length - 1] |
| 173 | |
| 174 | let min = 0 |
| 175 | if (offset >= lastLine) { |
| 176 | min = lineToIndex.length - 1 |
| 177 | } else { |
| 178 | let max = lineToIndex.length - 2 |
| 179 | let mid |
| 180 | while (min < max) { |
| 181 | mid = min + ((max - min) >> 1) |
| 182 | if (offset < lineToIndex[mid]) { |
| 183 | max = mid - 1 |
| 184 | } else if (offset >= lineToIndex[mid + 1]) { |
| 185 | min = mid + 1 |
| 186 | } else { |
| 187 | min = mid |
| 188 | break |
| 189 | } |
| 190 | } |
| 191 | } |
| 192 | return { |
| 193 | col: offset - lineToIndex[min] + 1, |
| 194 | line: min + 1 |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | mapResolve(file) { |
| 199 | if (/^\w+:\/\//.test(file)) { |
no test coverage detected