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

Function runBelowChunks

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

Source from the content-addressed store, hash-verified

294}
295
296export async function runBelowChunks(chunks: RMarkdownChunk[] = _getChunks(),
297 line: number = _getStartLine()): Promise<void> {
298
299 const currentChunk = getCurrentChunk(chunks, line);
300 const nextChunk = getNextChunk(chunks, line);
301 if (!currentChunk || !nextChunk) {
302 return;
303 }
304 const nextChunkId = nextChunk.id;
305 const lastChunkId = chunks.length;
306
307 const codeRanges: vscode.Range[] = [];
308
309 // Only do something if current chunk is not the last chunk
310 if (currentChunk.id < lastChunkId) {
311 for (let i = nextChunkId; i <= lastChunkId; i++) {
312 const chunk = chunks.find(e => e.id === i);
313 if (chunk?.eval) {
314 codeRanges.push(chunk.codeRange);
315 }
316 }
317 await runChunksInTerm(codeRanges);
318 }
319}
320
321export async function runCurrentAndBelowChunks(chunks: RMarkdownChunk[] = _getChunks(),
322 line: number = _getStartLine()): Promise<void> {

Callers

nothing calls this directly

Calls 5

runChunksInTermFunction · 0.90
_getChunksFunction · 0.85
_getStartLineFunction · 0.85
getCurrentChunkFunction · 0.85
getNextChunkFunction · 0.85

Tested by

no test coverage detected