MCPcopy Create free account
hub / github.com/alibaba/open-code-review / ResolveComment

Function ResolveComment

internal/diff/resolver.go:59–70  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

57// ResolveComment attempts to resolve StartLine/EndLine for a single comment
58// by matching ExistingCode against the diff. Returns true on success.
59func 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.
73type indexedLine struct {

Calls 2

resolveFromHunkFunction · 0.85
resolveFromFileContentFunction · 0.85