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