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

Function ResolveComment

internal/diff/resolver.go:62–73  ·  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

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

Calls 2

resolveFromHunkFunction · 0.85
resolveFromFileContentFunction · 0.85