ResolveComment attempts to resolve StartLine/EndLine for a single comment by matching ExistingCode against the diff. Returns true on success.
(cm *model.LlmComment, d *model.Diff)
| 57 | // ResolveComment attempts to resolve StartLine/EndLine for a single comment |
| 58 | // by matching ExistingCode against the diff. Returns true on success. |
| 59 | func ResolveComment(cm *model.LlmComment, d *model.Diff) bool { |
| 60 | if cm.StartLine > 0 || cm.EndLine > 0 { |
| 61 | return true |
| 62 | } |
| 63 | if cm.ExistingCode == "" { |
| 64 | return false |
| 65 | } |
| 66 | if resolveFromHunk(d, cm) { |
| 67 | return true |
| 68 | } |
| 69 | return resolveFromFileContent(d, cm) |
| 70 | } |
| 71 | |
| 72 | // indexedLine pairs a normalized line with its absolute file line number. |
| 73 | type indexedLine struct { |