(node: GraphNode)
| 190 | } |
| 191 | |
| 192 | process(node: GraphNode): StageMutation { |
| 193 | if (node.type !== 'File') { |
| 194 | return { nodes: [node], relationships: [] }; |
| 195 | } |
| 196 | |
| 197 | const filePath = node.properties?.path as string | undefined; |
| 198 | if (!filePath) { |
| 199 | return { nodes: [node], relationships: [] }; |
| 200 | } |
| 201 | |
| 202 | const ext = getExtension(filePath); |
| 203 | const language = detectLanguage(ext); |
| 204 | if (!language) { |
| 205 | return { nodes: [node], relationships: [] }; |
| 206 | } |
| 207 | |
| 208 | const parser = getParserForLanguage(language, ext); |
| 209 | const extractor = getExtractor(language); |
| 210 | if (!parser || !extractor) { |
| 211 | return { nodes: [node], relationships: [] }; |
| 212 | } |
| 213 | |
| 214 | const fileId = node.id; |
| 215 | const content = this.getContent(fileId); |
| 216 | if (content === undefined) { |
| 217 | return { nodes: [node], relationships: [] }; |
| 218 | } |
| 219 | |
| 220 | const nodes: GraphNode[] = [node]; // File node passes through |
| 221 | const rels: GraphRelationship[] = []; |
| 222 | |
| 223 | try { |
| 224 | const tree = parser.parse(content); |
| 225 | if (!tree) { |
| 226 | return { nodes: [node], relationships: [] }; |
| 227 | } |
| 228 | |
| 229 | const extraction = extractor(tree.rootNode); |
| 230 | |
| 231 | // Initialize file registry entry |
| 232 | this.registries.fileRegistry.set(fileId, new Map()); |
| 233 | |
| 234 | // Process symbols → graph nodes + registries |
| 235 | for (const sym of extraction.symbols) { |
| 236 | processSymbol( |
| 237 | sym, |
| 238 | fileId, |
| 239 | language, |
| 240 | this.registries, |
| 241 | this.allCallInfo, |
| 242 | nodes, |
| 243 | rels, |
| 244 | this.emittedNodeIds, |
| 245 | ); |
| 246 | } |
| 247 | |
| 248 | // Import analysis |
| 249 | const rootNode = extraction.rootNode; |
nothing calls this directly
no test coverage detected