MCPcopy Create free account
hub / github.com/REditorSupport/vscode-R / parseRange

Function parseRange

src/rstudioapi.ts:399–410  ·  view source on GitHub ↗
(rs_range: any, targetDocument: TextDocument)

Source from the content-addressed store, hash-verified

397}
398
399function 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
412function assertSupportedEditOperation(operation: string) {
413 if (operation !== 'insertText' && operation !== 'modifyRange') {

Callers 2

insertOrModifyTextFunction · 0.85
setSelectionsFunction · 0.85

Calls 1

toVSCCoordFunction · 0.85

Tested by

no test coverage detected