( filePath: string, kind: NodeKind, name: string, line: number )
| 16 | * large codebases with many files containing similar symbols. |
| 17 | */ |
| 18 | export 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 |
no outgoing calls
no test coverage detected