(name: string, context: ResolutionContext)
| 460 | } |
| 461 | |
| 462 | function resolveHelper(name: string, context: ResolutionContext): string | null { |
| 463 | const snakeName = name.replace(/([A-Z])/g, '_$1').toLowerCase().slice(1); |
| 464 | const helperPath = `app/helpers/${snakeName}.rb`; |
| 465 | |
| 466 | if (context.fileExists(helperPath)) { |
| 467 | const nodes = context.getNodesInFile(helperPath); |
| 468 | const helperNode = nodes.find( |
| 469 | (n) => n.kind === 'module' && n.name === name |
| 470 | ); |
| 471 | if (helperNode) { |
| 472 | return helperNode.id; |
| 473 | } |
| 474 | } |
| 475 | |
| 476 | return null; |
| 477 | } |
| 478 | |
| 479 | function resolveService(name: string, context: ResolutionContext): string | null { |
| 480 | const snakeName = name.replace(/([A-Z])/g, '_$1').toLowerCase().slice(1); |
no test coverage detected