* Check for blocks that failed to parse.
(dag: BlockDependencyDag, blockMap: Map<string, BlockInfo>)
| 469 | * Check for blocks that failed to parse. |
| 470 | */ |
| 471 | function checkParseErrors(dag: BlockDependencyDag, blockMap: Map<string, BlockInfo>): LintIssue[] { |
| 472 | const issues: LintIssue[] = [] |
| 473 | |
| 474 | for (const node of dag.nodes) { |
| 475 | if (node.error) { |
| 476 | const info = blockMap.get(node.id) |
| 477 | if (!info) continue |
| 478 | |
| 479 | issues.push({ |
| 480 | severity: 'error', |
| 481 | code: 'parse-error', |
| 482 | message: node.error.message ?? 'Failed to parse block', |
| 483 | blockId: node.id, |
| 484 | blockLabel: info.label, |
| 485 | notebookName: info.notebookName, |
| 486 | details: { errorType: node.error.type }, |
| 487 | }) |
| 488 | } |
| 489 | } |
| 490 | |
| 491 | return issues |
| 492 | } |
| 493 | |
| 494 | // ============================================================================ |
| 495 | // Integration and Input Checks |