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)
| 61 | // ResolveComment attempts to resolve StartLine/EndLine for a single comment |
| 62 | // by matching ExistingCode against the diff. Returns true on success. |
| 63 | func ResolveComment(cm *model.LlmComment, d *model.Diff) bool { |
| 64 | if cm.StartLine > 0 || cm.EndLine > 0 { |
| 65 | return true |
| 66 | } |
| 67 | if cm.ExistingCode == "" { |
| 68 | return false |
| 69 | } |
| 70 | if resolveFromHunk(d, cm) { |
| 71 | return true |
| 72 | } |
| 73 | return resolveFromFileContent(d, cm) |
| 74 | } |
| 75 | |
| 76 | // RelocateAcrossFiles handles the comment whose ExistingCode belongs to a |
| 77 | // different file than the one it was filed against. |