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

Function runPreviousChunk

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

Source from the content-addressed store, hash-verified

244}
245
246export async function runPreviousChunk(chunks: RMarkdownChunk[] = _getChunks(),
247 line: number = _getStartLine()): Promise<void> {
248 const currentChunk = getCurrentChunk(chunks, line);
249 const previousChunk = getPreviousChunk(chunks, line);
250
251 // Case: cursor is below the last chunk, run last chunk
252 if (currentChunk && line > currentChunk.endLine) {
253 await(runChunksInTerm([currentChunk.codeRange]));
254 // Case: currentChunk is not the first chunk, so run previousChunk
255 } else if (previousChunk && previousChunk !== currentChunk) {
256 await runChunksInTerm([previousChunk.codeRange]);
257 }
258
259}
260
261export async function runNextChunk(chunks: RMarkdownChunk[] = _getChunks(),
262 line: number = _getStartLine()): Promise<void> {

Callers

nothing calls this directly

Calls 5

runChunksInTermFunction · 0.90
_getChunksFunction · 0.85
_getStartLineFunction · 0.85
getCurrentChunkFunction · 0.85
getPreviousChunkFunction · 0.85

Tested by

no test coverage detected