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

Method Execute

internal/tool/code_comment.go:60–77  ·  view source on GitHub ↗
(_ context.Context, args map[string]any)

Source from the content-addressed store, hash-verified

58func (p *CodeCommentProvider) Tool() Tool { return CodeComment }
59
60func (p *CodeCommentProvider) Execute(_ context.Context, args map[string]any) (string, error) {
61 if p.Collector == nil {
62 return "Error: comment collector is not configured", nil
63 }
64
65 comments, errMsg := ParseComments(args)
66 if errMsg != "" {
67 return errMsg, nil
68 }
69 if len(comments) == 0 {
70 return CommentNoneUsableMsg, nil
71 }
72
73 for i := range comments {
74 p.Collector.Add(comments[i])
75 }
76 return CommentSucceed, nil
77}
78
79// ParseCommentsWithPath is like ParseComments but uses defaultPath as a fallback
80// when individual comment objects omit the path field.

Callers 1

Calls 2

ParseCommentsFunction · 0.85
AddMethod · 0.80

Tested by 1