(position: DiagnosticTextPosition,
lines: TextRangeCollection<TextRange>)
| 49 | |
| 50 | // Translates a position (line and col) into a file offset. |
| 51 | export function convertPositionToOffset(position: DiagnosticTextPosition, |
| 52 | lines: TextRangeCollection<TextRange>): number | undefined { |
| 53 | if (position.line >= lines.count) { |
| 54 | return undefined; |
| 55 | } |
| 56 | |
| 57 | return lines.getItemAt(position.line).start + position.column; |
| 58 | } |
no test coverage detected
searching dependent graphs…