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

Function selectCurrentChunk

src/rmarkdown/chunks.ts:384–397  ·  view source on GitHub ↗
(chunks: RMarkdownChunk[] = _getChunks(),
    line: number = _getStartLine())

Source from the content-addressed store, hash-verified

382}
383
384export function selectCurrentChunk(chunks: RMarkdownChunk[] = _getChunks(),
385 line: number = _getStartLine()): void {
386 const editor = vscode.window.activeTextEditor;
387 const currentChunk = getCurrentChunk(chunks, line);
388 if (!editor || !currentChunk || !isWithinChunk(currentChunk, line)) {
389 return;
390 }
391 const lines = editor.document.getText().split(/\r?\n/);
392
393 editor.selection = new vscode.Selection(
394 currentChunk.startLine, 0,
395 currentChunk.endLine, lines[currentChunk.endLine].length
396 );
397}
398
399export function getCodeLenses(chunks: RMarkdownChunk[], token: vscode.CancellationToken): vscode.CodeLens[] {
400

Callers

nothing calls this directly

Calls 4

_getChunksFunction · 0.85
_getStartLineFunction · 0.85
getCurrentChunkFunction · 0.85
isWithinChunkFunction · 0.85

Tested by

no test coverage detected