MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / getTypeDescendants

Method getTypeDescendants

src/graph/traversal.ts:463–486  ·  view source on GitHub ↗
(
    nodeId: string,
    nodes: Map<string, Node>,
    edges: Edge[],
    visited: Set<string>
  )

Source from the content-addressed store, hash-verified

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

Callers 1

getTypeHierarchyMethod · 0.95

Calls 5

hasMethod · 0.80
getNodesByIdsMethod · 0.80
getMethod · 0.65
getIncomingEdgesMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected