(rs_range: any, targetDocument: TextDocument)
| 397 | } |
| 398 | |
| 399 | function parseRange(rs_range: any, targetDocument: TextDocument) { |
| 400 | if (rs_range.start.length !== 2 || rs_range.end.length !== 2) { |
| 401 | throw ('an rstudioapi range must be an object containing two numeric arrays'); |
| 402 | } |
| 403 | return ( |
| 404 | targetDocument.validateRange( |
| 405 | new Range( |
| 406 | new Position(toVSCCoord(rs_range.start[0]), toVSCCoord(rs_range.start[1])), |
| 407 | new Position(toVSCCoord(rs_range.end[0]), toVSCCoord(rs_range.end[1])) |
| 408 | ) |
| 409 | )); |
| 410 | } |
| 411 | |
| 412 | function assertSupportedEditOperation(operation: string) { |
| 413 | if (operation !== 'insertText' && operation !== 'modifyRange') { |
no test coverage detected