* Resolve service/helper method using name-based lookup
( serviceName: string, method: string, context: ResolutionContext )
| 723 | * Resolve service/helper method using name-based lookup |
| 724 | */ |
| 725 | function resolveServiceMethod( |
| 726 | serviceName: string, |
| 727 | method: string, |
| 728 | context: ResolutionContext |
| 729 | ): string | null { |
| 730 | // Look for the method in files matching the service name |
| 731 | const methodCandidates = context.getNodesByName(method); |
| 732 | const stripped = serviceName.replace(/(Service|Helper|Utils?)$/i, '').toLowerCase(); |
| 733 | const methodNodes = methodCandidates.filter( |
| 734 | (n) => (n.kind === 'method' || n.kind === 'function') && |
| 735 | n.filePath.toLowerCase().includes(stripped) |
| 736 | ); |
| 737 | |
| 738 | if (methodNodes.length > 0) return methodNodes[0]!.id; |
| 739 | |
| 740 | return null; |
| 741 | } |
| 742 | |
| 743 | /** |
| 744 | * Detect language from file extension |
no test coverage detected