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

Function resurrectRefFromDroppedEdge

src/extraction/index.ts:1400–1415  ·  view source on GitHub ↗

* Resurrect a resolution edge that is about to be dropped (its target symbol * was removed, renamed, or its whole file deleted) as the ORIGINAL unresolved * reference that created it, read from the refName/refKind stamp * `createEdges` writes into edge metadata. Inserted as status='pending', the

(
  e: Edge & { sourceFilePath: string; sourceLanguage: Language }
)

Source from the content-addressed store, hash-verified

1398 * somewhere a full re-index never would. Silent beats wrong.
1399 */
1400function resurrectRefFromDroppedEdge(
1401 e: Edge & { sourceFilePath: string; sourceLanguage: Language }
1402): UnresolvedReference | null {
1403 const refName = e.metadata?.refName;
1404 if (typeof refName !== 'string' || refName.length === 0) return null;
1405 const refKind = typeof e.metadata?.refKind === 'string' ? (e.metadata.refKind as ReferenceKind) : e.kind;
1406 return {
1407 fromNodeId: e.source,
1408 referenceName: refName,
1409 referenceKind: refKind,
1410 line: e.line ?? 0,
1411 column: e.column ?? 0,
1412 filePath: e.sourceFilePath,
1413 language: e.sourceLanguage,
1414 };
1415}
1416
1417/**
1418 * Extraction orchestrator

Callers 2

syncMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected