| 406 | |
| 407 | // Map file extension → query key |
| 408 | function getLanguageQueryKey(path: string): string | null { |
| 409 | const ext = path.match(/\.([a-zA-Z0-9]+)$/)?.[1]?.toLowerCase(); |
| 410 | switch (ext) { |
| 411 | case 'py': return 'python'; |
| 412 | case 'js': case 'jsx': return 'javascript'; |
| 413 | case 'ts': case 'tsx': return 'typescript'; |
| 414 | case 'java': return 'java'; |
| 415 | case 'c': case 'h': return 'c'; |
| 416 | case 'cpp': case 'hpp': case 'cc': return 'cpp'; |
| 417 | case 'go': return 'go'; |
| 418 | case 'rs': return 'rust'; |
| 419 | case 'rb': return 'ruby'; |
| 420 | case 'php': return 'php'; |
| 421 | case 'kt': case 'kts': return 'kotlin'; |
| 422 | case 'dart': return 'dart'; |
| 423 | case 'cs': return 'csharp'; |
| 424 | case 'swift': return 'swift'; |
| 425 | case 'pl': case 'pm': return 'perl'; |
| 426 | default: return null; |
| 427 | } |
| 428 | } |
| 429 | |
| 430 | // Label a definition node type as Class / Function / Interface / etc. |
| 431 | function getNodeDisplayLabel(nodeType: string): string { |