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

Function goToChunk

src/rmarkdown/chunks.ts:357–366  ·  view source on GitHub ↗
(chunk: RMarkdownChunk)

Source from the content-addressed store, hash-verified

355}
356
357async function goToChunk(chunk: RMarkdownChunk) {
358 // Move cursor 1 line below 'chunk start line'
359 const line = chunk.startLine + 1;
360 const editor = vscode.window.activeTextEditor;
361 if (!editor) {
362 return;
363 }
364 editor.selection = new vscode.Selection(line, 0, line, 0);
365 await vscode.commands.executeCommand('revealLine', { lineNumber: line, at: 'center' });
366}
367
368export function goToPreviousChunk(chunks: RMarkdownChunk[] = _getChunks(),
369 line: number = _getStartLine()): void {

Callers 3

runCurrentChunkAndMoveFunction · 0.85
goToPreviousChunkFunction · 0.85
goToNextChunkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected