(chunks: RMarkdownChunk[] = _getChunks(),
line: number = _getStartLine())
| 270 | } |
| 271 | |
| 272 | export async function runAboveChunks(chunks: RMarkdownChunk[] = _getChunks(), |
| 273 | line: number = _getStartLine()): Promise<void> { |
| 274 | const currentChunk = getCurrentChunk(chunks, line); |
| 275 | const previousChunk = getPreviousChunk(chunks, line); |
| 276 | if (!currentChunk || !previousChunk) { |
| 277 | return; |
| 278 | } |
| 279 | const firstChunkId = 1; |
| 280 | const previousChunkId = previousChunk.id; |
| 281 | |
| 282 | const codeRanges: vscode.Range[] = []; |
| 283 | |
| 284 | // Only do something if current chunk is not the first chunk |
| 285 | if (currentChunk.id > 1) { |
| 286 | for (let i = firstChunkId; i <= previousChunkId; i++) { |
| 287 | const chunk = chunks.find(e => e.id === i); |
| 288 | if (chunk?.eval) { |
| 289 | codeRanges.push(chunk.codeRange); |
| 290 | } |
| 291 | } |
| 292 | await runChunksInTerm(codeRanges); |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | export async function runBelowChunks(chunks: RMarkdownChunk[] = _getChunks(), |
| 297 | line: number = _getStartLine()): Promise<void> { |
nothing calls this directly
no test coverage detected