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

Function ResolveComment

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

61// ResolveComment attempts to resolve StartLine/EndLine for a single comment
62// by matching ExistingCode against the diff. Returns true on success.
63func 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.

Callers 6

executeToolCallMethod · 0.92
ReLocateCommentFunction · 0.85
RelocateAcrossFilesFunction · 0.85

Calls 2

resolveFromHunkFunction · 0.85
resolveFromFileContentFunction · 0.85