| 429 | |
| 430 | // Label a definition node type as Class / Function / Interface / etc. |
| 431 | function getNodeDisplayLabel(nodeType: string): string { |
| 432 | if (nodeType.includes('class')) return 'Class'; |
| 433 | if (nodeType.includes('interface')) return 'Interface'; |
| 434 | if (nodeType.includes('trait')) return 'Trait'; |
| 435 | if (nodeType.includes('enum')) return 'Enum'; |
| 436 | if (nodeType.includes('module')) return 'Module'; |
| 437 | if (nodeType.includes('struct')) return 'Class'; // treat struct as class-like |
| 438 | if (nodeType.includes('impl')) return 'Class'; |
| 439 | return 'Function'; |
| 440 | } |
| 441 | |
| 442 | function valForLabel(label: string): number { |
| 443 | switch (label) { |