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

Function generateNodeId

src/extraction/tree-sitter-helpers.ts:18–30  ·  view source on GitHub ↗
(
  filePath: string,
  kind: NodeKind,
  name: string,
  line: number
)

Source from the content-addressed store, hash-verified

16 * large codebases with many files containing similar symbols.
17 */
18export function generateNodeId(
19 filePath: string,
20 kind: NodeKind,
21 name: string,
22 line: number
23): string {
24 const hash = crypto
25 .createHash('sha256')
26 .update(`${filePath}:${kind}:${name}:${line}`)
27 .digest('hex')
28 .substring(0, 32);
29 return `${kind}:${hash}`;
30}
31
32/**
33 * Extract text from a syntax node

Callers 15

createFileNodeMethod · 0.90
extractComponentMethod · 0.90
extractFunctionTagMethod · 0.90
createComponentNodeMethod · 0.90
createFileNodeMethod · 0.90
extractMapperMethod · 0.90
createComponentNodeMethod · 0.90
createComponentNodeMethod · 0.90
createComponentNodeMethod · 0.90
createNodeMethod · 0.90
createFileNodeMethod · 0.90
parseComponentsMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected