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