(chunks: RMarkdownChunk[] = _getChunks(),
line: number = _getStartLine())
| 294 | } |
| 295 | |
| 296 | export 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 | |
| 321 | export async function runCurrentAndBelowChunks(chunks: RMarkdownChunk[] = _getChunks(), |
| 322 | line: number = _getStartLine()): Promise<void> { |
nothing calls this directly
no test coverage detected