(ref: UnresolvedRef, context: ResolutionContext)
| 70 | }, |
| 71 | |
| 72 | resolve(ref: UnresolvedRef, context: ResolutionContext): ResolvedRef | null { |
| 73 | // Pattern 1: Controller references |
| 74 | if (ref.referenceName.endsWith('Controller')) { |
| 75 | const result = resolveByNameAndKind(ref, CLASS_KINDS, CONTROLLER_DIRS, context); |
| 76 | if (result) { |
| 77 | return { |
| 78 | original: ref, |
| 79 | targetNodeId: result, |
| 80 | confidence: 0.85, |
| 81 | resolvedBy: 'framework', |
| 82 | }; |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | // Pattern 2: Service references (dependency injection) |
| 87 | if (ref.referenceName.endsWith('Service') || ref.referenceName.startsWith('I') && ref.referenceName.length > 1) { |
| 88 | const result = resolveByNameAndKind(ref, SERVICE_KINDS, SERVICE_DIRS, context); |
| 89 | if (result) { |
| 90 | return { |
| 91 | original: ref, |
| 92 | targetNodeId: result, |
| 93 | confidence: 0.85, |
| 94 | resolvedBy: 'framework', |
| 95 | }; |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | // Pattern 3: Repository references |
| 100 | if (ref.referenceName.endsWith('Repository')) { |
| 101 | const result = resolveByNameAndKind(ref, SERVICE_KINDS, REPO_DIRS, context); |
| 102 | if (result) { |
| 103 | return { |
| 104 | original: ref, |
| 105 | targetNodeId: result, |
| 106 | confidence: 0.85, |
| 107 | resolvedBy: 'framework', |
| 108 | }; |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | // Pattern 4: Model/Entity references |
| 113 | if (/^[A-Z][a-zA-Z]+$/.test(ref.referenceName)) { |
| 114 | const result = resolveByNameAndKind(ref, CLASS_KINDS, MODEL_DIRS, context); |
| 115 | if (result) { |
| 116 | return { |
| 117 | original: ref, |
| 118 | targetNodeId: result, |
| 119 | confidence: 0.7, |
| 120 | resolvedBy: 'framework', |
| 121 | }; |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | // Pattern 5: ViewModel references |
| 126 | if (ref.referenceName.endsWith('ViewModel') || ref.referenceName.endsWith('Dto')) { |
| 127 | const result = resolveByNameAndKind(ref, CLASS_KINDS, VIEWMODEL_DIRS, context); |
| 128 | if (result) { |
| 129 | return { |
nothing calls this directly
no test coverage detected