(
nodeId: string,
nodes: Map<string, Node>,
edges: Edge[],
visited: Set<string>
)
| 461 | } |
| 462 | |
| 463 | private getTypeDescendants( |
| 464 | nodeId: string, |
| 465 | nodes: Map<string, Node>, |
| 466 | edges: Edge[], |
| 467 | visited: Set<string> |
| 468 | ): void { |
| 469 | if (visited.has(nodeId)) { |
| 470 | return; |
| 471 | } |
| 472 | visited.add(nodeId); |
| 473 | |
| 474 | const incomingEdges = this.queries.getIncomingEdges(nodeId, ['extends', 'implements']); |
| 475 | if (incomingEdges.length === 0) return; |
| 476 | const children = this.queries.getNodesByIds(incomingEdges.map((e) => e.source)); |
| 477 | |
| 478 | for (const edge of incomingEdges) { |
| 479 | const childNode = children.get(edge.source); |
| 480 | if (childNode && !nodes.has(childNode.id)) { |
| 481 | nodes.set(childNode.id, childNode); |
| 482 | edges.push(edge); |
| 483 | this.getTypeDescendants(childNode.id, nodes, edges, visited); |
| 484 | } |
| 485 | } |
| 486 | } |
| 487 | |
| 488 | /** |
| 489 | * Find all usages of a symbol |
no test coverage detected